/* PBXchange — design tokens + base styles.
   Palette: bible Vol 3 defaults. Pass-1 decision pending (bible vs PB-family vs
   event co-branding) — keep ALL colour usage on these variables so a re-skin is
   a token swap, not a rewrite. Spacing on an 8px rhythm. */

:root {
  /* Core palette (bible Vol 3) */
  --pbx-ink: #17324d;          /* primary ink / headers */
  --pbx-blue: #245d7a;         /* secondary blue */
  --pbx-action: #158a91;       /* action teal — buttons, links */
  --pbx-caution: #c58a1b;      /* caution gold */
  --pbx-success: #287a55;      /* success green */
  --pbx-critical: #a33a3a;     /* critical red */
  --pbx-surface: #f4f6f8;      /* page background */
  --pbx-card: #ffffff;
  --pbx-muted: #5e6b75;        /* muted text */
  --pbx-border: #d7dee4;

  /* Status families (word + colour, never colour alone) */
  --status-processing: var(--pbx-blue);
  --status-review: var(--pbx-caution);
  --status-published: var(--pbx-success);
  --status-withdrawn: var(--pbx-critical);
  --status-embargoed: var(--pbx-ink);

  /* Rhythm */
  --sp-1: 8px;
  --sp-2: 16px;
  --sp-3: 24px;
  --sp-4: 32px;
  --sp-6: 48px;

  --radius: 8px;
  --shadow-card: 0 1px 3px rgba(23, 50, 77, 0.1);
  --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-stack);
  background: var(--pbx-surface);
  color: var(--pbx-ink);
  font-size: 15px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
}

[hidden] {
  display: none !important;
}

h1, h2, h3 {
  margin: 0 0 var(--sp-2);
  line-height: 1.25;
}

a {
  color: var(--pbx-action);
}

/* ---- Header ---- */

.pbx-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--pbx-card);
  color: var(--pbx-ink);
  border-bottom: 3px solid var(--pbx-action);
  box-shadow: 0 1px 3px rgba(23, 50, 77, 0.08), 0 8px 24px rgba(23, 50, 77, 0.06);
  transition: box-shadow 0.22s ease, border-bottom-width 0.22s ease;
}

.pbx-header__inner {
  width: min(1480px, calc(100vw - 4rem));
  margin: 0 auto;
  padding: var(--sp-2) var(--sp-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  flex-wrap: wrap;
  transition: padding 0.22s ease;
}

.pbx-header__brand {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  transition: gap 0.22s ease;
}

.pbx-header__brand:hover .brand {
  color: var(--pbx-action);
}

.pbx-header__brand:hover .brand span {
  filter: brightness(1.08);
}

.pbx-header__brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}

.pbx-header .brand {
  font-size: 20px;
  font-weight: 800;
  transition: font-size 0.22s ease;
}

.pbx-header .brand span {
  color: var(--pbx-action);
}

.pbx-header .event-name {
  color: var(--pbx-ink);
  font-size: 14px;
  font-weight: 600;
  max-width: min(22rem, 42vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
  line-height: 1.25;
  transition: font-size 0.22s ease;
}

.pbx-header__context {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  transition: gap 0.22s ease;
}

.pbx-header__context .staff-badge {
  flex-shrink: 0;
}

.pbx-header__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.85rem;
  margin-left: auto;
  flex-shrink: 1;
  min-width: 0;
}

/* ---- Buttons & inputs ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 9px var(--sp-2);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  background: var(--pbx-action);
  color: #fff;
  text-decoration: none;
  box-sizing: border-box;
}

.btn:hover {
  filter: brightness(1.08);
}

.btn.secondary {
  background: transparent;
  color: var(--pbx-action);
  border-color: var(--pbx-action);
}

.btn__icon {
  display: block;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.field {
  display: block;
  margin-bottom: var(--sp-2);
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--pbx-muted);
}

.field input,
.field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--pbx-border);
  border-radius: var(--radius);
  font-size: 15px;
  background: #fff;
}

.field input:focus {
  outline: 2px solid var(--pbx-action);
  outline-offset: 0;
  border-color: var(--pbx-action);
}

/* ---- Brand logo ---- */

.brand-logo {
  display: block;
  border-radius: 7px;
}

.pbx-header .brand-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  flex-shrink: 0;
  transition: width 0.22s ease, height 0.22s ease;
}

/* Compact while scrolling — sticks to the top and eases back at scrollY ≈ 0 */
.pbx-header--compact {
  border-bottom-width: 2px;
  box-shadow: 0 1px 2px rgba(23, 50, 77, 0.1), 0 4px 14px rgba(23, 50, 77, 0.08);
}

.pbx-header--compact .pbx-header__inner {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.pbx-header--compact .pbx-header__brand {
  gap: 0.65rem;
}

.pbx-header--compact .brand-logo {
  width: 36px;
  height: 36px;
}

.pbx-header--compact .brand {
  font-size: 17px;
}

.pbx-header--compact .event-name {
  font-size: 13px;
}

.pbx-header--compact .pbx-header__context {
  gap: 2px;
}

.pbx-header--compact .staff-badge {
  font-size: 10px;
  padding: 1px 6px;
}

@media (prefers-reduced-motion: reduce) {
  .pbx-header,
  .pbx-header__inner,
  .pbx-header__brand,
  .pbx-header .brand,
  .pbx-header .brand-logo,
  .pbx-header .event-name,
  .pbx-header__context {
    transition: none;
  }
}

.auth-card .brand-logo--large {
  margin: 0 auto var(--sp-2);
}

/* ---- Sign-in ---- */

.auth-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-3);
}

.auth-card {
  background: var(--pbx-card);
  border: 1px solid var(--pbx-border);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(23, 50, 77, 0.08), 0 16px 42px rgba(23, 50, 77, 0.1);
  padding: var(--sp-4);
  width: 100%;
  max-width: 430px;
}

/* Spacing mirrors PBXhost's sign-in brand block: tight to the logo
   (line-height 1) with a clear gap before the heading. */
.auth-card .product-name {
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 1.75rem;
  text-align: center;
}

.auth-card .product-name span {
  color: var(--pbx-action);
}

.auth-card .tagline {
  color: var(--pbx-muted);
  font-size: 14px;
  margin: 0.25rem 0 1.25rem;
  text-align: center;
}

.auth-card .auth-heading {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 0.25rem;
  text-align: center;
}

.auth-card .auth-error {
  background: #fde8e8;
  color: #8a1f1f;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: var(--sp-2);
}

.auth-card .auth-links {
  display: flex;
  justify-content: center;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
  font-size: 13px;
}

.auth-card .auth-links a {
  color: var(--pbx-action);
}

.auth-card #sign-in-submit {
  width: 100%;
}


.auth-card .mock-note {
  margin-top: var(--sp-2);
  font-size: 12px;
  color: var(--pbx-muted);
  text-align: center;
}

.auth-choice {
  display: grid;
  gap: 0.875rem;
}

.auth-choice__card {
  width: 100%;
  min-height: 92px;
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 0.875rem;
  padding: 0.95rem 1rem;
  border: 1px solid var(--pbx-border);
  border-radius: 14px;
  background: var(--pbx-card);
  color: var(--pbx-ink);
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.auth-choice__card:hover,
.auth-choice__card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--pbx-action);
  background: color-mix(in srgb, var(--pbx-action) 8%, white);
  outline: none;
}

/* Keeps the family hover so the styling reads as live, but the cursor stays
   honest about there being nothing to click yet. */
.auth-choice__card--inactive {
  cursor: default;
}

.auth-choice__icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--pbx-action);
  background: color-mix(in srgb, var(--pbx-action) 10%, white);
}

.auth-choice__content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.auth-choice__content strong {
  font-size: 1rem;
  line-height: 1.3;
}

.auth-choice__content span {
  color: var(--pbx-muted);
  font-size: 0.8125rem;
  line-height: 1.4;
}

.auth-choice__arrow {
  color: var(--pbx-action);
  font-size: 1.35rem;
}

/* ---- Sign-in intro (wordmark reveal, then options stagger in) ----
   Plays once per tab session (js/signInIntro.js sets `no-intro`). */

.auth-card .product-name--intro {
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card .product-name .product-name__primary {
  color: inherit;
}

/* Zero-width clipped column: "change" slides out from behind the right edge
   of "PBX" as the column opens, pushing "PBX" left of centre. */
.product-name__reveal {
  display: grid;
  grid-template-columns: 1fr;
}

.product-name__reveal > span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-align: left;
}

.brand-logo--intro {
  opacity: 0;
  animation: intro-logo-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.product-name--intro .product-name__primary {
  opacity: 0;
  animation: intro-pbx-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.25s forwards;
}

.product-name--intro .product-name__reveal {
  grid-template-columns: 0fr;
  animation: intro-reveal 0.8s cubic-bezier(0.77, 0, 0.18, 1) 0.95s forwards;
}

.intro-enter {
  opacity: 0;
  animation: intro-fade-up 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.intro-enter--d1 {
  animation-delay: 1.7s;
}

.intro-enter--d2 {
  animation-delay: 1.82s;
}

.intro-enter--d3 {
  animation-delay: 1.96s;
}

.intro-enter--d4 {
  animation-delay: 2.1s;
}

.intro-enter--d5 {
  animation-delay: 2.24s;
}

@keyframes intro-logo-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes intro-pbx-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes intro-reveal {
  from {
    grid-template-columns: 0fr;
  }
  to {
    grid-template-columns: 1fr;
  }
}

@keyframes intro-fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.no-intro .brand-logo--intro,
.no-intro .product-name--intro .product-name__primary,
.no-intro .intro-enter {
  animation: none;
  opacity: 1;
}

.no-intro .product-name--intro .product-name__reveal {
  animation: none;
  grid-template-columns: 1fr;
}

@media (prefers-reduced-motion: reduce) {
  .brand-logo--intro,
  .product-name--intro .product-name__primary,
  .intro-enter {
    animation: none;
    opacity: 1;
  }

  .product-name--intro .product-name__reveal {
    animation: none;
    grid-template-columns: 1fr;
  }
}

.auth-back {
  margin-top: var(--sp-2);
  text-align: center;
}

.auth-back button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--pbx-action);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

/* ---- Library ---- */

.page {
  width: min(1480px, calc(100vw - 4rem));
  margin: 0 auto;
  padding: var(--sp-4) var(--sp-3) var(--sp-6);
  flex: 1;
}

.site-footer {
  margin-top: auto;
  padding: 1.25rem 1.5rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--pbx-muted);
  border-top: 1px solid var(--pbx-border);
  background: rgba(255, 255, 255, 0.68);
}

.site-footer p {
  margin: 0;
}

.library-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-bottom: var(--sp-2);
}

.library-head h1 {
  margin: 0;
}

.library-head .filter-row {
  margin-bottom: 0;
}

.search-bar {
  display: flex;
  gap: var(--sp-1);
  margin-bottom: var(--sp-3);
}

.search-bar input {
  flex: 1;
  padding: 12px var(--sp-2);
  border: 1px solid var(--pbx-border);
  border-radius: var(--radius);
  font-size: 16px;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-2);
  align-items: start;
}

.asset-card {
  background: var(--pbx-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: var(--pbx-ink);
}

.asset-card__main {
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.asset-card__main:hover .title {
  color: var(--pbx-action);
}

.asset-card:hover,
.asset-card:focus-within {
  outline: 2px solid var(--pbx-action);
}

.asset-card .thumb {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--pbx-ink), var(--pbx-blue));
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  position: relative;
  overflow: hidden;
}

.asset-card .thumb img,
.asset-card .thumb .asset-card__thumb-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.asset-card .thumb .asset-card__thumb-img {
  opacity: 0;
  transition: opacity 0.35s ease;
}

.asset-card .thumb .asset-card__thumb-img--ready {
  opacity: 1;
}

.asset-card .thumb .thumb-type {
  position: absolute;
  left: var(--sp-1);
  top: var(--sp-1);
  z-index: 1;
  background: rgba(0, 0, 0, 0.55);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
}

.asset-card .thumb .duration {
  position: absolute;
  left: var(--sp-1);
  bottom: var(--sp-1);
  background: rgba(0, 0, 0, 0.65);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: #fff;
  z-index: 2;
}

.asset-card .body {
  padding: var(--sp-2);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.asset-card .title {
  font-weight: 700;
  font-size: 15px;
}

.asset-card .meta {
  color: var(--pbx-muted);
  font-size: 13px;
}

.asset-card__footer {
  display: flex;
  align-items: center;
  min-height: 1.25rem;
  margin: -2px var(--sp-2) var(--sp-2);
}

.asset-card__more {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 12px;
  line-height: 1.25rem;
  color: var(--pbx-muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.asset-card__more:hover,
.asset-card__more:focus-visible {
  color: var(--pbx-action);
  outline: none;
}

.asset-card__more--spacer {
  visibility: hidden;
  pointer-events: none;
  cursor: default;
  text-decoration: none;
}

.asset-card__extra {
  display: grid;
  grid-template-rows: 0fr;
  margin: 0 var(--sp-2);
  border-top: 1px solid transparent;
  transition:
    grid-template-rows 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.24s ease;
}

.asset-card__extra--open {
  grid-template-rows: 1fr;
  border-top-color: var(--pbx-border);
}

.asset-card__extra-inner {
  overflow: hidden;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  opacity: 0;
  transform: translateY(-4px);
  transition:
    opacity 0.22s ease,
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    padding 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  padding: 0;
}

.asset-card__extra--open .asset-card__extra-inner {
  opacity: 1;
  transform: none;
  padding: var(--sp-1) 0 var(--sp-1);
}

.asset-card__extra-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--pbx-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 4px;
}

.asset-card__extra-label:first-child {
  margin-top: 0;
}

.asset-card__extra-text {
  font-size: 13px;
  color: var(--pbx-ink);
  line-height: 1.4;
}

@media (prefers-reduced-motion: reduce) {
  .asset-card__extra,
  .asset-card__extra-inner {
    transition: none;
  }
}

.asset-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.asset-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--pbx-action) 10%, white);
  color: var(--pbx-ink);
  font-size: 11px;
  font-weight: 600;
}

.asset-card-reasons {
  font-size: 11px;
  color: var(--pbx-blue);
  font-weight: 600;
  margin-top: 2px;
}

.asset-card-excerpt {
  font-size: 12px;
  color: var(--pbx-muted);
  font-style: italic;
  line-height: 1.35;
}

/* Status pill — always word + colour */
.status-pill {
  display: inline-block;
  align-self: flex-start;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--pbx-muted);
}

.status-pill[data-status="published"] { background: var(--status-published); }
.status-pill[data-status="processing"] { background: var(--status-processing); }
.status-pill[data-status="in_review"] { background: var(--status-review); }
.status-pill[data-status="changes_required"] { background: var(--status-review); }
.status-pill[data-status="withdrawn"] { background: var(--status-withdrawn); }
.status-pill[data-status="embargoed"] { background: var(--status-embargoed); }

.section-title {
  display: flex;
  align-items: baseline;
  gap: var(--sp-1);
  margin: var(--sp-3) 0 var(--sp-2);
}

.section-title .count {
  color: var(--pbx-muted);
  font-size: 13px;
}

/* ---- Filter chips ---- */

.filter-row {
  display: flex;
  gap: var(--sp-1);
  margin-bottom: var(--sp-2);
  flex-wrap: wrap;
}

.chip {
  border: 1px solid var(--pbx-border);
  background: var(--pbx-card);
  color: var(--pbx-ink);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.chip--active {
  background: var(--pbx-action);
  border-color: var(--pbx-action);
  color: #fff;
}

.chip--clear {
  font-size: 12px;
  margin-left: auto;
}

/* ---- Collections row ---- */

.collections-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--sp-1);
  margin-bottom: var(--sp-2);
}

.collection-tile {
  text-align: left;
  background: var(--pbx-card);
  border: 1px solid var(--pbx-border);
  border-left: 4px solid var(--pbx-blue);
  border-radius: var(--radius);
  padding: var(--sp-1) var(--sp-2);
  cursor: pointer;
  font-family: var(--font-stack);
}

.collection-tile:hover {
  outline: 2px solid var(--pbx-action);
}

.collection-tile--active {
  border-left-color: var(--pbx-action);
  outline: 2px solid var(--pbx-action);
}

.collection-tile__title {
  font-weight: 700;
  font-size: 14px;
}

.collection-tile__desc {
  color: var(--pbx-muted);
  font-size: 12px;
  margin: 2px 0 4px;
}

.collection-tile__count {
  color: var(--pbx-blue);
  font-size: 12px;
  font-weight: 600;
}

/* ---- Asset detail ---- */

.muted { color: var(--pbx-muted); }

.asset-head { margin-bottom: var(--sp-2); }

.asset-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.65rem;
  padding: 0;
  color: var(--pbx-action);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: color 0.15s ease, transform 0.15s ease, gap 0.15s ease;
}

.asset-back__icon {
  display: block;
  flex-shrink: 0;
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.asset-back:hover {
  color: var(--pbx-ink);
  gap: 0.5rem;
}

.asset-back:hover .asset-back__icon {
  transform: translateX(-3px);
}

.asset-back:focus-visible {
  outline: 2px solid var(--pbx-action);
  outline-offset: 3px;
  border-radius: 4px;
}

.asset-title { margin: 0 0 4px; font-size: 24px; }

.asset-head__title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: 4px;
}

.asset-head__title-row .asset-title {
  margin: 0;
  min-width: 0;
}

.asset-head__actions {
  display: flex;
  flex-shrink: 0;
  gap: var(--sp-1);
}

@media (max-width: 640px) {
  .asset-head__title-row {
    flex-wrap: wrap;
  }
}
.asset-head__meta {
  margin: 0 0 8px;
  font-size: 14px;
}
.asset-head__description {
  margin: 0 0 var(--sp-1);
  max-width: 48rem;
  color: var(--pbx-ink);
  line-height: 1.45;
}
/* Media + detail on the left, transcript rail on the right.
   Collapse animates the rail into a slim peek tab on the right. */
.asset-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: var(--sp-2);
  align-items: start;
  transition: grid-template-columns 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.asset-workspace--transcript-collapsed {
  grid-template-columns: minmax(0, 1fr) 44px;
}

.asset-workspace--solo {
  grid-template-columns: minmax(0, 1fr);
}

.asset-main,
.asset-rail,
.asset-details {
  min-width: 0;
}

.asset-rail {
  position: relative;
  overflow: hidden;
}

.asset-preview {
  line-height: 0;
  margin-bottom: var(--sp-2);
}

@media (max-width: 900px) {
  .asset-workspace,
  .asset-workspace--transcript-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }

  .asset-workspace--transcript-collapsed .asset-rail {
    min-height: 0 !important;
  }

  .asset-workspace--transcript-collapsed .transcript-peek {
    writing-mode: horizontal-tb;
    transform: none;
    letter-spacing: 0.04em;
    min-height: 44px;
  }
}

.asset-media,
.asset-player {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  background: #111;
}

.asset-audio { width: 100%; max-width: 100%; }

.asset-preview__thumb,
.asset-preview__still {
  width: 100%;
  border-radius: var(--radius);
  display: block;
  background: var(--pbx-surface);
}

.embargo-notice {
  background: var(--pbx-ink);
  color: #fff;
  border-radius: var(--radius);
  padding: var(--sp-1) var(--sp-2);
  margin-bottom: var(--sp-2);
  font-size: 14px;
}

.asset-split {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: var(--sp-2);
  align-items: start;
}

@media (max-width: 900px) {
  .asset-split { grid-template-columns: 1fr; }
}

.player-placeholder {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--pbx-ink), var(--pbx-blue));
  border-radius: var(--radius);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: var(--sp-2);
  transition: outline 0.2s;
}

.player-placeholder--jumped { outline: 3px solid var(--pbx-action); }
.player-badge { font-size: 20px; font-weight: 700; }
.player-note { font-size: 12px; color: rgba(255,255,255,0.7); }

.panel-block {
  background: var(--pbx-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: var(--sp-2);
  margin-bottom: var(--sp-2);
}

.panel-block h2 { font-size: 16px; margin-bottom: var(--sp-1); }

.kv-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: var(--sp-1);
  align-items: baseline;
  padding: 6px 0;
  border-top: 1px solid var(--pbx-surface);
  font-size: 14px;
  line-height: 1.4;
}

.kv-label {
  color: var(--pbx-muted);
  font-weight: 600;
  font-size: 13px;
  line-height: 1.4;
}

.kv-value {
  line-height: 1.4;
}

.rights-panel { border-left: 4px solid var(--pbx-caution); }

.download-block {
  margin: 0 0 var(--sp-2);
}

.asset-download-toggle__chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: -2px;
}

.asset-download-toggle__chevron-icon {
  display: block;
  transform-origin: 50% 50%;
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

.asset-download-toggle--open .asset-download-toggle__chevron-icon {
  transform: rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {
  .asset-download-toggle__chevron-icon {
    transition: none;
  }
}

.asset-download-panel {
  grid-column: 1 / -1;
  display: grid;
  grid-template-rows: 0fr;
  margin: 0;
  opacity: 0;
  transform: translateY(-8px);
  transition:
    grid-template-rows 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    margin 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.2s ease,
    transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.asset-download-panel--open {
  grid-template-rows: 1fr;
  margin: 0 0 var(--sp-2);
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .asset-download-panel,
  .asset-download-panel__inner {
    transition: none;
  }
}

.asset-download-panel__inner {
  min-height: 0;
  overflow: hidden;
  border: 0 solid transparent;
  border-radius: var(--radius);
  background: var(--pbx-card);
  transition:
    padding 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    border-width 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.2s ease;
}

.asset-download-panel--open .asset-download-panel__inner {
  padding: var(--sp-2);
  border-width: 1px;
  border-color: var(--pbx-border);
  border-top: 3px solid var(--pbx-action);
}

/* Timeline under the player, options under the transcript rail. */
.asset-download-panel__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: var(--sp-2);
  align-items: start;
}

.asset-download-panel--options-only .asset-download-panel__grid {
  grid-template-columns: minmax(0, 1fr);
}

.asset-download-panel__timeline,
.asset-download-panel__options {
  min-width: 0;
}

@media (max-width: 900px) {
  .asset-download-panel__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.asset-download-panel__heading {
  margin-bottom: var(--sp-2);
}

.asset-download-panel__heading h2,
.inline-clip-editor h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.asset-download-panel__heading p {
  margin: 0;
  font-size: 13px;
}

.download-locked {
  color: var(--pbx-muted);
  font-size: 13px;
  font-weight: 600;
  margin: 0;
}

.download-picker {
  display: grid;
  gap: 8px;
}

.download-picker__option {
  appearance: none;
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  text-align: left;
  border: 1px solid var(--pbx-border);
  background: var(--pbx-surface);
  border-radius: var(--radius);
  padding: 14px 16px;
  font: inherit;
  color: var(--pbx-ink);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.download-picker__option:hover,
.download-picker__option:focus-visible {
  border-color: var(--pbx-action);
  background: color-mix(in srgb, var(--pbx-action) 8%, white);
  color: var(--pbx-action);
  outline: none;
}

.download-picker__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.download-picker__title {
  font-size: 15px;
  font-weight: 700;
}

.download-picker__hint {
  font-size: 13px;
  font-weight: 500;
  color: var(--pbx-muted);
  word-break: break-all;
}

.download-picker__tech {
  font-size: 12px;
  font-weight: 600;
  color: var(--pbx-muted);
  font-variant-numeric: tabular-nums;
}

.download-picker__icon {
  flex-shrink: 0;
  display: inline-flex;
  color: var(--pbx-muted);
  transition: color 0.15s ease;
}

.download-picker__option:hover .download-picker__hint,
.download-picker__option:hover .download-picker__tech,
.download-picker__option:hover .download-picker__icon,
.download-picker__option:focus-visible .download-picker__hint,
.download-picker__option:focus-visible .download-picker__tech,
.download-picker__option:focus-visible .download-picker__icon {
  color: inherit;
  opacity: 0.85;
}

/* ---- Section download editor ---- */

.clip-editor__intro {
  margin: 0 0 var(--sp-2);
}

.clip-editor__timeline {
  margin-top: var(--sp-2);
}

.clip-editor__playhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-1);
  margin-bottom: 6px;
  color: var(--pbx-muted);
  font-size: 13px;
}

.clip-editor__playhead strong,
.clip-editor__time,
.clip-editor__point strong {
  font-variant-numeric: tabular-nums;
}

.clip-editor__scrubber {
  display: block;
  width: 100%;
  accent-color: var(--pbx-action);
  cursor: pointer;
}

.clip-editor__selection-track {
  position: relative;
  height: 6px;
  margin-top: 6px;
  margin-bottom: 22px;
  border-radius: 999px;
  background: var(--pbx-border);
}

.clip-editor__selection-fill {
  position: absolute;
  inset-block: 0;
  width: 0;
  border-radius: inherit;
  background: var(--pbx-action);
}

/* Excluded head and tail of the clip. */
.clip-editor__trim {
  position: absolute;
  inset-block: 0;
  width: 0;
  background-color: var(--pbx-ink);
  background-image: repeating-linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.28) 0 3px,
    transparent 3px 6px
  );
  opacity: 0.4;
}

.clip-editor__trim--before {
  left: 0;
  border-radius: 999px 0 0 999px;
}

.clip-editor__trim--after {
  right: 0;
  border-radius: 0 999px 999px 0;
}

.clip-editor__flag {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  margin-left: -1px;
  border-radius: 1px;
  background: var(--pbx-ink);
}

.clip-editor__flag::after {
  content: attr(data-label);
  position: absolute;
  top: calc(100% + 3px);
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--pbx-ink);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.clip-editor__flag--in::after {
  left: 0;
}

.clip-editor__flag--out::after {
  right: 0;
}

.clip-editor__selection {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: var(--sp-2);
}

/* One compact line each, so the player stays visible while marking. */
.clip-editor__point {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid var(--pbx-border);
  border-radius: var(--radius);
  background: var(--pbx-surface);
  font-size: 14px;
}

.clip-editor__point-label {
  flex-shrink: 0;
  color: var(--pbx-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.clip-editor__point-value {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  font-variant-numeric: tabular-nums;
}

.clip-editor__time {
  appearance: none;
  width: fit-content;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--pbx-action);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.clip-editor__time:disabled {
  color: var(--pbx-muted);
  cursor: default;
}

/* Mirrors .clip-editor__selection so each pair lines up with its box. */
.clip-editor__mark-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.clip-editor__mark-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  min-width: 0;
}

.clip-editor__mark-pair .btn {
  width: 100%;
  padding-inline: 6px;
  font-size: 13px;
  white-space: nowrap;
}

.clip-editor__mark-pair .btn:disabled {
  border-color: var(--pbx-border);
  background: var(--pbx-surface);
  color: var(--pbx-muted);
  cursor: default;
  filter: none;
}

.clip-editor__status {
  margin: 0;
  color: var(--pbx-muted);
  font-size: 13px;
  font-weight: 600;
}

.clip-editor__status:empty {
  display: none;
}

.clip-editor__status--error {
  color: var(--pbx-critical);
}

.clip-progress {
  height: 10px;
  margin: var(--sp-2) 0 var(--sp-1);
  overflow: hidden;
  border-radius: 999px;
  background: var(--pbx-border);
}

.clip-progress__fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--pbx-action);
  transition: width 0.35s ease;
}

.clip-progress__status {
  min-height: 1.5em;
  margin: 0 0 var(--sp-2);
  color: var(--pbx-muted);
  font-size: 14px;
  font-weight: 600;
}

.clip-progress__error {
  margin: 0 0 var(--sp-2);
  color: var(--pbx-critical);
}

/* ---- My clips ---- */

.my-clips__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}

.my-clips__head h1 {
  margin-bottom: 4px;
}

.my-clips__head p {
  margin: 0;
}

.my-clips {
  display: grid;
  gap: var(--sp-1);
}

.my-clip {
  padding: var(--sp-2);
  border: 1px solid var(--pbx-border);
  border-radius: var(--radius);
  background: var(--pbx-card);
  box-shadow: var(--shadow-card);
}

.my-clip__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-2);
}

.my-clip__identity {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.my-clip__title {
  color: var(--pbx-ink);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
}

.my-clip__title:hover {
  color: var(--pbx-action);
  text-decoration: underline;
}

.my-clip__public-id,
.my-clip__hint {
  color: var(--pbx-muted);
  font-size: 13px;
}

.my-clip__expiry {
  color: var(--pbx-ink);
  font-weight: 600;
}

.my-clip__expiry[data-expiry="pending"],
.my-clip__expiry[data-expiry="expired"] {
  color: var(--pbx-muted);
  font-weight: 500;
}

.my-clip__expiry[data-expiry="soon"] {
  color: var(--pbx-critical);
}

.my-clip__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 14px;
  margin-top: var(--sp-1);
  color: var(--pbx-muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.my-clip__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-1);
  margin-top: var(--sp-2);
}

.status-pill[data-status="ready"] {
  background: var(--pbx-success);
}

.status-pill[data-status="failed"] {
  background: var(--pbx-critical);
}

.status-pill[data-status="expired"] {
  background: var(--pbx-muted);
}

.my-clips__error {
  padding: var(--sp-2);
  border-left: 4px solid var(--pbx-critical);
  background: color-mix(in srgb, var(--pbx-critical) 8%, white);
  color: var(--pbx-critical);
}

.my-clip--skeleton {
  display: grid;
  gap: 10px;
  min-height: 96px;
}

.my-clip--skeleton .my-clip__identity .skeleton-line--meta {
  width: 46%;
}

.my-clip--skeleton .skeleton-pill {
  margin-top: 2px;
}

.my-clip--skeleton .my-clip__meta .skeleton-line {
  margin-top: 0;
  width: 7.5rem;
}

@media (max-width: 640px) {
  .my-clips__head {
    align-items: stretch;
    flex-direction: column;
  }

  .my-clips__head .btn {
    align-self: flex-start;
  }

  .clip-editor__selection,
  .clip-editor__mark-actions {
    grid-template-columns: 1fr 1fr;
  }

  .clip-editor__point--duration,
  .clip-editor__mark-pair:last-child {
    grid-column: 1 / -1;
  }
}

/* ---- Transcript ---- */

.transcript-panel {
  position: sticky;
  top: var(--sp-2);
  width: 340px;
  max-width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin-bottom: 0;
  transition:
    opacity 0.22s ease,
    transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.transcript-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.transcript-foot {
  flex: 0 0 auto;
  padding-top: 10px;
  margin-top: 8px;
  border-top: 1px solid var(--pbx-border);
}

.asset-workspace--transcript-collapsed .transcript-panel {
  opacity: 0;
  transform: translateX(18px);
  pointer-events: none;
}

.transcript-peek {
  appearance: none;
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 100%;
  margin: 0;
  padding: 12px 0;
  border: 1px solid var(--pbx-border);
  border-radius: var(--radius);
  background: var(--pbx-card);
  box-shadow: var(--shadow-card);
  color: var(--pbx-action);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s ease 0.08s,
    background 0.15s ease,
    border-color 0.15s ease;
}

.asset-workspace--transcript-collapsed .transcript-peek {
  opacity: 1;
  pointer-events: auto;
}

.transcript-peek:hover {
  background: color-mix(in srgb, var(--pbx-action) 10%, white);
  border-color: var(--pbx-action);
}

.transcript-peek:focus-visible {
  outline: 2px solid var(--pbx-action);
  outline-offset: 2px;
}

.transcript-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-1);
}

.transcript-hide {
  background: none;
  border: none;
  padding: 0;
  color: var(--pbx-action);
  font-family: var(--font-stack);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.transcript-hide:hover { text-decoration: underline; }

.transcript-label {
  background: var(--pbx-surface);
  color: var(--pbx-muted);
  border: 1px solid var(--pbx-border);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: var(--sp-1);
}

.transcript-search {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--pbx-border);
  border-radius: var(--radius);
  font-size: 14px;
  margin: 0;
  box-sizing: border-box;
}

.transcript-list {
  display: flex;
  flex-direction: column;
}

.transcript-seg-row {
  position: relative;
  display: flex;
  flex-direction: column;
}

.transcript-seg {
  text-align: left;
  background: none;
  border: none;
  border-top: 1px solid var(--pbx-surface);
  padding: 8px 4px;
  font-size: 14px;
  font-family: var(--font-stack);
  color: var(--pbx-ink);
  cursor: pointer;
  line-height: 1.45;
}

/* Mark In / Mark Out on a line — only while the download panel is open.
   The pills float straight over the line; no shared backdrop. */
.transcript-seg__marks {
  position: absolute;
  top: 50%;
  right: 4px;
  z-index: 1;
  display: none;
  gap: 6px;
  transform: translateY(-50%);
}

.asset-page--clipping .transcript-seg-row:hover .transcript-seg__marks,
.asset-page--clipping .transcript-seg-row:focus-within .transcript-seg__marks {
  display: flex;
}

.asset-page--clipping .transcript-seg-row:hover .transcript-seg {
  background: var(--pbx-surface);
}

.transcript-mark {
  appearance: none;
  min-width: 72px;
  padding: 3px 8px;
  border: 1px solid var(--pbx-action);
  border-radius: 999px;
  background: var(--pbx-card);
  box-shadow: 0 1px 6px rgba(23, 50, 77, 0.18);
  color: var(--pbx-action);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
}

.transcript-mark:hover,
.transcript-mark:focus-visible {
  background: var(--pbx-action);
  color: #fff;
}

.transcript-seg:hover { background: var(--pbx-surface); }

.transcript-seg--active {
  background: var(--pbx-surface);
  box-shadow: inset 3px 0 0 var(--pbx-action);
}

/* Lines covered by the current in/out selection. */
.transcript-seg--in-clip {
  background: color-mix(in srgb, var(--pbx-action) 12%, white);
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--pbx-action) 45%, white);
}

.transcript-seg--active.transcript-seg--in-clip {
  box-shadow: inset 3px 0 0 var(--pbx-action);
}

.transcript-seg--in-clip:hover,
.asset-page--clipping .transcript-seg-row:hover .transcript-seg--in-clip {
  background: color-mix(in srgb, var(--pbx-action) 18%, white);
}

.transcript-tc {
  color: var(--pbx-action);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-right: 6px;
}

.transcript-speaker { font-weight: 700; }

/* ---- Download acknowledgment overlay ---- */

.ack-overlay {
  position: fixed;
  inset: 0;
  background: rgba(23, 50, 77, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-3);
  z-index: 10;
}

.ack-card {
  background: var(--pbx-card);
  border-radius: var(--radius);
  padding: var(--sp-3);
  max-width: 480px;
  width: 100%;
  box-shadow: 0 8px 30px rgba(0,0,0,0.25);
}

.ack-body {
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.45;
  margin: var(--sp-2) 0;
  max-height: 240px;
  overflow: auto;
}

.ack-actions {
  display: flex;
  gap: var(--sp-1);
  margin-top: var(--sp-2);
}

/* ---- Download options (shared by full asset and clip) ---- */

.ack-card.download-options-modal {
  position: relative;
  max-width: 560px;
  max-height: min(92vh, 880px);
  overflow: auto;
  border-top: 3px solid var(--pbx-action);
  animation: download-options-in 0.16s ease-out;
}

/* Veils the card while a download/clip request is in flight. */
.modal-busy {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  border-radius: inherit;
  background: color-mix(in srgb, var(--pbx-card) 74%, transparent);
  backdrop-filter: blur(1.5px);
  animation: modal-busy-in 0.14s ease-out;
}

.modal-busy__dots {
  display: flex;
  gap: 9px;
}

.modal-busy__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--pbx-action);
  animation: modal-busy-bounce 0.95s ease-in-out infinite;
}

.modal-busy__dot:nth-child(2) {
  animation-delay: 0.14s;
}

.modal-busy__dot:nth-child(3) {
  animation-delay: 0.28s;
}

@keyframes modal-busy-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modal-busy-bounce {
  0%,
  70%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }
  35% {
    transform: translateY(-8px);
    opacity: 1;
  }
}

.download-options-modal h2 {
  margin: 0 0 var(--sp-2);
}

.download-options__list {
  display: grid;
  gap: 8px;
}

.download-options__option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--pbx-border);
  border-radius: var(--radius);
  background: var(--pbx-surface);
  cursor: pointer;
}

.download-options__option:has(.download-options__tick:checked) {
  border-color: var(--pbx-action);
  background: color-mix(in srgb, var(--pbx-action) 6%, var(--pbx-surface));
}

.download-options__option--locked {
  cursor: default;
  opacity: 0.55;
}

.download-options__tick {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--pbx-action);
  cursor: inherit;
}

.download-options__option-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.download-options__option-label {
  font-size: 14px;
  font-weight: 700;
}

.download-options__option-hint {
  color: var(--pbx-muted);
  font-size: 12px;
}

.download-options__badge {
  flex-shrink: 0;
  margin-left: auto;
  align-self: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--pbx-border);
  color: var(--pbx-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* What the current ticks add up to. */
.download-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  /* Label and value differ in size, so share a baseline rather than stretching. */
  align-items: baseline;
  gap: 6px var(--sp-2);
  margin: var(--sp-2) 0 0;
}

.download-summary dt {
  color: var(--pbx-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.download-summary dd {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.download-options__divider {
  height: 0;
  margin: var(--sp-3) 0 0;
  border: 0;
  border-top: 1px solid var(--pbx-border);
}

.download-options-modal .ack-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
}

.download-options-modal .ack-actions .btn {
  width: 100%;
}

.download-options-modal .ack-actions .btn:only-child {
  grid-column: 1 / -1;
}

.download-options-modal .btn:disabled {
  opacity: 0.55;
  cursor: default;
  filter: none;
}

@keyframes download-options-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Compact continuation of clip progress after the modal is dismissed. */
.clip-toast-host {
  position: fixed;
  /* Above the sticky header, and JS keeps --clip-toast-top clear of its height. */
  top: calc(var(--clip-toast-top, 96px) + env(safe-area-inset-top, 0px));
  left: 50%;
  z-index: 45;
  display: grid;
  gap: 8px;
  width: min(440px, calc(100vw - (2 * var(--sp-2))));
  transform: translateX(-50%);
  pointer-events: none;
}

.clip-toast {
  display: grid;
  gap: 5px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--pbx-action) 35%, var(--pbx-border));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--pbx-card) 96%, transparent);
  box-shadow: 0 10px 30px rgba(23, 50, 77, 0.2);
  backdrop-filter: blur(10px);
  opacity: 0;
  transform: translateY(-14px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.clip-toast--in {
  opacity: 1;
  transform: none;
}

.clip-toast__heading {
  color: var(--pbx-ink);
  font-size: 14px;
}

.clip-toast__name {
  overflow: hidden;
  color: var(--pbx-muted);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clip-toast__progress-row {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-1);
  margin-top: 2px;
  color: var(--pbx-muted);
  font-size: 12px;
  font-weight: 600;
}

.clip-toast__percent {
  color: var(--pbx-ink);
  font-variant-numeric: tabular-nums;
}

.clip-toast__track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--pbx-border);
}

.clip-toast__fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--pbx-action);
  transition: width 0.25s ease;
}

.clip-toast--complete {
  border-color: var(--pbx-action);
}

.clip-toast--complete .clip-toast__name,
.clip-toast--error .clip-toast__name {
  white-space: normal;
}

.clip-toast--error {
  border-color: var(--pbx-critical);
}

@media (prefers-reduced-motion: reduce) {
  .ack-card.download-options-modal,
  .modal-busy {
    animation: none;
  }

  .modal-busy__dot {
    animation: modal-busy-fade 1.1s ease-in-out infinite;
  }

  .clip-toast,
  .clip-toast__fill {
    transition: none;
  }

  @keyframes modal-busy-fade {
    0%,
    100% {
      opacity: 0.35;
    }
    50% {
      opacity: 1;
    }
  }
}

.ack-card.staff-edit-card {
  max-width: 720px;
  max-height: min(92vh, 880px);
  overflow: auto;
}

.staff-edit-card__meta {
  margin: -4px 0 var(--sp-1);
}

.staff-edit-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.staff-edit-collections h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.ack-card.staff-preview-card {
  max-width: min(920px, 96vw);
  width: 100%;
}

.staff-preview-body {
  margin-top: var(--sp-1);
}

.staff-preview-card__video,
.staff-preview-card__still {
  display: block;
  width: 100%;
  max-height: min(70vh, 640px);
  background: #0b1220;
  border-radius: var(--radius);
  object-fit: contain;
}

.staff-preview-card__audio {
  display: block;
  width: 100%;
  margin-top: var(--sp-1);
}

.ack-card.staff-transcript-card {
  max-width: min(720px, 96vw);
  max-height: min(90vh, 800px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.staff-transcript-body {
  margin-top: var(--sp-1);
  overflow: auto;
  min-height: 0;
  flex: 1;
  max-height: min(65vh, 560px);
}

.transcript-seg--readonly {
  cursor: default;
}

.transcript-seg--readonly:hover {
  background: transparent;
}

/* ---- Fake player timeline ---- */

.player-timeline {
  width: 70%;
  height: 6px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  overflow: hidden;
  margin: 4px 0;
}

.player-timeline__fill {
  height: 100%;
  width: 0%;
  background: var(--pbx-action);
  transition: width 0.3s linear;
}

/* ---- Staff area ---- */

.staff-badge {
  background: var(--pbx-caution);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  border-radius: 4px;
  padding: 2px 8px;
}

.staff-nav { display: flex; gap: var(--sp-1); }

.staff-nav__link {
  color: var(--pbx-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: var(--radius);
}

.staff-nav__link:hover { color: var(--pbx-action); }

.staff-nav__link--active {
  color: var(--pbx-ink);
  background: color-mix(in srgb, var(--pbx-action) 10%, white);
}

/* Upload screen */

.dropzone {
  border: 2px dashed var(--pbx-border);
  border-radius: var(--radius);
  background: var(--pbx-card);
  padding: var(--sp-4);
  text-align: center;
  cursor: pointer;
  margin-bottom: var(--sp-2);
}

.dropzone:hover, .dropzone--over {
  border-color: var(--pbx-action);
  outline: 2px solid var(--pbx-action);
}

.dropzone__icon { font-size: 28px; color: var(--pbx-action); }
.dropzone__title { font-weight: 700; font-size: 16px; }

.upload-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-1);
  margin-bottom: var(--sp-2);
}

.upload-queue { display: flex; flex-direction: column; gap: var(--sp-1); }

.upload-row {
  background: var(--pbx-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: var(--sp-2);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
  align-items: start;
}

.upload-row--pending {
  border-left: 3px solid var(--pbx-action);
}

.upload-remove { margin-top: 4px; }

@media (max-width: 700px) { .upload-row { grid-template-columns: 1fr; } }

.upload-row__state { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }

.upload-progress {
  width: 100%;
  height: 8px;
  background: var(--pbx-surface);
  border-radius: 999px;
  overflow: hidden;
}

.upload-progress__fill {
  height: 100%;
  width: 0%;
  background: var(--pbx-action);
  transition: width 0.3s;
}

.upload-note { font-size: 12px; }

.processing-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.job-chip {
  background: var(--pbx-surface);
  border: 1px solid var(--pbx-border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  color: var(--pbx-muted);
}

.job-chip--done {
  color: var(--pbx-success);
  border-color: var(--pbx-success);
}

.upload-actions { margin-top: 4px; }

/* Staff asset list + manage */

.staff-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: var(--sp-1);
}

.staff-page-head h1 {
  margin: 0;
}

.staff-asset-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  margin-top: var(--sp-2);
}

.staff-asset-row {
  background: var(--pbx-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.staff-asset-row__summary {
  appearance: none;
  width: 100%;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 24px;
  gap: var(--sp-2);
  align-items: center;
  min-height: 88px;
  padding: 14px var(--sp-2);
  margin: 0;
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

.staff-asset-row__summary--text {
  grid-template-columns: minmax(0, 1fr) 28px;
}

.staff-asset-row__summary:hover,
.staff-asset-row__summary:focus-visible {
  background: color-mix(in srgb, var(--pbx-action) 6%, white);
  outline: none;
}

.staff-asset-row__thumb {
  width: 72px;
  height: 48px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--pbx-surface);
  border: 1px solid var(--pbx-border);
  flex-shrink: 0;
  position: relative;
}

.staff-asset-row__thumb img,
.staff-asset-row__thumb-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.staff-asset-row__thumb-img {
  opacity: 0;
  transition: opacity 0.35s ease;
}

.staff-asset-row__thumb-img--ready {
  opacity: 1;
}

.staff-asset-row__thumb--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--pbx-muted);
  text-align: center;
  padding: 0 4px;
  line-height: 1.15;
}

.staff-asset-row__title {
  font-weight: 700;
  font-size: 15px;
}

.staff-asset-row__meta {
  font-size: 13px;
  margin-top: 2px;
}

.staff-asset-row__chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  color: var(--pbx-muted);
  border-radius: 50%;
  background: color-mix(in srgb, var(--pbx-surface) 80%, white);
}

.staff-asset-row__chevron-icon {
  display: block;
  transform-origin: 50% 50%;
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

.staff-asset-row__summary:hover .staff-asset-row__chevron {
  color: var(--pbx-action);
}

.staff-asset-row--open .staff-asset-row__chevron {
  color: var(--pbx-action);
  background: color-mix(in srgb, var(--pbx-action) 12%, white);
}

.staff-asset-row--open .staff-asset-row__chevron-icon {
  transform: rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {
  .staff-asset-row__chevron-icon {
    transition: none;
  }
}

.staff-asset-row__detail {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

.staff-asset-row--open .staff-asset-row__detail {
  grid-template-rows: 1fr;
}

/* No padding here — padding on this node prevented 0fr from fully collapsing. */
.staff-asset-row__detail-inner {
  overflow: hidden;
  min-height: 0;
}

@media (prefers-reduced-motion: reduce) {
  .staff-asset-row__detail {
    transition: none;
  }
}

.staff-asset-row__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 260px);
  gap: var(--sp-3);
  align-items: start;
  padding: var(--sp-2) var(--sp-2) 0;
  border-top: 1px solid var(--pbx-surface);
}

.staff-asset-row__about h2 {
  margin: 0 0 var(--sp-1);
  font-size: 16px;
}

.staff-asset-row__about .kv-row:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.staff-asset-row__flags {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0 0;
  justify-self: end;
}

.staff-asset-row__flag {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.staff-asset-row__flag-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--pbx-muted);
  letter-spacing: 0.02em;
  flex-shrink: 0;
  text-align: right;
  min-width: 5.5rem;
}

/* Match width of longest label: "Not Published" */
.staff-asset-row__flag .staff-pill {
  min-width: 8.75rem;
  text-align: center;
  box-sizing: border-box;
}

.staff-asset-row__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-start;
  margin-top: var(--sp-2);
  padding: var(--sp-2);
  border-top: 1px solid var(--pbx-surface);
}

.staff-pill {
  display: inline-block;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 11px;
  background: var(--pbx-surface);
  border: 1px solid var(--pbx-border);
  color: var(--pbx-muted);
}

/* Good: published / reviewed — filled teal */
.staff-pill--published,
.staff-pill--embargoed,
.staff-pill--tx-reviewed {
  color: #fff;
  background: var(--pbx-action);
  border-color: var(--pbx-action);
}

/* Not good: unpublished / withdrawn / not reviewed — filled red */
.staff-pill--unpublished,
.staff-pill--withdrawn,
.staff-pill--tx-none,
.staff-pill--tx-machine {
  color: #fff;
  background: var(--pbx-critical);
  border-color: var(--pbx-critical);
}

.staff-back {
  display: inline-block;
  margin-bottom: var(--sp-2);
  text-decoration: none;
}

.staff-manage-block {
  background: var(--pbx-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: var(--sp-2);
  margin-bottom: var(--sp-2);
}

.staff-manage-block h2 {
  margin: 0 0 var(--sp-1);
  font-size: 16px;
}

.staff-manage-status,
.staff-manage-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.staff-publish-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.staff-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
}

.staff-field select,
.staff-field input[type="text"],
.staff-field textarea,
.staff-textarea {
  padding: 8px 10px;
  border: 1px solid var(--pbx-border);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 400;
  background: #fff;
  max-width: 520px;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
}

.staff-edit-card .staff-field,
.staff-edit-card .staff-edit-form {
  width: 100%;
  max-width: none;
}

.staff-edit-card .staff-field select,
.staff-edit-card .staff-field input[type="text"],
.staff-edit-card .staff-field textarea,
.staff-edit-card .staff-textarea {
  width: 100%;
  max-width: none;
}

.staff-org-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 400;
}

.staff-org-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

@media (max-width: 900px) {
  .staff-asset-row__body {
    grid-template-columns: 1fr;
  }

  .staff-asset-row__flags {
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--sp-2) var(--sp-3);
  }
}

/* Transcript review */

.version-strip {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}

.version-badge {
  background: var(--pbx-blue);
  color: #fff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 12px;
}

.version-badge--reviewed { background: var(--pbx-success); }

.speaker-name-panel {
  margin: 0 0 var(--sp-3);
  padding: var(--sp-2);
  border: 1px solid var(--pbx-border);
  border-radius: var(--radius);
  background: var(--pbx-surface);
}

.speaker-name-panel h2 {
  margin: 0 0 var(--sp-1);
  font-size: 15px;
}

.speaker-name-panel__asset {
  margin: 0 0 var(--sp-2);
}

.speaker-tool-row {
  display: grid;
  grid-template-columns: minmax(7rem, 0.45fr) 1fr;
  gap: var(--sp-1);
  align-items: center;
  margin-bottom: var(--sp-1);
}

.speaker-tool-row__from {
  font-size: 13px;
  font-weight: 700;
  color: var(--pbx-ink);
}

.speaker-tool-row select,
.speaker-tool-row input {
  padding: 8px 10px;
  border: 1px solid var(--pbx-border);
  border-radius: var(--radius);
  font-size: 14px;
  background: #fff;
}

.edit-seg {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: var(--sp-1);
  border-top: 1px solid var(--pbx-surface);
  padding: 8px 4px;
  font-size: 14px;
  line-height: 1.45;
}

.edit-seg .transcript-tc {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-align: left;
  font-size: 14px;
  font-family: var(--font-stack);
}

.edit-seg__text {
  outline: none;
  border-bottom: 1px dashed transparent;
}

.edit-seg__text:hover { border-bottom-color: var(--pbx-border); }
.edit-seg__text:focus { border-bottom-color: var(--pbx-action); background: #f0f9fa; }

.edit-seg--edited { background: #fbf7ec; }

.edit-seg--active {
  background: color-mix(in srgb, var(--pbx-action) 12%, white);
  outline: 1px solid color-mix(in srgb, var(--pbx-action) 35%, white);
}

.edited-flag {
  display: inline-block;
  margin-left: 8px;
  background: var(--pbx-caution);
  color: #fff;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 8px;
  vertical-align: middle;
}


/* ---- Site menu (hamburger → panel) ---- */

.site-menu-toggle {
  appearance: none;
  border: 1px solid var(--pbx-border);
  background: var(--pbx-card);
  border-radius: var(--radius);
  width: 44px;
  height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--pbx-ink);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.site-menu-toggle:hover {
  border-color: var(--pbx-action);
  background: color-mix(in srgb, var(--pbx-action) 8%, white);
}

.site-menu-toggle:focus-visible {
  outline: 2px solid var(--pbx-action);
  outline-offset: 2px;
}

.site-menu-toggle__bars,
.site-menu-toggle__bars::before,
.site-menu-toggle__bars::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.site-menu-toggle__bars {
  position: relative;
}

.site-menu-toggle__bars::before,
.site-menu-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.site-menu-toggle__bars::before { top: -6px; }
.site-menu-toggle__bars::after { top: 6px; }

body.site-menu-open .site-menu-toggle__bars {
  background: transparent;
}

body.site-menu-open .site-menu-toggle__bars::before {
  top: 0;
  transform: rotate(45deg);
}

body.site-menu-open .site-menu-toggle__bars::after {
  top: 0;
  transform: rotate(-45deg);
}

.site-menu {
  position: fixed;
  inset: 0;
  z-index: 80;
}

.site-menu__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 50, 77, 0.4);
  opacity: 0;
  transition: opacity 0.28s ease;
}

.site-menu__panel {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: min(20.5rem, 92vw);
  background: var(--pbx-card);
  box-shadow: -16px 0 48px rgba(23, 50, 77, 0.22);
  display: flex;
  flex-direction: column;
  padding: calc(var(--sp-3) + 4px) var(--sp-2) var(--sp-3);
  transform: translateX(104%);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.site-menu.is-open .site-menu__backdrop {
  opacity: 1;
}

.site-menu.is-open .site-menu__panel {
  transform: translateX(0);
}

.site-menu.is-open .site-menu__user,
.site-menu.is-open .site-menu__link,
.site-menu.is-open .site-menu__sign-out {
  opacity: 1;
  transform: translateX(0);
}

.site-menu.is-open .site-menu__link--disabled {
  opacity: 0.42;
}

.site-menu__user,
.site-menu__link,
.site-menu__sign-out {
  opacity: 0;
  transform: translateX(14px);
  transition:
    opacity 0.22s ease,
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.12s ease,
    color 0.12s ease,
    padding-left 0.12s ease,
    border-color 0.12s ease;
}

.site-menu.is-open .site-menu__user { transition-delay: 0.06s; }
.site-menu.is-open .site-menu__link:nth-child(1) { transition-delay: 0.08s; }
.site-menu.is-open .site-menu__link:nth-child(2) { transition-delay: 0.1s; }
.site-menu.is-open .site-menu__link:nth-child(3) { transition-delay: 0.12s; }
.site-menu.is-open .site-menu__link:nth-child(4) { transition-delay: 0.14s; }
.site-menu.is-open .site-menu__link:nth-child(5) { transition-delay: 0.16s; }
.site-menu.is-open .site-menu__link:nth-child(6) { transition-delay: 0.18s; }
.site-menu.is-open .site-menu__link:nth-child(7) { transition-delay: 0.2s; }
.site-menu.is-open .site-menu__link:nth-child(8) { transition-delay: 0.22s; }
.site-menu.is-open .site-menu__link:nth-child(9) { transition-delay: 0.24s; }
.site-menu.is-open .site-menu__link:nth-child(10) { transition-delay: 0.26s; }
.site-menu.is-open .site-menu__sign-out { transition-delay: 0.16s; }

@media (prefers-reduced-motion: reduce) {
  .site-menu__backdrop,
  .site-menu__panel,
  .site-menu__user,
  .site-menu__link,
  .site-menu__sign-out {
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
}

.site-menu__head {
  padding: 0 var(--sp-1) var(--sp-2);
  border-bottom: 1px solid var(--pbx-border);
  margin-bottom: var(--sp-2);
}

.site-menu__user {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-align: left;
  border: none;
  background: transparent;
  padding: 10px 12px;
  border-radius: var(--radius);
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--pbx-ink);
  cursor: pointer;
}

.site-menu__user-icon {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  padding: 0.3rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--pbx-action) 12%, white);
  color: var(--pbx-action);
  box-sizing: border-box;
}

.site-menu__user-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-menu__user:hover,
.site-menu__user:focus-visible {
  background: color-mix(in srgb, var(--pbx-action) 10%, white);
  color: var(--pbx-action);
  outline: none;
}

.site-menu__user:hover .site-menu__user-icon,
.site-menu__user:focus-visible .site-menu__user-icon {
  background: color-mix(in srgb, var(--pbx-action) 18%, white);
}

.site-menu__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow: auto;
  padding: 0 var(--sp-1);
}

.site-menu__group {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--pbx-muted);
  padding: 14px 12px 6px;
}

.site-menu__group--disabled {
  opacity: 0.45;
}

.site-menu__link {
  display: block;
  color: var(--pbx-ink);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  padding: 11px 12px;
  border-radius: var(--radius);
  transition: background 0.12s ease, color 0.12s ease, padding-left 0.12s ease;
}

.site-menu__link:hover {
  background: var(--pbx-surface);
  color: var(--pbx-action);
  padding-left: 16px;
}

.site-menu__link--active {
  background: color-mix(in srgb, var(--pbx-action) 12%, white);
  color: var(--pbx-action);
}

.site-menu__link--disabled {
  color: var(--pbx-muted);
  cursor: not-allowed;
  font-weight: 600;
}

.site-menu__link--disabled:hover {
  background: transparent;
  color: var(--pbx-muted);
  padding-left: 12px;
}

.site-menu__foot {
  margin-top: auto;
  padding: var(--sp-2) var(--sp-1) 0;
  border-top: 1px solid var(--pbx-border);
}

.site-menu__sign-out {
  appearance: none;
  width: 100%;
  border: 1px solid var(--pbx-border);
  background: transparent;
  color: var(--pbx-ink);
  font: inherit;
  font-weight: 600;
  padding: 11px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
}

.site-menu__sign-out:hover {
  border-color: var(--pbx-critical);
  color: var(--pbx-critical);
  background: color-mix(in srgb, var(--pbx-critical) 8%, white);
}

body.site-menu-open {
  overflow: hidden;
}

/* ---- Page hero + panel (project picker, future staff pages) ---- */

.hero {
  margin-bottom: var(--sp-4);
}

.hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero__lead {
  margin: 0;
  color: var(--pbx-muted);
  font-size: 1.0625rem;
  max-width: 62ch;
}

.panel {
  background: var(--pbx-card);
  border: 1px solid var(--pbx-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: var(--sp-3);
  margin-bottom: var(--sp-3);
}

.panel__header {
  margin-bottom: var(--sp-2);
}

.panel__header h2 {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
}

.panel__hint {
  margin: 0;
  font-size: 0.875rem;
  color: var(--pbx-muted);
}

.panel-status {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  color: var(--pbx-muted);
}

/* ============================================================
   Project picker — copied from PBXhost canonical block.
   Token swap only: pb-blue→pbx-action, text→pbx-ink, etc.
   ============================================================ */
.page--picker {
  padding-top: 2rem;
  padding-bottom: 3rem;
}

.panel--picker {
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(23, 50, 77, 0.08), 0 8px 24px rgba(23, 50, 77, 0.06);
  padding: 1.5rem;
}

.panel--picker .panel__header {
  margin-bottom: 1rem;
}

.panel--picker .panel__header h2 {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
}

.panel--picker .panel__hint {
  margin: 0;
  font-size: 0.875rem;
  color: var(--pbx-muted);
}

.panel--picker .panel-status {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  color: var(--pbx-muted);
}

.project-picker {
  display: grid;
  gap: 0.85rem;
}

.project-picker__card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  width: 100%;
  text-align: left;
  padding: 1rem 1.15rem;
  border: 1px solid color-mix(in srgb, var(--pbx-action) 18%, transparent);
  border-radius: 12px;
  background: #f8fafc;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.project-picker__card:hover {
  border-color: var(--pbx-action);
  box-shadow: 0 1px 3px rgba(23, 50, 77, 0.08), 0 8px 24px rgba(23, 50, 77, 0.06);
  transform: translateY(-1px);
}

.project-picker__card:focus-visible {
  outline: 2px solid var(--pbx-action);
  outline-offset: 2px;
}

.project-picker__card--selected {
  border-color: var(--pbx-action);
  box-shadow: inset 0 0 0 1px var(--pbx-action);
}

.project-picker__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--pbx-ink);
}

.project-picker__subtitle {
  font-size: 0.9rem;
  color: var(--pbx-muted);
}

.project-picker__meta {
  font-size: 0.75rem;
  color: var(--pbx-muted);
  letter-spacing: 0.02em;
}

.panel-status--error,
#project-picker-status.panel-status--error {
  color: var(--pbx-critical);
}

.empty-state {
  color: var(--pbx-muted);
  margin: 0;
}

.empty-state--panel {
  grid-column: 1 / -1;
  padding: 2.5rem 1.25rem;
  border: 1px dashed var(--pbx-border);
  border-radius: var(--radius);
  background: var(--pbx-surface);
  text-align: center;
}

.empty-state--panel h2 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  color: var(--pbx-ink);
}

.empty-state--panel p {
  margin: 0;
  color: var(--pbx-muted);
}

/* ---- Skeleton loading ---- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skeleton-line,
.skeleton-thumb,
.skeleton-pill,
.skeleton-btn {
  display: block;
  background: color-mix(in srgb, var(--pbx-border) 70%, var(--pbx-surface));
  border-radius: 4px;
  animation: skeleton-pulse 1.2s ease-in-out infinite;
}

.skeleton-line--title {
  height: 14px;
  width: 72%;
}

.skeleton-line--sub {
  height: 12px;
  width: 54%;
  margin-top: 8px;
}

.skeleton-line--meta {
  height: 10px;
  width: 38%;
  margin-top: 8px;
}

.skeleton-line--tags {
  height: 10px;
  width: 48%;
  margin-top: 10px;
}

.skeleton-line--block {
  height: 12px;
  width: 100%;
  margin-top: 10px;
}

.skeleton-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 0;
}

.skeleton-thumb--staff {
  width: 72px;
  height: 48px;
  aspect-ratio: auto;
  border-radius: 4px;
  flex-shrink: 0;
}

.skeleton-pill {
  height: 22px;
  width: 78px;
  border-radius: 999px;
}

.skeleton-btn {
  height: 32px;
  width: 72px;
  border-radius: var(--radius);
}

.skeleton-card {
  pointer-events: none;
  user-select: none;
}

.skeleton-card--picker {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  width: 100%;
  padding: 1rem 1.15rem;
  border: 1px solid var(--pbx-border);
  border-radius: 12px;
  background: #f8fafc;
}

.skeleton-card--asset {
  background: var(--pbx-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.skeleton-card--asset .skeleton-card__body {
  padding: var(--sp-2);
  display: flex;
  flex-direction: column;
}

.skeleton-card--collection {
  text-align: left;
  background: var(--pbx-card);
  border: 1px solid var(--pbx-border);
  border-left: 4px solid color-mix(in srgb, var(--pbx-border) 80%, var(--pbx-blue));
  border-radius: var(--radius);
  padding: var(--sp-1) var(--sp-2);
}

.skeleton-card--staff-row {
  background: var(--pbx-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 14px var(--sp-2);
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: var(--sp-2);
  align-items: center;
  min-height: 88px;
}

.skeleton-card--staff-row-text {
  grid-template-columns: minmax(0, 1fr);
}

.skeleton-card--staff-row .skeleton-card__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.skeleton-card--asset-detail {
  display: grid;
  gap: var(--sp-2);
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.skeleton-card__asset-head {
  display: grid;
  gap: 8px;
  max-width: 48rem;
}

.skeleton-line--asset-title {
  width: min(28rem, 70%);
  height: 1.6rem;
}

.skeleton-line--block-short {
  width: 62%;
}

.skeleton-card__asset-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem);
  gap: var(--sp-3);
  align-items: start;
}

.skeleton-card__asset-main {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.skeleton-thumb--asset-preview {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
}

.skeleton-card__asset-rail {
  display: grid;
  gap: 10px;
  padding: var(--sp-2);
  background: var(--pbx-card);
  border: 1px solid var(--pbx-border);
  border-radius: var(--radius);
}

@media (max-width: 960px) {
  .skeleton-card__asset-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .skeleton-card__asset-rail {
    display: none;
  }
}

@keyframes skeleton-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-line,
  .skeleton-thumb,
  .skeleton-pill,
  .skeleton-btn {
    animation: none;
  }
}

@media (max-width: 720px) {
  .pbx-header__inner,
  .page {
    width: 100%;
  }

  .pbx-header__inner {
    padding: 0.875rem 1rem;
  }

  .page {
    padding: var(--sp-3) 1rem var(--sp-4);
  }

}

@media (max-width: 480px) {
  .auth-card {
    padding: var(--sp-3);
  }
}
