/* Portal CSS part: entry screen, password gate, dashboard, dashboard V6 and Music Choices. */
/* Split from portal.css (Phase 6): linked straight after portal.css and the earlier portal-*.css parts, in this order, so the cascade is unchanged. */

/* ═══════════════════════════════════════════════════
   PORTAL ENTRY SCREEN (portal.html)
═══════════════════════════════════════════════════ */

.clients-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 80px);
  padding: var(--space-10);
  overflow: hidden;
}

.portal-entry {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-10);
  width: 100%;
  max-width: 420px;
  position: relative;
}

.portal-entry-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: var(--space-6);
  opacity: 0.85;
}

.portal-entry-title {
  font-family: var(--rf-type-heading-family);
  font-weight: var(--rf-type-heading-weight);
  letter-spacing: var(--rf-type-heading-tracking);
  color: var(--text-primary);
  margin-bottom: var(--space-3);
  --rf-type-heading-size: var(--rf-type-size-28px);
}

.portal-entry-subtitle {
  font-size: var(--rf-type-size-13px, 13px);
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-7);
  max-width: 320px;
}

.portal-entry-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.portal-entry-form input[type="text"],

.portal-entry-form input[type="password"] {
  width: 100%;
}

.portal-entry-form .btn {
  width: 100%;
}

.portal-error {
  margin-top: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--rf-type-size-11px, 11px);
  color: rgba(var(--rf-tone-danger-rgb), 0.8);
  letter-spacing: 0.04em;
  min-height: 0;
  display: none;
}
.portal-error:not(:empty) {
  display: block;
}

/* ═══════════════════════════════════════════════════
   PORTAL PASSWORD GATE (portal-dashboard.html)
═══════════════════════════════════════════════════ */

.portal-body {
  min-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
}

.portal-gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-10);
  width: 100%;
  max-width: 420px;
  margin: auto;
}

.portal-gate-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: var(--radius-md);
  padding: var(--space-3);
  margin-bottom: var(--space-6);
  background: var(--rf-tone-neutral-fill);
  border: 1px solid rgba(var(--rf-tone-neutral-rgb), 0.1);
}

.pw-gate-icon {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-5);
  color: var(--text-dim);
}

.portal-gate-title {
  font-family: var(--rf-type-heading-family);
  font-weight: var(--rf-type-heading-weight);
  letter-spacing: var(--rf-type-heading-tracking);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
  --rf-type-heading-size: var(--rf-type-size-24px);
}

.pw-gate-label {
  font-family: var(--font-mono);
  font-size: var(--rf-type-size-10px, 10px);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: var(--space-7);
  padding-top: var(--space-1);
}

.pw-gate-label::after {
  content: '';
  display: block;
  width: 32px;
  height: 1px;
  background: rgba(var(--orange-rgb),0.35);
  margin: var(--space-3) auto 0;
}

.pw-gate-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.pw-gate-form input[type="password"],

.pw-gate-form input[type="text"] {
  width: 100%;
}

.pw-gate-form .btn {
  width: 100%;
}

.pw-modal-error {
  margin-top: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--rf-type-size-11px, 11px);
  color: rgba(var(--rf-tone-danger-rgb), 0.8);
  letter-spacing: 0.04em;
  min-height: 0;
  display: none;
}
.pw-modal-error:not(:empty) {
  display: block;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-8px); }
  40%       { transform: translateX(8px); }
  60%       { transform: translateX(-6px); }
  80%       { transform: translateX(6px); }
}

.pw-gate-form input.error {
  animation: shake 0.4s ease;
}

/* ═══════════════════════════════════════════════════
   PORTAL DASHBOARD
═══════════════════════════════════════════════════ */

.portal-dashboard {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 48px;
  width: 100%;
}

.portal-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: var(--space-10);
}

.portal-client-logo {
  max-width: 280px;
  max-height: 120px;
  width: auto;
  height: auto;
  object-fit: contain;
  margin-bottom: var(--space-6);
  /* Default: white-silhouette filter for raster logos that may be dark-on-transparent */
  filter: brightness(0) invert(1) drop-shadow(0 4px 16px color-mix(in srgb, var(--black) 40%, transparent));
  opacity: 0.92;
}
/* SVG logos: still apply white silhouette — most client SVGs are dark-on-transparent */
.portal-client-logo.portal-logo-svg {
  filter: brightness(0) invert(1) drop-shadow(0 4px 16px color-mix(in srgb, var(--black) 40%, transparent));
  opacity: 0.92;
}

.portal-client-name {
  font-family: var(--rf-type-heading-family);
  font-weight: var(--rf-type-heading-weight);
  letter-spacing: var(--rf-type-heading-tracking);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
  --rf-type-heading-size: var(--rf-type-size-32px);
}

.portal-label {
  font-family: var(--font-mono);
  font-size: var(--rf-type-size-10px, 10px);
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.portal-label::after {
  content: '';
  display: block;
  width: 32px;
  height: 1px;
  background: rgba(var(--orange-rgb),0.35);
  margin: var(--space-3) auto 0;
}

.portal-section {
  margin-bottom: var(--space-10);
}

.category-row-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-3);
}

.category-row-title {
  font-family: var(--font-mono);
  letter-spacing: var(--rf-type-heading-tracking);
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
  --rf-type-heading-size: var(--rf-type-size-10px);
}

.category-row-line {
  flex: 1;
  height: 1px;
  background: rgba(var(--rf-tone-neutral-rgb), 0.07);
}

.category-row-count {
  font-family: var(--font-mono);
  font-size: var(--rf-type-size-10px, 10px);
  color: var(--text-dim);
  white-space: nowrap;
}

/* Projects grid — 3-up desktop, 2-up tablet, 1-up mobile.
   Uses minmax with auto-fit-style limiting so a sparse 1-2 project client
   doesn't stretch a single card to fill the row. Cards cap at ~440px wide. */
.portal-projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  grid-auto-columns: minmax(0, 440px);
  gap: var(--space-5);
}
/* Limit the number of columns at each breakpoint so cards stay sized
   sensibly when there are fewer items than columns. */
.portal-projects-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.portal-projects-grid:has(> :nth-child(1):last-child) {
  grid-template-columns: minmax(0, 440px);
  justify-content: center;
}
.portal-projects-grid:has(> :nth-child(2):last-child) {
  grid-template-columns: repeat(2, minmax(0, 440px));
  justify-content: center;
}

@media (max-width: 959px) {
  .portal-projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 639px) {
  .portal-projects-grid {
    grid-template-columns: 1fr;
  }
}

/* Project card */
.portal-project-card {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.portal-project-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 28px 60px color-mix(in srgb, var(--black) 55%, transparent),
    0 8px 20px color-mix(in srgb, var(--black) 35%, transparent),
    inset 0 1px 0 rgba(var(--rf-tone-neutral-rgb), 0.22);
}

/* Caption strip — persistent title + meta below the thumbnail */
.portal-card-caption {
  padding: var(--space-3) var(--space-4) var(--space-4);
  background: rgba(var(--rf-tone-neutral-rgb), 0.02);
  border-top: 1px solid rgba(var(--rf-tone-neutral-rgb), 0.06);
}

.portal-card-caption-title {
  font-family: var(--font-display);
  font-weight: var(--rf-type-heading-weight);
  letter-spacing: var(--rf-type-heading-tracking);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: var(--space-1);
  --rf-type-heading-size: var(--rf-type-size-14px);
}

.portal-card-caption-meta {
  font-family: var(--font-mono);
  font-size: var(--rf-type-size-10px, 10px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.portal-project-card .browse-thumb {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: rgba(var(--rf-tone-neutral-rgb), 0.04);
}

.portal-project-card .browse-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.portal-project-card:hover .browse-thumb img {
  transform: scale(1.04);
}

.portal-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  background: rgba(var(--rf-tone-neutral-rgb), 0.03);
}

.portal-thumb-awaiting {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: var(--space-4);
  text-align: center;
  width: 100%;
  height: 100%;
}

.portal-thumb-awaiting-icon {
  color: var(--text-dim);
  opacity: 0.5;
  flex-shrink: 0;
}

.portal-thumb-awaiting-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--rf-type-size-13px, 13px);
  letter-spacing: 0.01em;
  color: var(--text-secondary);
  line-height: var(--rf-type-leading-1-2, 1.2);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-thumb-awaiting-caption {
  font-family: var(--font-mono);
  font-size: var(--rf-type-size-9px, 9px);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.portal-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, color-mix(in srgb, var(--black) 70%, transparent) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--space-4) var(--space-5);
  transition: background 0.2s ease;
}

.portal-project-card:hover .portal-overlay {
  background: linear-gradient(180deg, transparent 10%, color-mix(in srgb, var(--black) 80%, transparent) 100%);
}

.browse-overlay-meta {
  font-family: var(--font-mono);
  font-size: var(--rf-type-size-9px, 9px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(var(--rf-tone-neutral-rgb), 0.5);
  margin-bottom: var(--space-1);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.browse-overlay-title {
  font-family: var(--rf-type-heading-family);
  font-weight: var(--rf-type-heading-weight);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
  --rf-type-heading-size: var(--rf-type-size-15px);
}

.portal-overlay-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.portal-view-link {
  font-family: var(--font-mono);
  font-size: var(--rf-type-size-10px, 10px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--orange);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.portal-project-card:hover .portal-view-link {
  opacity: 1;
  transform: translateY(0);
}

/* Resources */
.portal-resource-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.portal-resources-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.portal-resource-icon {
  font-size: var(--rf-type-size-18px, 18px);
  flex-shrink: 0;
  width: 32px;
  text-align: center;
  color: var(--text-dim);
}

.portal-resource-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.portal-resource-name {
  font-size: var(--rf-type-size-13px, 13px);
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.portal-resource-meta {
  font-family: var(--font-mono);
  font-size: var(--rf-type-size-10px, 10px);
  letter-spacing: 0.04em;
  color: var(--text-dim);
  white-space: nowrap;
}

.portal-resource-download {
  flex-shrink: 0;
  color: var(--text-dim);
  transition: color 0.15s ease;
}

.resource-list a:hover .portal-resource-download,
.portal-resources-list a:hover .portal-resource-download {
  color: var(--text-secondary);
}

.portal-resources-list a {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  height: 50px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-sm);
  border-bottom: 1px solid rgba(var(--rf-tone-neutral-rgb), 0.05);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: var(--rf-type-size-13px, 13px);
  transition: background 0.15s ease, color 0.15s ease;
}

.portal-resources-list a:hover {
  background: rgba(var(--rf-tone-neutral-rgb), 0.04);
  color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════
   PORTAL DASHBOARD V6 — clean rebuild
═══════════════════════════════════════════════════ */

/* Portal header — no bar, just floating logo in top-left corner */
:is(body.portal-page, body.project-landing-page, body.review-page) .site-header {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: none;
  position: absolute;
  height: auto;
  padding: 20px 32px;
  pointer-events: none;
}
:is(body.portal-page, body.project-landing-page, body.review-page) .site-header .logo-link {
  pointer-events: auto;
}
:is(body.portal-page, body.project-landing-page, body.review-page) .site-header .hamburger,
:is(body.portal-page, body.project-landing-page, body.review-page) .site-header nav {
  display: none;
}
:is(body.portal-page, body.project-landing-page, body.review-page) .page-content {
  padding-top: 0;
}

/* Review page — transparent top bar */
body.review-page .review-top-bar {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid rgba(var(--rf-tone-neutral-rgb), 0.06);
}

/* Client logo masthead */
.client-masthead {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 0 56px;
}

.client-logo {
  max-width: 480px;
  max-height: 160px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}
/* SVG logos: still apply white silhouette — most client SVGs are dark-on-transparent */
.client-logo.portal-logo-svg {
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

/* Section divider label */
.section-label {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: var(--rf-type-size-10px, 10px);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(var(--rf-tone-neutral-rgb), 0.25);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rf-tone-neutral-fill);
}

/* Film grid — project cards */
.film-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 72px;
}

.film-card {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.25s var(--rf-motion-spring, cubic-bezier(0.16, 1, 0.3, 1));
}
.film-card:hover { transform: translateY(-4px); }

.film-thumb {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(var(--rf-tone-neutral-rgb), 0.03);
  border: 1px solid rgba(var(--rf-tone-neutral-rgb), 0.06);
  margin-bottom: 12px;
}
.film-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--rf-motion-spring, cubic-bezier(0.16, 1, 0.3, 1));
}
.film-card:hover .film-thumb img { transform: scale(1.03); }

.film-thumb-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(var(--green-deep-rgb), 0.3) 0%, color-mix(in srgb, var(--black) 45%, transparent) 100%);
  border: 1px solid rgba(var(--rf-tone-neutral-rgb), 0.06);
}
.film-thumb-initials {
  font-family: var(--font-display, 'Plus Jakarta Sans', sans-serif);
  font-weight: 700;
  font-size: var(--rf-type-size-28px, 28px);
  color: rgba(var(--rf-tone-neutral-rgb), 0.2);
  letter-spacing: 0.08em;
  user-select: none;
}

.film-title {
  font-family: var(--rf-type-heading-family);
  font-weight: var(--rf-type-heading-weight);
  letter-spacing: var(--rf-type-heading-tracking);
  color: rgba(var(--rf-tone-neutral-rgb), 0.7);
  transition: color 0.15s ease;
  --rf-type-heading-size: var(--rf-type-size-16px);
}
.film-card:hover .film-title { color: var(--white, var(--white)); }

/* Resources panel — tabbed */
.resources-panel { margin-bottom: 72px; }

.resource-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  justify-content: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.resource-tabs::-webkit-scrollbar { display: none; }

.resource-tab {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: var(--rf-type-size-13px, 13px);
  font-weight: 500;
  color: var(--text-muted);
  padding: var(--space-2) 20px;
  cursor: pointer;
  border: 1px solid rgba(var(--rf-tone-neutral-rgb), 0.07);
  background: rgba(var(--rf-tone-neutral-rgb), 0.02);
  border-radius: var(--radius-md);
  white-space: nowrap;
  transition: all 0.18s ease;
}
.resource-tab:hover {
  background: rgba(var(--rf-tone-neutral-rgb), 0.05);
  border-color: rgba(var(--rf-tone-neutral-rgb), 0.12);
  color: rgba(var(--rf-tone-neutral-rgb), 0.65);
}
.resource-tab.active {
  background: rgba(var(--orange-rgb), 0.1);
  border-color: rgba(var(--orange-rgb), 0.3);
  color: var(--orange);
}

.resource-tab-count {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: var(--rf-type-size-10px, 10px);
  margin-left: var(--space-2);
  background: rgba(var(--rf-tone-neutral-rgb), 0.1);
  border-radius: 20px;
  padding: 1px var(--space-2);
  opacity: 0.7;
}

.resource-tab-body { display: none; }
.resource-tab-body.active { display: block; }

.resource-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.resource-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 16px;
  text-decoration: none;
  color: inherit;
  border-radius: 12px;
  background: rgba(var(--rf-tone-neutral-rgb), 0.025);
  border: 1px solid rgba(var(--rf-tone-neutral-rgb), 0.04);
  transition: all 0.18s ease;
}
.resource-row:hover {
  background: rgba(var(--rf-tone-neutral-rgb), 0.05);
  border-color: rgba(var(--rf-tone-neutral-rgb), 0.1);
  transform: translateY(-1px);
}

.resource-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.resource-icon svg { width: 18px; height: 18px; }

.resource-info { flex: 1; min-width: 0; }

.resource-name {
  font-size: var(--rf-type-size-13px, 13px);
  font-weight: 500;
  color: rgba(var(--rf-tone-neutral-rgb), 0.75);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.resource-size {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: var(--rf-type-size-10px, 10px);
  color: rgba(var(--rf-tone-neutral-rgb), 0.2);
  margin-top: 2px;
  display: block;
}

.resource-dl {
  color: rgba(var(--rf-tone-neutral-rgb), 0.12);
  flex-shrink: 0;
  transition: color 0.15s ease;
}
.resource-row:hover .resource-dl { color: var(--orange); }

body.portal-dashboard-page.portal-page .resource-tab,
body.portal-page.project-landing-page .resource-tab {
  transition:
    background-color 180ms var(--client-ease, cubic-bezier(0.22, 1, 0.36, 1)),
    border-color 180ms var(--client-ease, cubic-bezier(0.22, 1, 0.36, 1)),
    color 180ms var(--client-ease, cubic-bezier(0.22, 1, 0.36, 1));
}

body.portal-dashboard-page.portal-page .resource-row,
body.portal-page.project-landing-page .resource-row {
  transition:
    background-color 180ms var(--client-ease, cubic-bezier(0.22, 1, 0.36, 1)),
    border-color 180ms var(--client-ease, cubic-bezier(0.22, 1, 0.36, 1)),
    transform 180ms var(--client-ease, cubic-bezier(0.22, 1, 0.36, 1));
}

body.portal-dashboard-page.portal-page .resource-download-outcome {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 32px;
  color: rgba(var(--rf-tone-neutral-rgb), 0.68);
  font: 600 var(--rf-type-size-12px, 12px)/var(--rf-type-leading-1, 1) var(--font-body, 'Inter', sans-serif);
  white-space: nowrap;
  flex: 0 0 auto;
  transition: color 0.15s ease;
}

body.portal-dashboard-page.portal-page .resource-download-outcome .resource-dl {
  color: currentColor;
}

body.portal-dashboard-page.portal-page .resource-row:hover .resource-download-outcome {
  color: var(--orange);
}

body.portal-page.project-landing-page .portal-file-row {
  min-width: 0;
  cursor: default;
}

body.portal-page.project-landing-page .portal-file-actions,
body.portal-page.project-landing-page .file-preview-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex: 0 0 auto;
}

/* Colour-coded icon backgrounds */
.icon-pdf { background: rgba(var(--rf-tone-danger-rgb), 0.08); }
.icon-pdf svg { color: rgba(var(--rf-tone-danger-rgb), 0.7); }
.icon-img { background: rgba(var(--rf-tone-info-rgb), 0.08); }
.icon-img svg { color: rgba(var(--rf-tone-info-rgb), 0.7); }
.icon-doc { background: rgba(var(--rf-tone-info-rgb), 0.08); }
.icon-doc svg { color: rgba(var(--rf-tone-info-rgb), 0.7); }
.icon-font { background: rgba(var(--rf-tone-violet-rgb), 0.08); }
.icon-font svg { color: rgba(var(--rf-tone-violet-rgb), 0.7); }

/* ── Music Choices (client portal) ──────────────────────────────── */
.music-panel {
  margin-bottom: 0;
  background: linear-gradient(180deg, rgba(var(--rf-tone-neutral-rgb), 0.04), rgba(var(--rf-tone-neutral-rgb), 0.015));
  border: 0;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  padding: 0;
}

.files-panel {
  background: linear-gradient(180deg, rgba(var(--rf-tone-neutral-rgb), 0.035), rgba(var(--rf-tone-neutral-rgb), 0.012));
}

.files-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 68px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
}

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

.files-summary-title {
  display: block;
  font-family: var(--rf-type-heading-family);
  font-weight: var(--rf-type-heading-weight);
  line-height: var(--rf-type-leading-1-1);
  color: var(--text-primary);
  --rf-type-heading-size: var(--rf-type-size-20px);
}

.files-summary-meta {
  display: block;
  margin-top: 5px;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: var(--rf-type-size-10px, 10px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.files-summary-chevron {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(var(--rf-tone-neutral-rgb), 0.12);
  border-radius: 50%;
  flex: 0 0 auto;
  position: relative;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.files-summary-chevron::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 9px;
  width: 8px;
  height: 8px;
  border-right: 1px solid rgba(var(--rf-tone-neutral-rgb), 0.75);
  border-bottom: 1px solid rgba(var(--rf-tone-neutral-rgb), 0.75);
  transform: rotate(45deg);
}

.files-panel[open] .files-summary-chevron {
  transform: rotate(180deg);
  border-color: rgba(var(--orange-rgb), 0.45);
}

.music-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 78px;
  padding: 18px;
  cursor: pointer;
  list-style: none;
}
.music-summary::-webkit-details-marker { display: none; }
.music-summary-title {
  display: block;
  font-family: var(--rf-type-heading-family);
  font-weight: var(--rf-type-heading-weight);
  line-height: var(--rf-type-leading-1-1);
  color: rgba(var(--rf-tone-neutral-rgb), 0.9);
  --rf-type-heading-size: var(--rf-type-size-24px);
}
.music-summary-meta {
  display: block;
  margin-top: 5px;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: var(--rf-type-size-10px, 10px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.music-summary-chevron {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(var(--rf-tone-neutral-rgb), 0.12);
  border-radius: 50%;
  flex: 0 0 auto;
  position: relative;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.music-summary-chevron::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 9px;
  width: 8px;
  height: 8px;
  border-right: 1px solid rgba(var(--rf-tone-neutral-rgb), 0.75);
  border-bottom: 1px solid rgba(var(--rf-tone-neutral-rgb), 0.75);
  transform: rotate(45deg);
}
.music-panel[open] .music-summary-chevron {
  transform: rotate(180deg);
  border-color: rgba(var(--orange-rgb), 0.45);
}
.music-panel-body {
  padding: 0 18px 16px;
}
.music-intro {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: var(--rf-type-size-14px, 14px);
  line-height: 1.55;
  color: rgba(var(--rf-tone-neutral-rgb), 0.55);
  max-width: 52ch;
  margin: 0 0 8px;
}

.music-tracks { margin-top: 6px; }
.project-landing-rail .music-tracks { margin-top: 0; }

.music-track {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: var(--space-3);
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.music-track + .music-track { border-top: 1px solid rgba(var(--rf-tone-neutral-rgb), 0.05); }
.music-track:hover { background: rgba(var(--rf-tone-neutral-rgb), 0.035); }
.music-track.playing {
  background: rgba(var(--orange-rgb), 0.12);
  border-color: rgba(var(--orange-rgb), 0.32);
}
.project-landing-rail .music-track {
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 56px;
  padding: 10px 0;
  border-radius: 0;
}
.project-landing-rail .music-track:hover { background: transparent; }
.project-landing-rail .music-track.playing {
  margin-left: -8px;
  margin-right: -8px;
  padding-left: 8px;
  padding-right: 8px;
  border-radius: var(--radius-md);
}

.music-play {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(var(--rf-tone-neutral-rgb), 0.12);
  background: color-mix(in srgb, var(--black) 28%, transparent);
  color: rgba(var(--rf-tone-neutral-rgb), 0.85);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.music-play:hover:not(:disabled) { border-color: var(--orange); color: var(--orange); }
.music-track.playing .music-play {
  background: var(--orange);
  border-color: var(--orange);
  color: #241006;
}
.music-play svg {
  width: 18px;
  height: 18px;
  transition: transform 0.18s cubic-bezier(0.22,0.61,0.36,1), opacity 0.18s ease;
}
.music-play:active svg { transform: scale(0.86); }
.music-play:disabled { cursor: default; opacity: 0.6; color: var(--text-muted); }
.music-play:focus-visible {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(var(--orange-rgb), 0.25);
}
.project-landing-rail .music-play {
  width: 36px;
  height: 36px;
}
.project-landing-rail .music-play svg {
  width: 15px;
  height: 15px;
}
/* Gentle, low-contrast spinner while the web copy is still preparing. */
.music-prep-spin { animation: rf-state-spin 0.9s linear infinite; opacity: 0.7; }

.music-meta { min-width: 0; }
.music-title {
  font-family: var(--rf-type-heading-family);
  font-weight: var(--rf-type-heading-weight);
  line-height: var(--rf-type-leading-1-25);
  color: var(--text-primary);
  word-break: break-word;
  --rf-type-heading-size: var(--rf-type-size-15px);
}
.music-track.preparing .music-title { color: rgba(var(--rf-tone-neutral-rgb), 0.55); }
.project-landing-rail .music-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: normal;
  --rf-type-heading-size: var(--rf-type-size-14px);
}

.music-seekrow { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.music-seek {
  position: relative;
  flex: 1;
  height: 5px;
  border-radius: var(--radius-pill);
  background: rgba(var(--rf-tone-neutral-rgb), 0.12);
  cursor: pointer;
  transform-origin: center;
  transition: transform 0.15s ease, background 0.15s ease;
}
/* Invisible enlarged hit area so the thin bar is easy to tap on mobile,
   without changing the visible bar height. */
.music-seek::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 22px;
  transform: translateY(-50%);
}
.music-seek:hover { background: rgba(var(--rf-tone-neutral-rgb), 0.18); transform: scaleY(1.35); }
.music-seek:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(var(--orange-rgb), 0.25);
}
.music-track.preparing .music-seek { cursor: default; }
.music-fill {
  position: relative;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--orange), #f0a25e);
  border-radius: var(--radius-pill);
  transition: none;
  pointer-events: none;
}
.music-time {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: var(--rf-type-size-11px, 11px);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  min-width: 78px;
  text-align: right;
}
.project-landing-rail .music-time { display: none; }

.music-actions { display: flex; align-items: center; gap: 4px; }
.music-iconbtn {
  display: flex;
  align-items: center;
  justify-content: center;
}
.music-fav.faved svg { fill: currentColor; }
.project-landing-rail .music-actions { gap: 0; }
/* One-shot confirmation pop when a track is favourited. */
.music-fav.pop svg { animation: music-fav-pop 0.42s cubic-bezier(0.22,0.61,0.36,1); }
@keyframes music-fav-pop {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.35); }
  60%  { transform: scale(0.92); }
  100% { transform: scale(1); }
}

.music-note {
  grid-column: 1 / -1;
  margin: var(--space-2) 4px 2px 60px;
  display: none;
}
.music-track.note-open .music-note { display: block; }
.project-landing-rail .music-note {
  margin: var(--space-2) 0 2px 48px;
}
.music-note-input {
  width: 100%;
  resize: vertical;
}
.music-note-status {
  display: inline-block;
  font-size: var(--rf-type-size-11px, 11px);
  color: var(--text-muted);
  margin-top: 4px;
  min-height: 14px;
}
.music-note-status.ok { color: var(--rf-tone-success-ink); }

.music-note-saved {
  grid-column: 1 / -1;
  font-size: var(--rf-type-size-12px, 12px);
  color: rgba(var(--rf-tone-neutral-rgb), 0.5);
  background: linear-gradient(
    100deg,
    rgba(var(--orange-rgb),0.16) 0%,
    color-mix(in srgb, var(--black) 14%, transparent) 38%,
    color-mix(in srgb, var(--black) 20%, transparent) 100%
  );
  border: 1px solid rgba(var(--orange-rgb),0.34);
  border-left: 1px solid rgba(var(--orange-rgb),0.34);
  padding: 8px 12px;
  border-radius: 10px;
  margin: 8px 0 2px;
  display: flex;
  gap: 8px;
  align-items: baseline;
  line-height: var(--rf-type-leading-1-4, 1.4);
}
.music-note-saved b { color: rgba(var(--rf-tone-neutral-rgb), 0.82); font-weight: 600; }

.music-footnote {
  text-align: center;
  color: rgba(var(--rf-tone-neutral-rgb), 0.35);
  font-size: var(--rf-type-size-12px, 12px);
  padding: var(--space-5) var(--space-2) 8px;
  line-height: 1.6;
}
.project-landing-rail .music-footnote {
  text-align: left;
  padding: var(--space-4) 0 2px;
}

.project-landing-rail .resources-panel {
  margin-bottom: 0;
  padding: 0 18px 18px;
}

.project-landing-rail .resource-tabs {
  display: grid;
  gap: 10px;
  justify-content: stretch;
  margin-bottom: 0;
  overflow: visible;
}

.project-landing-rail .resource-tab {
  width: 100%;
  min-height: 44px;
  justify-content: flex-start;
  text-align: left;
  border-radius: var(--radius-md);
}

.project-landing-rail .resource-list {
  grid-template-columns: 1fr;
  margin-top: 12px;
}

/* Mobile — stack the heart/note actions tighter and keep tap targets big */
@media (max-width: 600px) {
  .music-panel { padding: 0; }
  .music-track {
    grid-template-columns: 44px 1fr;
    grid-template-areas:
      "play meta"
      "note note"
      "actions actions";
    gap: var(--space-2) 12px;
  }
  .music-play { grid-area: play; }
  .music-meta { grid-area: meta; }
  .music-actions { grid-area: actions; justify-content: flex-end; gap: 8px; }
  .music-note { grid-area: note; margin-left: 0; }
  .music-note-saved { margin-left: 0; }
  .music-time { min-width: 70px; }
  /* Comfortable tap targets on touch devices (≥44px). */ /* avoid iOS auto-zoom on focus */
}

/* Slightly taller seek bar on coarse pointers (touch) for easier scrubbing. */
@media (pointer: coarse) {
  .music-seek { height: 7px; }
}

/* Respect reduced-motion: drop the spinner, fav pop, and icon transitions. */
@media (prefers-reduced-motion: reduce) {
  .music-prep-spin { animation: none; }
  .music-fav.pop svg { animation: none; }
  .music-play svg,
.music-fill,
.music-seek,
.music-track { transition: none; }
}

/* Upload drop zone */
.upload-area {
  margin-top: 16px;
  border: 2px dashed rgba(var(--rf-tone-neutral-rgb), 0.08);
  border-radius: var(--radius-md);
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.upload-area:hover,
.upload-area.drag-over {
  border-color: rgba(var(--orange-rgb), 0.3);
  background: rgba(var(--orange-rgb), 0.03);
}

body.portal-dashboard-page.portal-page .upload-area:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.upload-icon {
  color: rgba(var(--rf-tone-neutral-rgb), 0.15);
  margin-bottom: 8px;
}
.upload-area:hover .upload-icon,
.upload-area.drag-over .upload-icon { color: rgba(var(--orange-rgb), 0.5); }

.upload-text {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: var(--rf-type-size-13px, 13px);
  font-weight: 500;
  color: rgba(var(--rf-tone-neutral-rgb), 0.3);
}
.upload-area:hover .upload-text,
.upload-area.drag-over .upload-text { color: rgba(var(--rf-tone-neutral-rgb), 0.5); }

.upload-hint {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: var(--rf-type-size-10px, 10px);
  color: rgba(var(--rf-tone-neutral-rgb), 0.12);
  margin-top: 4px;
}

body.portal-dashboard-page.portal-page .portal-upload-queue {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

body.portal-dashboard-page.portal-page .portal-upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-2) var(--space-3);
  align-items: center;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--client-border-subtle);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--client-brand-text) 2.5%, transparent);
}

body.portal-dashboard-page.portal-page .portal-upload-name {
  min-width: 0;
  overflow: hidden;
  color: var(--text-primary);
  font-size: var(--rf-type-size-13px, 13px);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.portal-dashboard-page.portal-page .portal-upload-progress {
  grid-column: 1 / -1;
  height: 4px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--client-border-subtle);
}

body.portal-dashboard-page.portal-page .portal-upload-progress > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

body.portal-dashboard-page.portal-page .portal-upload-status,
body.portal-dashboard-page.portal-page .portal-upload-summary {
  color: var(--text-muted);
  font-size: var(--rf-type-size-12px, 12px);
  line-height: var(--rf-type-leading-1-4, 1.4);
}

body.portal-dashboard-page.portal-page .portal-upload-row.is-complete .portal-upload-status {
  color: var(--accent-green);
}

body.portal-dashboard-page.portal-page .portal-upload-row.is-error .portal-upload-status,
body.portal-dashboard-page.portal-page .portal-upload-row.is-blocked .portal-upload-status {
  color: var(--client-danger-text);
}

body.portal-dashboard-page.portal-page .portal-upload-summary {
  min-height: 17px;
  margin: var(--space-2) 0 0;
}

/* Producer contact card */
.producer-card {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  padding: 20px 24px;
  border-radius: var(--radius-md);
  background: rgba(var(--rf-tone-neutral-rgb), 0.02);
  border: 1px solid rgba(var(--rf-tone-neutral-rgb), 0.06);
  margin-bottom: 72px;
}

.producer-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(var(--rf-tone-neutral-rgb), 0.1);
  flex-shrink: 0;
}

.producer-info { flex: 1; }

.producer-role {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: var(--rf-type-size-10px, 10px);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(var(--rf-tone-neutral-rgb), 0.25);
  margin-bottom: var(--space-1);
}

.producer-name {
  font-family: var(--font-display, 'Plus Jakarta Sans', sans-serif);
  font-weight: 600;
  font-size: var(--rf-type-size-16px, 16px);
  color: rgba(var(--rf-tone-neutral-rgb), 0.8);
}

.producer-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.producer-btn {
  display: flex;
  align-items: center;
}

/* ── V6 responsive ── */
@media (max-width: 639px) {
  .client-masthead { padding: 40px 0 32px; }
  .client-logo { max-width: 300px; max-height: 100px; }
  .film-grid { grid-template-columns: 1fr; gap: 16px; margin-bottom: 48px; }
  .resource-list { grid-template-columns: 1fr; }
  .producer-card { flex-direction: column; text-align: center; gap: 12px; }
  .producer-actions { justify-content: center; }
}
