/* =========================================================
   Two and a Half Gallon Films — Studio Archive
   Cinematic dark UI (mockup redesign)
   ========================================================= */

:root {
  --bg-0: #0b0b0d;
  --bg-1: #121214;
  --bg-2: #1a1a1e;
  --bg-3: #222228;
  --bg-card: #141418;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.12);
  --text: #f2f1ee;
  --text-2: #a8a6a0;
  --text-3: #6e6c68;
  --gold: #c9a84c;
  --gold-soft: rgba(201, 168, 76, 0.12);
  --gold-border: rgba(201, 168, 76, 0.4);
  --accent: #6b9fd4;
  --accent-soft: rgba(107, 159, 212, 0.15);
  --success: #6bbf8a;
  --warn: #d4a85a;
  --purple: #8b7ec8;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  --font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --nav-h: 64px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --max: 1180px;
  --page-pad: clamp(16px, 3.5vw, 28px);
  --section-gap: clamp(28px, 4vw, 48px);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --touch: 44px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: clamp(14px, 0.35vw + 13.5px, 15.5px);
  line-height: 1.55;
  color: var(--text);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

body.nav-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.app-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 420px at 70% 0%, rgba(201, 168, 76, 0.05), transparent 55%),
    var(--bg-0);
}

/* ---- Top bar ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: calc(var(--nav-h) + var(--safe-top));
  padding-top: var(--safe-top);
  border-bottom: 1px solid var(--border);
  background: rgba(11, 11, 13, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.topbar-inner {
  max-width: var(--max);
  height: var(--nav-h);
  margin: 0 auto;
  padding: 0 var(--page-pad);
  padding-left: max(var(--page-pad), var(--safe-left));
  padding-right: max(var(--page-pad), var(--safe-right));
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 28px);
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #000;
  border: 1.5px solid var(--gold);
  flex-shrink: 0;
  padding: 0;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 400;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
}

.nav-link {
  position: relative;
  padding: 8px 12px;
  border-radius: 0;
  border: 0;
  background: transparent;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-3);
  cursor: pointer;
  transition: color 0.15s;
}

.nav-link:hover {
  color: var(--text-2);
  background: transparent;
}

.nav-link.active {
  color: var(--text);
  background: transparent;
}

.nav-link.active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 2.5px;
  border-radius: 2px 2px 0 0;
  background: var(--gold);
}

.nav-drop-btn.active::after {
  right: 22px;
}

.nav-dropdown {
  position: relative;
}

.nav-caret {
  font-size: 10px;
  margin-left: 2px;
  opacity: 0.7;
}

.nav-drop-menu {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 180px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: #151518;
  box-shadow: var(--shadow);
  z-index: 130;
}

.nav-dropdown:hover .nav-drop-menu,
.nav-dropdown:focus-within .nav-drop-menu {
  display: grid;
  gap: 2px;
}

.nav-drop-menu a {
  padding: 9px 11px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
}

.nav-drop-menu a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.nav-drop-sep {
  height: 1px;
  margin: 5px 6px;
  background: var(--border);
}

.edit-status-badge {
  font-size: 11px;
  font-weight: 500;
  color: var(--gold);
  white-space: nowrap;
  margin-left: auto;
  margin-right: 4px;
}

.search-wrap {
  position: relative;
  margin-left: auto;
  width: min(240px, 100%);
  min-width: 0;
  flex: 0 1 240px;
}

.account-slot {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.account-btn {
  height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.account-btn:hover {
  border-color: color-mix(in srgb, var(--gold) 45%, var(--border));
  color: var(--gold);
}

.account-btn--ghost {
  background: transparent;
  font-weight: 500;
  color: var(--text-3);
}

.account-signed {
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-who {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--text-2);
}

.account-role {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid color-mix(in srgb, var(--gold) 35%, var(--border));
  background: color-mix(in srgb, var(--gold) 10%, transparent);
  border-radius: 999px;
  padding: 2px 7px;
  white-space: nowrap;
}

.auth-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 4px;
}

.auth-note {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-3);
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-error {
  margin: 0;
  font-size: 13px;
  color: #e8a0a0;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

button.mobile-nav-link {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.account-invite-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
  white-space: nowrap;
}

body.archive-locked .nav-links,
body.archive-locked .search-wrap,
body.archive-locked .nav-dropdown {
  display: none;
}

body.archive-locked .mobile-nav-links > a:not(#mobile-account-invites):not(#mobile-account-users),
body.archive-locked .mobile-nav-section:not(#mobile-account-label) {
  display: none;
}

.lock-page {
  min-height: calc(100vh - 160px);
  display: grid;
  place-items: center;
  padding: 24px 0 48px;
}

.lock-card {
  width: min(440px, 100%);
}

.lock-copy {
  margin: 8px 0 18px;
  color: var(--text-2);
  line-height: 1.5;
}

.lock-hint {
  margin: 16px 0 0;
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.45;
}

.invite-fresh {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.invite-fresh p {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--text-2);
}

.invite-fresh input {
  width: 100%;
  margin-bottom: 8px;
}

.invite-table-wrap {
  overflow-x: auto;
}

.invite-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.invite-table th,
.invite-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.invite-table th {
  color: var(--text-3);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.invite-status {
  text-transform: capitalize;
  font-weight: 600;
}

.invite-status--pending { color: var(--gold); }
.invite-status--used { color: #8fca9a; }
.invite-status--expired,
.invite-status--revoked { color: var(--text-3); }
.invite-status--admin { color: var(--gold); }
.invite-status--member { color: #8fca9a; }
.invite-status--guest { color: var(--text-2); }

/* Mobile menu toggle — hidden on desktop */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: var(--touch);
  height: var(--touch);
  margin: 0 -8px 0 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
  background: rgba(255, 255, 255, 0.05);
  outline: none;
}

.nav-toggle-bar {
  display: block;
  width: 18px;
  height: 1.75px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.2s var(--ease), opacity 0.15s;
}

body.nav-open .nav-toggle-bar:nth-child(1) {
  transform: translateY(6.75px) rotate(45deg);
}

body.nav-open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

body.nav-open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-6.75px) rotate(-45deg);
}

/* Mobile drawer */
.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 140;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease);
}

.nav-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 150;
  width: min(320px, 88vw);
  max-width: 100%;
  padding: calc(var(--safe-top) + 12px) 0 calc(var(--safe-bottom) + 20px);
  background: #121214;
  border-left: 1px solid var(--border-strong);
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.45);
  transform: translateX(105%);
  transition: transform 0.28s var(--ease);
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
}

.mobile-nav.is-open {
  transform: translateX(0);
}

.mobile-nav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 18px 14px;
  border-bottom: 1px solid var(--border);
}

.mobile-nav-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
}

.mobile-nav-close {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-2);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.mobile-nav-close:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  gap: 2px;
}

.mobile-nav-section {
  margin: 14px 10px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-2);
  transition: background 0.15s, color 0.15s;
}

.mobile-nav-link:hover,
.mobile-nav-link:focus-visible {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  outline: none;
}

.mobile-nav-link.active {
  color: var(--text);
  background: var(--gold-soft);
  box-shadow: inset 3px 0 0 var(--gold);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 38px;
  padding: 0 48px 0 36px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  outline: none;
  font-size: 13px;
  transition: border-color 0.15s;
}

.search-input::placeholder {
  color: var(--text-3);
}

.search-input:focus {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
}

.search-kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: var(--text-3);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 5px;
  font-family: inherit;
  pointer-events: none;
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: auto;
  right: 0;
  width: max(100%, min(360px, calc(100vw - 2 * var(--page-pad))));
  max-width: min(400px, calc(100vw - 2 * var(--page-pad)));
  max-height: min(420px, 60vh);
  overflow: auto;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: rgba(18, 18, 22, 0.98);
  box-shadow: var(--shadow);
  z-index: 140;
  padding: 6px;
}

.search-group-label {
  padding: 10px 12px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

.search-hit {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 9px 11px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  color: inherit;
}

.search-hit:hover,
.search-hit.active {
  background: rgba(255, 255, 255, 0.05);
}

.search-hit-poster {
  position: relative;
  width: 40px;
  height: 28px;
  border-radius: 6px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  overflow: hidden;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.search-hit-poster .poster-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.search-hit-poster .film-poster-initials {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-3);
}

.search-hit-poster.has-cover .film-poster-initials {
  display: none;
}

.search-hit-title {
  font-size: 13px;
  font-weight: 600;
}

.search-hit-meta {
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 2px;
}

.search-hit-match {
  font-size: 10.5px;
  color: var(--gold);
  max-width: 90px;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-empty {
  padding: 18px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}

.search-footer {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border: 0;
  border-top: 1px solid var(--border);
  background: transparent;
  color: var(--gold);
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}

/* ---- Main ---- */
.app-main {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(20px, 3.5vw, 36px) var(--page-pad) clamp(48px, 8vw, 80px);
  padding-left: max(var(--page-pad), var(--safe-left));
  padding-right: max(var(--page-pad), var(--safe-right));
  min-height: calc(100dvh - var(--nav-h) - var(--safe-top) - 100px);
  outline: none;
  min-width: 0;
}

.loading-state {
  display: grid;
  place-items: center;
  gap: 14px;
  min-height: 40vh;
  color: var(--text-2);
}

.spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  border-top-color: var(--gold);
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.fade-in {
  animation: fadeIn 0.35s var(--ease) both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---- Typography helpers ---- */
.page-header {
  margin-bottom: 28px;
}

.page-title {
  font-size: clamp(1.5rem, 2.8vw, 1.9rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin: 0 0 8px;
}

.page-desc {
  margin: 0;
  max-width: 48ch;
  color: var(--text-2);
  font-size: 14.5px;
  line-height: 1.6;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
}

.section-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: "";
  width: 3px;
  height: 16px;
  border-radius: 2px;
  background: var(--gold);
}

.section-link {
  font-size: 13px;
  color: var(--text-3);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.section-link:hover {
  color: var(--text);
}

.section-meta {
  font-size: 12px;
  color: var(--text-3);
}

.text-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 6px;
  font-size: 12.5px;
  color: var(--text-3);
}

.meta-sep {
  opacity: 0.45;
}

.muted {
  color: var(--text-3);
  font-size: 13px;
  margin: 0;
}

.view-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-3);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  height: auto;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: transparent;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
  white-space: nowrap;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.18);
}

.btn-primary {
  background: #f0efe9;
  color: #151512;
  border-color: transparent;
  font-weight: 600;
}

.btn-primary:hover {
  background: #fff;
  filter: none;
  transform: translateY(-1px);
}

.btn-ghost {
  border-color: transparent;
  color: var(--text-2);
  padding-left: 10px;
  padding-right: 10px;
}

.btn-ghost:hover {
  color: var(--text);
  background: transparent;
  border-color: transparent;
}

.btn-arrow::after {
  content: "→";
  font-size: 14px;
  opacity: 0.85;
}

/* ---- HOME: Hero ---- */
.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(20px, 4vw, 40px);
  align-items: center;
  margin-bottom: var(--section-gap);
}

.home-hero-copy {
  max-width: 34rem;
}

.welcome-kicker {
  margin: 0 0 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.welcome-title {
  margin: 0 0 16px;
  font-size: clamp(2rem, 4.2vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.12;
  color: #f5f3ec;
}

.welcome-lead {
  margin: 0 0 28px;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--text-2);
  max-width: 36ch;
}

.welcome-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.home-hero-media {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-2);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  padding: 0;
  width: 100%;
}

.home-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 42%, rgba(0, 0, 0, 0.72));
  pointer-events: none;
}

.home-hero-feature-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px 16px 16px;
  text-align: left;
  pointer-events: none;
}

.home-hero-feature-kicker {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.home-hero-feature-title {
  font-size: clamp(15px, 1.6vw, 18px);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- Stats strip ---- */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  margin: 8px 0 var(--section-gap);
  padding: clamp(14px, 2vw, 20px) 4px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.022), transparent);
}

.stat-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 6px clamp(12px, 1.8vw, 22px);
  position: relative;
  min-width: 0;
}

.stat-cell:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 0;
  top: 12%;
  bottom: 12%;
  width: 1px;
  background: var(--border);
}

.stat-icon {
  width: 20px;
  height: 20px;
  color: var(--gold);
  opacity: 0.9;
}

.stat-cell .stat-value {
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text);
  overflow-wrap: anywhere;
}

.stat-cell .stat-label {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 400;
}

/* ---- Film media: scenes + before/after ---- */
.media-section {
  margin-top: 16px;
}

.media-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.media-section-head h2 {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
}

.media-empty {
  margin: 0 0 12px;
  color: var(--text-3);
  font-size: 13.5px;
}

.scene-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
  align-items: start;
}

.scene-card {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.scene-thumb {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-2);
}

.scene-thumb img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  vertical-align: top;
}

.scene-card.is-portrait {
  max-width: 280px;
}

.scene-caption {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.4;
}

.scene-remove {
  border: 0;
  background: transparent;
  color: var(--text-3);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  text-align: left;
  padding: 0;
}

.scene-remove:hover {
  color: #e08080;
}

.media-upload-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.media-upload-btn {
  position: relative;
  cursor: pointer;
}

.media-upload-btn.small {
  min-height: 36px;
  height: auto;
  padding: 8px 14px;
  font-size: 12.5px;
}

.media-caption-input {
  flex: 1 1 180px;
  min-width: 140px;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  outline: none;
}

.compare-edit-list {
  display: grid;
  gap: 14px;
  margin-bottom: 12px;
}

.compare-edit-card {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.015);
}

.compare-edit-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.compare-edit-top strong {
  font-size: 13.5px;
}

.compare-edit-top .compare-remove {
  margin-left: auto;
  padding: 6px 10px;
  min-height: 0;
  height: auto;
}

.compare-upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.compare-side {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.compare-side-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}

.compare-preview {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-2);
}

.compare-preview.empty {
  display: grid;
  place-items: center;
  color: var(--text-3);
  font-size: 12.5px;
}

.compare-edit-preview {
  margin-top: 12px;
}

.ba-list {
  display: grid;
  gap: 18px;
}

.ba-slider {
  width: 100%;
}

.ba-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0a0a0c;
  touch-action: none;
  user-select: none;
  cursor: ew-resize;
}

.ba-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.ba-before-clip {
  position: absolute;
  inset: 0 auto 0 0;
  width: 50%;
  overflow: hidden;
  z-index: 2;
}

.ba-before-clip .ba-before {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  max-width: none;
  /* width set in JS to match full frame */
}

.ba-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
  z-index: 3;
  transform: translateX(-50%);
  pointer-events: none;
}

.ba-divider::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 36px;
  height: 36px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  background: rgba(11, 11, 13, 0.55);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.ba-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  z-index: 4;
}

.ba-tag {
  position: absolute;
  bottom: 12px;
  z-index: 5;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.55);
  color: #f2f1ee;
  pointer-events: none;
}

.ba-tag-before {
  left: 12px;
}

.ba-tag-after {
  right: 12px;
}

.ba-caption {
  margin: 10px 2px 0;
  font-size: 13px;
  color: var(--text-2);
}

@media (max-width: 640px) {
  .compare-upload-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- On this day / This month ---- */
.memory-lane {
  margin: var(--section-gap) 0;
  display: flex;
  flex-direction: column;
  gap: clamp(28px, 4vw, 40px);
}

.memory-section {
  margin: 0;
}

.memory-section .section-head {
  align-items: flex-end;
  margin-bottom: 8px;
}

.memory-section-desc {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-3);
}

.memory-empty {
  margin: 0;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px dashed var(--border);
  font-size: 13.5px;
  color: var(--text-3);
}

.memory-kicker {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}

.memory-section .section-title::before {
  display: none;
}

.memory-section .section-title {
  font-size: clamp(1.05rem, 2vw, 1.2rem);
}

.memory-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.memory-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  width: 100%;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  text-align: left;
  color: inherit;
  transition: border-color 0.15s, background 0.15s, transform 0.2s var(--ease);
}

.memory-card:hover {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.035);
  transform: translateY(-1px);
}

.memory-thumb {
  position: relative;
  width: 72px;
  height: 48px;
  border-radius: 9px;
  overflow: hidden;
  background: var(--bg-2);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.memory-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.memory-thumb-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
}

.memory-body {
  min-width: 0;
}

.memory-headline {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 3px;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.memory-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.memory-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 6px;
  font-size: 12px;
  color: var(--text-3);
}

.memory-years {
  display: grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  padding: 0 8px;
  border-radius: 10px;
  background: var(--gold-soft);
  border: 1px solid var(--gold-border);
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

/* ---- Home dual columns ---- */
.home-split {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.9fr);
  gap: clamp(24px, 3.5vw, 36px);
  align-items: start;
}

.recent-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(10px, 1.5vw, 14px);
}

.recent-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: inherit;
  transition: opacity 0.15s, transform 0.2s var(--ease);
}

.recent-card:hover {
  opacity: 0.92;
  transform: translateY(-2px);
}

.recent-thumb {
  position: relative;
  aspect-ratio: 16 / 11;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-2);
}

.recent-thumb img,
.recent-thumb .poster-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recent-thumb-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.15);
  font-size: 1.1rem;
}

.recent-title {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* In the works */
.works-list {
  display: grid;
  gap: 10px;
}

.works-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  text-align: left;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
}

.works-item:hover {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.035);
}

.works-thumb {
  position: relative;
  width: 56px;
  height: 40px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-2);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.works-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.works-thumb-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
}

.works-title {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}

.works-meta {
  font-size: 12px;
  color: var(--text-3);
}

.works-badge {
  font-size: 10.5px;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.works-badge.pre {
  background: rgba(201, 168, 76, 0.14);
  color: #d4bc6a;
}

.works-badge.vfx {
  background: rgba(107, 159, 212, 0.16);
  color: #8eb8e8;
}

.works-badge.dev {
  background: rgba(139, 126, 200, 0.16);
  color: #b0a5e0;
}

.works-badge.progress {
  background: rgba(107, 191, 138, 0.14);
  color: #7dcea0;
}

/* ---- Film cards (global) ---- */
.film-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr));
  gap: clamp(14px, 2vw, 18px) clamp(10px, 1.5vw, 14px);
}

.film-grid-home {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr));
}

.film-card {
  display: flex;
  flex-direction: column;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  text-align: left;
  color: inherit;
  transition: opacity 0.15s, transform 0.2s var(--ease);
  width: 100%;
}

.film-card:hover {
  opacity: 0.92;
  transform: translateY(-2px);
}

.film-poster {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-2);
}

.film-poster .poster-img,
.featured-poster .poster-img,
.detail-poster .poster-img,
.tl-card-media .poster-img,
.collection-cover .poster-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  display: block;
}

.film-poster.has-cover .film-poster-initials,
.featured-poster.has-cover .film-poster-initials,
.detail-poster.has-cover .film-poster-initials,
.search-hit-poster.has-cover .film-poster-initials {
  display: none;
}

.film-poster-initials {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: 600;
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.14);
  z-index: 0;
}

.film-poster-year {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.55);
  color: rgba(255, 255, 255, 0.9);
}

.film-card-body {
  padding: 10px 2px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.film-card-title {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-2);
  border: 0;
}

.badge-success { color: var(--success); }
.badge-warn { color: var(--warn); }
.badge-gold { color: var(--gold); }
.badge-accent { color: var(--accent); }
.badge-purple { color: var(--purple); }
.badge-muted { color: var(--text-2); }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 22px var(--page-pad) calc(22px + var(--safe-bottom));
  padding-left: max(var(--page-pad), var(--safe-left));
  padding-right: max(var(--page-pad), var(--safe-right));
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 24px;
  font-size: 12.5px;
  color: var(--text-3);
}

.footer-quote {
  margin: 0;
  font-style: italic;
  color: var(--text-3);
  flex: 1 1 220px;
}

.footer-quote-attr {
  font-style: normal;
  opacity: 0.8;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-3);
  transition: color 0.15s;
  padding: 0 16px;
  position: relative;
}

.footer-links a + a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 15%;
  bottom: 15%;
  width: 1px;
  background: var(--border);
}

.footer-links a svg {
  opacity: 0.65;
  flex-shrink: 0;
}

.footer-links a:hover {
  color: var(--text-2);
}

.footer-copy {
  margin-left: auto;
  white-space: nowrap;
  padding-left: 16px;
  border-left: 1px solid var(--border);
}

.footer-link {
  border: 0;
  background: transparent;
  color: var(--text-3);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  padding: 0;
}

/* ---- Panels / tools / stats pages ---- */
.panel {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  padding: 20px;
}

.panel-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  margin: 0 0 14px;
}

.stats-page .panel-title,
.chart-panel .panel-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.stats-page .stats-grid {
  margin-bottom: 22px;
}

.stats-page .stat-label {
  font-size: 13.5px;
  color: var(--text-2);
}

.stats-page .stat-value {
  font-size: 1.7rem;
}

.stat-value--sm {
  font-size: 1.2rem !important;
}

.chart-hint {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-2);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
  gap: 12px;
}

.stat-card {
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.stat-label {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 6px;
}

.stat-value {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
}

.filter-group label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}

.filter-group select,
.filter-group input {
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  outline: none;
  transition: border-color 0.15s;
}

.filter-group select:focus,
.filter-group input:focus {
  border-color: var(--border-strong);
}

.toolbar-spacer {
  flex: 1;
}

.results-count {
  font-size: 13px;
  color: var(--text-3);
}

.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 18px;
}

.detail-back:hover {
  color: var(--text);
}

.detail-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.detail-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, min(420px, 42%)) minmax(0, 1fr);
  gap: clamp(16px, 3vw, 28px);
  margin-bottom: 28px;
  align-items: start;
}

.detail-poster {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-2);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.detail-title {
  font-size: clamp(1.4rem, 2.5vw, 1.8rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
}

.detail-summary {
  font-size: 15px;
  color: var(--text-2);
  max-width: 55ch;
  margin: 0 0 18px;
  line-height: 1.65;
}

.detail-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.quick-label {
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: 3px;
}

.quick-value {
  font-size: 14px;
  font-weight: 600;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 16px;
}

.detail-section {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  padding: 20px;
}

.detail-section h2 {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
}

.cast-list {
  display: grid;
  gap: 0;
}

.cast-list-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 0 8px;
  margin-bottom: 2px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}

.cast-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}

.cast-row a {
  color: var(--accent);
}

.cast-actor {
  font-weight: 600;
}

.cast-role {
  color: var(--text-2);
}

.cast-role a + .meta-sep {
  margin: 0 2px;
}

/* VFX toggle in edit form */
.edit-toggle-field .toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
}

.edit-toggle-field .toggle-label input {
  width: 16px;
  height: 16px;
  accent-color: var(--gold);
  cursor: pointer;
}

.meta-list {
  display: grid;
  gap: 12px;
}

.meta-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 10px;
  font-size: 13.5px;
}

.meta-key {
  color: var(--text-3);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr));
  gap: 14px;
}

/* Edit form */
.edit-form {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}

.edit-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
}

.edit-field input,
.edit-field select,
.edit-field textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-1);
  color: var(--text);
  font-weight: 400;
  outline: none;
  resize: vertical;
}

.edit-span-2 {
  grid-column: 1 / -1;
}

.edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.edit-hint {
  margin: 14px 0 0;
  font-size: 12.5px;
  color: var(--text-3);
  line-height: 1.5;
}

.edit-pill {
  font-size: 11px;
  font-weight: 500;
  color: var(--gold);
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--gold-border);
  background: var(--gold-soft);
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 300;
  max-width: min(92vw, 420px);
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: #161618;
  color: var(--text);
  font-size: 13px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

.toast.is-on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---- Studio faces / People (behind the films) ---- */
.studio-page .studio-header {
  max-width: 42rem;
}

.studio-intro {
  max-width: 40rem;
}

.studio-trio {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 8px 0 28px;
}

.studio-card {
  --studio-accent: var(--gold);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 20px 18px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  overflow: hidden;
  transition:
    border-color 0.25s var(--ease),
    box-shadow 0.25s var(--ease),
    transform 0.25s var(--ease);
  min-height: 100%;
}

.studio-card:hover {
  border-color: color-mix(in srgb, var(--studio-accent) 55%, var(--border));
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.35),
    0 0 0 1px color-mix(in srgb, var(--studio-accent) 22%, transparent);
  transform: translateY(-2px);
}

.studio-card.is-lead {
  border-color: color-mix(in srgb, var(--studio-accent) 40%, var(--border));
}

.studio-card-glow {
  position: absolute;
  inset: auto -20% 40% -20%;
  height: 60%;
  background: radial-gradient(
    ellipse at 50% 0%,
    color-mix(in srgb, var(--studio-accent) 16%, transparent),
    transparent 70%
  );
  pointer-events: none;
}

.studio-card-top {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.studio-avatar {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--studio-accent) 12%, var(--bg-2));
  border: 1px solid color-mix(in srgb, var(--studio-accent) 45%, var(--border));
  color: var(--studio-accent);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  overflow: hidden;
}

.studio-avatar.has-photo,
.entity-avatar.has-photo,
.search-entity-avatar.has-photo {
  padding: 0;
  background: var(--bg-2);
}

.studio-avatar img,
.entity-avatar img,
.search-entity-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.studio-avatar--xl {
  width: 88px;
  height: 88px;
  border-radius: 20px;
  font-size: 22px;
}

.studio-card-kind {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--studio-accent);
  border: 1px solid color-mix(in srgb, var(--studio-accent) 35%, var(--border));
  background: color-mix(in srgb, var(--studio-accent) 10%, transparent);
  border-radius: 999px;
  padding: 3px 9px;
}

.studio-card-name {
  position: relative;
  margin: 4px 0 0;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.studio-card-role {
  position: relative;
  margin: 0;
  font-size: 12.5px;
  color: var(--text-3);
}

.studio-card-tagline {
  position: relative;
  margin: 6px 0 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-2);
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.studio-card-meta {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-3);
}

.studio-card-cta {
  color: var(--studio-accent);
  font-weight: 600;
  white-space: nowrap;
}

.studio-about-strip {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: end;
  padding: 20px 22px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
  margin-bottom: 16px;
}

.studio-about-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.studio-edit-hint {
  margin: 0;
  font-size: 12px;
  color: var(--text-3);
}

/* Profile page */
.studio-profile-hero {
  --studio-accent: var(--gold);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 22px;
  align-items: center;
  margin: 8px 0 28px;
  padding: 22px;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--studio-accent) 35%, var(--border));
  background:
    radial-gradient(
      ellipse 80% 90% at 0% 0%,
      color-mix(in srgb, var(--studio-accent) 12%, transparent),
      transparent 55%
    ),
    var(--bg-card);
}

.studio-profile-role {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--text-3);
}

.studio-profile-tagline {
  margin: 10px 0 0;
  max-width: 40rem;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-2);
  font-style: italic;
}

.studio-profile-count {
  margin: 10px 0 0;
}

.studio-profile-section {
  margin: 0 0 28px;
}

.studio-profile-bio {
  margin: 0;
  max-width: 48rem;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-2);
}

.studio-points-hint {
  margin: 0 0 14px;
  font-size: 13px;
}

.studio-points-hint code {
  font-size: 12px;
  color: var(--gold);
}

.studio-points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.studio-point {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.studio-point.is-empty {
  border-style: dashed;
  background: rgba(255, 255, 255, 0.015);
}

.studio-point-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}

.studio-point-text {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-2);
}

.studio-point-placeholder {
  color: var(--text-3);
  font-style: italic;
}

.studio-highlights {
  margin: 0;
  padding-left: 18px;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.75;
  max-width: 40rem;
}

.studio-profile-links {
  margin: 0 0 28px;
}

/* Legacy crew class hooks (search / home leftovers) */
.crew-home-grid,
.crew-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 14px;
}

.crew-avatar {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--bg-2);
  border: 1px solid var(--gold-border);
  color: var(--gold);
  font-weight: 600;
  flex-shrink: 0;
}

/* Film Gallery */
.gallery-header {
  margin-bottom: 12px;
}

.gallery-header .page-desc {
  display: none;
}

.gallery-filter-note {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-3);
}

.gallery-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 22px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.gallery-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.gallery-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.gallery-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.gallery-tab.is-active {
  color: var(--text);
  background: var(--gold-soft);
  border-color: var(--gold-border);
}

.gallery-tab-count {
  min-width: 1.35em;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  background: rgba(255, 255, 255, 0.06);
}

.gallery-tab.is-active .gallery-tab-count {
  color: var(--gold);
  background: rgba(201, 168, 76, 0.15);
}

.gallery-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 4px;
}

.gallery-sort select {
  height: 36px;
  padding: 0 28px 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-1);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.gallery-slideshow-btn {
  min-height: 36px;
  padding: 0 12px;
  font-size: 12.5px;
}

.gallery-section-head {
  margin-bottom: 12px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
  gap: 14px;
}

.gallery-card {
  position: relative;
  margin: 0;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.gallery-card.is-focus,
.gallery-compare-card.is-focus {
  border-color: var(--gold-border);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 35%, transparent);
}

.gallery-thumb {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  aspect-ratio: 16 / 10;
  background: var(--bg-2);
  overflow: hidden;
  cursor: zoom-in;
  color: inherit;
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.35s var(--ease);
}

.gallery-thumb.is-portrait {
  aspect-ratio: 9 / 16;
}

.gallery-card:hover .gallery-thumb img {
  transform: scale(1.03);
}

.gallery-cap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px 12px;
}

.gallery-film {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.gallery-film:hover {
  color: var(--gold);
}

.gallery-caption {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.4;
}

.gallery-compare-list {
  display: grid;
  gap: 18px;
  max-width: 720px;
}

.gallery-compare-card {
  position: relative;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.gallery-compare-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding-right: 72px;
}

.gallery-open-hit {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(16, 16, 20, 0.85);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.gallery-open-hit:hover {
  border-color: var(--gold-border);
  color: var(--gold);
}

.scene-gallery-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--gold);
}

.media-gallery-foot {
  margin: 8px 0 0;
}

.ba-gallery-wrap {
  margin-bottom: 12px;
}

/* Lightbox — fixed shell size; media scales inside (no jump) */
body.gallery-lb-open {
  overflow: hidden;
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 280;
  display: grid;
  place-items: center;
  padding: 16px;
}

.gallery-lightbox[hidden] {
  display: none !important;
}

.gallery-lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
}

.gallery-lb-shell {
  position: relative;
  z-index: 1;
  /* Stable footprint so different images never resize the window */
  width: min(1040px, 94vw);
  height: min(78dvh, 760px);
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid var(--border-strong);
  background: #121214;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  transition: width 0.35s var(--ease), height 0.35s var(--ease), border-radius 0.2s;
}

/* Slideshow: larger, still centered, still fixed size */
.gallery-lb-shell.is-slideshow:not(.is-fullscreen) {
  width: min(1200px, 96vw);
  height: min(88dvh, 900px);
}

.gallery-lb-shell.is-fullscreen {
  width: 100%;
  height: 100%;
  max-width: none;
  border-radius: 0;
  border: 0;
}

.gallery-lb-top {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  display: flex;
  gap: 6px;
}

.gallery-lb-iconbtn {
  width: 40px;
  height: 40px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.gallery-lb-close {
  font-size: 24px;
}

.gallery-lb-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  transform: translateY(-70%);
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(16, 16, 20, 0.75);
  color: var(--text);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.gallery-lb-prev {
  left: 12px;
}

.gallery-lb-next {
  right: 12px;
}

.gallery-lb-nav:hover,
.gallery-lb-iconbtn:hover {
  border-color: var(--gold-border);
  color: var(--gold);
}

.gallery-lb-stage {
  flex: 1 1 auto;
  min-height: 0;
  height: 0; /* force flex child to respect parent height */
  display: grid;
  place-items: center;
  padding: 52px 56px 12px;
  background: #0b0b0d;
  overflow: hidden;
}

.gallery-lb-inner {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  opacity: 1;
  transition: opacity 0.35s ease;
}

.gallery-lb-inner.is-fade-out {
  opacity: 0;
}

.gallery-lb-inner.is-fade-in {
  opacity: 0;
}

.gallery-lb-img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
}

.gallery-lb-compare {
  width: min(100%, 880px);
  max-height: 100%;
}

.gallery-lb-compare .ba-slider,
.gallery-lb-compare .ba-frame {
  max-height: min(100%, 62dvh);
}

.gallery-lb-compare .ba-img {
  object-fit: contain;
}

.gallery-lb-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  min-height: 56px;
}

.gallery-lb-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 600;
}

.gallery-lb-meta a:hover {
  color: var(--gold);
}

.gallery-lb-cap {
  font-weight: 500;
  color: var(--text-3);
}

.gallery-lb-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.gallery-lb-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  min-width: 3.5em;
  text-align: right;
}

@media (max-width: 720px) {
  .gallery-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .gallery-tools {
    justify-content: space-between;
  }

  .gallery-lb-shell {
    width: 100%;
    height: min(86dvh, 720px);
  }

  .gallery-lb-shell.is-slideshow:not(.is-fullscreen) {
    width: 100%;
    height: min(90dvh, 820px);
  }

  .gallery-lb-stage {
    padding: 48px 12px 10px;
  }

  .gallery-lb-nav {
    width: 38px;
    height: 38px;
    font-size: 24px;
  }

  .gallery-lb-prev {
    left: 6px;
  }

  .gallery-lb-next {
    right: 6px;
  }

  .gallery-lb-footer {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Profile photo (actors / characters) */
.profile-layout {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 20px;
  align-items: start;
}

.profile-layout--studio {
  margin-top: 4px;
}

.profile-photo-panel {
  margin: 0;
  padding: 16px;
}

.profile-photo-wrap {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-2);
  aspect-ratio: 1;
}

.profile-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-photo--fallback {
  display: grid;
  place-items: center;
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.04em;
  background: linear-gradient(160deg, rgba(201, 168, 76, 0.12), transparent 60%);
}

.profile-photo-actions {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-photo-btn {
  position: relative;
  text-align: center;
  cursor: pointer;
}

/* Keep file pickers in the button so focusing them does not jump the page */
label.btn input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
  font-size: 0;
}

.profile-main .character-bio {
  margin-bottom: 0;
}

@media (max-width: 720px) {
  .profile-layout {
    grid-template-columns: 1fr;
  }

  .profile-photo-wrap {
    max-width: 220px;
    margin: 0 auto;
  }
}

/* Character bio */
.character-bio {
  margin: 0 0 20px;
}

.character-bio-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.character-bio-head .panel-title {
  margin: 0;
}

.character-bio-source {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}

.character-bio-text {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text-2);
  max-width: 48rem;
}

.character-bio-text p {
  margin: 0 0 12px;
}

.character-bio-text p:last-child {
  margin-bottom: 0;
}

.character-bio-sections {
  display: grid;
  gap: 16px;
  max-width: 48rem;
}

.character-bio-section {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.character-bio-section:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.character-bio-label {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.character-bio-copy {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text-2);
}

.character-bio-actions {
  margin-top: 14px;
}

.character-bio--editing .edit-hint {
  margin-top: 8px;
}

/* Entity / misc pages */
.entity-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.entity-filter-input {
  flex: 1;
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  outline: none;
}

/* Asset library sections */
.asset-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.asset-jump a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.asset-jump a:hover {
  border-color: var(--gold-border);
  color: var(--text);
  background: var(--gold-soft);
}

.asset-jump a span {
  min-width: 1.4em;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 11px;
  color: var(--text-3);
  text-align: center;
}

.asset-live-note {
  margin: 0 0 22px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-2);
}

.asset-section {
  margin: 0 0 32px;
  scroll-margin-top: calc(var(--nav-h) + 16px);
}

.entity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 12px;
}

.entity-card {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.entity-avatar {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--bg-2);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 12px;
  color: var(--text-3);
  overflow: hidden;
}

.entity-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.entity-card--core {
  border-color: color-mix(in srgb, var(--gold) 28%, var(--border));
}

.entity-core-badge {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid color-mix(in srgb, var(--gold) 35%, var(--border));
  background: color-mix(in srgb, var(--gold) 10%, transparent);
  border-radius: 999px;
  padding: 2px 7px;
  white-space: nowrap;
}

.entity-name {
  font-weight: 600;
  font-size: 14px;
}

.entity-meta {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}

.entity-count {
  font-weight: 700;
  color: var(--text-2);
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 16px;
}

.chart-panel--wide {
  grid-column: 1 / -1;
}

.chart-svg {
  width: 100%;
  height: auto;
  display: block;
}

.chart-label {
  fill: var(--text);
  font-size: 14px;
  font-family: var(--font);
  font-weight: 500;
}

.chart-value {
  fill: var(--text);
  font-size: 14px;
  font-family: var(--font);
  font-weight: 700;
}

.chart-axis {
  fill: var(--text-2);
  font-size: 13px;
  font-family: var(--font);
  font-weight: 500;
}

.chart-grid {
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 1;
}

.chart-bar {
  fill: #9a9aa2;
}

.chart-bar-row:hover .chart-bar {
  fill: var(--gold);
}

.chart-line {
  stroke: #c9a84c;
  stroke-width: 2.5;
}

.chart-area {
  fill: rgba(201, 168, 76, 0.12);
}

.chart-dot {
  fill: #c9a84c;
  stroke: #0b0b0d;
  stroke-width: 1.5;
}

.chart-dot.is-active {
  r: 8;
  fill: #f0d78a;
}

.year-chart,
.month-chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.year-chart-svg {
  cursor: crosshair;
}

.year-guide-line {
  stroke: rgba(201, 168, 76, 0.55);
  stroke-width: 1.25;
  stroke-dasharray: 3 4;
  pointer-events: none;
}

.chart-readout {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-height: 1.6em;
}

.chart-readout-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}

.chart-readout-main {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

.month-col-bar {
  fill: #8d8d96;
}

.month-col.is-active .month-col-bar,
.month-col:hover .month-col-bar {
  fill: var(--gold);
}

.month-col {
  cursor: pointer;
}

.donut-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: center;
}

.donut-center {
  fill: var(--text);
  font-size: 28px;
  font-weight: 700;
  font-family: var(--font);
}

.donut-sub {
  fill: var(--text-2);
  font-size: 13px;
  font-family: var(--font);
}

.donut-legend {
  display: grid;
  gap: 8px;
}

.donut-legend-row {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: 10px;
  align-items: center;
  font-size: 14.5px;
  color: var(--text);
}

.donut-legend-row strong {
  font-size: 15px;
}

.donut-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.series-grid {
  display: grid;
  gap: 14px;
}

.series-card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  padding: 20px;
}

.series-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.series-name {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.series-count {
  font-size: 13px;
  color: var(--text-3);
}

.series-films {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.series-film-chip {
  display: inline-flex;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  font-size: 12.5px;
  cursor: pointer;
  color: inherit;
}

.collection-covers {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px;
  margin: -20px -20px 14px;
  border-bottom: 1px solid var(--border);
}

.collection-cover {
  aspect-ratio: 16 / 9;
  background: var(--bg-2);
  position: relative;
  overflow: hidden;
}

.prod-list {
  display: grid;
  gap: 0;
}

.prod-row {
  display: grid;
  grid-template-columns: 1fr minmax(120px, 160px);
  gap: 16px;
  align-items: center;
  width: 100%;
  padding: 16px 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: inherit;
}

.prod-title {
  font-weight: 600;
  margin-bottom: 6px;
}

.prod-notes {
  margin: 8px 0 0;
  font-size: 12.5px;
  color: var(--text-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.prod-pct {
  font-weight: 700;
  text-align: right;
  margin-bottom: 8px;
}

.progress-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--gold);
}

.universe-wrap {
  display: grid;
  place-items: center;
  padding: 12px;
}

.universe-svg {
  width: min(100%, 520px);
  height: auto;
}

.universe-node {
  fill: #8a8a90;
  stroke: var(--bg-0);
  stroke-width: 2;
  cursor: pointer;
}

.universe-label {
  fill: var(--text-2);
  font-size: 11px;
  font-family: var(--font);
}

.conn-list {
  display: grid;
  gap: 8px;
}

.conn-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 13.5px;
  min-width: 0;
}

.conn-row > * {
  min-width: 0;
  overflow-wrap: anywhere;
}

.conn-weight {
  color: var(--text-3);
  font-size: 12px;
  text-align: center;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 16px;
}

.recipe-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.recipe-chip {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-2);
}

.shortcut-table {
  display: grid;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-2);
}

.shortcut-table kbd,
.overlay-card kbd {
  display: inline-block;
  min-width: 1.4em;
  padding: 2px 6px;
  margin: 0 2px;
  border-radius: 5px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.05);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}

.health-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.8;
}

.museum-hall {
  margin-bottom: 36px;
}

.search-query-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 0 0 20px;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--border);
}

/* Full search results — people & production (matches dropdown) */
.search-entity-section {
  margin: 0 0 28px;
}

.search-entity-group {
  margin-bottom: 16px;
}

.search-entity-group-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0 0 8px;
}

.search-entity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 10px;
}

.search-entity-card {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.15s, background 0.15s;
}

.search-entity-card:hover {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
}

.search-entity-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--bg-2);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  flex-shrink: 0;
  overflow: hidden;
}

.search-entity-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.search-entity-meta {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}

.search-entity-kind {
  font-size: 11px;
  font-weight: 600;
  color: var(--gold);
  white-space: nowrap;
}

.search-films-head {
  margin-bottom: 12px;
}

/* =========================================================
   Horizontal journey timeline
   ========================================================= */
.tl-page {
  margin: calc(-1 * clamp(20px, 3.5vw, 36px)) calc(-1 * var(--page-pad)) 0;
  min-height: calc(100dvh - var(--nav-h) - var(--safe-top));
}

.tl-experience {
  position: relative;
  min-height: calc(100dvh - var(--nav-h) - var(--safe-top));
}

/* ---- Intro gate ---- */
.tl-intro {
  min-height: calc(100dvh - var(--nav-h) - var(--safe-top));
  display: grid;
  place-items: center;
  padding: clamp(32px, 6vw, 64px) var(--page-pad);
  background:
    radial-gradient(700px 320px at 50% 20%, rgba(201, 168, 76, 0.08), transparent 60%),
    var(--bg-0);
  animation: tlIntroIn 0.7s var(--ease) both;
}

@keyframes tlIntroIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.tl-intro-inner {
  max-width: 40rem;
  text-align: center;
}

.tl-intro-kicker {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.tl-intro-title {
  margin: 0 0 16px;
  font-size: clamp(1.9rem, 4.5vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.tl-intro-lead {
  margin: 0 auto 28px;
  max-width: 36ch;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--text-2);
}

.tl-intro-path {
  list-style: none;
  margin: 0 auto 28px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.tl-intro-path li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  min-width: 5.5rem;
}

.tl-intro-path-years {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
}

.tl-intro-note {
  margin: 0 0 22px;
  font-size: 12.5px;
  color: var(--text-3);
}

.tl-intro .btn {
  min-width: 180px;
}

/* ---- Journey shell ---- */
.tl-journey {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - var(--nav-h) - var(--safe-top));
  animation: tlIntroIn 0.45s var(--ease) both;
}

.tl-journey-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px var(--page-pad);
  border-bottom: 1px solid var(--border);
  background: rgba(11, 11, 13, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 30;
}

.tl-back-intro {
  flex-shrink: 0;
  min-height: 36px;
  height: auto;
  padding: 6px 12px;
}

.tl-h-progress {
  flex: 1;
  height: 3px;
  border-radius: 99px;
  background: var(--border);
  overflow: hidden;
  min-width: 40px;
}

.tl-h-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(201, 168, 76, 0.35), var(--gold));
  border-radius: 99px;
  transition: width 0.08s linear;
}

.tl-h-nav {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  max-width: min(42vw, 420px);
  overflow-x: auto;
  scrollbar-width: none;
}

.tl-h-nav::-webkit-scrollbar {
  display: none;
}

.tl-h-dot {
  border: 0;
  background: transparent;
  color: var(--text-3);
  font: inherit;
  font-size: 10.5px;
  font-weight: 600;
  padding: 6px 7px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}

.tl-h-dot:hover {
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.04);
}

.tl-h-dot.is-active {
  color: var(--gold);
  background: var(--gold-soft);
}

/* ---- Horizontal scroller ---- */
.tl-h-scroll {
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  outline: none;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 168, 76, 0.35) transparent;
}

.tl-h-track {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(28px, 4vw, 56px);
  min-height: calc(100dvh - var(--nav-h) - var(--safe-top) - 110px);
  padding: 48px clamp(40px, 6vw, 80px) 56px;
  width: max-content;
}

.tl-h-line {
  position: absolute;
  left: 40px;
  right: 40px;
  top: 50%;
  height: 2px;
  transform: translateY(-50%);
  background: linear-gradient(
    90deg,
    transparent,
    var(--border-strong) 4%,
    var(--border-strong) 96%,
    transparent
  );
  pointer-events: none;
}

/* ---- Era nodes (zigzag up / down) ---- */
.tl-h-era {
  position: relative;
  width: min(340px, 78vw);
  flex: 0 0 auto;
  scroll-snap-align: center;
  opacity: 0.45;
  transform: translateY(10px) scale(0.97);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}

.tl-h-era.is-inview,
.tl-h-era.is-active {
  opacity: 1;
  transform: none;
}

/* Default active chrome — journey page overrides with era-colored rings later */
.tl-h-era.is-active .tl-h-card {
  border-color: var(--era-ring, var(--gold-border));
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.tl-h-era--up {
  align-self: flex-start;
  margin-top: 8%;
}

.tl-h-era--down {
  align-self: flex-end;
  margin-bottom: 8%;
}

.tl-h-era--mid {
  align-self: center;
}

.tl-h-spine {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
  pointer-events: none;
}

.tl-h-era--up .tl-h-spine {
  bottom: -28px;
  flex-direction: column-reverse;
}

.tl-h-era--down .tl-h-spine {
  top: -28px;
}

.tl-h-era--mid .tl-h-spine {
  top: 50%;
  transform: translate(-50%, -50%);
}

.tl-h-node {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--text-3);
  background: var(--bg-0);
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
}

.tl-h-era.is-active .tl-h-node {
  border-color: var(--era-accent, var(--gold));
  background: var(--era-accent, var(--gold));
  box-shadow: 0 0 0 4px var(--era-glow, var(--gold-soft));
}

.tl-h-era.is-passed:not(.is-active) .tl-h-node {
  border-color: var(--gold);
  background: var(--gold);
  box-shadow: 0 0 0 4px var(--gold-soft);
}

.tl-h-stem {
  width: 2px;
  height: 22px;
  background: var(--border-strong);
}

.tl-h-era--mid .tl-h-stem {
  display: none;
}

.tl-h-card {
  position: relative;
  padding: 16px 16px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(18, 18, 22, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color 0.25s, box-shadow 0.25s;
}

.tl-h-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.tl-h-years {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  transition: color 0.65s var(--ease);
}

.tl-h-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-3);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
}

.tl-h-title {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.tl-h-feeling {
  margin: 0 0 10px;
  font-size: 13.5px;
  font-style: italic;
  line-height: 1.45;
  color: var(--text-2);
}

.tl-h-meta {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--text-3);
}

.tl-h-hero {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px;
  align-items: center;
  width: 100%;
  margin: 0 0 10px;
  padding: 0;
  border: 1px solid var(--gold-border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--gold-soft);
  color: inherit;
  cursor: pointer;
  text-align: left;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
}

.tl-h-hero img {
  width: 64px;
  height: 40px;
  object-fit: cover;
}

.tl-h-hero span {
  padding-right: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tl-h-keys {
  display: flex;
  gap: 6px;
  margin: 0 0 12px;
}

.tl-h-key {
  width: 48px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-2);
  cursor: pointer;
  color: var(--text-3);
  font-size: 10px;
  font-weight: 700;
}

.tl-h-key img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tl-h-era.is-bridge .tl-h-card {
  border-color: var(--gold-border);
  background: var(--bg-1);
}

/* Folds */
.tl-folds {
  display: grid;
  gap: 6px;
}

.tl-fold {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.tl-fold-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
}

.tl-fold-summary::-webkit-details-marker,
.tl-fold-summary::marker {
  display: none;
  content: "";
}

.tl-fold-summary:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.tl-fold[open] > .tl-fold-summary {
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.tl-fold-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tl-fold-count {
  min-width: 1.4em;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 10.5px;
  color: var(--text-3);
}

.tl-fold-chevron {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.55;
  margin-top: -3px;
  transition: transform 0.2s var(--ease);
}

.tl-fold[open] .tl-fold-chevron {
  transform: rotate(225deg);
  margin-top: 2px;
}

.tl-fold-body {
  padding: 12px;
  max-height: min(42vh, 320px);
  overflow: auto;
}

.tl-era-text {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-2);
}

.tl-craft-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}

.tl-craft-chip {
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-3);
}

.tl-identity {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  font-size: 12px;
}

.tl-identity-label {
  color: var(--gold);
  font-weight: 700;
}

.tl-identity-detail {
  color: var(--text-3);
}

.tl-milestones-grid {
  display: grid;
  gap: 8px;
}

.tl-milestone {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.tl-milestone.is-hero {
  border-color: var(--gold-border);
  background: var(--gold-soft);
}

.tl-milestone-kind {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 3px;
}

.tl-milestone-label {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 3px;
}

.tl-milestone-blurb {
  margin: 0;
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.4;
}

.tl-milestone-films {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.tl-milestone-chip {
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-2);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.tl-milestone-chip:hover {
  border-color: var(--gold-border);
  color: var(--text);
}

.tl-era-films {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.tl-era-films-key {
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
}

.tl-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: inherit;
}

.tl-card:hover {
  opacity: 0.92;
}

.tl-card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  overflow: hidden;
}

.tl-card.is-highlight .tl-card-media,
.tl-card.is-hero .tl-card-media {
  border-color: rgba(201, 168, 76, 0.4);
}

.tl-card-media .poster-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tl-card-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.14);
}

.tl-card-ribbon {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(201, 168, 76, 0.92);
  color: #151512;
}

.tl-card-title {
  font-size: 12px;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tl-h-end {
  --era-accent: var(--gold);
  --era-glow: var(--gold-soft);
  --era-ring: var(--gold-border);
  width: min(280px, 70vw);
  flex: 0 0 auto;
  align-self: center;
  scroll-snap-align: center;
  padding: 20px;
  border-radius: 16px;
  border: 1px dashed var(--border-strong);
  text-align: center;
  background: var(--bg-1);
  transition:
    border-color 0.55s var(--ease),
    box-shadow 0.55s var(--ease),
    opacity 0.45s var(--ease);
  opacity: 0.45;
}

.tl-h-end.is-active {
  opacity: 1;
  border-style: solid;
  border-color: var(--gold) !important;
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--gold) 45%, transparent),
    0 0 0 7px color-mix(in srgb, var(--gold) 16%, transparent),
    0 14px 36px rgba(0, 0, 0, 0.42),
    0 0 30px var(--gold-soft);
}

.tl-h-end.is-inview {
  opacity: 0.75;
}

.tl-end-kicker {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
}

.tl-h-end-path {
  margin: 0 0 16px;
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.5;
}

.tl-end-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.tl-h-hint {
  margin: 0;
  padding: 8px var(--page-pad) 12px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}

@media (max-width: 720px) {
  .tl-h-track {
    min-height: calc(100dvh - var(--nav-h) - 130px);
    padding: 36px 28px 48px;
    gap: 36px;
  }

  .tl-h-era {
    width: min(300px, 82vw);
  }

  .tl-h-era--up {
    margin-top: 4%;
  }

  .tl-h-era--down {
    margin-bottom: 4%;
  }

  .tl-intro-path li {
    min-width: 4.8rem;
    font-size: 11.5px;
  }

  .tl-journey-bar {
    gap: 8px;
  }

  .tl-h-nav {
    max-width: 36vw;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tl-intro,
  .tl-journey,
  .tl-h-era {
    animation: none;
    transition: none;
  }
}

.overlay-panel {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
}

.overlay-card {
  width: min(440px, 100%);
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: #151518;
  box-shadow: var(--shadow);
}

.overlay-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.overlay-head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.eyebrow {
  display: none;
}

/* =========================================================
   Responsive breakpoints
   ========================================================= */

/* Large tablets / small laptops */
@media (max-width: 1100px) {
  .nav-links {
    gap: 0;
  }

  .nav-link {
    padding: 8px 9px;
    font-size: 13px;
  }

  .home-split {
    grid-template-columns: 1fr;
  }

  .recent-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Tablets */
@media (max-width: 960px) {
  .home-hero,
  .detail-grid,
  .detail-hero,
  .charts-grid,
  .tools-grid,
  .studio-trio,
  .studio-profile-hero,
  .studio-points,
  .studio-about-strip {
    grid-template-columns: 1fr;
  }

  .studio-about-actions {
    justify-content: flex-start;
  }

  .memory-list {
    grid-template-columns: 1fr;
  }

  .stats-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stat-cell:nth-child(3)::after {
    display: none;
  }

  .stat-cell:nth-child(n + 4) {
    margin-top: 8px;
  }

  .recent-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .collection-covers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .conn-row {
    grid-template-columns: 1fr;
    text-align: left;
    gap: 4px;
  }

  .conn-weight {
    text-align: left;
  }
}

/* Compact tablets / large phones — hamburger nav */
@media (max-width: 840px) {
  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .edit-status-badge {
    display: none;
  }

  .brand-text {
    max-width: 42vw;
  }

  .brand-name {
    font-size: 12.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .search-wrap {
    flex: 1 1 auto;
    width: auto;
    max-width: none;
    min-width: 100px;
  }

  .account-who {
    display: none;
  }

  .search-kbd {
    display: none;
  }

  .search-input {
    padding-right: 12px;
  }

  .search-results {
    position: fixed;
    left: var(--page-pad);
    right: var(--page-pad);
    top: calc(var(--nav-h) + var(--safe-top) + 6px);
    width: auto;
    max-width: none;
    max-height: min(70vh, 480px);
  }

  .welcome-actions {
    gap: 10px;
  }

  .welcome-actions .btn {
    flex: 1 1 auto;
    min-width: min(100%, 140px);
  }

  .welcome-actions .btn-ghost {
    flex: 1 1 100%;
    justify-content: flex-start;
    padding-left: 4px;
  }

  .prod-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .prod-pct {
    text-align: left;
  }

  .meta-row {
    grid-template-columns: minmax(80px, 30%) 1fr;
  }

  .cast-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .detail-topbar {
    flex-wrap: wrap;
  }
}

/* Phones */
@media (max-width: 640px) {
  :root {
    --nav-h: 58px;
    --page-pad: 16px;
  }

  .memory-list {
    grid-template-columns: 1fr;
  }

  .brand-text {
    display: none;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .stats-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 8px 4px;
  }

  .stat-cell {
    padding: 10px 14px;
  }

  .stat-cell::after {
    display: none;
  }

  .stat-cell:nth-child(n + 4) {
    margin-top: 0;
  }

  .stat-cell .stat-value {
    font-size: 1.15rem;
  }

  .recent-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .works-item {
    grid-template-columns: 48px 1fr;
    gap: 10px;
  }

  .works-badge {
    grid-column: 2;
    justify-self: start;
  }

  .edit-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .footer-quote {
    flex: none;
    width: 100%;
  }

  .footer-links {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .footer-links a {
    padding: 10px 0;
    min-height: 40px;
  }

  .footer-links a + a::before {
    display: none;
  }

  .footer-copy {
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
    padding-top: 4px;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group {
    width: 100%;
    min-width: 0;
  }

  .filter-group select,
  .filter-group input {
    width: 100%;
  }

  .toolbar-spacer {
    display: none;
  }

  .results-count {
    order: -1;
  }

  .entity-card {
    grid-template-columns: 40px 1fr;
  }

  .entity-count {
    grid-column: 2;
    justify-self: start;
  }

  .studio-profile-hero {
    gap: 16px;
  }

  .studio-avatar--xl {
    width: 72px;
    height: 72px;
    font-size: 18px;
  }

  .series-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .collection-covers {
    margin-left: -16px;
    margin-right: -16px;
  }

  .home-hero-media {
    border-radius: 14px;
  }

  .panel,
  .detail-section,
  .series-card {
    padding: 16px;
  }

  .toast {
    left: var(--page-pad);
    right: var(--page-pad);
    max-width: none;
    transform: translateY(20px);
  }

  .toast.is-on {
    transform: translateY(0);
  }

  .overlay-card {
    max-width: calc(100vw - 2 * var(--page-pad));
    margin: var(--page-pad);
  }
}

/* Narrow phones */
@media (max-width: 400px) {
  .recent-row {
    grid-template-columns: 1fr;
  }

  .stats-strip {
    grid-template-columns: 1fr 1fr;
  }

  .welcome-title {
    font-size: 1.65rem;
  }

  .welcome-actions .btn {
    width: 100%;
    min-width: 0;
  }

  .film-grid {
    grid-template-columns: 1fr;
  }

  .search-hit {
    grid-template-columns: auto 1fr;
  }

  .search-hit-match {
    display: none;
  }
}

/* Short landscape phones / small landscape tablets */
@media (max-height: 480px) and (orientation: landscape) {
  .topbar {
    height: 52px;
    padding-top: 0;
  }

  .topbar-inner {
    height: 52px;
  }

  :root {
    --nav-h: 52px;
  }

  .home-hero {
    gap: 16px;
  }

  .home-hero-media {
    max-height: 48vh;
  }

  .mobile-nav {
    padding-top: 8px;
  }
}

/* Wide desktop — roomier content shell */
@media (min-width: 1400px) {
  :root {
    --max: 1240px;
  }
}

/* Ultra-wide: keep content readable, don't stretch forever */
@media (min-width: 1800px) {
  :root {
    --max: 1320px;
  }
}

/* Touch devices: slightly larger hit targets */
@media (hover: none) and (pointer: coarse) {
  .nav-link {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
  }

  .recent-card,
  .film-card,
  .works-item {
    -webkit-tap-highlight-color: transparent;
  }

  .btn {
    min-height: 44px;
  }

  .search-input {
    height: 42px;
    font-size: 16px; /* prevents iOS zoom on focus */
  }
}

/* High-DPI fine pointer still gets hover polish */
@media (hover: hover) and (pointer: fine) {
  .film-card:hover .film-poster,
  .recent-card:hover .recent-thumb {
    border-color: var(--border-strong);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tl-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .fade-in {
    animation: none;
  }

  .mobile-nav,
  .nav-backdrop,
  .nav-toggle-bar {
    transition: none;
  }
}

/* Print: clean archive printouts */
@media print {
  .topbar,
  .site-footer,
  .search-wrap,
  .nav-toggle,
  .mobile-nav,
  .nav-backdrop,
  .edit-status-badge,
  .account-slot,
  .welcome-actions,
  .toast {
    display: none !important;
  }

  body {
    background: #fff;
    color: #111;
    font-size: 12pt;
  }

  .app-main {
    max-width: none;
    padding: 0;
    min-height: 0;
  }

  a {
    color: inherit;
  }

  .home-hero-media,
  .film-poster,
  .recent-thumb {
    break-inside: avoid;
  }
}
/* Journey page: full-bleed vertical scroll drives horizontal track */
body.tl-journey-active .app-main {
  max-width: none;
  padding: 0;
  min-height: 0;
}
body.tl-journey-active .site-footer {
  display: none;
}
body.tl-journey-active .topbar {
  border-bottom-color: transparent;
}

.tl-page-journey {
  margin: 0;
  min-height: 0;
}

.tl-experience-journey {
  position: relative;
  min-height: 0;
}

.tl-scroll-space {
  position: relative;
  height: 600vh; /* JS overwrites based on track width */
}

.tl-stage {
  position: sticky;
  top: var(--nav-h);
  z-index: 1;
  height: calc(100dvh - var(--nav-h) - var(--safe-top));
  overflow: hidden;
  display: flex;
  align-items: center;
}

/* Horizontal scroll only — Y lift lives on the inner shift layer */
.tl-h-track {
  display: block;
  width: max-content;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

/*
 * Fixed height = stage height so opening folds never reflows/re-centers the track
 * (that reflow was the snap on upward eras). Room is made via translateY instead.
 */
.tl-h-track-shift {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(36px, 5vw, 72px);
  padding: 40px clamp(48px, 8vw, 120px);
  width: max-content;
  height: calc(100dvh - var(--nav-h) - var(--safe-top));
  box-sizing: border-box;
  transform: translate3d(0, 0, 0);
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.tl-h-line {
  position: absolute;
  left: 48px;
  right: 48px;
  top: 50%;
  height: 2px;
  transform: translateY(-50%);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(201, 168, 76, 0.22) 8%,
    rgba(201, 168, 76, 0.32) 50%,
    rgba(201, 168, 76, 0.22) 92%,
    transparent
  );
  z-index: 0;
  pointer-events: none;
}

/* Defaults first — theme classes below must win (same element has both classes) */
.tl-h-era {
  --era-accent: var(--gold);
  --era-glow: var(--gold-soft);
  --era-ring: var(--gold-border);
  position: relative;
  z-index: 2;
  width: min(320px, 78vw);
  flex: 0 0 auto;
  opacity: calc(0.38 + var(--tl-focus, 0) * 0.62);
  transform: translateY(0) scale(calc(0.96 + var(--tl-focus, 0) * 0.04));
  transition:
    opacity 0.45s var(--ease),
    transform 0.45s var(--ease);
}

/* ---- Era mood accents (after defaults so they are not reset to gold) ---- */
.tl-h-era.tl-era-origins {
  --era-accent: #7eb89a;
  --era-glow: rgba(126, 184, 154, 0.32);
  --era-ring: #7eb89a;
}
.tl-h-era.tl-era-experiment {
  --era-accent: #d4a06a;
  --era-glow: rgba(212, 160, 106, 0.3);
  --era-ring: #d4a06a;
}
.tl-h-era.tl-era-discovery {
  --era-accent: #9b7ed4;
  --era-glow: rgba(155, 126, 212, 0.32);
  --era-ring: #9b7ed4;
}
.tl-h-era.tl-era-explosion {
  --era-accent: #d45a5a;
  --era-glow: rgba(212, 90, 90, 0.3);
  --era-ring: #d45a5a;
}
.tl-h-era.tl-era-identity {
  --era-accent: #d4b45c;
  --era-glow: rgba(212, 180, 92, 0.32);
  --era-ring: #d4b45c;
}
.tl-h-era.tl-era-refinement {
  --era-accent: #9a93c9;
  --era-glow: rgba(154, 147, 201, 0.3);
  --era-ring: #9a93c9;
}
.tl-h-era.tl-era-ambition {
  --era-accent: #e0954a;
  --era-glow: rgba(224, 149, 74, 0.3);
  --era-ring: #e0954a;
}
.tl-h-era.tl-era-frontier {
  --era-accent: #6bbf7a;
  --era-glow: rgba(107, 191, 122, 0.3);
  --era-ring: #6bbf7a;
}
.tl-h-era.tl-era-horizon {
  --era-accent: #e8bc4a;
  --era-glow: rgba(232, 188, 74, 0.34);
  --era-ring: #e8bc4a;
}

.tl-h-era.is-active {
  z-index: 5;
  opacity: 1;
}

.tl-h-era.is-expanded {
  z-index: 8;
  opacity: 1;
}

.tl-h-card {
  position: relative;
  z-index: 2;
  max-height: min(68vh, 520px);
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--bg-1);
  border: 1px solid var(--border);
  box-shadow: none;
  transition:
    border-color 0.55s var(--ease),
    box-shadow 0.55s var(--ease),
    background 0.55s var(--ease);
}

/* Colored selection ring when you land on / expand an era */
.tl-h-era.is-active .tl-h-card {
  border-color: var(--era-ring) !important;
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--era-accent) 45%, transparent),
    0 0 0 7px color-mix(in srgb, var(--era-accent) 16%, transparent),
    0 14px 36px rgba(0, 0, 0, 0.42),
    0 0 30px var(--era-glow) !important;
}

.tl-h-era.is-active .tl-h-years {
  color: var(--era-accent) !important;
  transition: color 0.55s var(--ease);
}

.tl-h-era.is-active .tl-h-tag {
  border-color: color-mix(in srgb, var(--era-accent) 50%, var(--border));
  color: var(--era-accent);
}

.tl-h-era.is-active .tl-h-node {
  border-color: var(--era-accent) !important;
  background: var(--era-accent) !important;
  box-shadow: 0 0 0 4px var(--era-glow) !important;
}

.tl-h-era.is-active .tl-h-stem {
  background: var(--era-accent);
}

.tl-h-era.is-expanded .tl-h-card {
  border-color: var(--era-ring) !important;
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--era-accent) 50%, transparent),
    0 0 0 8px color-mix(in srgb, var(--era-accent) 18%, transparent),
    0 18px 42px rgba(0, 0, 0, 0.48),
    0 0 34px var(--era-glow) !important;
}

/* In-flow folds; track Y-shift makes room below (smooth) */
.tl-fold {
  position: relative;
  overflow: hidden;
  transition: border-color 0.35s var(--ease);
}

.tl-h-era.is-active .tl-fold {
  border-color: color-mix(in srgb, var(--era-accent) 28%, var(--border));
}

.tl-fold-body {
  position: static;
  max-height: min(30vh, 220px);
  overflow: auto;
  padding: 12px;
  background: rgba(0, 0, 0, 0.28);
}

/* Identity / name transition — solid so the line & node never show through type */
.tl-h-era.is-bridge {
  z-index: 6;
}

.tl-h-era.is-bridge .tl-h-card {
  z-index: 6;
  background: var(--bg-1);
  border-color: var(--gold-border);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}

.tl-h-era.is-bridge.is-active .tl-h-card {
  background: #16140f;
  border-color: var(--era-ring);
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--era-accent) 40%, transparent),
    0 0 0 6px color-mix(in srgb, var(--era-accent) 14%, transparent),
    0 16px 40px rgba(0, 0, 0, 0.55),
    0 0 30px var(--era-glow);
}

.tl-h-era.is-bridge .tl-h-spine {
  z-index: 1;
}

.tl-h-era.is-bridge .tl-h-node {
  z-index: 1;
}

/* Key film callout on the era face */
.tl-h-key-wrap {
  margin: 0 0 12px;
}

.tl-h-key-badge {
  display: inline-block;
  margin: 0 0 6px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--gold-border);
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tl-h-era.is-active .tl-h-key-badge {
  border-color: color-mix(in srgb, var(--era-accent) 50%, var(--gold-border));
  background: color-mix(in srgb, var(--era-accent) 14%, transparent);
  color: var(--era-accent);
  transition:
    color 0.55s var(--ease),
    border-color 0.55s var(--ease),
    background 0.55s var(--ease);
}

.tl-h-hero {
  margin: 0;
}

.tl-h-hero-title {
  padding-right: 10px;
}

.tl-h-hero-plain {
  grid-template-columns: 40px 1fr;
}

.tl-h-hero-fallback {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: var(--bg-2);
  color: var(--text-3);
  font-weight: 700;
  font-size: 11px;
}

/*
 * Backdrop is portaled to document.body so page scroll / fade-in transforms
 * never drag the grid or dust. Grid is fully static; dust only self-drifts.
 */
.tl-fx,
#tl-fx-host.tl-fx {
  position: fixed;
  top: var(--nav-h);
  right: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  background: transparent;
  transform: none !important;
  will-change: auto;
}

/* Hide in-page copy if still present; body host is the real layer */
.tl-experience .tl-fx {
  display: none !important;
}

body:not(.tl-journey-active) #tl-fx-host {
  display: none;
}

.tl-fx-grid {
  display: block;
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(201, 168, 76, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 168, 76, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: center center;
  opacity: 0.7;
  mask-image: radial-gradient(ellipse 75% 65% at 50% 45%, #000 15%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 45%, #000 15%, transparent 78%);
  /* Static — no scroll-linked or idle translate */
  transform: none;
  animation: none;
}

.tl-fx-glow {
  display: none !important;
}

.tl-fx-stars {
  position: absolute;
  inset: 0;
  transform: none;
}

/* Soft dust — independent idle drift only (not tied to page scroll) */
.tl-star {
  position: absolute;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 5px rgba(201, 168, 76, 0.28);
  opacity: 0.2;
  animation: tlStarDrift 16s ease-in-out infinite alternate;
}

.tl-star--dim {
  background: rgba(242, 241, 238, 0.5);
  box-shadow: none;
  opacity: 0.1;
}

.tl-star--dust {
  background: rgba(201, 168, 76, 0.4);
  box-shadow: none;
  opacity: 0.12;
}

.tl-star--bright {
  background: rgba(242, 241, 238, 0.65);
  box-shadow: 0 0 4px rgba(201, 168, 76, 0.22);
  opacity: 0.24;
}

@keyframes tlStarDrift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(var(--star-drift-x, 10px), var(--star-drift-y, -14px), 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tl-star {
    animation: none;
  }
  .tl-h-track-shift {
    transition: none;
  }
  .tl-h-era,
  .tl-h-card {
    transition: none;
  }
}

/* ---- Music library ---- */
.music-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.music-upload-btn {
  position: relative;
}

.music-toolbar-note {
  margin: 0;
  flex: 1 1 220px;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.45;
}

.music-list {
  display: grid;
  gap: 12px;
}

.music-card {
  padding: 16px 18px 14px;
}

.music-card-top {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.music-play {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--gold-border);
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0 0 0 2px;
}

.music-play.is-playing {
  background: var(--gold);
  color: #111;
  padding: 0;
}

.music-title {
  margin: 0 0 3px;
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.music-stinger-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--gold-border);
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: middle;
}

.music-meta {
  margin: 0;
  font-size: 14px;
  color: var(--text-2);
}

.music-card-actions {
  display: flex;
  gap: 6px;
}

.music-audio {
  display: none;
}

.music-progress-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}

.music-seek {
  width: 100%;
  accent-color: var(--gold);
  height: 6px;
  cursor: pointer;
}

.music-time {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
  white-space: nowrap;
}

.music-notes {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.45;
}

.music-used {
  margin: 10px 0 0;
  font-size: 13.5px;
  color: var(--text-2);
}

.music-used a {
  color: var(--gold);
}

.film-music-used {
  margin: 28px 0 8px;
}

.film-music-list {
  display: grid;
  gap: 8px;
}

.film-music-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.film-music-title {
  font-weight: 600;
}

.film-music-meta {
  font-size: 13.5px;
  color: var(--text-2);
}

.music-card--editing .music-edit-form {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

@media (max-width: 640px) {
  .music-card-top {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .music-card-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .chart-readout-main {
    font-size: 1.02rem;
  }
}
