/* 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 {
  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);
}

.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;
}

.pbx-header__brand {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  min-width: 0;
}

.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;
}

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

.pbx-header .event-name {
  color: var(--pbx-muted);
  font-size: 13px;
  max-width: min(30rem, 55vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pbx-header__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-left: auto;
  flex-wrap: wrap;
}

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

.btn {
  display: inline-block;
  border: none;
  border-radius: var(--radius);
  padding: 10px var(--sp-2);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  background: var(--pbx-action);
  color: #fff;
}

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

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

.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;
}

.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;
}

.auth-card .product-name {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 4px;
  text-align: center;
}

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

.auth-card .tagline {
  color: var(--pbx-muted);
  font-size: 14px;
  margin-bottom: var(--sp-3);
  text-align: center;
}

.auth-card .auth-heading {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 var(--sp-2);
  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: space-between;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
  font-size: 13px;
}

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

.pbx-header .user-label {
  color: var(--pbx-muted);
  font-size: 13px;
}

.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;
  margin-top: var(--sp-2);
}

.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;
}

.auth-choice__card--inactive {
  cursor: default;
}

.auth-choice__card--inactive:hover,
.auth-choice__card--inactive:focus-visible {
  transform: none;
  border-color: var(--pbx-border);
  background: var(--pbx-card);
}

.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;
}

.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);
}

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

.asset-card:hover {
  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 {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.asset-card .thumb.thumb--image .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;
  right: 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: 1;
}

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

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

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

.asset-tag {
  font-size: 11px;
  line-height: 1.2;
  padding: 2px 6px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--pbx-border) 55%, transparent);
  color: var(--pbx-muted, #5a6570);
}

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

/* 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-head .status-pill { margin-bottom: var(--sp-1); }
.asset-title { margin: 6px 0 4px; font-size: 24px; }
.transcript-show { margin-top: var(--sp-1); }

/* Media + detail on the left, transcript rail on the right; hiding the rail
   gives the player the full width. */
.asset-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: var(--sp-2);
  align-items: start;
}

.asset-workspace--wide { grid-template-columns: minmax(0, 1fr); }
.asset-workspace--wide .asset-rail { display: none; }

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

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

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

.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 {
  width: 100%;
  border-radius: var(--radius);
  display: block;
}

.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);
  padding: 6px 0;
  border-top: 1px solid var(--pbx-surface);
  font-size: 14px;
}

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

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

.download-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-1);
  padding: 10px 0;
  border-top: 1px solid var(--pbx-surface);
}

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

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

.transcript-panel { position: sticky; top: var(--sp-2); }

.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: #fdf3e0;
  color: #7a5410;
  border: 1px solid var(--pbx-caution);
  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-bottom: var(--sp-1);
}

.transcript-list {
  max-height: 60vh;
  overflow-y: auto;
  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;
}

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

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

.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);
}

/* ---- 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-asset-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.staff-asset-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, 1.4fr) minmax(0, 0.8fr) auto;
  gap: var(--sp-2);
  align-items: center;
  min-height: 88px;
}

.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;
}

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

.staff-asset-row__thumb--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--pbx-muted);
}

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

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

.staff-asset-row__status {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
}

.staff-asset-row__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

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

.staff-pill--published {
  color: var(--pbx-success);
  border-color: var(--pbx-success);
}

.staff-pill--withdrawn {
  color: #a33;
  border-color: #a33;
}

.staff-pill--unpublished,
.staff-pill--embargoed {
  color: var(--pbx-action);
  border-color: var(--pbx-action);
}

.staff-pill--tx-reviewed {
  color: var(--pbx-success);
  border-color: var(--pbx-success);
}

.staff-pill--tx-machine {
  color: var(--pbx-action);
  border-color: var(--pbx-action);
}

.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;
}

.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 {
    grid-template-columns: 72px 1fr;
  }

  .staff-asset-row__status,
  .staff-asset-row__actions {
    grid-column: 1 / -1;
  }

  .staff-asset-row__actions {
    justify-content: flex-start;
  }
}

/* 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-tool-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: var(--sp-1);
}

.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;
}

.transcript-label--reviewed {
  background: #e9f4ee;
  color: #1d5c40;
  border-color: var(--pbx-success);
}

/* ---- Prototype pages menu (dev convenience) ---- */

.pages-menu {
  position: relative;
}

.pages-menu summary {
  list-style: none;
  cursor: pointer;
  color: var(--pbx-action);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 12px;
  border: 1px solid var(--pbx-action);
  border-radius: var(--radius);
}

.pages-menu summary::-webkit-details-marker { display: none; }

.pages-menu[open] summary,
.pages-menu summary:hover {
  color: var(--pbx-ink);
  background: color-mix(in srgb, var(--pbx-action) 10%, white);
}

.pages-menu__list {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: var(--pbx-card);
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  min-width: 230px;
  padding: 6px;
  z-index: 20;
  display: flex;
  flex-direction: column;
}

.pages-menu__group {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pbx-muted);
  padding: 8px 10px 2px;
}

.pages-menu__list a {
  color: var(--pbx-ink);
  text-decoration: none;
  font-size: 14px;
  padding: 7px 10px;
  border-radius: 6px;
}

.pages-menu__list a:hover {
  background: var(--pbx-surface);
  color: var(--pbx-action);
}

/* ---- Project picker + empty library ---- */

.project-picker {
  display: grid;
  gap: 0.85rem;
  margin-top: var(--sp-3);
}

.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 var(--pbx-border);
  border-radius: var(--radius);
  background: var(--pbx-surface);
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.project-picker__card:hover {
  border-color: var(--pbx-action);
}

.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;
}

.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: #9b1c1c;
}

.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);
}

@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);
  }

  .pbx-header__actions {
    width: 100%;
    justify-content: flex-start;
  }
}
