/* Self-hosted pen-script face for the wordmark (no third-party font CDN,
   keeping the app's no-tracking promise). Falls back to system scripts. */
@font-face {
  font-family: "Studio Script";
  src: url("/static/assets/dancing-script-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/static/assets/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #241d12;
  --gold: #896214;
  --gold-brand: #b3821a;
  --gold-dark: #68480b;
  --gold-soft: #f4e1a6;
  --forest: var(--gold);
  --forest-dark: var(--gold-dark);
  --acid: var(--gold-soft);
  --paper: #f7f2e7;
  --card: #fffdf8;
  --muted: #6c655b;
  --dark-text: #f4f1ea;
  --dark-muted: #bdb7aa;
  --dark-action: #f4e1a6;
  --dark-error: #ffaaa4;
  --dark-success: #a6dab1;
  --line: #ded5c2;
  --bad: #922f29;
  --bad-bg: #ffe0dc;
  --blue: #d7e8ff;
  --success: #dff3df;
  --shadow: 0 14px 40px #6f51100d;
  --coral: #ff765f;
  --lavender: #c8b8ff;
  --sun: #ffd86b;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 Inter, ui-sans-serif, system-ui, sans-serif; }
button, input, textarea, select { font: inherit; }
a { color: var(--gold-dark); }
button, .button { min-height: 44px; }
:focus-visible { outline: 3px solid var(--gold-dark); outline-offset: 3px; }

.skip-link { position: fixed; left: 12px; top: -60px; z-index: 10; padding: 10px 14px; border-radius: 8px; background: var(--ink); color: white; }
.skip-link:focus { top: 12px; }
.brand { display: inline-flex; align-items: flex-end; gap: 0; font: 750 26px/1 Inter, ui-sans-serif, system-ui, sans-serif; color: var(--gold-brand); text-decoration: none; letter-spacing: .01em; padding-bottom: 5px; }
.brand:hover { color: var(--gold-dark); }
.brand-logo-icon { width: auto; height: 38px; margin-right: 7px; margin-bottom: -2px; object-fit: contain; flex-shrink: 0; filter: drop-shadow(0 2px 5px rgba(82, 50, 4, 0.25)); transition: transform .22s cubic-bezier(0.34, 1.56, 0.64, 1); }
.brand:hover .brand-logo-icon { transform: scale(1.08) rotate(-3deg); }
.brand-text { display: inline-flex; align-items: baseline; white-space: nowrap; }
.brand-tail { color: #b8861d; letter-spacing: -0.01em; }
.brand-reels { color: var(--gold-dark); margin-left: 6px; }
.brand-reels span { color: var(--gold-brand); }
.brand:hover .brand-tail { color: var(--gold-dark); }
.login-brand-head { display: flex; justify-content: flex-start; margin-bottom: 18px; }
.login-brand { font-size: clamp(24px, 7vw, 36px); padding-bottom: 2px; }
.login-brand .brand-logo-icon { height: 50px; margin-bottom: -3px; }
.login-emblem-icon { width: auto; height: 50px; object-fit: contain; filter: drop-shadow(0 4px 14px rgba(82, 50, 4, 0.28)); }

/* Section navigation: labelled sidebar on wide screens, thumb tab bar on phones. */
.mobilebar, .tabbar { display: none; }
.shell { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100vh; }
.shell-plain { display: block; }
.sidenav { position: sticky; top: 0; align-self: start; height: 100vh; height: var(--reading-screen-height, 100dvh); display: flex; flex-direction: column; padding: 22px 14px 16px; border-right: 1px solid var(--line); background: #f2ecdc; }
.sidenav .brand { margin: 0 0 20px; font-size: 21px; }
.sidenav .brand-logo-icon { height: 28px; }
.side-main { display: grid; gap: 4px; }
.side-link { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 12px; font-weight: 750; font-size: .95rem; color: var(--ink); text-decoration: none; }
.side-link svg, .side-foot button svg, .icon-button svg { width: 20px; height: 20px; flex: none; }
.side-link svg { color: var(--gold-dark); }
.side-link:hover { background: #fffdf899; }
.side-link.is-active { background: var(--card); color: var(--gold-dark); box-shadow: 0 0 0 2px #c99a2d45; }
.side-foot { margin-top: auto; display: grid; gap: 4px; padding-top: 12px; border-top: 1px dashed var(--line); }
.side-foot form { margin: 0; }
.side-foot .side-link { font-weight: 650; font-size: .88rem; color: var(--muted); }
.side-foot .side-link svg { color: var(--muted); }
.side-foot button { display: flex; width: 100%; align-items: center; gap: 11px; padding: 11px 12px; min-height: 0; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-weight: 650; font-size: .88rem; cursor: pointer; }
.side-foot button svg { color: var(--muted); }
.side-foot button:hover { background: #fffdf899; color: var(--ink); }
.topbar-plain { display: flex; justify-content: center; padding: 30px 0 0; }
.icon-button { min-height: 42px; padding: 9px; border-radius: 10px; }

@media (max-width: 880px) {
  .sidenav { display: none; }
  .shell { display: block; min-height: auto; }
  .mobilebar { display: flex; position: sticky; top: 0; z-index: 6; align-items: center; justify-content: space-between; height: 58px; padding: 0 16px; background: #f7f2e7f2; backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
  .mobilebar .brand { font-size: 26px; padding-bottom: 2px; }
  .mobilebar .brand .brand-logo-icon { height: 32px; margin-bottom: -2px; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--card); border-top: 1px solid var(--line); padding: 7px 8px calc(7px + env(safe-area-inset-bottom, 0px)); }
  .tab-link { min-width: 0; flex: 1; display: grid; justify-items: center; gap: 3px; padding: 6px 2px; border-radius: 10px; font-size: .75rem; font-weight: 750; color: var(--muted); text-decoration: none; overflow: hidden; }
  .tab-link span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: clamp(.62rem, 2vw, .75rem); }
  .tab-link svg { width: 22px; height: 22px; flex-shrink: 0; }
  .tab-link.is-active { color: var(--gold-dark); }
}
main { max-width: 1160px; margin: auto; padding: 28px 20px 80px; }
@media (max-width: 880px) {
  main { padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px)); }
}

h1 { font: 700 clamp(2.5rem, 7vw, 5rem)/.98 Georgia, serif; letter-spacing: -.04em; margin: .15em 0; }
h1 em, h2 em { color: var(--forest); font-weight: inherit; }
h2 { margin: .25em 0 .5em; font-size: clamp(1.45rem, 3vw, 2rem); line-height: 1.15; }
h3 { margin: 18px 0 8px; font-size: 1.25rem; line-height: 1.25; }
.eyebrow { margin: 0 0 8px; font-size: .73rem; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; color: var(--forest); }
.muted, .hint { color: var(--muted); }
.lede { max-width: 680px; color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.23rem); }
.back-link { display: inline-flex; margin: 4px 0 18px; font-weight: 750; text-decoration: none; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 22px; box-shadow: var(--shadow); }
.button, button { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; background: var(--forest); color: white; padding: 12px 18px; font-weight: 800; text-decoration: none; cursor: pointer; }
.button:hover, button:hover { background: var(--forest-dark); }
button:disabled { opacity: .45; cursor: not-allowed; }
.ghost { background: transparent; color: var(--ink); }
.ghost:hover { background: #16231d0a; }
.ghostdark { background: transparent; border: 1px solid var(--forest); color: var(--forest); }
.ghostdark:hover { background: #946b1612; color: var(--forest-dark); }
.button-large { margin-top: 18px; padding: 15px 22px; font-size: 1.05rem; }
.button-wide { display: flex; width: 100%; }
.button-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.text-button, .job-open { font-weight: 850; text-decoration: none; }

.home-hero { max-width: 800px; padding: 55px 0 65px; }
.studio-hero { max-width: none; min-height: 570px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr); align-items: center; gap: 70px; padding: 44px 0 76px; }
.studio-hero-copy { position: relative; z-index: 2; }
.studio-hero h1 { max-width: 730px; }
.studio-hero h1 em { color: var(--gold); font-style: italic; }
.hero-actions { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.hero-proof { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .86rem; font-weight: 700; }
.hero-proof i, .live-dot { width: 9px; height: 9px; border-radius: 50%; background: #c99a2d; box-shadow: 0 0 0 5px #c99a2d24; }
.studio-hero-art, .auth-art { min-height: 410px; border: 1px solid #ffffff75; border-radius: 28px; background: linear-gradient(90deg, #13251e08, transparent 35%), url('/static/assets/editorial-studio-hero.png?v=20260902-12') 62% center / cover no-repeat; box-shadow: 0 30px 70px #16231d25; }
.studio-hero.has-projects { min-height: 0; grid-template-columns:minmax(0,1fr) minmax(220px,.42fr); gap:32px; padding:22px 0 30px; }
.studio-hero.has-projects .studio-hero-art { min-height:190px; }
.studio-hero.has-projects h1 { font-size:clamp(2.55rem,5vw,4.7rem); }
.studio-stats { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 0 26px; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: #ffffff75; box-shadow: var(--shadow); }
.studio-stats div { display: flex; flex-direction: column; padding: 20px 22px; border-right: 1px solid var(--line); }
.studio-stats div:last-child { border: 0; }
.studio-stats strong { font: 700 2rem Georgia, serif; color: var(--gold-dark); }
.studio-stats span { color: var(--muted); font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }

/* Returning-user dashboard: attention band leads, stats stay secondary. */
.attention-band { margin: 0 0 18px; padding: 14px 18px; border: 1px solid #922f2933; border-radius: 16px; background: #ffe0dc59; }
.attention-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.attention-head .eyebrow { margin: 0; }
.attention-band ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.attention-item { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.attention-item .status { flex: none; }
.attention-name { font-weight: 800; }
.attention-reason { flex: 1 1 220px; margin: 0; font-size: .85rem; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin: 18px 0; }
.section-head h2 { margin-bottom: 0; }
.folder-library { margin: 0 0 18px; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: #fffdf899; }
.folder-library-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.folder-library-head h3 { margin: 0; }
.folder-create-form { display: flex; align-items: end; gap: 8px; margin: 0; }
.folder-create-form label { margin: 0; }
.folder-create-form input { min-width: 220px; margin: 0; }
.folder-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-bottom: 2px; overflow-x: auto; }
.folder-tab-wrap { display: inline-flex; flex: none; align-items: stretch; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: white; }
.folder-tab { display: inline-flex; flex: none; align-items: center; gap: 7px; min-height: 40px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 12px; background: white; color: var(--ink); font-size: .82rem; font-weight: 800; text-decoration: none; }
.folder-tab-wrap .folder-tab { border: 0; border-radius: 0; }
.folder-tab span { min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--paper); color: var(--muted); text-align: center; font-size: .68rem; }
.folder-tab.is-active { border-color: var(--gold-brand); background: var(--gold-soft); color: var(--gold-dark); }
.folder-brand-button { align-self:center; padding:5px 7px; border-radius:8px; color:var(--gold-dark); font-size:.66rem; font-weight:850; text-decoration:none; }
.folder-brand-button:hover { background:var(--gold-soft); }
.brand-kit-form { max-width:900px; padding:clamp(22px,4vw,38px); }
.brand-kit-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px 18px; }
.brand-kit-checks { display:flex; flex-wrap:wrap; gap:10px 22px; margin:18px 0; }
.compact-hero { padding-bottom:24px; }
.folder-delete-button { min-height: 0; width: 32px; padding: 0; border-radius: 0; background: white; color: var(--muted); font-size: 1.15rem; }
.folder-delete-button:hover { background: var(--bad-bg); color: var(--bad); }
.library-tools {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) minmax(160px, 200px) auto auto;
  align-items: end;
  gap: 14px;
  margin: 0 0 24px;
  padding: 16px 20px;
  border: 1px solid rgba(201, 154, 46, 0.22);
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(40, 30, 15, 0.04);
}
.library-tools label {
  margin: 0;
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  flex-direction: column;
}
.library-tools input, .library-tools select {
  margin-top: 6px;
  min-height: 42px;
}
.library-tools select {
  font-size: .84rem;
  font-weight: 750;
  background-position: right 12px center;
  padding: 8px 34px 8px 12px;
}
.library-tools button {
  min-height: 42px;
  padding: 8px 18px;
}
.library-tools > a {
  align-self: center;
  font-size: .82rem;
  font-weight: 800;
  white-space: nowrap;
  color: var(--gold-dark);
}
.library-tools > a:hover {
  text-decoration: underline;
}
.jobs { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 18px; }
.job { padding: 0; overflow: hidden; color: inherit; text-decoration: none; transition: transform .18s, box-shadow .18s; }
.job:hover { transform: translateY(-3px); box-shadow: 0 20px 48px #1d392518; }
.job-card-link { display: block; color: inherit; text-decoration: none; }
.dashboard-job { display: flex; flex-direction: column; }
.dashboard-job .job-card-link { flex: 1; }
.dashboard-job-actions { display: flex; align-items: center; gap: 8px; padding: 0 14px 14px; }
.project-folder-form { flex: 1; margin: 0; }
.project-folder-form label { margin: 0; }
.project-folder-form select { min-height: 40px; margin: 0; padding: 8px 34px 8px 11px; border-color: var(--line); font-size: .78rem; font-weight: 750; }
.project-rename { position:relative; flex:none; }
.project-rename summary { min-height:40px; display:flex; align-items:center; padding:8px 10px; border:1px solid var(--line); border-radius:9px; color:var(--gold-dark); cursor:pointer; font-size:.74rem; font-weight:800; list-style:none; }
.project-rename summary::-webkit-details-marker { display:none; }
.project-rename form { position:absolute; z-index:12; right:0; bottom:46px; display:flex; gap:7px; width:min(340px,80vw); padding:10px; border:1px solid var(--line); border-radius:12px; background:white; box-shadow:0 14px 35px #1c2b2430; }
.project-rename label { flex:1; margin:0; }
.project-rename input { min-width:0; margin:0; padding:9px; }
.project-rename button { flex:none; }
.dashboard-project-delete { margin: 0; }
.dashboard-delete-button { min-height: 40px; padding: 8px 11px; border: 1px solid #d8aaa5; background: transparent; color: var(--bad); font-size: .76rem; }
.dashboard-delete-button:hover { background: var(--bad-bg); color: var(--bad); }
.dashboard-delete-button svg { width: 17px; height: 17px; }
.job-cover { position: relative; display: grid; place-items: center; height: 210px; overflow: hidden; background: radial-gradient(circle at 70% 25%, #527563, transparent 22%), linear-gradient(145deg, #284d40, #13251e); }
.job-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, #0b171477); }
.job-cover.ready_for_selection { background: linear-gradient(145deg, #715b9e, #29203f); }
.job-cover.awaiting_visual_approval { background: linear-gradient(145deg, #c78e43, #563918); }
.job-cover.failed, .job-cover.cancelled { background: linear-gradient(145deg, #7b413d, #331c1a); }
.job-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.job:hover .job-cover img { transform: scale(1.035); }
/* Dashboard cards show the whole exported cover, including its safe margins. */
.jobs:has(.dashboard-job) { grid-template-columns:repeat(auto-fill,minmax(min(100%,250px),1fr)); }
.dashboard-job .job-cover { height:auto; aspect-ratio:9 / 16; background:#e9e0cd; }
.dashboard-job .job-cover::after { display:none; }
.dashboard-job .job-cover img { position:absolute; inset:0; object-fit:contain; }
.dashboard-job:hover .job-cover img { transform:none; }
.dashboard-job .cover-play { right:12px; bottom:12px; }
.cover-format, .cover-play { position: absolute; z-index: 2; }
.cover-format { top: 14px; right: 14px; padding: 5px 8px; border-radius: 8px; background: #0b17148f; color: white; font-size: .65rem; font-weight: 900; }
.cover-play { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid #ffffff90; border-radius: 50%; background: #ffffff20; color: white; backdrop-filter: blur(8px); }
.job-body { padding: 18px 20px 21px; }
.job-body h3 { overflow-wrap: anywhere; }
.job-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.job-meta > .muted { margin-left: auto; }
.job-open { display: inline-block; margin-top: 12px; color: var(--forest); }
.empty { grid-column: 1 / -1; max-width: 680px; padding: 34px; }
.empty-icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: var(--acid); color: var(--forest); }
.lab-link { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px; margin-top: 55px; padding: 24px; background: linear-gradient(110deg, #f7e7b8, var(--card) 60%); }
.lab-orb { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 18px; background: var(--forest); color: var(--acid); font-size: 1.5rem; }

.status { display: inline-flex; align-items: center; width: fit-content; padding: 6px 11px; border-radius: 999px; background: var(--acid); font-size: .69rem; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.mode-chip { display: inline-flex; align-items: center; width: fit-content; padding: 6px 11px; border-radius: 999px; font-size: .69rem; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.mode-chip.mode-yapping { background: var(--forest); color: var(--acid); }
.mode-chip.mode-standard { background: #eee9dd; color: #4d4636; }
.stock-music-row { display: flex; gap: 10px; margin: 8px 0 12px; }
.stock-music-row input[type="search"] { flex: 1; }
.stock-music-option { display: grid; gap: 4px; margin-bottom: 10px; }
.stock-music-option audio { width: 100%; height: 34px; }
.cutaway-style-details .check-choice { margin-bottom: 8px; }
.status.failed, .status.cancelled { background: var(--bad-bg); color: var(--bad); }
.status.discovered, .status.validating, .status.transcribing, .status.analysing, .status.generating_plans, .status.rendering_previews, .status.planning_visuals, .status.rendering_final, .status.qa_final { background: var(--blue); }
.status.awaiting_visual_approval { background: #fff0b7; color: #654c00; }

.hero, .jobhead { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin: 25px 0 35px; }
.jobhead h1 { max-width: 820px; overflow-wrap: anywhere; font-size: clamp(2.2rem, 6vw, 4.3rem); }
.jobhead-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex-shrink: 0; }
.jobhead-actions .ghostdark { width: auto; padding: 10px 14px; white-space: nowrap; }
.source-preview { position: fixed; top: 0; right: 0; bottom: 0; z-index: 30; display: flex; flex-direction: column; gap: 12px; width: min(100vw, 420px); padding: 18px 18px calc(18px + env(safe-area-inset-bottom, 0px)); background: var(--card); border-left: 1px solid var(--line); box-shadow: -18px 0 50px #1c160e28; }
.source-preview[hidden] { display: none; }
.source-preview-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.source-preview-head h2 { margin: 0 36px 0 0; font-size: 1.35rem; }
.source-preview-copy { margin: 0; }
.source-preview-video { width: 100%; flex: 1 1 auto; min-height: 240px; max-height: calc(100vh - 180px); background: #101510; border-radius: 14px; object-fit: contain; }
.final-video-column { display: grid; gap: 12px; }
html.source-preview-open { overflow: hidden; }
@media (min-width: 761px) {
  html.source-preview-open { overflow: auto; }
  html.source-preview-open .final-layout { padding-right: min(420px, 36vw); }
}
.narrow { max-width: 640px; margin: 3vh auto; }
.auth-shell { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(340px, .9fr); gap: 60px; align-items: center; min-height: calc(100vh - 160px); }
.login { max-width: 640px; margin: 3vh 0; }
.login.card { padding: clamp(24px, 4vw, 40px); }
.login h1 { font-size: clamp(2.6rem, 5vw, 4.5rem); }
.login h1 em { color: var(--gold); font-style: italic; }
.auth-art { min-height: 520px; background-position: 66% center; }

label { display: block; margin: 14px 0 6px; font-weight: 750; }
input, textarea { display: block; width: 100%; margin-top: 6px; border: 1px solid #aeb3ad; border-radius: 12px; padding: 13px; background: white; color: var(--ink); }
select {
  display: block;
  width: 100%;
  margin-top: 6px;
  border: 1px solid #d8cfb8;
  border-radius: 12px;
  padding: 11px 38px 11px 14px;
  background-color: #fffdfa;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238d6410' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
select:hover {
  border-color: var(--gold-brand);
  background-color: #ffffff;
}
select:focus, select:focus-visible {
  outline: none;
  border-color: var(--gold-brand);
  box-shadow: 0 0 0 3px rgba(202, 138, 4, 0.22);
}
textarea { min-height: 96px; resize: vertical; }
.upload-page { display: grid; grid-template-columns: minmax(300px, .78fr) minmax(440px, 1.22fr); gap: clamp(34px, 5vw, 70px); align-items: start; min-height: 650px; }
.upload-intro { position: sticky; top: 28px; align-self: start; }
.upload-intro h1 { font-size: clamp(2.7rem, 4.8vw, 4.2rem); }
.upload-intro h1 em { color: var(--gold); font-style: italic; }
.upload-page > .lede { margin-bottom: 26px; }
.upload-card { padding: clamp(18px, 4vw, 30px); }
.upload-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; font-size: .8rem; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.upload-card-head small { margin-left: auto; color: var(--muted); font-weight: 600; letter-spacing: 0; text-transform: none; }
.upload-folder-choice { margin-bottom: 18px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); }
.upload-folder-choice select { background: white; }
.upload-folder-choice small { display: block; margin-top: 5px; color: var(--muted); font-weight: 500; }
.upload-outcomes { list-style: none; margin: 34px 0 0; padding: 0; border-top: 1px solid var(--line); }
.upload-outcomes li { display: flex; align-items: center; gap: 18px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.upload-outcomes b { color: #a3aaa3; font: 700 1.2rem Georgia, serif; }
.upload-outcomes span { display: flex; flex-direction: column; color: var(--muted); font-size: .82rem; }
.upload-outcomes strong { color: var(--ink); font-size: .96rem; }
.upload-plan-card { display: grid; gap: 15px; margin-top: 26px; padding: 18px; border: 1px solid #d9cfb8; border-radius: 18px; background: linear-gradient(145deg, #fffdf5, #f5edd9); box-shadow: 0 16px 32px #6f51100d; }
.upload-plan-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; color: var(--forest-dark); font-size: .7rem; font-weight: 900; letter-spacing: .09em; }
.upload-plan-head > span { flex-shrink: 0; }
.upload-plan-head small { min-width: 0; overflow-wrap: anywhere; padding: 4px 7px; border-radius: 999px; background: #fff7db; color: #6b5518; font-size: .62rem; font-weight: 800; letter-spacing: 0; text-transform: none; }
.upload-plan-steps { display: grid; gap: 11px; margin: 0; padding: 0; list-style: none; }
.upload-plan-steps li { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.upload-plan-steps b { display: grid; place-items: center; width: 25px; height: 25px; border: 1px solid #c9c3b4; border-radius: 50%; font-size: .68rem; }
.upload-plan-steps li.is-current { color: var(--ink); }
.upload-plan-steps li.is-current b { border-color: var(--forest); background: var(--forest); color: white; }
.upload-plan-steps span { display: grid; gap: 1px; font-size: .78rem; }
.upload-plan-steps small { color: var(--muted); font-size: .68rem; font-weight: 600; }
.upload-plan-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; padding-top: 13px; border-top: 1px solid #ddd3bf; }
.upload-plan-summary div { min-width: 0; }
.upload-plan-summary dt { color: var(--muted); font-size: .61rem; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.upload-plan-summary dd { margin: 3px 0 0; overflow: hidden; color: var(--ink); font-size: .7rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.drop { min-height: 300px; margin: 0 0 18px; border: 2px dashed #939c94; border-radius: 17px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; text-align: center; padding: 30px; cursor: pointer; transition: background .18s, border-color .18s; }
.drop strong { font: 700 1.8rem Georgia, serif; }
.drop small { margin-top: 10px; color: var(--muted); }
.drop { position:relative; }
.drop input { position:absolute; width:1px; height:1px; padding:0; margin:0; opacity:0; pointer-events:none; }
.upload-customisation { margin:0 0 18px; border:1px solid var(--line); border-radius:15px; background:#fbf8f0; overflow:hidden; }
.upload-customisation > summary { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:15px 16px; cursor:pointer; list-style:none; }
.upload-customisation > summary::-webkit-details-marker { display:none; }
.upload-customisation > summary span:first-child { display:grid; gap:3px; }
.upload-customisation > summary small { color:var(--muted); font-weight:600; }
.upload-customisation[open] > summary { border-bottom:1px solid var(--line); }
.upload-customisation[open] > summary span:last-child { transform:rotate(45deg); }
.upload-customisation-body { padding:16px; }
.finish-all-reels { display:flex; align-items:center; justify-content:space-between; gap:24px; margin:0 0 24px; padding:20px 22px; border-color:#c59b38; background:linear-gradient(110deg,#fffaf0,#f4e6b8); }
.finish-all-reels h2,.finish-all-reels p { margin:2px 0; }
.caption-copy-source { min-height:88px; max-height:150px; margin-top:12px; font-size:.78rem; color:var(--muted); }
.drop.drag { background: #eff8d8; border-color: #648c3d; }
.upload-icon { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 8px; border-radius: 50%; background: var(--acid); font-size: 1.5rem; font-weight: 900; }
.selected-file { padding: 11px 14px; border-radius: 10px; background: #edf4eb; font-weight: 750; overflow-wrap: anywhere; }
.upload-setup { margin: 0 0 18px; }
.upload-setup > .eyebrow { margin: 0 0 8px; }
.upload-setup-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.upload-setup-grid .upload-folder-choice { margin: 0; }
.upload-setup-grid .upload-folder-choice:last-child { grid-column: 1 / -1; }
.upload-source-tabs { display: flex; gap: 8px; margin: 0 0 16px; }
.upload-source-tab { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); font-size: .88rem; font-weight: 750; cursor: pointer; transition: all .15s ease; }
.upload-source-tab:hover { background: #fbf8f0; border-color: var(--gold-soft); }
.upload-source-tab.is-active { background: var(--paper); border-color: var(--forest); color: var(--forest-dark); box-shadow: inset 0 0 0 1px var(--forest); }
.upload-source-icon { font-size: 1.1rem; }

.camera-panel { margin: 0 0 18px; border: 1px solid var(--line); border-radius: 17px; background: #14120f; box-shadow: 0 12px 30px #261c0d1a; overflow: hidden; color: #fff; }
.camera-stage { position: relative; display: grid; place-items: center; min-height: 380px; max-height: 520px; background: #000; overflow: hidden; }
.camera-stage video { display: block; width: 100%; max-height: 520px; object-fit: contain; }
#camera-live-video { transform: scaleX(-1); }
.camera-guide-overlay { position: absolute; inset: 0; pointer-events: none; display: grid; place-items: center; }
.camera-guide-box { width: min(280px, 58%); aspect-ratio: 9 / 16; border: 1.5px dashed rgba(255, 255, 255, 0.4); border-radius: 14px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.32); }
.camera-guide-label { position: absolute; top: 12px; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(4px); padding: 4px 10px; border-radius: 20px; font-size: .7rem; letter-spacing: .04em; color: rgba(255, 255, 255, 0.85); text-transform: uppercase; font-weight: 700; }
.camera-countdown-overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.75); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; z-index: 30; }
.camera-countdown-number { font-size: 4.8rem; font-weight: 900; color: #fff; line-height: 1; text-shadow: 0 4px 12px rgba(0, 0, 0, 0.6); animation: countdownPop .8s ease-out infinite; }
@keyframes countdownPop { 0% { transform: scale(0.6); opacity: 0; } 50% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
.camera-rec-badge { position: absolute; top: 12px; right: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px; background: rgba(220, 38, 38, 0.95); backdrop-filter: blur(4px); color: #fff; font-size: .72rem; font-weight: 850; letter-spacing: .05em; z-index: 20; box-shadow: 0 2px 8px rgba(0,0,0,0.4); }
.camera-rec-dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: recBlink 1s infinite alternate ease-in-out; }
@keyframes recBlink { from { opacity: 1; } to { opacity: .2; } }
.camera-mic-meter { position: absolute; bottom: 12px; left: 12px; display: flex; align-items: center; gap: 8px; padding: 4px 10px; border-radius: 20px; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px); font-size: .68rem; color: #eee; z-index: 5; }
.camera-meter-track { width: 56px; height: 5px; background: rgba(255, 255, 255, 0.25); border-radius: 3px; overflow: hidden; }
.camera-meter-fill { width: 0%; height: 100%; background: #4ade80; border-radius: 3px; transition: width .08s ease; }
.camera-controls-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; background: var(--card); border-top: 1px solid var(--line); color: var(--ink); }
.camera-controls-info { min-width: 0; font-size: .78rem; }
.camera-controls-btns { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.camera-btn-record { background: #dc2626; color: white; border: none; border-radius: 20px; padding: 9px 18px; font-weight: 800; font-size: .85rem; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.camera-btn-record:hover { background: #b91c1c; }
.camera-btn-stop { background: #111; color: white; border: 1px solid #444; border-radius: 20px; padding: 9px 18px; font-weight: 800; font-size: .85rem; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.camera-btn-stop:hover { background: #222; }

/* Camera Off / Paused Stage */
.camera-off-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #14120f;
  z-index: 8;
  padding: 24px;
}
.camera-off-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  max-width: 320px;
}
.camera-off-icon {
  font-size: 2.2rem;
  opacity: 0.8;
}
.camera-off-card strong {
  font-size: 1.1rem;
  color: #fff;
}
.camera-off-card p {
  font-size: .82rem;
  color: rgba(255, 255, 255, 0.65);
  margin: 0 0 10px;
}

.camera-power-btn.is-paused {
  background: rgba(220, 38, 38, 0.15);
  border-color: rgba(220, 38, 38, 0.4);
  color: #fca5a5;
}

/* In-Camera Teleprompter HUD */
.camera-teleprompter {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: min(520px, 94%);
  max-height: 72%;
  background: rgba(14, 12, 10, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(234, 179, 8, 0.45);
  border-radius: 13px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.75);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 15;
  color: #fff;
  transition: max-height .2s ease, opacity .15s ease;
}
/* Size presets cycled from the prompter bar (S → M → L), persisted per browser */
.camera-teleprompter.is-size-s { width: min(360px, 92%); max-height: 56%; }
.camera-teleprompter.is-size-s .teleprompter-viewport { min-height: 64px; max-height: 130px; }
.camera-teleprompter.is-size-l { width: min(820px, 96%); max-height: 88%; }
.camera-teleprompter.is-size-l .teleprompter-viewport { min-height: 220px; max-height: 56vh; }
.camera-teleprompter.is-collapsed {
  /* Tall enough for the control bar when it wraps onto two rows */
  max-height: 76px;
}
.camera-teleprompter.is-collapsed .teleprompter-source-panels,
.camera-teleprompter.is-collapsed .teleprompter-viewport,
.camera-teleprompter.is-collapsed .teleprompter-footer {
  display: none !important;
}

.teleprompter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  row-gap: 4px;
  padding: 5px 10px;
  background: rgba(25, 22, 18, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: .75rem;
}
.teleprompter-tabs {
  display: flex;
  gap: 4px;
}
.teleprompter-tab {
  background: transparent;
  border: 1px solid transparent;
  color: rgba(255, 255, 255, 0.7);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: .72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .12s ease;
}
.teleprompter-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.teleprompter-tab.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.25);
}

.teleprompter-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.prompt-tool-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: .7rem;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 5px;
  cursor: pointer;
  line-height: 1;
}
.prompt-tool-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}
.prompt-size-btn {
  min-width: 26px;
  text-align: center;
}
.prompt-close-btn:hover {
  background: rgba(239, 68, 68, 0.45);
  border-color: rgba(239, 68, 68, 0.7);
}
.prompt-speed-group {
  display: inline-flex;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 5px;
  overflow: hidden;
}
.prompt-speed-btn {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: .66rem;
  padding: 4px 6px;
  cursor: pointer;
}
.prompt-speed-btn.is-active {
  background: #facc15;
  color: #000;
  font-weight: 850;
}

.teleprompter-source-panels {
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.prompt-source-pane[hidden] {
  display: none !important;
}
.prompt-select {
  width: 100%;
  padding: 5px 8px;
  background: #221f1a;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: #fff;
  font-size: .72rem;
}
.prompt-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 5px 8px;
  background: #221f1a;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: #fff;
  font-size: .72rem;
  font-family: inherit;
  resize: vertical;
  max-height: 150px;
}
.prompt-file-drop {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border: 1px dashed rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  cursor: pointer;
  font-size: .7rem;
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
}
.prompt-file-drop:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.prompt-file-input {
  display: none;
}

.teleprompter-viewport {
  position: relative;
  flex: 1;
  min-height: 96px;
  max-height: 240px;
  overflow-y: auto;
  scroll-behavior: auto;
  padding: 10px 14px 20px;
  user-select: text;
}
.teleprompter-viewport::-webkit-scrollbar {
  width: 4px;
}
.teleprompter-viewport::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
}
.teleprompter-eyeline {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #facc15 25%, #facc15 75%, transparent);
  margin-bottom: 6px;
  opacity: 0.85;
}
.teleprompter-content {
  font-size: .95rem;
  line-height: 1.45;
  color: #fff;
  font-weight: 650;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  white-space: pre-wrap;
  word-break: break-word;
}
.prompt-placeholder {
  font-size: .78rem;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 500;
  margin: 6px 0;
  text-align: center;
}
.prompt-text {
  white-space: pre-wrap;
}

.teleprompter-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 10px;
  background: rgba(25, 22, 18, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: .68rem;
}
.teleprompter-footer-actions {
  display: flex;
  gap: 4px;
}
.prompt-action-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: .7rem;
  font-weight: 750;
  cursor: pointer;
}
.prompt-action-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}
.prompt-status-label {
  color: rgba(255, 255, 255, 0.6);
  font-size: .66rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.camera-teleprompter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .78rem;
}
.camera-teleprompter-toggle.is-active {
  background: #facc15;
  color: #000;
  border-color: #eab308;
  font-weight: 800;
}

.camera-status-banner { padding: 12px 16px; background: #fef2f2; border-bottom: 1px solid #fecaca; color: #991b1b; font-size: .82rem; line-height: 1.4; }

.video-upload-preview { margin: 0 0 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: #15130f; box-shadow: 0 12px 30px #261c0d1a; }
.video-upload-stage { position: relative; display: grid; place-items: center; min-height: 280px; max-height: 520px; background: #111; }
.video-upload-stage video { display: block; width: 100%; max-height: 520px; object-fit: contain; }
.video-upload-stage p { max-width: 360px; padding: 22px; color: white; text-align: center; }
.video-upload-details { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 16px; background: var(--card); }
.video-upload-details > div { min-width: 0; }
.video-upload-details .eyebrow { margin-bottom: 3px; }
.video-upload-details strong, .video-upload-details span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-upload-details span { margin-top: 2px; font-size: .78rem; }
.video-upload-details button { flex: none; min-height: 40px; padding: 8px 12px; font-size: .78rem; }
.caption-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 0 0 18px; padding: 0; border: 0; }
.caption-picker legend { margin-bottom: 8px; font-size: .85rem; font-weight: 850; }
.caption-choice { display: grid; gap: 7px; margin: 0; padding: 10px; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; }
.caption-choice:has(input:checked) { border-color: var(--forest); box-shadow: 0 0 0 3px #c99a2d35; }
.caption-choice input { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; margin: 0; }
.caption-choice > span:last-child { display: flex; flex-direction: column; font-size: .72rem; line-height: 1.25; }
.caption-choice small { color: var(--muted); }
.caption-demo { display: grid; place-items: center; min-height: 54px; padding: 7px; border-radius: 8px; background: #222; color: white; font-size: .65rem; font-weight: 950; text-align: center; text-shadow: 0 2px 2px #000; }
.caption-choice.capcut .caption-demo b, .caption-choice.boxed .caption-demo b { color: #ffe800; }
.caption-choice.cyan_pop .caption-demo b { color: #00d4ff; }
.caption-choice.bold_yellow .caption-demo { color: #ffe800; }
.caption-choice.boxed .caption-demo { background: #111; }
.caption-choice.gold_panel .caption-demo { background: #111; color: #ffe800; }
.caption-choice.minimal .caption-demo { font-weight: 600; text-shadow: none; }
.caption-choice.none .caption-demo { background: transparent; border: 1px dashed var(--muted); color: var(--muted); text-shadow: none; font-weight: 700; letter-spacing: .08em; }
.hint { font-size: .9rem; }
.error { background: var(--bad-bg); color: #7f2721; padding: 12px; border-radius: 10px; }
.success { background: var(--success); color: #205a32; padding: 12px 14px; border-radius: 10px; font-weight: 700; }
.dashboard-notice { margin: 18px 0 0; }

.progress-wrap[hidden], [hidden] { display: none !important; }
.progress { height: 12px; background: #dfe2db; border-radius: 20px; overflow: hidden; margin-top: 18px; }
.progress i { display: block; height: 100%; width: 4%; background: var(--forest); transition: width .4s; }
.project-phases { display: grid; grid-template-columns: repeat(4, 1fr); margin: -10px 0 38px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.project-phases span { position: relative; display: flex; align-items: center; gap: 10px; padding: 14px 8px; color: #9ba19b; font-size: .76rem; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; }
.project-phases span::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -1px; height: 3px; background: var(--forest); transition: right .3s; }
.project-phases span.current, .project-phases span.done { color: var(--ink); }
.version-history { display: flex; gap: 8px; margin: -8px 0 28px; overflow-x: auto; padding-bottom: 4px; }
.version-history a { display: grid; min-width: 104px; gap: 2px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 12px; background: white; color: var(--ink); text-decoration: none; }
.version-history a.current { border-color: var(--forest); box-shadow: inset 0 0 0 1px var(--forest); }
.version-history span { font-weight: 850; }
.version-history small { color: var(--muted); font-size: .68rem; }
.version-count { padding: 4px 7px; border-radius: 999px; background: var(--gold-soft); color: var(--forest-dark); font-size: .68rem; font-weight: 850; }
.highlight-count { padding: 4px 7px; border-radius: 999px; background: #fff1c8; color: #684d00; font-size: .68rem; font-weight: 850; }
.revision-comparison { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 18px; }
.comparison-video { min-width: 0; overflow: hidden; padding: 16px; }
.comparison-video.revised { border-color: #9ab876; }
.comparison-video.source-upload { border-color: #c4b48a; }
.comparison-video video { display: block; width: 100%; max-height: 600px; aspect-ratio: 9/16; object-fit: contain; border-radius: 12px; background: #101510; }
.change-summary { margin-top: 18px; }
.change-summary ul { margin: 12px 0; padding-left: 20px; }
.change-summary li { margin: 5px 0; }
.change-summary blockquote { margin: 14px 0; padding-left: 16px; border-left: 3px solid var(--acid); font: 1.1rem/1.5 Georgia,serif; }
.revision-approval { display: grid; grid-template-columns: minmax(0,1fr) minmax(240px,360px); gap: 30px; align-items: end; margin-top: 18px; }
.revision-approval h2 { margin-bottom: 5px; }
.completed-change-summary { margin: 24px 0; }
.project-phases span.current::after, .project-phases span.done::after { right: 0; }
.project-phases i { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid currentColor; border-radius: 50%; font-style: normal; font-size: .68rem; }
.project-phases span.done i { border-color: var(--forest); background: var(--forest); color: white; }
.revision-brief { margin: -18px 0 30px; padding: 16px 18px; border-left: 4px solid var(--sun); border-radius: 0 12px 12px 0; background: #fff8dd; }
.revision-brief p { margin: 0 0 5px; }
.revision-brief .eyebrow { margin-bottom: 5px; }
.revision-brief a { font-size: .82rem; font-weight: 800; }
.processing-card { max-width: 880px; margin: 0 auto; padding: clamp(24px, 5vw, 42px); }
.processing-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.processing-head strong { font: 700 1.7rem Georgia, serif; }
.steps { display: grid; grid-template-columns: repeat(5, 1fr); list-style: none; margin: 34px 0 0; padding: 0; }
.steps li { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 9px; padding: 9px 8px 9px 0; color: var(--muted); font-size: .78rem; }
.steps li:not(:last-child)::after { content: ""; position: absolute; top: 19px; left: 27px; right: 5px; height: 2px; background: #d9ddd7; }
.steps li span { display: grid; place-items: center; flex: 0 0 22px; width: 22px; height: 22px; border: 2px solid #b5bbb5; border-radius: 50%; }
.steps li span { position: relative; z-index: 1; background: var(--card); }
.steps li.done { color: var(--ink); }
.steps li.done span { border-color: var(--forest); background: var(--forest); }
.steps li.done span::after { content: "✓"; color: white; font-size: .75rem; font-weight: 900; }
.steps li.active { color: var(--ink); font-weight: 800; }
.steps li.active span { border: 6px solid var(--forest); background: white; }
.checkpoint-list { display: grid; gap: 4px; margin: 12px 0 0; padding: 0; list-style: none; font-size: .78rem; }
.checkpoint-list li { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.checkpoint-list li.done { color: var(--ink); }
.checkpoint-list li.done span { color: var(--forest); font-weight: 900; }
.checkpoint-list li.active { color: var(--ink); font-weight: 800; }
.checkpoint-list li.active span { color: var(--forest); }
.reassurance { margin: 28px 0 0; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); }

.selection-intro { max-width: 760px; margin: 0 0 30px; }
.selection-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.reject-analysis { margin-top: 0; }
.reject-analysis .ghostdark, .reload-preview .ghostdark { width: auto; }
.reload-preview { margin: 12px 0 4px; }
.selection-intro h2 { font: 700 clamp(2rem, 4vw, 3.35rem)/1.02 Georgia, serif; letter-spacing: -.025em; }
.candidates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.candidates-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.candidates-1 { grid-template-columns: minmax(0, 1fr); }
/* Single highlight: use the full row — video column left, controls column right. */
.candidates-1 .candidate { display: grid; grid-template-columns: minmax(280px, 400px) minmax(0, 1fr); align-items: start; column-gap: 26px; overflow: visible; }
.candidates-1 .candidate-head { grid-column: 1 / -1; }
.candidates-1 .candidate-screen { grid-column: 1; grid-row: 2 / span 16; position: sticky; top: 18px; }
.candidates-1 .candidate > :not(.candidate-head):not(.candidate-screen) { grid-column: 2; }
.candidates-1 .highlight-title, .candidates-1 .candidate-description { min-height: 0; }
@media (max-width: 1000px) { .candidates-1 .candidate, .candidates-2 .candidate { display: block; } .candidates-1 .candidate-screen { position: static; } }
.candidate { position: relative; padding: 16px; overflow: hidden; }
.candidate::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--forest); }
.candidate:nth-child(2)::before { opacity: .7; }.candidate:nth-child(3)::before { opacity: .42; }
.candidate-head { display: flex; justify-content: space-between; gap: 12px; }
.candidate-head h2 { margin-top: 0; }
.candidate-tone { flex: 0 0 auto; padding: 5px 8px; border-radius: 7px; background: var(--gold-soft); color: var(--forest-dark); font-size: .62rem; font-weight: 900; letter-spacing: .08em; }
.highlight-title { min-height: 48px; margin: 8px 0; font: 700 1.08rem/1.3 Georgia,serif; }
.candidate-description { min-height: 48px; color: var(--muted); }
.candidate-screen { position: relative; overflow: hidden; border-radius: 14px; background: #101510; }
.candidate video, .final-video { display: block; width: 100%; aspect-ratio: 9/16; background: #101510; border-radius: 14px; object-fit: contain; }
.screen-label { position: absolute; top: 10px; left: 10px; pointer-events: none; padding: 5px 8px; border-radius: 7px; background: #101510a8; color: white; font-size: .59rem; font-weight: 900; letter-spacing: .09em; backdrop-filter: blur(6px); }
.candidate-best { display: flex; justify-content: space-between; gap: 10px; margin-top: 13px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .78rem; }
.candidate-best span { color: var(--muted); }.candidate-best strong { text-align: right; }
.candidate form { margin-top: 18px; }
.candidate form label { font-size: .9rem; }
.candidate textarea { min-height: 72px; font-size: .92rem; }
.candidate-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.candidate-toolbar .score-breakdown, .candidate-toolbar .reload-preview { margin: 0; }
.score-breakdown { margin: 10px 0 0; font-size: .78rem; }
.score-breakdown summary { cursor: pointer; color: var(--forest); font-weight: 850; }
.score-breakdown dl { display: grid; gap: 5px; margin: 9px 0 0; }
.score-breakdown dl div { display: flex; justify-content: space-between; gap: 12px; }
.score-breakdown dt { color: var(--muted); }.score-breakdown dd { margin: 0; font-weight: 850; }
.discard-highlight-form { margin-top: 8px !important; }
.discard-button, .discard-button:hover { width: 100%; min-height: 38px; padding: 8px 12px; border: 1px solid #c89d98; background: transparent; color: var(--bad); font-size: .78rem; }
.danger-link, .danger-link:hover { min-height: 34px; padding: 6px 10px; background: transparent; color: var(--bad); font-size: .75rem; text-decoration: underline; }
.quiet-link, .quiet-link:hover { min-height: 0; padding: 6px 2px; background: transparent; color: var(--muted); font-size: .78rem; font-weight: 750; text-decoration: underline; }
.quiet-link:hover { color: var(--forest-dark); }
.delete-highlight-files-form { margin-top: 4px !important; }
.discarded-shelf { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 0 26px; padding: 16px 18px; }
.discarded-shelf p { margin-bottom: 0; }
.discarded-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.discarded-item { display: grid; gap: 2px; padding: 6px 7px 5px 11px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.discarded-actions form { display: flex; align-items: center; gap: 8px; margin: 0; font-size: .78rem; font-weight: 800; }
.discarded-actions button { min-height: 34px; padding: 6px 10px; font-size: .75rem; }
.legacy-notice { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; margin: 0 0 24px; padding: 13px 16px; border: 1px solid #dfc16d; border-radius: 13px; background: #fff8dd; font-size: .82rem; }
.legacy-notice strong { color: #694e00; }.legacy-notice span { color: var(--muted); }.legacy-notice a { font-weight: 850; white-space: nowrap; }

.complete-hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 18px 0 28px; }
.complete-hero h2 { font: 700 clamp(2.4rem, 5vw, 4rem)/1 Georgia, serif; }
.complete-mark { display: grid; place-items: center; flex: 0 0 74px; width: 74px; height: 74px; border-radius: 50%; background: var(--acid); font-size: 2rem; font-weight: 900; }
.final-layout { display: grid; grid-template-columns: minmax(280px, 430px) minmax(270px, 1fr); gap: 24px; align-items: start; }
.downloads { position: sticky; top: 18px; }
.downloads .button { margin-top: 10px; }
.feedback-card { max-width: 760px; margin-top: 28px; }
.primary-editor { max-width:920px; margin:30px auto 18px; border-color:#cfaf59; box-shadow:0 18px 48px #6f561413; }
.edit-target-banner { display:grid; grid-template-columns:12px 1fr auto; align-items:center; gap:12px; max-width:920px; margin:22px auto 0; padding:11px 15px; border:1px solid #cfaf59; border-radius:14px; background:linear-gradient(135deg,#fffdf8,#f7edd0); }
.active-reel-dot { width:10px; height:10px; border-radius:50%; background:#9b741d; box-shadow:0 0 0 4px #ead9a7; }
.edit-target-banner h2 { margin:1px 0 3px; font-size:1.12rem; }
.edit-target-banner p { margin:0; color:var(--muted); font-size:.82rem; }
.edit-target-banner .eyebrow { color:#806017; font-size:.63rem; }
.edit-target-banner > a { font-size:.76rem; font-weight:800; white-space:nowrap; }
.primary-editor > h2 { font-size:clamp(1.65rem,3vw,2.25rem); margin-bottom:6px; }
.primary-editor > form { display:grid; gap:10px; }
.primary-editor textarea { min-height:116px; font-size:1rem; }
.revision-legend.compact { margin-top:14px; }
.revision-legend.compact > summary { color:#72591b; }
.revision-legend.compact p { margin:12px 0 0; color:var(--muted); }
.revision-plan { margin: 22px 0; padding: 20px; border: 1px solid #9ab876; border-radius: 14px; background: #f6faef; }
.revision-plan-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.revision-plan-head h3, .revision-plan h4 { margin: 0; }
.revision-plan-head > span { padding: 5px 9px; border-radius: 999px; background: var(--forest); color: white; font-size: .72rem; font-weight: 850; white-space: nowrap; }
.revision-plan blockquote { margin: 16px 0; padding: 12px 14px; border-left: 3px solid var(--acid); background: white; font: 1rem/1.45 Georgia,serif; }
.revision-plan-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.revision-plan-grid ul, .cost-note ul { margin: 9px 0 0; padding-left: 18px; }
.revision-plan-grid li { margin: 8px 0; }
.revision-plan-grid li small { display: block; margin-top: 2px; color: var(--muted); line-height: 1.35; }
.cost-note { margin: 18px 0; padding: 14px; border-radius: 10px; background: #fff8dd; }
.cost-note li { margin: 4px 0; }
.cost-note > small { display: block; margin-top: 9px; color: var(--muted); }
@media (max-width: 640px) { .revision-plan-grid { grid-template-columns: 1fr; } .revision-plan { padding: 15px; } }
.alternate-intro { margin-top: 55px; }
.completed-candidates { margin-bottom: 28px; }
.storyboard-track { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; margin: 18px 0 46px; color: var(--muted); font-size: .65rem; font-weight: 850; letter-spacing: .08em; }
.track-line { position: relative; height: 4px; border-radius: 5px; background: #cbd0c9; }
.track-line::before { content: ""; position: absolute; inset: 0 35% 0 0; border-radius: inherit; background: var(--forest); }
.track-line i { position: absolute; top: 50%; width: 1px; height: 1px; font-style: normal; }
.track-line b { display: grid; place-items: center; position: absolute; top: -14px; left: -14px; width: 28px; height: 28px; border: 3px solid var(--paper); border-radius: 50%; background: var(--forest); color: white; }
.track-line small { position: absolute; top: 19px; left: -10px; white-space: nowrap; }
.visual-plan-form { display: grid; gap: 24px; }
.visual-slot { min-width: 0; margin: 0; }
.visual-slot legend { padding: 0 9px; font: 700 1.05rem Georgia, serif; }
.visual-slot legend span { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-right: 6px; border-radius: 50%; background: var(--forest); color: white; font: 800 .75rem Inter, sans-serif; }
.visual-slot-layout { display: grid; grid-template-columns: minmax(220px, .65fr) minmax(0, 1.35fr); gap: 24px; align-items: start; }
.visual-slot-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.visual-slot-head h3 { margin-top: 0; }
.visual-why-pill { display: inline-flex; align-items: center; gap: 6px; margin: 6px 0 0; padding: 4px 10px; border-radius: 999px; background: var(--surface-2, #f0e9d8); color: var(--ink-2, #2c2a26); font-size: .72rem; font-weight: 700; letter-spacing: .03em; }
.visual-why-pill[data-kind="masked_jump_cut"] { background: #ffe6cf; color: #7a3a05; }
.visual-why-pill[data-kind="concept_visual"] { background: #d9ecdb; color: #1d4a26; }
.visual-why-pill[data-kind="neutral_34_66"] { background: #ece4d2; color: #4a3f2a; }
.placement-banner { grid-column:1/-1; display:flex; align-items:center; gap:12px; margin:0 0 16px; padding:13px 15px; border:1px solid #d9bd72; border-radius:13px; background:linear-gradient(135deg,#fffaf0,#f8efd5); color:var(--ink); }
.placement-banner > span { display:grid; place-items:center; width:34px; height:34px; flex:0 0 34px; border-radius:50%; background:#ead9a5; color:#765715; font-size:1.15rem; font-weight:900; }
.placement-banner > div { display:grid; gap:3px; }
.placement-banner small { color:var(--muted); line-height:1.4; }
.placement-banner.compact { margin:10px 0 14px; padding:11px 13px; }
.guide-list { margin: 8px 0 12px 18px; padding: 0; }
.guide-list li { margin: 4px 0; }
.cost-pill { flex: 0 0 auto; padding: 6px 10px; border-radius: 999px; background: var(--success); color: #205a32; font-size: .76rem; font-weight: 900; }
.visual-excerpt { max-width: 820px; padding-left: 14px; border-left: 3px solid var(--acid); font-family: Georgia, serif; font-size: 1.05rem; }
.visual-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 12px; margin-top: 0; }
.visual-option { position: relative; display: grid; grid-template-rows: 140px 1fr; margin: 0; overflow: hidden; border: 2px solid var(--line); border-radius: 15px; background: white; cursor: pointer; }
.visual-option:has(input:checked) { border-color: var(--forest); box-shadow: 0 0 0 3px #c99a2d45; }
.visual-option input { position: absolute; z-index: 2; top: 9px; right: 9px; width: 21px; height: 21px; margin: 0; accent-color: var(--forest); }
.visual-preview { display: grid; place-items: center; overflow: hidden; background: #dfe5dd; }
.visual-preview img, .visual-preview video { width: 100%; height: 100%; object-fit: cover; }
.speaker-preview { display: grid; place-items: center; width: 66px; height: 66px; border-radius: 50%; background: var(--acid); font: 700 .95rem/1.1 "Studio Script", Georgia, serif; color: var(--gold-dark); }
.visual-option-copy { display: flex; flex-direction: column; gap: 5px; padding: 12px; }
.visual-option-copy small { color: var(--muted); font-weight: 500; }
.visual-option-copy .provider-name { color: #738078; font-size: .59rem; font-weight: 900; letter-spacing: .1em; }
.visual-option-copy a { width: fit-content; font-size: .8rem; }
.visual-approval { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 420px); gap: 30px; align-items: center; }
.approval-actions { display: grid; gap: 10px; }
.qa-summary { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.qa-summary summary { cursor: pointer; font-weight: 800; }
.qa-summary ul { list-style: none; padding: 0; }
.qa-summary li { padding: 4px 0; }
.qa-summary li.pass { color: #205a32; }
.qa-summary li.warn { color: #8a5a00; }
.problem-card { max-width: 680px; margin: 0 auto; padding: clamp(26px, 5vw, 42px); }
.problem-icon { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 22px; border-radius: 50%; background: var(--bad-bg); color: var(--bad); font-size: 1.5rem; font-weight: 900; }
.error-detail { padding: 14px; border-left: 3px solid var(--bad); background: #fff5f3; color: #6e2a25; overflow-wrap: anywhere; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 28px; margin-top: 56px; padding: 24px 0; border-top: 1px solid #d8aaa5; }
.danger-zone h2 { margin-bottom: 4px; font-size: 1.25rem; }
.danger-zone p { max-width: 720px; margin-bottom: 0; }
.danger-button, .danger-button:hover { flex: 0 0 auto; background: var(--bad); color: white; }
.danger-actions { display: grid; min-width: min(100%, 330px); gap: 9px; }
.danger-actions form, .danger-actions button { width: 100%; margin: 0; }
.confirm-dialog { width: min(92vw, 520px); max-width: none; padding: 0; border: 0; border-radius: 22px; background: transparent; color: var(--ink); box-shadow: 0 30px 90px #120b0755; }
.confirm-dialog::backdrop { background: #1d160e99; backdrop-filter: blur(4px); }
.confirm-dialog-card { position: relative; padding: clamp(24px, 5vw, 36px); border: 1px solid #ead3cf; border-radius: 22px; background: var(--card); }
.confirm-dialog-close { position: absolute; top: 13px; right: 13px; width: 38px; min-height: 38px; padding: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 1.45rem; }
.confirm-dialog-close:hover { background: var(--paper); color: var(--ink); }
.confirm-dialog-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 18px; border-radius: 50%; background: var(--bad-bg); color: var(--bad); font-size: 1.25rem; font-weight: 900; }
.confirm-dialog h2 { margin: 4px 42px 10px 0; }
.confirm-dialog #confirm-dialog-message { margin-bottom: 8px; font-weight: 700; }
.confirm-dialog-detail { margin: 0; color: var(--muted); }
.confirm-dialog-phrase { margin-top: 20px; padding: 14px; border-radius: 13px; background: #fff5f3; color: #5f2823; font-size: .86rem; }
.confirm-dialog-phrase input { border-color: #d8aaa5; background: white; font-weight: 800; letter-spacing: .04em; }
.confirm-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.confirm-dialog-actions button { min-width: 130px; }
.generation-dialog .confirm-dialog-card { border-color: #d9bd72; background: linear-gradient(145deg, #fffdf8, #fbf5e7); }
.generation-dialog-icon { background: #f4e7bc; color: #86651b; }
.generation-dialog #generation-dialog-message { margin-bottom: 8px; font-weight: 700; }
.storage-panel { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 34px; background: #f8fbf4; }
.storage-panel h2 { margin-bottom: 4px; }
.storage-panel p { margin-bottom: 0; }
.storage-panel > div:last-child { display: grid; min-width: 150px; text-align: right; }
.storage-panel > div:last-child strong { font: 700 1.6rem Georgia,serif; }
.storage-panel > div:last-child span { color: var(--muted); font-size: .75rem; }

.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.check input { width: auto; margin: 4px 0 0; }
.magnific-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(250px, 1fr); gap: 18px; align-items: start; }
@media (max-width: 880px) {
  /* phones and portrait tablets: the 250px sidebar column would crush the
     generator forms to ~100px, so everything stacks in one column */
  .magnific-grid { grid-template-columns: minmax(0, 1fr); }
}
.magnific-history { margin-top: 36px; }
/* Lab cards reuse .job (padding 0 + overflow hidden), so all copy lives in
   .job-body — and prompts wrap instead of leaking under the card edges. */
.prompt { margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); font-size: .84rem; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-line; }
.magnific-delete { display: flex; justify-content: flex-start; margin-top: 12px; }
.magnific-result video { display: block; width: 100%; aspect-ratio: 9/16; max-height: 520px; object-fit: contain; background: #101510; border-radius: 14px; margin: 15px 0; }
.credit-warning { padding: 12px; border-radius: 12px; background: #fff4cd; }
.logs { margin-top: 30px; }
.logs summary { cursor: pointer; font-weight: 800; }
.logs pre { max-height: 420px; overflow: auto; font-size: 11px; }
.admin-settings { margin-bottom: 24px; }
.admin-settings summary { cursor: pointer; font-weight: 800; }
.settings-content { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 420px); gap: 28px; align-items: end; padding-top: 20px; }

@media (max-width: 780px) {
  .video-upload-stage { min-height: 220px; }
  .video-upload-details { align-items: stretch; flex-direction: column; }
  .video-upload-details button { width: 100%; }
  .folder-library-head { align-items: stretch; flex-direction: column; }
  .folder-create-form input { min-width: 0; }
  .folder-create-form label { flex: 1; }
  .dashboard-delete-button span { display: none; }
  .confirm-dialog-actions { flex-direction: column-reverse; }
  .confirm-dialog-actions button { width: 100%; }
  .studio-hero { grid-template-columns: 1fr; gap: 10px; }
  .studio-hero-art { min-height: 330px; }
  /* Narrow cover crop at the desktop focal point cuts her eyes: anchor the
     visible window on her face (right third, upper quarter of the frame). */
  .studio-hero-art { background-position: 75% 20%; }
  /* Must match .has-projects specificity, or the two-column desktop grid
     crushes the copy into a one-word column on phones. */
  .studio-hero.has-projects { grid-template-columns: 1fr; gap: 14px; padding: 18px 0 24px; }
  .studio-hero.has-projects h1 { font-size: clamp(2.2rem, 9.5vw, 2.9rem); }
  .studio-hero.has-projects .studio-hero-art { min-height: 230px; }
  .auth-shell, .upload-page { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .upload-intro { position: static; }
  .upload-plan-card { margin-top: 18px; }
  .upload-setup-grid { grid-template-columns: 1fr; }
  .upload-setup-grid .upload-folder-choice:last-child { grid-column: auto; }
  .auth-art { display: none; }
  .candidates { grid-template-columns: 1fr; }
  .caption-picker { grid-template-columns: 1fr; }
  .candidate { max-width: 560px; width: 100%; margin: 0 auto; }
  .candidate-description { min-height: 0; }
  .final-layout { grid-template-columns: minmax(0, 1fr); }
  .settings-content { grid-template-columns: minmax(0, 1fr); }
  .visual-approval { grid-template-columns: minmax(0, 1fr); }
  .visual-slot-layout { grid-template-columns: minmax(0, 1fr); }
  .revision-comparison, .revision-approval { grid-template-columns: minmax(0,1fr); }
  .library-tools { grid-template-columns: 1fr 1fr; }
  .final-video { max-width: 480px; margin: 0 auto; }
  .downloads { position: static; }
}

@media (max-width: 1100px) {
  /* Tablet portrait: the two-column hero crushes the art into a narrow strip
     where no focal point survives — stack it full-width and anchor the crop
     on her face (right third of the frame). */
  .studio-hero { grid-template-columns: 1fr; gap: 14px; }
  .studio-hero.has-projects { grid-template-columns: 1fr; gap: 14px; }
  /* Match the photo's own aspect so the whole frame is visible, no crop. */
  .studio-hero-art { min-height: 0; aspect-ratio: 3 / 2; background-position: 75% 20%; }
}

@media (max-width: 600px) {
  .bar { height: 60px; padding: 0 16px; }
  .topnav { gap: 9px; }
  .topnav a { display: none; }
  /* Keep every page clear of the fixed mobile tab bar, iPhone safe area included. */
  main { padding: 12px 16px calc(112px + env(safe-area-inset-bottom, 0px)); }
  .studio-stats { grid-template-columns: repeat(2, 1fr); }
  .attention-reason { flex-basis: 100%; }
  .montage-bar { flex-direction: column; align-items: stretch; gap: 10px; }
  .montage-bar [data-montage-submit] { flex: auto; }
  .ai-image-generator { flex-direction: column; align-items: flex-start; }
  .home-hero { padding: 38px 0 48px; }
  .studio-hero { min-height: 0; }
  .studio-stats { margin-top: 0; }
  .studio-stats div { padding: 13px 10px; }
  .studio-stats strong { font-size: 1.35rem; }
  .studio-hero-art { min-height: 260px; }
  .project-phases span { justify-content: center; font-size: 0; }
  .project-phases i { font-size: .68rem; }
  .steps { grid-template-columns: 1fr; }
  .steps li { flex-direction: row; align-items: center; }
  .steps li:not(:last-child)::after { top: 28px; bottom: -10px; left: 10px; right: auto; width: 2px; height: auto; }
  .lab-link { grid-template-columns: auto 1fr; }
  .lab-link .text-button { grid-column: 1 / -1; }
  .hero, .jobhead, .complete-hero, .lab-link { align-items: flex-start; flex-direction: column; }
  .danger-zone { align-items: flex-start; flex-direction: column; }
  .storage-panel { align-items: flex-start; flex-direction: column; }
  .storage-panel > div:last-child { text-align: left; }
  .library-tools { grid-template-columns: 1fr; }
  .discarded-shelf { align-items: flex-start; flex-direction: column; }
  .legacy-notice { grid-template-columns: 1fr; }
  .section-head { align-items: end; }
  .jobhead { gap: 14px; }
  .source-preview { width: 100vw; padding-bottom: calc(18px + 76px + env(safe-area-inset-bottom, 0px)); }
  .drop { min-height: 240px; padding: 22px 14px; }
  .drop strong { font-size: 1.5rem; }
  .processing-card { padding: 22px 18px; }
  .processing-head strong { font-size: 1.35rem; }
  .complete-mark { order: -1; width: 58px; height: 58px; flex-basis: 58px; }
  .button-row > * { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* Optional finishing choices on the upload form */
.finishing-picker { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin: 0 0 18px; padding: 0; border: 0; }
.finishing-picker legend { margin-bottom: 8px; font-size: .85rem; font-weight: 850; }
.finishing-picker legend small { color: var(--muted); font-weight: 600; }
.check-choice { display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; }
.check-choice:has(input:checked) { border-color: var(--forest); box-shadow: 0 0 0 3px #c99a2d35; }
.check-choice input { width: 17px; height: 17px; accent-color: var(--forest); flex: none; }
.check-choice span { display: flex; flex-direction: column; font-size: .72rem; line-height: 1.25; }
.check-choice small { color: var(--muted); }

/* Per-project finishing uploads: details appear only when the option is on */
.finishing-picker { grid-template-columns: 1fr; }
.finishing-details { display: none; margin: -3px 0 6px 27px; padding: 10px 12px; border-left: 2px solid var(--line); gap: 9px; }
.finishing-picker:has(input[name="background_music"]:checked) .music-details { display: grid; }
.finishing-picker:has(input[name="brand_watermark"]:checked) .brand-details { display: grid; }
.visual-intent-picker:has(input[name="ai_visuals"]:checked) .visual-entry-details { display: grid; }
.finishing-picker:has(input[name="end_card"]:checked) .end-card-details { display: grid; }
.finishing-picker:has(input[name="use_cover_asset"]:checked) .cover-details { display: grid; }
.file-choice { display: grid; gap: 4px; font-size: .75rem; font-weight: 700; }
.file-choice input { font: inherit; font-weight: 500; }
.file-choice small { color: var(--muted); font-weight: 500; }
.asset-drop { position: relative; min-height: 98px; padding: 14px 16px; border: 2px dashed #b8ae97; border-radius: 12px; background: #fffdf8; cursor: pointer; transition: background .18s, border-color .18s, box-shadow .18s; }
.asset-drop input { position: absolute; width: 1px; height: 1px; padding: 0; margin: 0; opacity: 0; pointer-events: none; }
.asset-drop-copy { display: grid; gap: 3px; }
.asset-drop-copy > span { color: var(--ink); font-size: .82rem; font-weight: 700; }
.asset-drop-copy small { line-height: 1.35; }
.asset-drop.drag { border-color: #648c3d; background: #eff8d8; box-shadow: 0 0 0 3px #c8e4a880; }
.asset-drop.has-file { border-color: var(--forest); background: #edf4eb; }
.asset-drop-selected { color: var(--forest); font-size: .72rem; font-weight: 800; overflow-wrap: anywhere; }
.corner-choice { display: flex; align-items: center; gap: 8px; font-size: .75rem; font-weight: 700; }
.corner-choice select { font: inherit; font-weight: 600; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--card, #fff); }
.brand-source { display: grid; gap: 7px; }
.radio-inline { display: flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 600; }
.radio-inline input { accent-color: var(--forest); }
.brand-preview { width: 34px; height: 34px; object-fit: contain; border: 1px solid var(--line); border-radius: 7px; padding: 2px; background: #fff; }
.brand-upload { display: none; margin-top: 4px; }
.brand-source:has(input[value="upload"]:checked) .brand-upload { display: block; }
.brand-gallery { display: grid; gap: 8px; margin-top: 8px; }

/* Gallery thumbnail pickers on the upload form */
.thumb-choice { display: grid; gap: 7px; }
.thumb-choice-title { font-size: .75rem; font-weight: 700; }
.thumb-picker { display: grid; grid-template-columns: repeat(auto-fill, 68px); gap: 10px; }
/* Cover and closing-screen tiles are portrait and filled, so the design
   reads at a glance; logos stay square with the whole mark visible. */
.thumb-picker-covers { grid-template-columns: repeat(auto-fill, 62px); }
.thumb-picker-covers .thumb-media { aspect-ratio: 3 / 4; padding: 0; }
.thumb-picker-covers .thumb-media img { width: 100%; height: 100%; object-fit: cover; }
.picker-grid { margin-top: 8px; }
.picker-card { position: relative; cursor: pointer; }
.picker-card > input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.picker-card:has(> input:checked) { border-color: var(--forest); box-shadow: 0 0 0 2px #c99a2d2c, 0 14px 28px #6f51100a; }
.picker-card .gallery-item-body { grid-template-rows: auto; }
.picker-card .gallery-item-body strong { min-height: 0; }
/* Intro/final-screen choices stay intentionally compact on Upload. Their
   media still opens in the full lightbox, so a large gallery card only adds
   scrolling without helping the choice. */
.gallery-grid.upload-media-picker { grid-template-columns: repeat(auto-fill, minmax(96px, 124px)); gap: 10px; align-items: start; }
.upload-media-picker .gallery-item { gap: 7px; padding: 7px; border-radius: 12px; }
.upload-media-picker .gallery-preview { border-radius: 9px; }
.upload-media-picker .gallery-item-body { font-size: .68rem; }
.upload-media-picker .gallery-item-body strong { display: -webkit-box; overflow: hidden; min-height: 0; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.upload-media-picker .zoom-pill { right: 5px; bottom: 5px; padding: 4px 7px; font-size: .58rem; }
.thumb-pick { position: relative; }
.thumb-pick > input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.thumb-pick > label { display: grid; gap: 4px; cursor: pointer; }
.thumb-media { display: grid; place-items: center; aspect-ratio: 1 / 1; padding: 5px; border: 2px solid var(--line); border-radius: 11px; background: #fff; overflow: hidden; }
.thumb-media img { max-width: 100%; max-height: 100%; object-fit: contain; }
.thumb-media-text { background: #f3ecdb; }
.thumb-design-icon { font: 800 1rem Georgia, serif; color: var(--forest); letter-spacing: .02em; }
.thumb-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .68rem; font-weight: 700; color: var(--ink); text-align: center; }
.thumb-pick:has(> input:checked) .thumb-media { border-color: var(--forest); box-shadow: 0 0 0 3px #c99a2d35; }
.thumb-zoom { position: absolute; top: 8px; right: 8px; z-index: 1; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #241d12cc; color: #fff; font-size: .82rem; font-weight: 800; cursor: zoom-in; }
.thumb-zoom:hover, .thumb-zoom:focus-visible { background: #000; outline: 2px solid #d0a535; }
.music-gallery-preview { margin-top: 4px; }
.music-gallery-preview audio { width: 100%; }
.music-volume-choice { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.music-volume-choice legend { font-size: .72rem; font-weight: 700; color: var(--ink); }
.music-volume-choice legend small { display: block; color: var(--muted); font-weight: 600; }
.music-volume-choice label { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: .72rem; font-weight: 700; cursor: pointer; }
.music-volume-choice label:has(input:checked) { border-color: var(--forest); background: var(--forest); color: #fff; }
.music-volume-choice input { accent-color: var(--forest); }
.brand-preview { cursor: zoom-in; }
.visual-intent-picker { border-color: rgba(107, 143, 69, .35); background: rgba(217, 239, 89, .08); }
.featured-choice { align-items: flex-start; }
.next-step-note { display: block; margin-top: 9px; color: var(--muted); text-align: center; }
.ai-visuals-callout { display: flex; align-items: center; gap: 12px; margin: 16px 0; padding: 15px 18px; border: 1px solid rgba(107, 143, 69, .35); border-radius: 14px; background: rgba(217, 239, 89, .12); }
.ai-visuals-callout div { display: flex; flex-direction: column; gap: 3px; }
.ai-visuals-callout small { color: var(--muted); }
.brand-details:has(input[name="logo_source"][value="saved"]:checked) .check-inline { display: none; }
.check-inline { display: flex; align-items: center; gap: 8px; font-size: .75rem; font-weight: 600; }
.check-inline input { width: 15px; height: 15px; accent-color: var(--forest); }

/* AI-shot panel on finished Reels */
.ai-shot-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.supporting-visual-editor { margin-top: 24px; padding: 0; overflow: hidden; }
.supporting-visual-editor > summary { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:22px; cursor:pointer; list-style:none; }
.supporting-visual-editor > summary::-webkit-details-marker { display:none; }
.supporting-visual-editor > summary span:first-child { display:grid; gap:3px; }
.supporting-visual-editor > summary small { color:var(--gold); font-size:.68rem; font-weight:900; letter-spacing:.12em; }
.supporting-visual-editor > summary strong { font:700 clamp(1.25rem,2.5vw,1.7rem)/1.15 Georgia,serif; }
.supporting-visual-editor > summary > span:last-child { color:var(--gold); font-size:1.6rem; transition:transform .2s; }
.supporting-visual-editor[open] > summary > span:last-child { transform:rotate(45deg); }
.supporting-visual-editor[open] > :not(summary) { margin-left:22px; margin-right:22px; }
.supporting-visual-editor[open] > :last-child { margin-bottom:22px; }
.supporting-visual-intro { padding:14px 16px; border-radius:12px; background:#fbf4df; color:#4d3b18; }
.supporting-visual-intro p { margin:0; }
.visual-editor-step { display:grid; grid-template-columns:34px minmax(0,1fr); gap:12px; padding:16px 0; border-bottom:1px solid var(--line); }
.visual-editor-step:last-of-type { border-bottom:0; }
.visual-editor-step > div { min-width:0; }
.visual-editor-step label { margin-top:0; }
.visual-editor-step.is-locked { opacity:.62; }
.visual-editor-step { transition:opacity .2s,background .2s; }
.step-status { margin:0; padding:8px 10px; border-radius:8px; background:#eee9df; color:var(--muted); font-size:.8rem; font-weight:750; }
.step-status.ready { background:var(--gold-soft); color:var(--gold-dark); }
.step-number { display:grid; place-items:center; width:30px; height:30px; border-radius:50%; background:var(--gold); color:white; font-size:.78rem; font-weight:900; }
.ai-shot-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.ai-shot-form select, .ai-shot-form textarea { font: inherit; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card, #fff); }
.ai-shot-image-form { padding: 12px; border: 1px dashed var(--line); border-radius: 10px; }
.ai-shot-image-form small { color: var(--muted); font-weight: 500; }
.create-image-option, .inline-advanced, .cover-tools { margin-top:10px; border:1px solid var(--line); border-radius:10px; padding:10px 12px; }
.create-image-option summary, .inline-advanced summary, .cover-tools summary { cursor:pointer; color:var(--gold-dark); font-weight:800; }
.inline-advanced label { margin:10px 0 0; }
.inline-advanced select { width:100%; margin-top:6px; padding:8px; border:1px solid var(--line); border-radius:8px; background:var(--card); }
.ai-auto-choice { display:flex; align-items:center; gap:12px; padding:14px; border:1px solid color-mix(in srgb,var(--forest) 35%,var(--line)); border-radius:12px; background:color-mix(in srgb,var(--forest) 5%,#fff); }
.ai-auto-choice div { display:grid; gap:3px; }
.ai-auto-choice small, .ai-image-generator small { color:var(--muted); }
.advanced-lab { border:1px solid var(--line); border-radius:10px; padding:10px 12px; }
.advanced-lab summary { display:flex; align-items:center; justify-content:space-between; gap:12px; cursor:pointer; font-weight:700; list-style:none; }
.advanced-lab summary::-webkit-details-marker { display:none; }
.advanced-lab summary::after { content:"⌄"; color:var(--gold); font-size:1.15rem; transition:transform .2s; }
.advanced-lab[open] summary::after { transform:rotate(180deg); }
.advanced-lab summary span { display:grid; gap:2px; }
.advanced-lab summary small { color:var(--muted); font-size:.72rem; font-weight:600; }
.advanced-lab[open] { display:grid; gap:10px; }
.ai-shot-moment { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ai-shot-moment select, .ai-shot-moment input { font: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--card, #fff); }
.ai-shot-moment input { width: 90px; }
.ai-shot-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ai-shot-actions label select { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--card, #fff); margin-left: 6px; }
.ai-cover-form { display: grid; gap: 8px; padding-top: 10px; border-top: 1px dashed var(--line); }
.cover-tools { margin-top:4px; }
.cover-tools > p { font-size:.85rem; }
.cover-tools select { width:100%; padding:8px; border:1px solid var(--line); border-radius:8px; background:var(--card); }
.cover-task { display:grid; gap:8px; margin-top:12px; }
.cover-task video { width:100%; border-radius:10px; background:#000; }
.generation-note { margin:2px 0; padding:11px 12px; border-radius:10px; background:#f7efd8; color:#58451e; font-size:.82rem; }
.preview-reassurance { display:block; text-align:center; color:var(--muted); font-size:.78rem; }
.ai-shot-tasks { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 6px; }
.ai-shot-task { display: flex; gap: 12px; align-items: flex-start; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.ai-shot-task.ready { border-color: var(--forest); }
.ai-shot-task video { width: 170px; flex: none; border-radius: 10px; background: #000; }
.ai-shot-task-copy { display: grid; gap: 6px; justify-items: start; min-width: 0; }
.ai-shot-task-copy .button-row { flex-wrap: wrap; }
.ai-shot-task.is-picked { border-color: var(--forest); box-shadow: 0 0 0 3px #c99a2d35; }
.ai-shot-task.clashes { border-color: var(--bad); }
.montage-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 12px; background: #fafaf7; }
.montage-bar-copy { display: grid; gap: 6px; min-width: 0; }
.montage-bar-copy small { color: var(--muted); }
.montage-bar [data-montage-submit] { flex: 0 0 auto; }
@media (max-width: 600px) { .ai-shot-task { flex-direction:column; } .ai-shot-task video { width:100%; } .supporting-visual-editor[open] > :not(summary) { margin-left:14px; margin-right:14px; } }
.ai-shot-pending { display: flex; align-items: center; gap: 9px; font-size: .82rem; font-weight: 600; }
.qa-badge { display:inline-flex; padding:4px 8px; border-radius:999px; font-size:.72rem; font-weight:800; background:#eef2ed; }
.qa-badge.review { background:#fff0c7; color:#684900; }
.ai-image-generator { grid-column:1/-1; display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; padding:12px; border:1px dashed var(--line); border-radius:12px; background:#fafaf7; }
.ai-image-generator > div:first-child { display:grid; gap:3px; }
.generation-allowance { display:inline-flex; align-items:center; gap:5px; margin:0; padding:6px 10px; border-radius:999px; background:#f4e7bc; color:#654b13; font-size:.76rem; }
.generation-allowance strong { color:#4f3808; }
.preview-state { display:inline-flex; width:max-content; margin:2px 0 7px; padding:4px 8px; border-radius:999px; background:#f4e7bc; color:#6d5010 !important; font-size:.65rem; font-weight:850; letter-spacing:.06em; }
.advanced-timeline { margin-top:12px; border:1px solid var(--line); border-radius:13px; background:#fbfaf6; overflow:hidden; }
.advanced-timeline > summary { padding:12px 14px; cursor:pointer; list-style:none; }
.advanced-timeline > summary span { display:grid; gap:2px; font-weight:800; }
.advanced-timeline > summary small { color:var(--muted); font-weight:500; }
.timeline-editor { display:grid; grid-template-columns:minmax(150px,.65fr) minmax(240px,1.35fr); gap:16px; padding:0 14px 14px; }
.timeline-editor video { width:100%; max-height:290px; border-radius:12px; background:#171510; }
.timeline-editor-controls { display:grid; align-content:center; gap:13px; min-width:0; }
.timeline-time-row, .timeline-selection { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.timeline-time-row { color:var(--muted); font-size:.78rem; font-weight:750; }
.timeline-time-row output { color:var(--ink); font-variant-numeric:tabular-nums; }
.timeline-scrubber-wrap { position:relative; padding:13px 0 19px; }
.timeline-scrubber-wrap input[type="range"] { position:relative; z-index:2; width:100%; accent-color:#a47d22; }
.timeline-markers { position:absolute; z-index:1; left:9px; right:9px; bottom:4px; height:15px; }
.timeline-markers button { position:absolute; width:9px; min-height:15px; padding:0; transform:translateX(-50%); border:0; border-radius:5px; background:#b68b29; box-shadow:0 0 0 3px #f5e8bd; }
.timeline-selection { padding:11px 12px; border-radius:11px; background:#f4e7bc; }
.timeline-selection > div { display:grid; gap:2px; }
.timeline-selection small { color:#765715; font-size:.62rem; font-weight:850; letter-spacing:.08em; }
.timeline-selection strong { color:#4f3808; font-variant-numeric:tabular-nums; }
@media (max-width:680px) { .timeline-editor { grid-template-columns:1fr; } .timeline-editor video { max-height:360px; } .timeline-selection { align-items:flex-start; flex-direction:column; } }
.advanced-editor { padding:0; overflow:hidden; border-color:#d9bd72; }
.advanced-editor > summary { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:20px 22px; cursor:pointer; list-style:none; background:linear-gradient(135deg,#fffdf8,#f7edd0); }
.advanced-editor > summary > span:first-child { display:grid; gap:2px; }
.advanced-editor > summary small { color:#886719; font-size:.68rem; font-weight:850; letter-spacing:.09em; }
.advanced-editor > summary strong { font:700 1.35rem Georgia,serif; }
.advanced-editor > summary em { color:var(--muted); font-size:.78rem; font-style:normal; }
.advanced-editor[open] > summary > span:last-child { transform:rotate(45deg); }
.advanced-editor-intro { display:flex; align-items:center; justify-content:space-between; gap:18px; padding:22px 22px 8px; }
.advanced-editor-intro h2 { margin:0 0 4px; }
.advanced-editor-intro p { margin:0; color:var(--muted); }
.safe-version-badge { flex:0 0 auto; padding:7px 10px; border-radius:999px; background:#e3f0df; color:#2c5b28; font-size:.65rem; font-weight:850; letter-spacing:.07em; }
.advanced-editor-form, #advanced-editor-form { padding:14px 22px 22px; }
.advanced-edit-summary { position:sticky; bottom:10px; z-index:4; box-shadow:0 14px 38px #1d241d24; }
.other-highlights { margin-top:30px; border:1px solid var(--line); border-radius:20px; background:#faf7ef; overflow:hidden; }
.other-highlights > summary { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:20px 22px; cursor:pointer; list-style:none; }
.other-highlights > summary > span:first-child { display:grid; gap:2px; }
.other-highlights > summary small { color:#886719; font-size:.68rem; font-weight:850; letter-spacing:.09em; }
.other-highlights > summary strong { font:700 1.25rem Georgia,serif; }
.other-highlights > summary em { color:var(--muted); font-size:.78rem; font-style:normal; }
.other-highlights[open] > summary { border-bottom:1px solid var(--line); }
.other-highlights[open] > summary > span:last-child { transform:rotate(45deg); }
.other-highlights .alternate-intro { margin-top:26px; padding-inline:22px; }
.other-highlights .completed-candidates { padding:0 22px 22px; }
.highlight-management { margin-top:12px; padding-top:10px; border-top:1px solid var(--line); }
.highlight-management > summary { cursor:pointer; color:var(--muted); font-size:.8rem; }
.highlight-management form { margin-top:10px; }
.hook-frame-editor { margin-top:12px; padding:12px; border:1px solid var(--line); border-radius:14px; background:#1a1712; color:#f4e1a6; display:grid; gap:8px; }
.hook-frame-head { display:flex; align-items:baseline; justify-content:space-between; gap:10px; }
.hook-frame-head .eyebrow { margin:0; }
.hook-frame-head small { color:#b5a57a; font-size:.7rem; font-weight:650; text-align:right; }
.hook-frame-row { display:flex; align-items:stretch; gap:8px; }
.hook-frame-row input { flex:1; min-width:0; margin:0; }
.hook-frame-row button { flex:none; padding:10px 16px; }
/* Live preview of the burned opening hook over a real frame of the Reel. */
@font-face { font-family:"BRInter"; src:url("/static/assets/inter-var.woff2") format("woff2"); font-weight:100 900; font-display:swap; }
@font-face { font-family:"BR Hook"; src:url("/static/assets/montserrat-bold.ttf") format("truetype"); font-weight:700; font-display:swap; }
@font-face { font-family:"BR Spartan"; src:url("/static/assets/LeagueSpartan-ExtraBold.otf") format("opentype"); font-weight:800; font-display:swap; }
@font-face { font-family:"BR Condensed"; src:url("/static/assets/RobotoCondensed-Bold.ttf") format("truetype"); font-weight:700; font-display:swap; }
@font-face { font-family:"BR Lato"; src:url("/static/assets/Lato-Bold.ttf") format("truetype"); font-weight:700; font-display:swap; }
@font-face { font-family:"BR Slab"; src:url("/static/assets/RobotoSlab-Bold.otf") format("opentype"); font-weight:700; font-display:swap; }
.hook-frame-preview { --hook-accent:#ffe800; --hook-font:"BRInter", Inter, sans-serif; position:relative; display:block; aspect-ratio:9/16; width:min(100%, 280px); margin:0 auto; overflow:hidden; border-radius:12px; background:#000; container-type:inline-size; }
.hook-frame-preview video { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; pointer-events:none; }
.hook-frame-render { position:absolute; left:7%; right:7%; top:13%; margin:0; padding:.42em .7em; font-family:var(--hook-font); font-weight:700; font-size:12.1cqw; line-height:1.06; text-align:center; text-transform:uppercase; white-space:pre-line; text-wrap:balance; }
[data-hook-pos="middle"] .hook-frame-render { top:45%; }
[data-hook-pos="bottom"] .hook-frame-render { top:auto; bottom:18%; }
.hook-frame-render-underline { top:11.5%; padding:0; color:#fff; font-size:12.8cqw; font-weight:800; letter-spacing:-.02em; line-height:1.15; text-shadow:0 2px 22px rgba(0,0,0,.55), 0 1px 3px rgba(0,0,0,.65); }
.hook-frame-render-underline::after { content:""; position:absolute; left:33%; right:33%; bottom:-.18em; height:max(2px,.9cqw); border-radius:99em; background:var(--hook-accent); }
.hook-frame-render-pill { top:12.5%; padding:.38em .8em .38em 1.05em; color:#0f1115; background:#fff; box-shadow:0 16px 46px rgba(15,17,21,.3); border-radius:99em; font-size:10.3cqw; }
.hook-frame-render-pill::before { content:""; position:absolute; left:.42em; top:50%; width:.3em; height:.3em; margin-top:-.15em; border-radius:50%; background:var(--hook-accent); }
.hook-frame-render-card { top:12.5%; left:7%; right:auto; padding:.4em .85em; color:#0f1115; background:#fff; box-shadow:0 14px 44px rgba(15,17,21,.28); border-left:.16em solid var(--hook-accent); border-radius:.55em; font-size:10.7cqw; text-align:left; }
.hook-frame-empty { position:absolute; left:10%; right:10%; bottom:10%; color:#ffffffb3; font-size:.72rem; font-weight:650; text-align:center; }
.hook-preview-accent { color:var(--hook-accent); -webkit-text-stroke:1px #101010; paint-order:stroke fill; }
.hook-frame-brand { position:absolute; bottom:3%; left:5%; color:#ffffffdc; font:600 2.1cqw/1.1 var(--hook-font); letter-spacing:.08em; text-transform:uppercase; text-shadow:0 1px 3px #000; }
.hook-frame-duration { position:absolute; right:5%; bottom:3%; padding:3px 5px; border-radius:5px; background:#0009; color:#fff; font:700 1.8cqw/1 Inter, sans-serif; letter-spacing:.04em; }
.hook-frame-styles { display:flex; gap:8px; margin:0; padding:0; border:0; }
.hook-style-chip { position:relative; flex:1; display:grid; gap:4px; justify-items:center; cursor:pointer; }
.hook-style-chip input { position:absolute; opacity:0; pointer-events:none; }
.hook-style-chip-art { display:grid; place-items:center; width:100%; aspect-ratio:5/4; overflow:hidden; border:1px solid #ffffff2b; border-radius:9px; background:linear-gradient(160deg,#3f3a33,#1b1814); font:700 .6rem/1 "BR Hook", Inter, sans-serif; letter-spacing:.04em; text-transform:uppercase; }
.hook-style-chip-art b { font-weight:700; }
.hook-style-art-underline b { position:relative; padding-bottom:.3em; color:#fff; text-shadow:0 2px 6px rgba(0,0,0,.95); }
.hook-style-art-underline b::after { content:""; position:absolute; left:12%; right:12%; bottom:.04em; height:2px; border-radius:2px; background:var(--hook-accent,#ffe800); }
.hook-style-art-pill b { position:relative; color:#0f1115; background:#fff; padding:.16em .55em .16em .95em; border-radius:99em; }
.hook-style-art-pill b::before { content:""; position:absolute; left:.38em; top:50%; width:.28em; height:.28em; margin-top:-.14em; border-radius:50%; background:var(--hook-accent,#ffe800); }
.hook-style-art-card b { color:#0f1115; background:#fff; padding:.16em .38em .16em .42em; border-left:3px solid var(--hook-accent,#ffe800); border-radius:4px; }
.hook-style-chip-name { font-size:.8125rem; font-weight:750; color:#d9c89a; }
.hook-style-chip input:checked ~ .hook-style-chip-art { outline:2px solid #ffe800; outline-offset:2px; }
.hook-style-chip input:focus-visible ~ .hook-style-chip-art { outline:2px solid #fff; outline-offset:2px; }
/* Size preference (S/M/L): the base before the automatic shrink-to-fit. */
.hook-frame-controls { display:flex; gap:8px; align-items:end; }
.hook-frame-controls .hook-frame-styles { flex:1; min-width:0; }
.hook-frame-sizes { display:flex; gap:3px; margin:0; padding:3px; border:1px solid #ffffff2b; border-radius:11px; background:#141210; }
.hook-size-chip { position:relative; display:block; cursor:pointer; }
.hook-size-chip input { position:absolute; opacity:0; pointer-events:none; }
.hook-size-chip-dot { display:grid; place-items:center; min-width:27px; height:27px; padding:0 4px; border-radius:8px; color:#d9c89a; font-size:.8125rem; font-weight:800; letter-spacing:.02em; }
.hook-size-chip input:checked ~ .hook-size-chip-dot { background:#ffe800; color:#1a1712; }
.hook-size-chip input:focus-visible ~ .hook-size-chip-dot { outline:2px solid #fff; outline-offset:1px; }
.hook-fit-note { margin:0; color:#b5a57a; font-size:.8125rem; font-weight:650; text-align:center; }
.hook-extra-details { margin-top:10px; font-size:.8rem; }
.hook-extra-details > summary { cursor:pointer; color:var(--muted); font-weight:700; display:flex; align-items:center; justify-content:space-between; list-style:none; padding:4px 0; }
.hook-extra-details > summary::-webkit-details-marker { display:none; }
.hook-extra-details > summary::after { content:"＋"; font-size:.85rem; color:#b5a57a; font-weight:700; }
.hook-extra-details[open] > summary::after { content:"−"; }
.hook-extra-details > summary small { color:#b5a57a; font-weight:600; font-size:.75rem; margin-left:6px; }
.hook-extra-details[open] > summary { margin-bottom:8px; }
.hook-extra-controls { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:8px; padding-top:8px; border-top:1px dashed var(--line); }
.hook-extra-label { display:grid; gap:3px; font-size:.68rem; font-weight:700; color:#d9c89a; }
.hook-extra-label small { font-size:.8125rem; font-weight:600; color:#b5a57a; }
.hook-extra-label input[type=text],.hook-extra-label input[type=number] { font:700 .8rem/1.2 Inter, sans-serif; }
.hook-extra-label select { font:600 .875rem/1.2 Inter, sans-serif; }
.accent-color-row { display:flex; gap:8px; flex-wrap:wrap; margin-top:2px; }
.accent-color-swatch { position:relative; display:flex; align-items:center; gap:4px; font-weight:700; font-size:.65rem; color:#d9c89a; cursor:pointer; }
.accent-color-swatch input { position:absolute; width:1px; height:1px; padding:0; margin:0; opacity:0; }
.accent-color-swatch span { display:inline-block; width:16px; height:16px; border-radius:50%; vertical-align:middle; }
.accent-color-swatch input:checked + span { outline:2px solid #fff; outline-offset:1px; }
.accent-color-swatch input:focus-visible + span { outline:3px solid #fff; outline-offset:4px; }
.choose-note { margin-top:10px; margin-bottom:16px; font-size:.8rem; }
.choose-note > summary { cursor:pointer; color:var(--muted); font-weight:700; }
.choose-note[open] > summary { margin-bottom:6px; }
.hook-frame-editor .eyebrow { color:#f4e1a6; letter-spacing:.12em; }
.hook-frame-editor label { display:grid; gap:3px; font-size:.8125rem; font-weight:700; color:#d9c89a; }
.hook-frame-editor label small { font-weight:600; color:#b5a57a; }
.hook-frame-editor input { font:700 1rem/1.2 Inter, sans-serif; text-transform:uppercase; letter-spacing:.02em; }
.hook-frame-editor .ghostdark { justify-self:start; }
.hook-frame-editor .accent-color-swatch { display:flex; font-size:.8125rem; }
.hook-frame-chip { margin:0; padding:.45em .7em; border-radius:10px; background:#101010; color:#ffe800; font:700 1.05rem/1.15 Inter, sans-serif; text-align:center; text-transform:uppercase; letter-spacing:.03em; white-space:pre-line; }
.copy-editor { margin-top:12px; padding-top:10px; border-top:1px solid var(--line); font-size:.8rem; }
.copy-editor > summary { cursor:pointer; color:var(--forest); font-weight:850; }
.copy-editor > summary small { color:var(--muted); font-weight:600; }
.copy-editor form { margin-top:10px; display:grid; gap:8px; }
.copy-editor label { display:grid; gap:3px; font-size:.72rem; font-weight:700; color:var(--muted); }
.copy-editor input, .copy-editor textarea { font:inherit; font-weight:500; color:var(--ink); }
.copy-editor-actions { display:flex; flex-wrap:wrap; gap:6px; align-items:center; margin-top:2px; }
.copy-editor-actions select { font:inherit; font-weight:600; padding:5px 8px; border:1px solid var(--line); border-radius:8px; }
.copy-editor-actions button { min-height:34px; }
.overlay-suggestions { margin-top:12px; padding-top:10px; border-top:1px solid var(--line); font-size:.8rem; }
.overlay-suggestions > summary { cursor:pointer; color:var(--forest); font-weight:850; }
.overlay-suggestions > summary small { color:var(--muted); font-weight:600; }
.active-overlay { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:8px; padding:8px 10px; border:1px solid var(--line); border-radius:10px; background:#fff; }
.active-overlay strong { display:block; }
.active-overlay small { color:var(--muted); }
.overlay-suggestion { display:grid; gap:6px; margin-top:8px; padding:10px; border:1px dashed var(--line); border-radius:10px; }
.overlay-suggestion blockquote { margin:0; font-style:italic; }
.overlay-suggestion blockquote small { color:var(--muted); font-style:normal; }
.overlay-suggestion label { display:grid; gap:3px; font-size:.72rem; font-weight:700; color:var(--muted); }
.overlay-suggestion input[type="text"] { font:italic 500 .85rem/1.35 Inter, sans-serif; color:var(--ink); padding:7px 9px; border:1px solid var(--line); border-radius:8px; background:#fff; }
.graphic-page { display:grid; grid-template-columns:104px minmax(0,1fr); gap:12px; margin-top:10px; padding:10px; border:1px solid var(--line); border-radius:14px; align-items:start; }
.graphic-preview-frame { margin:0; display:grid; gap:6px; }
.graphic-preview-frame img { display:block; width:100%; aspect-ratio:9/16; object-fit:cover; border:1px solid var(--line); border-radius:8px; background:#161313; }
.graphic-preview-frame img.is-updating { opacity:.5; }
.graphic-preview-frame img, .draft-preview img { cursor:zoom-in; }
.preview-lightbox { position:fixed; inset:0; z-index:90; display:grid; place-items:center; padding:24px; background:rgba(12,10,8,.86); cursor:zoom-out; }
.preview-lightbox img { width:min(88vw,360px); aspect-ratio:9/16; object-fit:cover; border-radius:14px; border:1px solid #ffffff26; background:#161313; box-shadow:0 30px 80px #000c; }
.preview-lightbox figcaption { position:fixed; bottom:26px; left:0; right:0; text-align:center; color:#fffcf5cc; font-size:.8rem; }
.graphic-preview-frame figcaption { font-size:.66rem; }
.graphic-page-controls { display:grid; gap:10px; min-width:0; }
.draft-preview { max-width:104px; justify-self:start; }
.draft-preview img { width:104px; }
.study-live { margin-top:8px; max-width:104px; }
@media (max-width:760px) { .graphic-page { grid-template-columns:1fr; } .graphic-preview-frame img { max-width:104px; } }
.overlay-applied-note { margin-top:8px; }
.claim-review-card { display: grid; gap: 12px; }
.claim-item { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.claim-item blockquote { margin: 0; padding-left: 10px; border-left: 3px solid var(--line); font-style: italic; }
.claim-head { display: flex; align-items: center; gap: 8px; }
.risk-badge { padding: 2px 10px; border-radius: 999px; font-size: .68rem; font-weight: 900; letter-spacing: .04em; }
.risk-high .risk-badge { background: #b3261e; color: #fff; }
.risk-medium .risk-badge { background: #e8a33d; color: #241d12; }
.risk-high { border-color: #b3261e55; }
.claim-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.claim-edit summary { cursor: pointer; color: var(--forest); font-size: .78rem; font-weight: 800; }
.claim-edit form { display: grid; gap: 6px; margin-top: 6px; }
.claim-disclaimer { display: grid; gap: 4px; padding-top: 8px; border-top: 1px solid var(--line); }
.completed-copy-editor { border-top:0; padding-top:0; margin-top:0; }
.completed-copy-editor > summary { color:var(--forest); }
.advanced-editor-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.advanced-tool { display:grid; align-content:start; gap:11px; padding:17px; border:1px solid var(--line); border-radius:15px; background:#fcfbf8; }
.advanced-tool-head { display:flex; align-items:center; gap:10px; }
.advanced-tool-head > span { display:grid; place-items:center; width:36px; height:36px; flex:0 0 36px; border-radius:10px; background:#f0e2b7; color:#6f5210; font-weight:900; }
.advanced-tool-head h3 { margin:0; }
.advanced-tool-head small, .advanced-tool > p { color:var(--muted); }
.advanced-tool label { margin:0; font-size:.78rem; }
.control-help,.empty-control-note { margin:0; color:var(--muted); font-size:.76rem; }
.advanced-tool audio[data-music-preview] { width:100%; height:38px; }
.inline-music-upload { padding:10px 12px; border:1px solid var(--line); border-radius:11px; background:white; }
.inline-music-upload > summary { cursor:pointer; color:#765715; font-size:.78rem; font-weight:800; }
.inline-music-upload[open] { display:grid; gap:9px; }
.inline-music-upload input[type="file"] { margin-top:5px; }
.caption-stage { position:relative; display:grid; place-items:end center; min-height:150px; padding:18px; border-radius:13px; overflow:hidden; background:radial-gradient(circle at 50% 24%,#d8b18e 0 8%,transparent 9%),linear-gradient(165deg,#b8c8be,#727c76 55%,#313933); }
.caption-stage span { margin-bottom:12px; padding:6px 10px; border-radius:7px; background:none; color:white; font-weight:900; text-align:center; text-shadow:0 2px 2px #000; }
.caption-stage b { color:#f1cb4b; }
.caption-stage[data-position="higher"] { place-items:center; }
.caption-stage[data-position="lower"] { place-items:end center; }
.caption-stage[data-style="clean_white"] b { color:white; }
.caption-stage[data-style="cyan_pop"] b { color:#00d4ff; }
.caption-stage[data-style="minimal"] span { font-weight:600; text-shadow:none; }
.caption-stage[data-style="bold_yellow"] span, .caption-stage[data-style="bold_yellow"] b { color:#f1cb4b; }
.caption-stage[data-style="boxed"] span { background:#000c; }
.caption-stage[data-style="gold_panel"] span { background:#000c; color:#f1cb4b; }
.asset-tool { border-color:#d9bd72; background:#fffaf0; }
.experimental-tool { border-style:dashed; opacity:.78; }
.advanced-edit-summary { display:flex; align-items:center; justify-content:space-between; gap:18px; margin-top:16px; padding:15px 17px; border-radius:14px; background:#252b27; color:white; }
.advanced-edit-summary > div { display:grid; gap:3px; min-width:0; }
.advanced-edit-summary small { color:#d7bd72; font-size:.63rem; font-weight:850; letter-spacing:.09em; }
.advanced-edit-summary p { margin:0; color:#cad0cb; font-size:.76rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.advanced-edit-summary button { flex:0 0 auto; }
@media (max-width:760px) { .advanced-editor-grid { grid-template-columns:1fr; } .advanced-editor-intro,.advanced-edit-summary { align-items:flex-start; flex-direction:column; } .advanced-edit-summary button { width:100%; } }
@media (max-width:760px) { .finish-all-reels { align-items:stretch; flex-direction:column; } .finish-all-reels button { width:100%; } }
@media (max-width:760px) { .advanced-edit-summary { bottom:calc(76px + env(safe-area-inset-bottom, 0px)); z-index:7; } }
.friendly-error-card { max-width:680px; margin:clamp(40px,10vh,110px) auto; padding:clamp(28px,5vw,56px); }
/* Long underscore filenames are one unbreakable token; let them wrap instead
   of blowing out the card (and the page) on phones. */
.trash-item h2, .trash-item p, .trash-card-title, .dashboard-job h3, .jobhead h1, .attention-name { overflow-wrap:anywhere; }
.background-tool { grid-column:1/-1; }
.background-form-grid { display:grid; grid-template-columns:minmax(220px,1fr) minmax(220px,1fr) auto; align-items:end; gap:12px; }
.local-processing-note { grid-column:1/-1; margin:0; color:var(--muted); font-size:.8rem; }
.background-results { display:grid; gap:12px; margin-top:14px; }
.background-result { padding-top:14px; border-top:1px solid #eadfbe; }
.background-ready-copy { display:flex; align-items:center; gap:10px; margin-bottom:12px; padding:11px 13px; border:1px solid #bcd5b8; border-radius:12px; background:#edf6ea; color:#285325; }
.background-ready-copy > span { display:grid; place-items:center; width:28px; height:28px; flex:0 0 28px; border-radius:50%; background:#397236; color:white; font-weight:900; }
.background-ready-copy > div { display:grid; gap:2px; }
.background-ready-copy small { color:#567052; }
.separate-clip-warning { margin:8px 0 10px; color:var(--muted); font-size:.76rem; }
.background-result video { width:min(100%,320px); max-height:500px; border-radius:16px; background:#111; }
.background-progress { display:flex; align-items:center; gap:14px; padding:14px; border-radius:14px; background:#fffaf0; }
.background-progress > div { display:grid; flex:1; gap:5px; }
.background-progress progress { width:100%; accent-color:var(--gold); }
@media (max-width:760px) { .background-form-grid { grid-template-columns:1fr; } }
@media (max-width:560px) { .edit-target-banner { grid-template-columns:10px 1fr; } .edit-target-banner > a { grid-column:2; } }
.ai-image-generator[aria-busy="true"] { border-style:solid; border-color:#d9bd72; background:#fffdf6; }
.generation-progress-card { flex:1 0 100%; display:flex; align-items:center; gap:12px; padding:13px 15px; border:1px solid #e4d29c; border-radius:12px; background:#fffaf0; color:var(--ink); }
.generation-progress-card > span:last-child { display:grid; gap:3px; }
.generation-progress-card small { line-height:1.4; }
.generation-spinner { width:24px; height:24px; flex:0 0 24px; border:3px solid #eadfbe; border-top-color:#a47d22; border-radius:50%; animation:generation-spin .85s linear infinite; }
@keyframes generation-spin { to { transform:rotate(360deg); } }
.magnific-result img { width:100%; max-height:520px; object-fit:cover; border-radius:10px; }

/* Playbook (/guide) */
.guide-hero { display: grid; gap: 4px; margin: 0 0 28px; padding: 36px 0 14px; }
.guide-toc { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 0 0 26px; }
.guide-toc a { padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); font-weight: 750; font-size: .85rem; text-decoration: none; }
.guide-toc a:hover { border-color: var(--forest); }
.guide-section { margin: 0 0 22px; display: grid; gap: 4px; }
.guide-row { display: grid; grid-template-columns: 215px 1fr; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); }
.guide-row:first-of-type { border-top: 0; }
.guide-what { display: grid; gap: 4px; align-content: start; }
.guide-what small { color: var(--muted); font-size: .82rem; }
.guide-body p { margin: 0 0 8px; }
.guide-body p:last-child { margin: 0; }
.guide-example { padding: 10px 12px; border-radius: 10px; background: #fbf3dd; border-left: 3px solid var(--forest); font-size: .9rem; color: #4d3b18; }
.guide-magic { display: grid; gap: 8px; margin: 10px 0 14px; padding: 0; list-style: none; }
.guide-magic code { background: #eef2ed; border-radius: 6px; padding: 2px 7px; font-size: .85rem; }
@media (max-width: 760px) { .guide-row { grid-template-columns: 1fr; gap: 8px; } }

/* Gallery (/gallery) */
.gallery-upload-card { margin: 0 0 28px; }
.gallery-tools { display:grid; grid-template-columns:minmax(220px,1fr) minmax(180px,.35fr) auto auto; align-items:end; gap:12px; margin:0 0 24px; padding:14px; border:1px solid var(--line); border-radius:15px; background:#ffffff80; }
.gallery-tools label { margin:0; font-size:.74rem; }
.gallery-tools input,.gallery-tools select { margin-top:4px; }
.gallery-tools a { align-self:center; }
.asset-usage { color:var(--gold-dark); font-size:.72rem; font-weight:800; }
.asset-usage a { color:inherit; text-decoration:underline; text-underline-offset:2px; }
.asset-rename { width:100%; }
.asset-rename summary { cursor:pointer; color:var(--gold-dark); font-size:.76rem; font-weight:800; }
.asset-rename form { display:flex; gap:7px; margin-top:7px; }
.asset-rename input { min-width:0; margin:0; padding:9px; }
.asset-rename button { flex:none; }
.gallery-pagination { display:flex; align-items:center; justify-content:center; gap:14px; margin-top:22px; }
.gallery-pagination span { color:var(--muted); font-size:.8rem; font-weight:750; }
.gallery-upload-form { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 18px 22px; }
.gallery-drop { grid-column: 1 / -1; }
.gallery-file-preview { grid-column: 1 / -1; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: #15130f; }
.gallery-file-stage { display: grid; place-items: center; min-height: 220px; max-height: 420px; background: #111; }
.gallery-file-stage img, .gallery-file-stage video { display: block; width: 100%; max-height: 420px; object-fit: contain; }
.gallery-file-stage audio { width: min(100%, 420px); margin: 24px; }
.gallery-file-details { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; background: var(--card); }
.gallery-file-details > div { display: grid; gap: 2px; min-width: 0; }
.gallery-file-details strong, .gallery-file-details span { overflow-wrap: anywhere; }
@media (max-width: 640px) { .gallery-file-details { flex-direction: column; align-items: stretch; } }
.gallery-upload-fields { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; min-width: 0; }
.gallery-type-picker { grid-column: 1 / -1; margin: 0; padding: 0; border: 0; }
.gallery-type-picker legend { margin-bottom: 10px; font-size: .82rem; font-weight: 800; color: var(--ink); }
.gallery-type-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.gallery-type-option { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 14px; margin: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: #fffdf8; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s, transform .15s; min-height: 78px; }
.gallery-type-option:hover { border-color: #c9ae6a; transform: translateY(-1px); }
.gallery-type-option input { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }
.gallery-type-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: #f6ead0; color: var(--gold-dark); font-size: 1.2rem; font-weight: 900; flex: none; }
.gallery-type-copy { display: grid; gap: 2px; min-width: 0; }
.gallery-type-copy strong { font-size: .95rem; color: var(--ink); }
.gallery-type-copy small { color: var(--muted); font-size: .76rem; line-height: 1.4; font-weight: 500; }
.gallery-type-option:has(input:checked) { border-color: var(--forest); background: #fffdf2; box-shadow: 0 0 0 2px #c99a2d2c; }
.gallery-type-option:has(input:checked) .gallery-type-icon { background: var(--forest); color: white; }
.gallery-upload-form button { align-self: end; }
@media (max-width: 880px) { .gallery-type-options { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .gallery-upload-form { grid-template-columns: 1fr; align-items: stretch; }
  .gallery-upload-fields { flex-direction: column; align-items: stretch; }
  .gallery-type-options { grid-template-columns: 1fr; }
  .gallery-section-head { flex-direction: column; align-items: flex-start; }
  .gallery-section-stats { flex-direction: row; align-items: center; }
  .gallery-grid { grid-template-columns: 1fr; }
  .gallery-section-copy { gap: 12px; }
}
@media (max-width:760px) { .gallery-tools { grid-template-columns:1fr; } }
@media (max-width:760px) { .brand-kit-grid { grid-template-columns:1fr; } }
.supporting-visual-editor > summary small { color:var(--gold-dark); }
.gallery-section { margin: 0 0 30px; }
.gallery-category { padding: clamp(20px, 3vw, 30px); border-radius: 26px; background: #ffffff; border: 1px solid #e3d9c2; box-shadow: 0 18px 40px #6f511010; }
.gallery-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin: 0 0 22px; padding-bottom: 18px; border-bottom: 1px solid #ece2c8; }
.gallery-section-copy { display: flex; align-items: flex-start; gap: 14px; min-width: 0; }
.gallery-section-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 16px; background: #f6ead0; color: var(--gold-dark); font-size: 1.35rem; font-weight: 900; flex: none; }
.gallery-section-copy h2 { margin: 0 0 4px; font-size: clamp(1.35rem, 2.4vw, 1.7rem); }
.gallery-section-copy .muted { margin: 0; max-width: 680px; font-size: .92rem; }
.gallery-section-stats { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: none; }
.gallery-count, .gallery-default-summary { display: inline-flex; align-items: center; justify-content: center; min-height: 28px; padding: 5px 10px; border-radius: 999px; font-size: .7rem; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.gallery-count { background: #f5ebcc; color: var(--gold-dark); }
.gallery-default-summary { background: #edf4eb; color: #31533b; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.gallery-item { display: grid; grid-template-rows: auto 1fr; gap: 14px; padding: 14px; height: 100%; border-radius: 18px; box-shadow: 0 14px 28px #6f51100a; background: #fffdf8; }
.gallery-preview { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; border: 1px solid #ece2c8; border-radius: 14px; background: linear-gradient(180deg, #fbf7ef, #f1ecdf); overflow: hidden; }
.gallery-preview.is-audio { background: linear-gradient(160deg, #f6edcf, #f2e3b4); }
.gallery-preview img { display: block; width: 100%; height: 100%; object-fit: contain; padding: 10px; }
/* Photos and designs fill their frame (centre crop) so you can tell what
   she is picking; logos and brand marks are never cropped. */
.gallery-preview.preview-cover,
.gallery-preview.preview-end_card { aspect-ratio: 4 / 5; }
/* Upload pickers show real 9:16 video parts (intro / closing screen);
   gallery covers keep 4:5 for the feed crop. */
.upload-media-picker .gallery-preview.preview-end_card { aspect-ratio: 9 / 16; }
.gallery-preview.preview-image,
.gallery-preview.preview-ai_generated { aspect-ratio: 1 / 1; }
.gallery-preview.preview-cover img,
.gallery-preview.preview-end_card img,
.gallery-preview.preview-image img,
.gallery-preview.preview-ai_generated img { object-fit: cover; padding: 0; }
.gallery-preview video { display: block; width: 100%; height: 100%; object-fit: contain; background: #101510; }
.gallery-preview.is-video { background: #101510; }
.gallery-preview.is-zoomable { cursor: zoom-in; }
.gallery-preview.is-zoomable:focus-visible { outline: 3px solid var(--gold-dark); outline-offset: 2px; }
.gallery-preview-empty { color: #8a7350; font-size: .72rem; font-weight: 800; letter-spacing: .06em; }
.generated-item.is-failed { border-color: #f0c4b0; background: #fff8f5; }
.generated-item.is-pending { border-color: #e8dfc4; opacity: .96; }
.zoom-pill { position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 999px; background: #241d12cc; color: white; font-size: .64rem; font-weight: 800; letter-spacing: .05em; opacity: 0; transition: opacity .15s ease; pointer-events: none; }
.is-zoomable:hover .zoom-pill, .is-zoomable:focus-visible .zoom-pill { opacity: 1; }
@media (hover: none) { .zoom-pill { opacity: 1; } }

/* Enlarged media viewer with previous/next navigation */
body.is-lightbox-open { overflow: hidden; }
.lightbox { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 20px; background: #14100ae8; backdrop-filter: blur(4px); }
.lightbox[hidden] { display: none; }
.lightbox-stage { display: grid; gap: 12px; justify-items: center; margin: 0; max-width: min(92vw, 920px); }
.lightbox-media { display: grid; place-items: center; }
.lightbox-media img, .lightbox-media video { max-width: min(92vw, 920px); max-height: 74vh; border-radius: 14px; background: #000; object-fit: contain; }
.lightbox-caption { display: flex; align-items: baseline; justify-content: center; gap: 12px; color: #f3ecdb; font-size: .85rem; text-align: center; max-width: 90vw; }
.lightbox-caption span { color: #f3ecdb99; font-size: .74rem; font-weight: 700; white-space: nowrap; }
.lightbox-close { position: absolute; top: 14px; right: 14px; width: 46px; min-width: 46px; height: 46px; padding: 0; border-radius: 50%; background: #ffffff21; color: white; font-size: 1.05rem; }
.lightbox-close:hover { background: #ffffff3d; }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 54px; min-width: 54px; height: 54px; padding: 0; border-radius: 50%; background: #ffffff21; color: white; font-size: 2.1rem; line-height: 1; }
.lightbox-nav:hover { background: #ffffff3d; }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox-nav[hidden] { display: none; }
@media (max-width: 640px) {
  .lightbox { padding: 12px; align-items: flex-start; padding-top: 64px; }
  .lightbox-media img, .lightbox-media video { max-height: 62vh; }
  .lightbox-nav { top: auto; bottom: 96px; transform: none; }
  .lightbox-prev { left: 10px; }
  .lightbox-next { right: 10px; }
}
.gallery-audio-preview { display: grid; justify-items: center; gap: 8px; text-align: center; color: var(--gold-dark); }
.gallery-audio { font-size: 2.3rem; color: var(--forest); }
.gallery-audio-preview small { font-size: .76rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.default-badge { position: absolute; top: 10px; left: 10px; padding: 4px 9px; border-radius: 999px; background: var(--forest); color: white; font-size: .62rem; font-weight: 900; letter-spacing: .08em; }
.gallery-item.is-default { border-color: var(--forest); box-shadow: 0 0 0 2px #c99a2d2c, 0 14px 28px #6f51100a; }
.gallery-item-body { display: grid; grid-template-rows: auto auto 1fr; gap: 6px; font-size: .85rem; min-width: 0; }
.gallery-item-body strong { line-height: 1.35; min-height: 2.7em; word-break: break-word; }
/* Long prompts: three readable lines, expandable in place with More/Less so
   nothing stays cut off on a phone. */
.clamp-body { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; word-break: break-word; }
.clamp-body.is-expanded { display: block; overflow: visible; }
.clamp-toggle { min-height: 0; padding: 3px 0; background: none; color: var(--gold-dark); font-size: .72rem; font-weight: 800; text-decoration: underline; }
.clamp-toggle:hover { background: none; color: var(--gold-dark); }
.gallery-size { color: var(--muted); font-size: .76rem; font-weight: 700; }
.gallery-item-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; padding-top: 12px; border-top: 1px solid #ece2c8; }
.gallery-move-form { display: flex; align-items: center; gap: 6px; margin: 0; }
.gallery-move-form select { width: auto; margin: 0; min-height: 36px; padding: 6px 8px; font-size: .74rem; border-radius: 9px; }
.gallery-page-form { display: flex; align-items: center; margin: 0; }
.gallery-page-form label { margin: 0; }
.gallery-page-form select { width: auto; max-width: 150px; margin: 0; min-height: 36px; padding: 6px 8px; font-size: .74rem; border-radius: 9px; }
.gallery-item-actions form { margin: 0; }
.gallery-item-actions button, .gallery-item-actions a { min-height: 36px; padding: 8px 10px; font-size: .74rem; border-radius: 9px; }
.gallery-item-actions audio { width: 100%; height: 36px; margin: 8px 0 0; }
.gallery-empty-state { margin: 0 0 30px; padding: clamp(24px, 4vw, 40px); text-align: center; }
.gallery-empty-state h2 { margin: 0 0 6px; }
.gallery-empty-state .muted { margin: 0; }
@media (max-width: 640px) {
  .gallery-upload-form { grid-template-columns: 1fr; align-items: stretch; }
  .gallery-section-head { flex-direction: column; align-items: flex-start; }
  .gallery-section-stats { flex-direction: row; align-items: center; }
  .gallery-grid { grid-template-columns: 1fr; }
  .gallery-section-copy { gap: 12px; }
}

/* Transcript lab — review & fix what BR heard before re-sending to the AI. */
.transcript-lab { margin: 14px 0; }
.transcript-intro { max-width: 72ch; }
.transcript-lab > summary { display: grid; gap: 3px; cursor: pointer; list-style: none; }
.transcript-lab > summary::-webkit-details-marker { display: none; }
.transcript-lab > summary::after { content: "▾"; justify-self: end; color: var(--muted); }
.transcript-lab[open] > summary::after { content: "▴"; }
.transcript-summary-title { font-weight: 800; font-size: .95rem; }
.transcript-summary-title small { color: var(--muted); font-weight: 600; }
.transcript-intro { margin: 10px 0 12px; }
.transcript-tools { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.transcript-search { flex: 1; min-width: 200px; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper, #fff); }
.transcript-edited-count { font-size: .75rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.transcript-rows { display: grid; gap: 6px; max-height: 420px; overflow: auto; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper, #fff); }
.seg-row { display: grid; grid-template-columns: 52px 1fr; gap: 8px; align-items: start; }
.seg-time { font: 600 .72rem/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); padding-top: 8px; text-align: right; }
.seg-row textarea { width: 100%; font: inherit; font-size: .84rem; line-height: 1.5; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: transparent; resize: vertical; }
.seg-row.seg-edited textarea { border-color: var(--forest, #6b8f45); background: rgba(217, 239, 89, .14); }
.transcript-form .button-wide { margin-top: 12px; }

/* Complete capability legend beside the revision instruction box */
.revision-legend { margin: 10px 0 12px; border: 1px solid rgba(28,25,23,.14); border-radius: 10px; padding: 10px 14px; background: rgba(255,255,255,.5); }
.revision-legend summary { cursor: pointer; font-weight: 600; }
.revision-legend summary span { display: inline-block; transition: transform .15s ease; }
.revision-legend[open] summary span { transform: rotate(180deg); }
.revision-legend[open] summary { margin-bottom: 10px; }
.legend-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(250px,1fr)); gap: 12px 24px; }
.legend-grid h4 { margin: 0 0 4px; font-size: .76rem; letter-spacing: .07em; text-transform: uppercase; opacity: .7; }
.legend-grid ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.legend-grid li { font-size: .9rem; line-height: 1.45; }
.revision-legend > .muted { margin: 12px 0 0; font-size: .84rem; }

/* Timeline aids: spoken phrase under the scrubber and a strip that shows
   where the new cutaway lands against the visuals already in the Reel. */
.timeline-video-wrap { display: grid; gap: 8px; min-width: 0; }
.timeline-insert-strip { position: relative; height: 32px; border: 1px solid var(--line); border-radius: 8px; background: #f2ecdc; overflow: hidden; }
.timeline-insert-strip small { position: absolute; left: 7px; top: 50%; transform: translateY(-50%); z-index: 3; font-size: .56rem; font-weight: 900; letter-spacing: .09em; color: var(--muted); pointer-events: none; }
.timeline-insert-strip div { position: absolute; inset: 0; }
.timeline-insert-strip div b { position: absolute; top: 5px; bottom: 5px; border-radius: 5px; background: #b3a888; }
.timeline-insert-strip i { position: absolute; top: 4px; bottom: 4px; z-index: 2; border-radius: 5px; background: var(--gold-brand); box-shadow: 0 0 0 2px #c99a2d45; }
.timeline-phrase { margin: 0; padding: 8px 11px; border-left: 3px solid var(--acid); border-radius: 0 9px 9px 0; background: #fffdf8; font-family: Georgia, serif; font-size: .88rem; line-height: 1.45; color: var(--ink); }

/* Mini-editor extras: honest framing diagram, overlay preview, chips. */
.framing-preview { display: grid; gap: 6px; }
.framing-frame { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; border-radius: 10px; background: radial-gradient(circle at 50% 30%, #cfd8cc, #96a196 70%); overflow: hidden; }
.framing-frame i { position: absolute; border: 2px dashed #ffffffcc; border-radius: 6px; transition: inset .25s ease; inset: 18%; }
.framing-preview[data-mode="tighter"] i { inset: 6%; }
.framing-preview[data-mode="wider"] i { inset: 30%; }
.framing-preview[data-mode="nozooms"] i { border-style: solid; inset: 12%; }
.framing-preview small { color: var(--muted); font-size: .72rem; font-weight: 700; }
.overlay-stage { position: relative; display: grid; place-items: start center; aspect-ratio: 16 / 9; padding-top: 14px; border-radius: 10px; background: linear-gradient(165deg, #b8c8be, #727c76 55%, #313933); overflow: hidden; }
.overlay-stage span { padding: 5px 12px; border-radius: 7px; background: #000000b3; color: white; font-weight: 900; letter-spacing: .06em; text-shadow: 0 2px 3px #000; }
.advanced-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.advanced-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 6px 4px 10px; border: 1px solid #e4d9bd; border-radius: 999px; background: #fff8dd; font-size: .72rem; font-weight: 700; color: #58451e; }
.advanced-chip button { min-height: 0; flex: none; width: 19px; height: 19px; padding: 0; border-radius: 50%; background: #e7dbb8; color: #58451e; font-size: .78rem; line-height: 1; }
.advanced-chip button:hover { background: #dcc98f; }
.advanced-summary-actions { display: flex; flex-direction: column; gap: 8px; justify-content: flex-end; }
@media (max-width: 640px) { .advanced-editor-grid { grid-template-columns: 1fr; } }

/* Phones: every control reads at 16px (iOS zooms in below that) and prompt
   boxes get real reading room instead of a three-line slit. Kept last so it
   wins the cascade over the component rules above. */
@media (max-width: 640px) {
  input, select, textarea,
  .candidate textarea, .seg-row textarea, .gallery-move-form select, .gallery-page-form select,
  .ai-shot-form select, .ai-shot-form textarea, .transcript-search,
  .project-folder-form select, .library-tools select, .upload-folder-choice select,
  .corner-choice select, .inline-advanced select, .ai-shot-actions label select,
  .drop input, .file-choice input {
    font-size: 16px;
  }
  textarea, .seg-row textarea { min-height: 120px; }
  .gallery-item-body strong { min-height: 4em; }
}

/* Settings · API keys */
.api-key-card { margin-bottom: 18px; }
.api-key-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.api-key-head .muted { margin: 0; max-width: 56ch; }
.api-key-status { margin: 0; display: flex; align-items: center; gap: 8px; font-weight: 700; }
.api-key-status.success { color: var(--forest, #2f6b46); }
.api-key-status code { font-size: .95rem; letter-spacing: .06em; background: var(--line, #e7e0d2); border-radius: 8px; padding: 3px 8px; }
.api-key-actions { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-top: 16px; }
.api-key-form { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.api-key-form label { display: grid; gap: 6px; font-size: .82rem; font-weight: 700; }
.api-key-form input { min-width: 260px; }

/* Upload form · video designs (intro / animated closing) */
.thumb-media-video { position: relative; padding: 0; background: #101510; }
.thumb-picker-covers .thumb-media-video video { width: 100%; height: 100%; object-fit: cover; }
.thumb-video-badge { position: absolute; left: 6px; bottom: 6px; font-size: .62rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; background: #101510d9; color: #fff; border-radius: 7px; padding: 2px 7px; }
.choice-hint { display: block; margin-top: 8px; color: var(--muted); font-size: .76rem; line-height: 1.4; }
.transition-demo-a, .transition-demo-b { position: absolute; inset: 0; }
.transition-demo-a { background: linear-gradient(#f6e7c1 0 40%, #7fb08a 40% 100%); }
.transition-demo-b { background: linear-gradient(#d7e8ff 0 45%, #946b16 45% 100%); }
.transition-demo-auto .transition-demo-b { animation: br-trans-auto 2.4s ease infinite; }
.transition-demo-instant_cut .transition-demo-b { animation: br-trans-cut 2.2s steps(1) infinite; }
.transition-demo-cross_zoom .transition-demo-b { animation: br-trans-zoom 2.4s ease infinite; }
.transition-demo-soft_dissolve .transition-demo-b { animation: br-trans-dissolve 2.6s ease infinite; }
.transition-demo-blur_flash .transition-demo-b { animation: br-trans-flash 2.2s ease infinite; }
.transition-demo-none .transition-demo-b { opacity: 0; }
@keyframes br-trans-auto { 0%, 40% { opacity: 0; transform: scale(1); } 55% { opacity: 1; transform: scale(1.022); } 100% { opacity: 1; transform: scale(1); } }
@keyframes br-trans-cut { 0%, 45% { opacity: 0; } 50%, 100% { opacity: 1; } }
@keyframes br-trans-zoom { 0%, 30% { opacity: 0; transform: scale(.86); } 100% { opacity: 1; transform: scale(1.12); } }
@keyframes br-trans-dissolve { 0%, 25% { opacity: 0; } 100% { opacity: 1; } }
@keyframes br-trans-flash { 0%, 40% { opacity: 0; transform: scale(1); filter: brightness(1); } 50% { opacity: 1; transform: scale(1.06); filter: brightness(2.2) blur(1.5px); } 100% { opacity: 1; transform: scale(1.02); filter: brightness(1); } }

/* Upload form · opening effect picker */
.entry-effect-choice { border: 0; padding: 0; margin: 0 0 4px; }
.entry-effect-choice > legend { font-size: .8rem; font-weight: 800; letter-spacing: .02em; padding: 0; margin-bottom: 8px; }
.entry-effect-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; }
.entry-effect-option { position: relative; display: grid; gap: 6px; justify-items: center; text-align: center; padding: 10px 8px; border: 2px solid var(--line); border-radius: 14px; background: var(--card); cursor: pointer; }
/* Visually hidden but focusable: a bare absolutely-positioned radio escapes
   its card when no ancestor is positioned and stretches the page sideways. */
.entry-effect-option input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; margin: -1px; }
.entry-effect-option:has(> input:checked) { border-color: var(--forest); box-shadow: 0 0 0 3px #c99a2d35; }
.entry-effect-option strong { font-size: .82rem; }
.entry-effect-option small { font-size: .7rem; color: var(--muted); line-height: 1.25; }
/* The demo is a tiny landscape photo that moves INSIDE a fixed frame, so
   every effect reads as a distinct camera move instead of a resizing tile. */
.entry-effect-demo { width: 52px; height: 82px; border-radius: 10px; overflow: hidden; position: relative; background: #101510; border: 1px solid #0002; }
.entry-demo-inner { position: absolute; inset: -14%; width: 128%; height: 128%; border-radius: 0; background: linear-gradient(#f6e7c1 0 30%, #7fb08a 30% 68%, #2f6b46 68% 100%); }
.entry-demo-inner::after { content: ""; position: absolute; left: 58%; top: 14%; width: 14px; height: 14px; border-radius: 50%; background: #e6b23c; }
.entry-demo-none .entry-demo-inner { animation: br-demo-none 2.4s steps(1) infinite; }
.entry-demo-fade .entry-demo-inner { animation: br-demo-fade 2.4s ease infinite; }
.entry-demo-flash.entry-effect-demo { animation: br-demo-flash 2.4s ease-out infinite; background: #fff; }
.entry-demo-zoom_in .entry-demo-inner { animation: br-demo-zoom-in 2.4s ease-out infinite alternate; }
.entry-demo-zoom_out .entry-demo-inner { animation: br-demo-zoom-out 2.4s ease-out infinite alternate; }
.entry-demo-punch .entry-demo-inner { animation: br-demo-punch 2.4s cubic-bezier(.2,.9,.3,1) infinite alternate; }
.entry-demo-spring .entry-demo-inner { animation: br-demo-spring 2.6s ease-out infinite; }
.entry-demo-zoom_up .entry-demo-inner { animation: br-demo-zoom-up 2.4s ease-out infinite; }
.entry-demo-drop_in .entry-demo-inner { animation: br-demo-drop-in 2.4s ease-out infinite; }
.entry-demo-slide_left .entry-demo-inner { animation: br-demo-slide-left 2.4s ease-out infinite; }
.entry-demo-slide_right .entry-demo-inner { animation: br-demo-slide-right 2.4s ease-out infinite; }
.entry-demo-swing .entry-demo-inner { animation: br-demo-swing 2.4s ease-out infinite; }
.entry-demo-fit_in .entry-effect-demo { background: #000; }
.entry-demo-fit_in .entry-demo-inner { inset: 14% 22%; width: auto; height: auto; animation: br-demo-fit-in 2.6s ease-out infinite; }
@keyframes br-demo-none { 0%, 14% { opacity: 0; } 18%, 100% { opacity: 1; } }
@keyframes br-demo-fade { 0% { opacity: 0; } 38%, 100% { opacity: 1; } }
@keyframes br-demo-flash { 0% { filter: brightness(4); } 30%, 100% { filter: brightness(1); } }
@keyframes br-demo-zoom-in { 0% { transform: scale(1); } 100% { transform: scale(1.18); } }
@keyframes br-demo-zoom-out { 0% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes br-demo-punch { 0% { transform: scale(1.18); } 20%, 100% { transform: scale(1); } }
@keyframes br-demo-spring { 0% { transform: scale(1.18); } 30% { transform: scale(.97); } 55% { transform: scale(1.04); } 75%, 100% { transform: scale(1); } }
@keyframes br-demo-zoom-up { 0% { transform: translateY(9%) scale(1.18); } 100% { transform: translateY(0) scale(1); } }
@keyframes br-demo-drop-in { 0% { transform: translateY(-9%) scale(1.18); } 100% { transform: translateY(0) scale(1); } }
@keyframes br-demo-slide-left { 0% { transform: translateX(-9%) scale(1.18); } 100% { transform: translateX(0) scale(1); } }
@keyframes br-demo-slide-right { 0% { transform: translateX(9%) scale(1.18); } 100% { transform: translateX(0) scale(1); } }
@keyframes br-demo-swing { 0% { transform: rotate(7deg) scale(1.22); } 100% { transform: rotate(0) scale(1); } }
@keyframes br-demo-fit-in { 0% { transform: scale(1); } 55%, 100% { transform: scale(1.55); } }
/* The same moves played once on her loaded video */
.video-preview-frame.entry-play-none { animation: br-entry-none 2.4s steps(1) 1; }
.video-preview-frame.entry-play-fade { animation: br-entry-fade 1.6s ease 1; }
.video-preview-frame.entry-play-flash { animation: br-entry-flash 1.2s ease-out 1; }
.video-preview-frame.entry-play-zoom_in { animation: br-entry-zoom-in-video 1.6s ease-out 1 forwards; }
.video-preview-frame.entry-play-zoom_out { animation: br-entry-zoom-out-video 1.6s ease-out 1 forwards; }
.video-preview-frame.entry-play-punch { animation: br-entry-punch-video 0.9s cubic-bezier(.2,.9,.3,1) 1 forwards; }
.video-preview-frame.entry-play-spring { animation: br-entry-spring-video 1.4s ease-out 1 forwards; }
.video-preview-frame.entry-play-zoom_up { animation: br-entry-move-video 1.6s ease-out 1 forwards; --move-from: translateY(7%); }
.video-preview-frame.entry-play-drop_in { animation: br-entry-move-video 1.6s ease-out 1 forwards; --move-from: translateY(-7%); }
.video-preview-frame.entry-play-slide_left { animation: br-entry-move-video 1.6s ease-out 1 forwards; --move-from: translateX(-7%); }
.video-preview-frame.entry-play-slide_right { animation: br-entry-move-video 1.6s ease-out 1 forwards; --move-from: translateX(7%); }
.video-preview-frame.entry-play-swing { animation: br-entry-swing-video 1.6s ease-out 1 forwards; }
.video-preview-frame.entry-play-fit_in { animation: br-entry-fit-in-video 1.8s ease-out 1 forwards; }
@keyframes br-entry-none { 0%, 15% { opacity: 0; } 20%, 100% { opacity: 1; } }
@keyframes br-entry-fade { 0% { opacity: 0; } 35%, 100% { opacity: 1; } }
@keyframes br-entry-flash { 0% { filter: brightness(3.5); } 100% { filter: brightness(1); } }
@keyframes br-entry-zoom-in-video { from { transform: scale(1); } to { transform: scale(1.06); } }
@keyframes br-entry-zoom-out-video { from { transform: scale(1.1); } to { transform: scale(1); } }
@keyframes br-entry-punch-video { from { transform: scale(1.1); } to { transform: scale(1); } }
@keyframes br-entry-spring-video { 0% { transform: scale(1.1); } 40% { transform: scale(.99); } 65% { transform: scale(1.015); } 100% { transform: scale(1); } }
@keyframes br-entry-move-video { from { transform: var(--move-from) scale(1.16); } to { transform: translate(0, 0) scale(1); } }
@keyframes br-entry-swing-video { from { transform: rotate(4deg) scale(1.16); } to { transform: rotate(0) scale(1); } }
@keyframes br-entry-fit-in-video { from { transform: scale(.62); } to { transform: scale(1); } }
.sticker-stage{position:relative;width:100%;max-width:300px;margin:0 auto;aspect-ratio:9/16;overflow:hidden;border-radius:.5em;background:#111}
.sticker-stage video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.sticker{position:absolute;touch-action:none;cursor:move;border:1px dashed rgba(255,255,255,.65);border-radius:.25em}
.sticker img{display:block;width:100%;height:auto;pointer-events:none}
.sticker-resize{position:absolute;right:-8px;bottom:-8px;width:18px;height:18px;border-radius:50%;background:#ffd60a;cursor:nwse-resize}
.sticker-add-form .sticker-suggestion-row{display:flex;gap:.6em;flex-wrap:wrap}
.dropzone{border:1px dashed rgba(0,0,0,.25);border-radius:.5em;padding:.8em;margin:.6em 0}
.dropzone.is-dragover{border-color:#0a84ff;background:rgba(10,132,255,.06)}

/* ---------- Studio timeline editor (CapCut-style) ---------- */
.studio-app{display:flex;flex-direction:column;gap:.8rem;margin:0 calc(-1 * clamp(.6rem, 3vw, 2.2rem))}
.studio-topbar{display:flex;align-items:center;gap:.9rem;flex-wrap:wrap}
.studio-topbar h1{font-size:1.15rem;margin:0}
.studio-back{font-size:1.3rem;text-decoration:none;padding:.2em .5em;border-radius:.4em;background:rgba(0,0,0,.06)}
.studio-title{display:flex;flex-direction:column;min-width:0}
.studio-title small{color:rgba(0,0,0,.55)}
.studio-save{margin-left:auto;font-size:.85rem;color:#3f6f3f;transition:color .2s}
.studio-save.studio-save-error{color:#b3261e;font-weight:600}
.studio-topbar-actions{display:flex;gap:.5rem;align-items:center;flex-wrap:wrap}
.studio-body{display:grid;grid-template-columns:minmax(190px,240px) 1fr;gap:.8rem;align-items:start}
.studio-media{display:flex;flex-direction:column;gap:.5rem;background:var(--card);border:1px solid var(--line);border-radius:1em;padding:.8rem;position:sticky;top:.8rem}
.studio-media .eyebrow{margin:.2rem 0 .3rem}
.studio-media-item{display:flex;align-items:center;gap:.6rem;background:#fbf8f0;border:1px solid var(--line);border-radius:.6em;padding:.45rem .55rem;color:var(--ink);width:100%;min-width:0;text-align:left}
button.studio-media-item{cursor:pointer}
.studio-media-item:hover{border-color:var(--forest)}
.studio-media-thumb{flex:0 0 44px;height:44px;border-radius:.35em;background:#efe9da center/cover no-repeat;overflow:hidden;display:flex;align-items:center;justify-content:center;color:#8a8578;font-size:1.1rem}
.studio-media-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.studio-media-label{min-width:0;display:flex;flex-direction:column}
.studio-media-label strong{font-size:.85rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.studio-media-label small{color:#57534a;font-size:.72rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.studio-media-actions{margin-left:auto;display:flex;flex-direction:column;gap:.25rem}
.studio-media-actions button{font-size:.7rem;padding:.25em .5em;border-radius:.4em;border:1px solid #aeb3ad;background:#fff;color:var(--ink);cursor:pointer;white-space:nowrap}
.studio-media-actions button:hover{border-color:var(--forest);color:var(--forest-dark)}
.studio-media-more{color:#57534a;font-size:.78rem}
.studio-main{display:flex;flex-direction:column;gap:.7rem;min-width:0}
/* The video well and the timeline strip stay dark on purpose: footage and
   overlays are judged against a neutral dark surround, like the legacy
   sticker stage already was inside this light site. */
.studio-stage-wrap{display:flex;justify-content:center;background:#101014;border-radius:.8em;padding:1rem}
.studio-stage{position:relative;background:#000;border-radius:.5em;overflow:hidden;aspect-ratio:var(--stage-ratio, 9/16);max-height:56vh;max-width:100%;touch-action:none}
.studio-stage .studio-media-layer{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;display:none;background:#000}
.studio-stage .studio-media-layer.active{display:block}
.studio-stage .sticker{transform:translate(-50%,-50%)}
.studio-stage .sticker.selected{border-color:#ffd60a}
.studio-transport{display:flex;align-items:center;gap:.8rem;flex-wrap:wrap;background:var(--card);border:1px solid var(--line);color:var(--ink);border-radius:.8em;padding:.55rem .8rem}
.studio-play{width:2.4em;height:2.4em;border-radius:50%;border:0;background:#ffd60a;color:#101014;font-size:1rem;cursor:pointer;flex:0 0 auto}
.studio-time{font-variant-numeric:tabular-nums;font-size:.85rem;color:#57534a;min-width:11ch}
.studio-transport-tools,.studio-zoom{display:flex;gap:.4rem}
.studio-timeline{background:#101014;border-radius:.8em;padding:.7rem .8rem .6rem;color:#f4f1ea}
.studio-timeline-hint{margin:.5rem 0 0;color:#9a968b;font-size:.75rem}
.tl-scroll{overflow-x:auto;overscroll-behavior-x:contain;cursor:crosshair}
.tl-inner{position:relative;min-width:100%}
.tl-ruler{position:relative;height:26px;border-bottom:1px solid #2c2c36;touch-action:none}
.tl-tick{position:absolute;bottom:0;width:1px;height:6px;background:#4a4a58}
.tl-tick.major{height:12px;background:#6f6f7d}
.tl-tick.major::after{content:attr(data-label);position:absolute;bottom:11px;left:3px;font-size:.8125rem;color:#9a968b;white-space:nowrap}
.tl-track{position:relative;height:60px;margin-top:6px;background:repeating-linear-gradient(90deg,#16161c 0 2px,#14141a 2px 76px);border-radius:.4em;touch-action:none}
.tl-overlay{height:34px;background:repeating-linear-gradient(90deg,#141a16 0 2px,#121713 2px 76px)}
.tl-clip,.tl-sticker{position:absolute;top:4px;bottom:4px;border-radius:.4em;background:#2b3a55;border:1px solid #45608c;overflow:hidden;cursor:grab;touch-action:none;user-select:none}
.tl-clip.selected,.tl-sticker.selected{border-color:#ffd60a;box-shadow:0 0 0 1px #ffd60a}
.tl-clip.dragging{opacity:.75;z-index:5;cursor:grabbing}
.tl-thumb{position:absolute;inset:0;background:center/cover no-repeat;opacity:.85}
.tl-label{position:absolute;left:4px;top:3px;z-index:1;padding:2px 4px;border-radius:3px;background:#101014e8;font-size:.8125rem;color:#e8e6df;text-shadow:0 1px 2px rgba(0,0,0,.9);pointer-events:none;max-width:calc(100% - 10px);white-space:nowrap;overflow:hidden;text-orientation:mixed}
.tl-label small{display:block;color:#c9c5ba}
.tl-sticker{background:#1f3a2b;border-color:#2f6b45;color:#bfe8cd;font-size:.8125rem;display:flex;align-items:center;padding-left:6px}
.tl-handle{position:absolute;top:0;bottom:0;width:10px;cursor:ew-resize;touch-action:none}
.tl-handle-l{left:0}.tl-handle-r{right:0}
.tl-handle::after{content:"";position:absolute;top:22%;bottom:22%;width:3px;border-radius:2px;background:rgba(255,255,255,.75)}
.tl-handle-l::after{left:3px}.tl-handle-r::after{right:3px}
.tl-handle.disabled{visibility:hidden}
.tl-playhead{position:absolute;top:0;bottom:0;width:2px;background:#ff5d5d;pointer-events:none;z-index:6}
.tl-playhead::before{content:"";position:absolute;top:0;left:-5px;border:6px solid transparent;border-top-color:#ff5d5d}
body.studio-dragging{user-select:none;cursor:grabbing}
body.studio-dragging .tl-scroll{cursor:grabbing}
@media (max-width:900px){
  .studio-body{grid-template-columns:1fr}
  .studio-media{position:static;flex-direction:row;flex-wrap:wrap}
  .studio-media-item{width:auto;flex:1 1 200px}
  .studio-media .eyebrow,.studio-media-more{width:100%}
}

/* ---------- Highlight sticker editor (Studio-style) ---------- */
.hl-editor{display:flex;flex-direction:column;gap:.6rem;padding:.6rem 0 .2rem}
.hl-toolbar{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}
.hl-play{width:2.2em;height:2.2em;border-radius:50%;border:0;background:#ffd60a;color:#101014;font-size:.9rem;cursor:pointer;flex:0 0 auto}
.hl-time{font-variant-numeric:tabular-nums;font-size:.8rem;color:#57534a;min-width:11ch}
.hl-status{margin-left:auto;font-size:.875rem;color:var(--dark-success)}
.hl-status.hl-status-error{color:var(--dark-error);font-weight:600}
.hl-render-status{font-size:.78rem;color:#8a8578}
.hl-render-status.hl-render-busy{color:var(--dark-action)}
.hl-timeline{background:#101014;border-radius:.6em;padding:.5rem .5rem .4rem}
.hl-timeline .tl-scroll{cursor:crosshair}
.hl-editor .sticker{transform:translate(-50%,-50%)}
.hl-editor .sticker.selected{border-color:#ffd60a}
.hl-media{display:flex;gap:.5rem;flex-wrap:wrap}
.hl-asset{display:flex;align-items:center;gap:.45rem;background:#f4f0e6;border:1px solid rgba(0,0,0,.14);border-radius:.55em;padding:.3rem .5rem .3rem .3rem;cursor:pointer;max-width:210px;text-align:left}
.hl-asset:hover{border-color:#0a84ff}
.hl-asset-thumb{flex:0 0 36px;height:36px;border-radius:.35em;background:#e6e0d2 center/cover no-repeat;overflow:hidden}
.hl-asset-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.hl-asset-name{font-size:.8125rem;min-width:0;overflow-wrap:anywhere;white-space:normal}
.hl-asset-name small{color:#8a8578}
.hl-asset-add{font-size:1rem;color:#0a84ff;font-weight:700}

/* ---------- Studio home: the same warm editorial system as Projects/Create ---------- */
.studio-home{min-height:72vh;margin:0;gap:clamp(2rem,5vw,4rem)}
.studio-home-head{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(340px,.95fr);gap:clamp(2rem,6vw,5rem);align-items:center;padding:24px 0 34px}
.studio-home-head h1{max-width:690px;margin:.12em 0 .24em;font-size:clamp(2.8rem,6vw,5.25rem)}
.studio-home-head h1 em{color:var(--gold);font-style:italic}
.studio-home-copy .lede{max-width:610px;margin-bottom:24px}
.studio-home-points{display:flex;gap:10px;flex-wrap:wrap}
.studio-home-points span{display:inline-flex;align-items:center;gap:8px;padding:8px 11px;border:1px solid var(--line);border-radius:999px;background:#fffdf899;color:var(--muted);font-size:.76rem;font-weight:750}
.studio-home-points b{color:var(--gold-dark);font-size:.66rem;letter-spacing:.08em}
.studio-home-visual{padding:18px;border:1px solid #ffffff75;border-radius:28px;background:linear-gradient(145deg,#eadbb7,#c99b3e);box-shadow:0 30px 70px #6f511020;transform:rotate(1.25deg)}
.studio-visual-window{overflow:hidden;border:1px solid #ffffff24;border-radius:17px;background:#161512;box-shadow:0 22px 45px #241d1266;transform:rotate(-1.25deg)}
.studio-visual-top{display:flex;align-items:center;gap:6px;height:38px;padding:0 12px;border-bottom:1px solid #ffffff14;color:#c7bfae;font-size:.63rem;font-weight:750;letter-spacing:.06em;text-transform:uppercase}
.studio-visual-top i{width:7px;height:7px;border-radius:50%;background:#5b554a}.studio-visual-top i:first-child{background:#b3821a}.studio-visual-top span{margin-left:auto}
.studio-visual-canvas{display:grid;place-items:center;position:relative;height:245px;background:radial-gradient(circle at 50% 40%,#3a352c,#1d1b17 64%)}
.studio-visual-canvas>b{position:absolute;right:12px;bottom:10px;color:#8f887b;font-size:.62rem}
.studio-visual-frame{display:block;position:relative;width:104px;height:185px;overflow:hidden;border:2px solid #d7b458;border-radius:7px;background:linear-gradient(160deg,#8d7656,#332e28 58%,#171614);box-shadow:0 14px 30px #0008}
.studio-visual-frame::before{content:"";position:absolute;top:31px;left:31px;width:42px;height:42px;border-radius:50%;background:#d7bda0}
.studio-visual-frame::after{content:"";position:absolute;left:20px;right:20px;bottom:30px;height:68px;border-radius:40px 40px 8px 8px;background:#4a3c30}
.studio-visual-frame i{position:absolute;z-index:2;left:10px;right:10px;bottom:18px;height:8px;border-radius:4px;background:#f5f1e8;box-shadow:0 -12px 0 #d7b458}
.studio-visual-timeline{position:relative;height:112px;padding:22px 14px 12px;border-top:1px solid #ffffff12;background:#11110f}
.studio-visual-ruler{display:block;height:1px;margin-bottom:9px;background:repeating-linear-gradient(90deg,#777166 0 1px,transparent 1px 28px)}
.studio-visual-track,.studio-visual-overlay{display:flex;height:31px;gap:3px;margin-bottom:5px}
.studio-visual-track i{display:block;border:1px solid #6f5a25;border-radius:4px;background:linear-gradient(90deg,#80641e,#a68332)}
.studio-visual-track i:nth-child(1){width:34%}.studio-visual-track i:nth-child(2){width:21%}.studio-visual-track i:nth-child(3){flex:1}
.studio-visual-overlay i{display:block;width:47%;height:20px;border:1px solid #435f49;border-radius:4px;background:#253c2b}
.studio-visual-playhead{position:absolute;top:15px;bottom:8px;left:58%;width:2px;background:#ead16f;box-shadow:0 0 8px #ead16f88}
.studio-visual-playhead::before{content:"";position:absolute;top:0;left:-4px;border:5px solid transparent;border-top-color:#ead16f}
.studio-new{padding:clamp(20px,4vw,34px);border-radius:26px}
.studio-new-head,.studio-edits-head{display:flex;align-items:end;justify-content:space-between;gap:20px;margin-bottom:22px}
.studio-new-head h2,.studio-edits-head h2{margin:0;font:700 clamp(1.55rem,3vw,2.15rem)/1.1 Georgia,serif}
.studio-private-note{display:inline-flex;align-items:center;gap:8px;color:var(--muted);font-size:.75rem;font-weight:750;white-space:nowrap}
.studio-private-note i{width:8px;height:8px;border-radius:50%;background:#c99a2d;box-shadow:0 0 0 5px #c99a2d24}
.studio-new-form{display:grid;grid-template-columns:minmax(280px,1.12fr) minmax(280px,.88fr);gap:clamp(20px,4vw,42px);align-items:stretch}
.studio-dropzone{position:relative;min-height:330px;padding:0;border:2px dashed #c8b98f;border-radius:18px;background:linear-gradient(145deg,#fbf8f0,#f5ecda);text-align:center;transition:border-color .18s,background .18s,box-shadow .18s}
.studio-dropzone-label{display:flex;height:100%;min-height:326px;align-items:center;justify-content:center;flex-direction:column;padding:28px;cursor:pointer}
.studio-dropzone input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}
.studio-upload-icon{display:grid;place-items:center;width:58px;height:58px;margin-bottom:17px;border-radius:50%;background:var(--gold);color:#fff;font-size:1.7rem;font-weight:500;box-shadow:0 10px 24px #946b1630}
.studio-dropzone strong{font:700 1.45rem Georgia,serif}.studio-dropzone-label>span:not(.studio-upload-icon){margin-top:4px;color:var(--muted);font-size:.86rem}
.studio-dropzone small{max-width:270px;margin-top:12px;color:var(--muted);font-size:.8125rem;line-height:1.45}
.studio-dropzone:hover,.studio-dropzone.is-dragover{border-color:var(--gold);background:#fff8e5;box-shadow:0 0 0 4px #c99a2d22}
.studio-new-fields{display:flex;flex-direction:column;gap:14px;min-width:0}
.studio-field{display:flex;flex-direction:column;gap:6px;color:var(--ink);font-size:.8rem;font-weight:800}
.studio-field small{color:var(--muted);font-size:.8125rem;font-weight:500}
.studio-new-fields input,.studio-new-fields select{width:100%;min-height:47px;margin:0;padding:10px 12px;border:1px solid #bdb29c;border-radius:11px;background:#fff;color:var(--ink);font:inherit;font-weight:500}
.studio-new-fields input:focus,.studio-new-fields select:focus{outline:3px solid var(--gold-dark);border-color:var(--gold)}
.studio-existing-source{display:grid;gap:11px;padding-top:4px}
.studio-source-divider{display:flex;align-items:center;gap:10px;color:var(--muted);font-size:.8125rem;font-weight:750;text-transform:uppercase;letter-spacing:.07em}
.studio-source-divider::before,.studio-source-divider::after{content:"";height:1px;flex:1;background:var(--line)}
.studio-start-button{margin-top:auto}.studio-start-note{margin:-6px 0 0;text-align:center;color:var(--muted);font-size:.8125rem}
.studio-edits{margin-top:0}
.studio-edits-head{margin-bottom:16px}.studio-edits-head>span{padding:6px 10px;border-radius:999px;background:#eee3c9;color:var(--gold-dark);font-size:.72rem;font-weight:850}
.studio-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(270px,1fr));gap:16px}
.studio-card{display:flex;min-width:0;flex-direction:column;overflow:hidden;border:1px solid var(--line);border-radius:18px;background:var(--card);color:var(--ink);text-decoration:none;box-shadow:var(--shadow);transition:border-color .18s,transform .18s,box-shadow .18s}
.studio-card:hover{border-color:#c19a3e;transform:translateY(-3px);box-shadow:0 18px 42px #6f511018}
.studio-card-thumb{display:block;position:relative;aspect-ratio:16/9;overflow:hidden;background:#191816}
.studio-card-thumb::after{content:"";position:absolute;inset:55% 0 0;background:linear-gradient(transparent,#000a);pointer-events:none}
.studio-card-thumb video{width:100%;height:100%;object-fit:cover;display:block;pointer-events:none;transition:transform .25s}
.studio-card:hover .studio-card-thumb video{transform:scale(1.025)}
.studio-card-duration,.studio-card-open{position:absolute;z-index:1;bottom:10px;padding:4px 7px;border-radius:7px;background:#171512d9;color:#fff;font-size:.67rem;font-weight:800}
.studio-card-duration{left:10px}.studio-card-open{right:10px;opacity:0;transform:translateX(5px);transition:opacity .18s,transform .18s}
.studio-card:hover .studio-card-open{opacity:1;transform:none}
.studio-card-body{display:flex;flex-direction:column;gap:5px;padding:14px 15px 16px}
.studio-card-title{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0}
.studio-card-title strong{min-width:0;overflow-wrap:anywhere;font-size:.94rem}
.studio-card-title i{flex:none;padding:4px 7px;border-radius:999px;background:#eeeae0;color:var(--muted);font-size:.8125rem;font-style:normal;font-weight:850}
.studio-card-title i.ready{background:#dff3df;color:#205a32}.studio-card-title i.running{background:#fff0c7;color:#7b5a0a}.studio-card-title i.failed{background:var(--bad-bg);color:var(--bad)}
.studio-card-body small{color:var(--muted);font-size:.8125rem}.studio-card-body .studio-card-error{color:var(--bad);overflow-wrap:anywhere;white-space:normal}
.studio-empty{display:flex;align-items:center;gap:17px;padding:22px;border:1px dashed #c8b98f;border-radius:18px;background:#fffdf866}
.studio-empty>span{display:grid;place-items:center;width:48px;height:48px;flex:0 0 48px;border-radius:50%;background:#eee3c9;color:var(--gold-dark);font-size:1.15rem}
.studio-empty strong{font-family:Georgia,serif;font-size:1.05rem}.studio-empty p{margin:3px 0 0;color:var(--muted);font-size:.82rem}
@media (max-width:960px){
  .studio-home-head{grid-template-columns:1fr;gap:24px;padding-top:12px}
  .studio-home-visual{width:min(100%,620px)}
  .studio-new-form{grid-template-columns:1fr 1fr;gap:22px}
}
@media (max-width:720px){
  .studio-home{gap:2.2rem}.studio-home-head{padding-bottom:8px}.studio-home-head h1{font-size:clamp(2.55rem,13vw,4rem)}
  .studio-home-visual{padding:10px;border-radius:20px}.studio-visual-canvas{height:190px}.studio-visual-frame{width:78px;height:139px}.studio-visual-timeline{height:94px}
  .studio-new{padding:18px}.studio-new-head,.studio-edits-head{align-items:flex-start}
  .studio-new-form{grid-template-columns:1fr}.studio-dropzone,.studio-dropzone-label{min-height:240px}
  .studio-cards{grid-template-columns:1fr}.studio-card-open{opacity:1;transform:none}
}
@media (max-width:430px){
  .studio-home-points{display:grid;grid-template-columns:1fr}.studio-home-points span{width:fit-content}
  .studio-visual-canvas{height:155px}.studio-visual-timeline{height:84px;padding-top:16px}.studio-visual-track{height:26px}.studio-visual-overlay{height:18px}
  .studio-new-head,.studio-edits-head{margin-bottom:16px}
  .studio-empty{align-items:flex-start}
}

/* More caption styles: collapsed overflow of the 3 featured caption choices. */
.caption-more-styles { grid-column: 1 / -1; }
.caption-more-styles summary { cursor: pointer; color: var(--muted); font-size: .85rem; padding: .35rem 0; }
.caption-more-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .6rem; padding-top: .5rem; }
.upload-setup-fieldset { border: 0; padding: 0; margin: 0 0 1rem; }

/* Advanced background tool: collapsed by default (niche post-production). */
.advanced-tool-details { border: 1px solid var(--line, rgba(255,255,255,.08)); border-radius: 12px; margin-bottom: 14px; }
.advanced-tool-details summary { cursor: pointer; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; }
.advanced-tool-details summary span { font-weight: 850; }
.advanced-tool-details summary small { color: var(--muted); }
.advanced-tool-details[open] summary { border-bottom: 1px solid var(--line, rgba(255,255,255,.08)); }
.advanced-tool-details section { border: 0; margin: 0; }

/* Sticker editor shell: product-language summary with a live count badge. */
.sticker-editor > summary { display: flex; flex-direction: column; gap: 3px; cursor: pointer; }
.sticker-editor > summary strong { font-size: .95rem; font-weight: 850; }
.sticker-editor > summary small { color: var(--dark-muted); font-size: .875rem; }
.sticker-editor[open] > summary { margin-bottom: 10px; }
.hl-render-status { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: .875rem; background: rgba(255,255,255,.06); color: var(--dark-muted); }
.hl-render-status:not(:empty)::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--gold, #ffe800); animation: hl-pulse 1.1s ease-in-out infinite; }
@keyframes hl-pulse { 0%,100% { opacity: .35; } 50% { opacity: 1; } }

/* ============================================================
   OPENING TITLE EDITOR · visual redesign (2026-10)
   Warmer card, gold accents, preview mocks synced to the
   burned look (gold chip / clean text / dark card).
   ============================================================ */
.hook-frame-editor {
  margin-top: 14px; padding: 16px; gap: 12px;
  border: 1px solid #3a3220; border-radius: 18px;
  background: radial-gradient(120% 140% at 18% 0%, #251f14 0%, #171410 55%, #12100b 100%);
  box-shadow: 0 12px 36px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,232,0,.07);
}
.hook-frame-editor .hook-frame-head .eyebrow { color: #ffe800; letter-spacing: .16em; }
.hook-frame-editor .hook-frame-head small { color: #c9b87e; max-width: 34ch; }
.hook-frame-row input {
  padding: 12px 14px; border-radius: 12px; border: 1px solid #4a4028; background: #100d08;
  font-weight: 750; letter-spacing: .03em; color: #f4e1a6; transition: border-color .15s ease, box-shadow .15s ease;
}
.hook-frame-row input:focus { border-color: #ffe800; box-shadow: 0 0 0 3px rgba(255,232,0,.15); outline: none; }
.hook-frame-row input::placeholder { color: #8d7c52; }
.hook-frame-row button {
  border-radius: 12px; border: 0; font-weight: 800; cursor: pointer;
  background: linear-gradient(180deg, #ffe800, #e3cb00); color: #171106;
  box-shadow: 0 6px 18px rgba(255,232,0,.22); transition: transform .12s ease, box-shadow .12s ease;
}
.hook-frame-row button:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(255,232,0,.3); }
.hook-frame-row button:active { transform: translateY(0); }

/* Style + size chips: tactile */
.hook-style-chip-art { border-radius: 12px; border: 1px solid #ffffff20; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.hook-style-chip:hover .hook-style-chip-art { transform: translateY(-2px); border-color: rgba(255,232,0,.45); }
.hook-style-chip input:checked ~ .hook-style-chip-art {
  outline: none; border-color: #ffe800;
  box-shadow: 0 0 0 2px rgba(255,232,0,.35), 0 10px 22px rgba(255,232,0,.14);
}
.hook-style-chip input:checked ~ .hook-style-chip-name { color: #ffe800; }
.hook-style-chip-name { transition: color .15s ease; }
.hook-fit-note { color: #a8986b; }

/* ============================================================
   STICKER EDITOR · visual redesign (2026-10)
   Product shell: framed stage, dark timeline, card asset shelf.
   ============================================================ */
.sticker-editor {
  margin-top: 12px; border: 1px solid #2c2c36; border-radius: 16px; background: #14141a; color: var(--dark-text);
  overflow: hidden;
}
.sticker-editor > summary { padding: 13px 15px; list-style: none; }
.sticker-editor > summary::-webkit-details-marker { display: none; }
.sticker-editor > summary { position: relative; padding-left: 44px; }
.sticker-editor > summary::before {
  content: "▣"; position: absolute; left: 15px; top: 50%; transform: translateY(-58%);
  width: 22px; height: 22px; display: grid; place-items: center; border-radius: 7px;
  background: rgba(255,232,0,.12); color: #ffe800; font-size: .8rem;
}
.sticker-editor > summary strong::after { content: ""; }
.sticker-editor[open] > summary { border-bottom: 1px solid #23232b; background: #17171e; }
.sticker-editor .hl-editor { padding: 14px; }

.hl-toolbar {
  padding: 8px 10px; background: #0f0f14; border: 1px solid #26262e; border-radius: 12px;
}
.hl-play { background: linear-gradient(180deg, #ffd60a, #e0bb00); box-shadow: 0 4px 14px rgba(255,214,10,.25); }
.hl-toolbar .ghostdark { border-radius: 9px; color: var(--dark-action); border-color: #bda671; }
.hl-toolbar .ghostdark:hover { background: #30291b; color: #fff4d6; }
.hl-toolbar .danger-link, .hl-toolbar .danger-link:hover { color: var(--dark-error); font-size: .875rem; }
.sticker-editor .muted, .sticker-editor .hint { color: var(--dark-muted); }
.sticker-editor a { color: var(--dark-action); }
.hl-time { font-variant-numeric: tabular-nums; color: #cfcbc0; }
.hl-play:hover, .studio-play:hover { background: #f4e1a6; }
.sticker-editor :focus-visible { outline-color: var(--dark-action); }

.sticker-stage {
  border-radius: 14px; border: 1px solid #26262e; background: #0b0b0f;
  box-shadow: 0 14px 34px rgba(0,0,0,.4);
}
.hl-timeline .tl-scroll { border-radius: 10px; border: 1px solid #26262e; background: #0f0f14; padding: 6px 8px; }
.tl-ruler { border-bottom-color: #2e2e38; }
.tl-track { background: repeating-linear-gradient(90deg, #17171f 0 2px, #141419 2px 76px); border-radius: .5em; }
.tl-overlay { background: repeating-linear-gradient(90deg, #1b1f18 0 2px, #171b15 2px 76px); }
.tl-sticker { background: linear-gradient(180deg, #1f4a30, #16351f); border-color: #2f8a4d; color: #c9ecd4; }
.tl-playhead { background: #ffe800; }
.tl-playhead::before { border-top-color: #ffe800; }

/* Asset shelf: dark cards with big thumbs (was light-cream buttons) */
.hl-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; }
.hl-asset {
  display: flex; flex-direction: column; gap: 6px; max-width: none;
  background: #101017; border: 1px solid #26262e; border-radius: 12px; padding: 8px;
  cursor: pointer; text-align: left;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.hl-asset:hover { background: #1c1c27; transform: translateY(-3px); border-color: rgba(255,214,10,.55); box-shadow: 0 10px 24px rgba(0,0,0,.35); }
.hl-asset-thumb { flex: none; width: 100%; height: 74px; border-radius: 8px; background: #1a1a22 center/cover no-repeat; overflow: hidden; }
.hl-asset-thumb img { width: 100%; height: 100%; object-fit: cover; }
.hl-asset-name { color: #ddd8ca; font-size: .8125rem; font-weight: 650; line-height: 1.25; }
.hl-asset-name small { color: var(--dark-muted); }
.hl-asset-add {
  position: absolute; right: 12px; top: 12px; width: 24px; height: 24px; border-radius: 8px;
  display: grid; place-items: center; background: #ffe800; color: #171106; font-weight: 800;
  opacity: 0; transform: scale(.8); transition: opacity .15s ease, transform .15s ease;
}
.hl-asset { position: relative; }
.hl-asset:hover .hl-asset-add { opacity: 1; transform: scale(1); }

/* Extra hook looks (additions, originals untouched): gold chip + gold card. */
.hook-style-art-goldchip b { color:#15110f; background:var(--hook-accent,#ffe800); padding:.16em .55em; border-radius:1.05em; }
.hook-style-art-goldcard b { color:var(--hook-accent,#ffe800); background:rgba(21,17,15,.85); padding:.16em .38em .16em .42em; border-left:3px solid var(--hook-accent,#ffe800); border-radius:6px; }
.hook-frame-render-goldchip { top:12.5%; padding:.38em .8em; color:#15110f; background:var(--hook-accent,#ffe800); border-radius:1.05em; font-size:10.3cqw; box-shadow:0 14px 40px rgba(0,0,0,.38); }
.hook-frame-render-goldcard { top:12.5%; left:7%; right:auto; padding:.4em .85em; color:var(--hook-accent,#ffe800); background:rgba(21,17,15,.92); border-left:.16em solid var(--hook-accent,#ffe800); border-radius:.55em; font-size:10.7cqw; text-align:left; box-shadow:0 14px 44px rgba(0,0,0,.28); }

/* Sharper gold-card identity: solid panel, thick gold bar — unmistakable vs the chip. */
.hook-style-art-goldcard b { color:var(--hook-accent,#ffe800); background:#191512; padding:.22em .5em .22em .55em; border-left:5px solid var(--hook-accent,#ffe800); border-radius:8px 10px 10px 8px; box-shadow:0 4px 14px rgba(0,0,0,.4); }
.hook-frame-render-goldcard { background:#191512f2; border-left:max(3px,.9cqw) solid var(--hook-accent); border-radius:.55em 1em 1em .55em; }
.hook-frame-render-pill .hook-preview-accent,
.hook-frame-render-card .hook-preview-accent { color:#946b16; -webkit-text-stroke:2px #101010; }
.hook-frame-render-goldchip .hook-preview-accent { color:#15110f; -webkit-text-stroke:0; }
.hook-frame-render-goldcard .hook-preview-accent { -webkit-text-stroke:0; }


/* Instagram-style look picker: her real footage, one chip per look. */
.look-picker { margin-top: 12px; display: grid; gap: 8px; }
.look-frame-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.look-frame-head .eyebrow { margin: 0; color: var(--gold-dark); letter-spacing: .16em; }
.look-frame-head small { color: var(--muted); font-size: .8125rem; font-weight: 650; text-align: right; }
.look-strip { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: thin; }
.look-chip { position: relative; flex: 0 0 auto; display: grid; gap: 6px; justify-items: center; padding: 0; border: 0; background: none; cursor: pointer; }
.look-chip img { width: 72px; height: 128px; object-fit: cover; border-radius: 10px; border: 2px solid transparent; box-shadow: 0 6px 18px rgba(0,0,0,.35); transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; background: #101017; }
.look-chip:hover { background: transparent; }
.look-chip:hover img { transform: translateY(-3px); border-color: rgba(255,232,0,.4); }
.look-chip.is-selected img { border-color: #ffe800; box-shadow: 0 0 0 3px rgba(255,232,0,.25), 0 10px 24px rgba(0,0,0,.4); }
.look-chip-name { font-size: .8125rem; font-weight: 750; color: var(--muted); }
.look-chip.is-selected .look-chip-name { color: var(--gold-dark); text-decoration: underline; text-underline-offset: 3px; }

/* Skin picker sits tight under the look strip. */
.skin-picker { margin-top: 2px; }
.skin-picker .look-frame-head .eyebrow { color: var(--gold-dark); }

/* Preview re-burn progress: pill + bar, shown while a look/skin/hook applies. */
.preview-burn-status { display: flex; align-items: center; gap: 12px; margin: 10px 0 2px; padding: 8px 12px; border: 1px solid #2c2c36; border-radius: 12px; background: #101017; scroll-margin-top: 72px; }
.preview-burn-status:focus { outline: 3px solid #ffe800; outline-offset: 3px; }
.burn-pill { display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 750; color: #ffe800; white-space: nowrap; }
.burn-dot { width: 9px; height: 9px; border-radius: 50%; background: #ffe800; animation: hl-pulse 1.1s ease-in-out infinite; }
.preview-burn-status.is-failed .burn-pill { color: #ff8484; }
.preview-burn-status.is-failed .burn-dot { background: #ff8484; animation: none; }
.burn-bar { position: relative; flex: 1; height: 8px; border-radius: 99em; background: #23232b; overflow: hidden; }
.burn-bar i { position: absolute; inset: 0 auto 0 0; width: 0%; border-radius: 99em; background: linear-gradient(90deg,#ffe800,#ffb300); transition: width .8s linear; }

/* Look intensity: honest 0-100 blend, live under the strip. */
.look-intensity { display: flex; align-items: center; gap: 10px; font-size: .875rem; font-weight: 750; color: var(--ink); }
.look-intensity input[type="range"] { flex: 1; accent-color: #ffe800; }
.look-intensity output { min-width: 3ch; text-align: right; color: var(--gold-dark); font-variant-numeric: tabular-nums; }

/* Keep keyboard focus visible on the card when its native input is hidden. */
.entry-effect-option:has(input:focus-visible),
.gallery-type-option:has(input:focus-visible),
.studio-dropzone:focus-within { outline: 3px solid var(--gold-dark); outline-offset: 3px; }
.studio-card:focus-visible .studio-card-open,
.hl-asset:focus-visible .hl-asset-add { opacity: 1; transform: none; }
@media (hover: none) {
  .studio-card-open, .hl-asset-add { opacity: 1; transform: none; }
}
/* Native controls must stay readable after component font shorthands. */
@media (max-width: 640px) {
  .hook-extra-label select,
  .hook-extra-label input[type="text"],
  .hook-extra-label input[type="number"],
  .studio-new-fields input, .studio-new-fields select { font-size: 16px; }
  .hook-frame-controls { flex-wrap: wrap; }
  .hook-frame-controls .hook-frame-styles { flex-basis: 100%; }
  .hook-extra-controls { grid-template-columns: minmax(0, 1fr); }
  .look-frame-head { flex-wrap: wrap; }
  .look-frame-head small { text-align: left; }
}

.skin-picker .look-chip img { width: 112px; height: 112px; object-fit: cover; }
.cover-preview { display: block; width: min(100%, 180px); height: auto; margin: 12px auto; border-radius: 12px; }

/* Reusable motion cards and montage inspector. All controls inherit readable
   text/field tokens; preview panels use the exact exported raster. */
.motion-form{display:grid;gap:.65rem;margin:.9rem 0}
.motion-controls{display:flex;flex-wrap:wrap;gap:.65rem;align-items:end}
.motion-controls label{flex:1 1 125px;min-width:0}
.motion-controls input,.motion-controls select,.motion-form input,.motion-form select,.motion-form textarea{width:100%;box-sizing:border-box}
.studio-graphics{width:100%;border-top:1px solid var(--line);padding-top:.8rem}
.studio-graphics summary{cursor:pointer;font-weight:700}
.studio-inspector{padding:.8rem 0;font-size:.82rem}
.studio-inspector small{flex-basis:100%}
.studio-graphic-layer{position:absolute;height:auto;z-index:3;cursor:pointer;border:2px solid transparent;box-sizing:border-box}
.studio-graphic-layer.selected{border-color:#ffd60a}
.tl-graphic{background:#694365;color:#fff;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.studio-app{margin:0;min-width:0;max-width:100%}
.studio-body{grid-template-columns:minmax(190px,240px) minmax(0,1fr)}
.studio-stage{width:min(100%,var(--stage-width,31.5vh));height:auto;flex-shrink:0}
@media(max-width:900px){.studio-body{grid-template-columns:minmax(0,1fr)}.studio-media{order:2}}
/* Seekable text pieces share the export's pixel layout, within Reel safe areas. */
.studio-graphic-layer{border:0;overflow:hidden}
.studio-graphic-layer.selected{outline:2px solid #ffd60a;outline-offset:0}
.studio-graphic-piece{position:absolute;display:block;max-width:none;pointer-events:none}
.studio-media-layer:not(video):not(img){overflow:hidden}
.studio-rhythm-option{display:flex;align-items:center;gap:.4rem}
.studio-rhythm-option input{width:auto}
.studio-media-actions{flex-wrap:wrap}
.studio-safe-guide{display:none;position:absolute;inset:10% 14% 22% 8%;z-index:12;border:1px dashed rgba(255,255,255,.85);box-shadow:0 0 0 100vh rgba(0,0,0,.12);pointer-events:none}
.show-safe-guide .studio-safe-guide{display:block}
.studio-safe-toggle{display:flex;align-items:center;gap:.25rem;font-size:.75rem;color:#30251a;white-space:nowrap}
.studio-camera-layer{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;display:block}

.ai-montage { margin:16px 0; padding:16px; border:1px solid var(--line); border-radius:12px; background:var(--paper); color:var(--ink); }
.ai-montage > form { margin-top:12px; }
.ai-montage .active-overlay small { display:block; margin-top:4px; overflow-wrap:anywhere; }
.graphic-timing { display:flex; flex-wrap:wrap; align-items:end; gap:12px; margin:0 0 20px; padding:12px; border:1px solid var(--line); border-radius:10px; }
.graphic-timing label { display:grid; gap:6px; flex:1 1 110px; min-width:0; font-size:.85rem; font-weight:700; }
.graphic-timing input { width:100%; min-width:0; }
.graphic-timing button { flex:1 1 210px; }
.graphic-reading { flex-basis:100%; display:grid; gap:8px; }
.graphic-reading small { line-height:1.5; color:var(--ink); }
.graphic-reading button { justify-self:start; }
.graphic-reading [data-reading-warning] { color:#9a3b16; font-weight:700; }
.presentation-picker { display:grid; gap:14px; margin:18px 0; padding:16px; border:1px solid var(--line); border-radius:12px; background:#fffcf6; }
.presentation-picker fieldset { border:0; padding:0; margin:0; min-width:0; }
.presentation-picker legend { font-size:1rem; font-weight:850; }
.presentation-palettes { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin:12px 0; }
.presentation-palette { position:relative; display:grid; align-content:start; gap:7px; padding:9px; border:2px solid var(--line); border-radius:10px; cursor:pointer; background:white; }
.presentation-palette:has(input:checked) { border-color:#987323; box-shadow:0 0 0 2px #ead9ae; }
.presentation-palette:focus-within { outline:3px solid var(--forest); outline-offset:3px; }
.presentation-palette input { position:absolute; right:12px; top:12px; width:18px; height:18px; accent-color:#805d1d; z-index:1; }
.presentation-palette > strong { font-size:.8rem; }
.presentation-palette > small { color:var(--muted); font-size:.72rem; line-height:1.4; }
.palette-sample { height:126px; position:relative; display:block; overflow:hidden; border-radius:5px; background:var(--slide-bg); color:var(--slide-fg); }
.palette-person { position:absolute; right:28%; top:8%; width:19%; height:23%; border:1px solid var(--slide-accent); background:var(--slide-surface); border-radius:2px; }
.palette-rule { position:absolute; left:10%; top:38%; width:24%; height:3px; background:var(--slide-accent); }
.palette-sample strong { position:absolute; left:10%; top:42%; font-family:Georgia,serif; font-size:31px; line-height:1; color:var(--slide-fg); }
.palette-card { position:absolute; left:10%; top:73%; width:77%; height:8%; border-radius:2px; border-left:3px solid var(--slide-accent); background:var(--slide-surface); }
.palette-card.short { top:85%; width:61%; }
.palette-auto { display:flex; align-items:center; gap:8px; padding:9px 12px; border:2px solid var(--line); border-radius:10px; cursor:pointer; background:white; font-size:.85rem; }
.palette-auto:has(input:checked) { border-color:#987323; box-shadow:0 0 0 2px #ead9ae; }
.palette-auto:focus-within { outline:3px solid var(--forest); outline-offset:3px; }
.palette-auto input { width:auto; flex:0 0 auto; accent-color:#805d1d; margin:0; }
.graphic-appearance { display:flex; flex-wrap:wrap; align-items:end; gap:10px; margin:-8px 0 22px; }
.graphic-appearance label { display:grid; gap:5px; flex:1 1 140px; font-size:.8rem; }
@media (max-width:540px) { .presentation-palettes { grid-template-columns:repeat(2,minmax(0,1fr)); } }
.composition-entry { margin:0 0 16px; padding:20px; }
.final-actions-column { min-width:0; }
.composition-entry h2 { margin:6px 0 10px; font-size:1.35rem; }
.composition-entry p { line-height:1.5; }
.composition-entry form { margin:12px 0; }
.composition-entry small { display:block; line-height:1.5; }
.revision-compositions { margin:16px 0; }
/* Animated highlights style picker: one row, three clear choices. */
.rich-choice{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.5rem}
.rich-style-options{display:flex;gap:.8rem;flex-wrap:wrap}
.rich-style-options label{display:inline-flex;align-items:center;gap:.3rem;font-size:.85rem;font-weight:700;color:#241d12}
.rich-style-options input{width:auto}
/* Animated highlights legend: an "Aa" chip in each style's own colours. */
.rich-style-options{display:flex;gap:.6rem;flex-wrap:wrap}
.rich-off{display:inline-flex;align-items:center;gap:.3rem;font-size:.85rem;font-weight:700;color:#241d12}
.rich-style-chip{display:inline-flex;align-items:center;gap:.5rem;padding:.35rem .6rem .35rem .35rem;border:1px solid rgba(36,29,18,.16);border-radius:.6em;background:#fffdf8;cursor:pointer}
.rich-style-chip:has(input:checked){border-color:#946b16;box-shadow:0 0 0 1px #946b16}
.rich-style-chip input{width:auto}
.rich-swatch{position:relative;display:inline-flex;align-items:center;justify-content:center;width:2.3rem;height:2.3rem;border-radius:.4em;border:2px solid;font-size:1rem;font-weight:800;font-family:Lato,sans-serif}
.rich-swatch i{position:absolute;left:.25rem;right:.25rem;bottom:.2rem;height:3px;border-radius:2px}
.rich-style-copy{display:flex;flex-direction:column;line-height:1.15}
.rich-style-copy b{font-size:.8rem;color:#241d12}
.rich-style-copy small{font-size:.66rem;color:#57534a}

.ai-montage [data-draft-page] { margin:16px 0; padding:14px; border:1px solid var(--line); border-radius:12px; background:var(--card); min-width:0; }
.ai-montage [data-draft-page] legend { padding:0 6px; }
.ai-montage [data-draft-page] legend label { display:flex; align-items:center; gap:8px; margin:0; }
.ai-montage [data-draft-page] input[type="checkbox"] { width:auto; margin:0; accent-color:var(--gold-dark); }
.ai-montage [data-draft-page][data-included="false"] { border-style:dashed; }

/* Real study evidence: inspect the complete figure before cropping for a Reel. */
.study-sources {margin:1rem 0;padding:1rem;border:1px solid #b7a078;border-radius:12px;background:#fcf8ef;color:#26362f}
.study-sources summary {font-weight:700;cursor:pointer}
.study-sources form {display:grid;gap:.65rem;margin:1rem 0}
.study-sources fieldset {min-width:0;margin-top:1.2rem}
.study-preview {display:block;max-width:100%;max-height:280px;object-fit:contain;background:#fff;border:1px solid #b7a078;border-radius:8px}
.study-figures {display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:.7rem}
.study-figures figure {margin:0;background:#fff;border:1px solid #b7a078;border-radius:8px;padding:.5rem}
.study-figures img {width:100%;height:180px;object-fit:contain}
.study-figures figcaption {font-size:.85rem;color:#26362f;padding-top:.4rem;overflow-wrap:anywhere}
.study-crop input {width:100%;min-width:0}

/* Frozen production-rendered examples; each native button works with keyboard. */
.composition-gallery { margin:.75rem 0; }
.composition-gallery-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:.75rem; margin-top:.75rem; }
.composition-choice { display:flex; flex-direction:column; align-items:stretch; gap:.4rem; padding:.6rem; background:var(--card,#fff); color:var(--ink,#242424); border:2px solid var(--line); border-radius:10px; text-align:left; }
.composition-choice img { width:100%; height:auto; aspect-ratio:9/16; object-fit:contain; border-radius:5px; }
.composition-choice small { font-size:.72rem; line-height:1.35; font-weight:normal; }
.composition-choice[aria-pressed="true"] { background:var(--gold-soft); color:var(--ink); border-color:#896214; box-shadow:0 0 0 1px #896214; }
.composition-choice:focus-visible { outline:3px solid #896214; outline-offset:3px; }
.social-platform-card, .longform-clips-panel .clip-card {
  padding: 16px;
  margin-top: 16px;
  border: 1px solid var(--line, #d8d0bc);
  border-radius: 12px;
  font-size: 16px;
}
.social-platform-card label, .longform-clips-panel form label {
  display: block;
  margin: 12px 0;
}
.longform-clips-panel video {
  display: block;
  max-width: 100%;
  width: 360px;
  max-height: 480px;
  margin: 12px 0;
}
.longform-clips-panel blockquote {
  max-height: 12em;
  overflow: auto;
}
.recording-picker { margin: 18px 0; display: grid; gap: 12px; }
.recording-picker[hidden] { display: none; }
.recording-list { padding: 0; list-style: none; display: grid; gap: 12px; }
.recording-list li { padding: 14px; border: 1px solid var(--line, #ddd); border-radius: 12px; display: grid; gap: 12px; }
.recording-list li > span { overflow-wrap: anywhere; }
.recording-list li > div { display: flex; flex-wrap: wrap; gap: 8px; }
.recording-list button { min-height: 44px; }
.source-recordings { margin: 20px 0; font-size: 16px; }
.source-recordings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 16px; }
.source-recordings-grid article { min-width: 0; }
.source-recordings-grid video { width: 100%; max-height: 360px; background: #111; }

/* Script Studio */
.hero-actions-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.hero-actions { flex-shrink: 0; }
.empty-scripts-card { text-align: center; padding: 48px 24px; margin-top: 24px; border: 2px dashed var(--line); }
.empty-scripts-card .empty-icon { font-size: 2.5rem; margin-bottom: 12px; }
.scripts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 18px; margin-top: 24px; }
.script-card { display: flex; flex-direction: column; gap: 12px; padding: 20px; border-radius: 16px; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.script-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.06); }
.script-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.script-badge-draft { background: #fef3c7; color: #92400e; font-size: 0.68rem; font-weight: 800; padding: 3px 8px; border-radius: 12px; }
.script-badge-ready { background: #dcfce7; color: #166534; font-size: 0.68rem; font-weight: 800; padding: 3px 8px; border-radius: 12px; }
.script-badge-recorded { background: #e0e7ff; color: #3730a3; font-size: 0.68rem; font-weight: 800; padding: 3px 8px; border-radius: 12px; }
.script-angle-tag { font-size: 0.72rem; font-weight: 750; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.script-title { font-size: 1.25rem; font-weight: 800; margin: 0; line-height: 1.3; }
.script-title a { color: var(--ink); text-decoration: none; }
.script-title a:hover { color: var(--forest); }
.script-topic-line { font-size: 0.85rem; color: var(--muted); margin: 0; }
.script-hook-snippet { margin: 4px 0 8px; padding: 10px 14px; background: #fbf8f0; border-left: 3px solid var(--forest); border-radius: 0 10px 10px 0; font-size: 0.88rem; font-style: italic; color: var(--ink); line-height: 1.4; }
.script-meta-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 0.78rem; font-weight: 750; color: var(--muted); margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.script-card-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.script-card-actions .button, .script-card-actions .ghostdark { font-size: 0.82rem; padding: 8px 12px; }

/* Script Binding on Upload Page */
.script-binding-card { margin: 0 0 16px; padding: 14px 18px; background: linear-gradient(110deg, #fdfbf7, #f7f0df); border: 1.5px solid var(--gold-soft); border-radius: 14px; box-shadow: 0 4px 16px rgba(137, 98, 20, 0.08); }
.script-binding-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.binding-icon { font-size: 1.3rem; flex-shrink: 0; }
.binding-info strong { display: block; font-size: 0.95rem; color: var(--ink); }
.script-binding-options { border-top: 1px solid rgba(137, 98, 20, 0.18); padding-top: 8px; }
.script-picker-details { margin: 0 0 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); overflow: hidden; }
.script-picker-details > summary { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; list-style: none; }
.script-picker-details > summary::-webkit-details-marker { display: none; }
.script-picker-details[open] > summary { border-bottom: 1px solid var(--line); }
.script-picker-body { padding: 14px; display: flex; flex-direction: column; gap: 10px; }

/* Script Creator */
.script-creator-wrap { max-width: 1140px; margin: 0 auto 60px; }
.script-form { padding: 28px; border-radius: 18px; margin-top: 24px; display: flex; flex-direction: column; gap: 24px; }
.script-fieldset { border: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.script-fieldset legend { font-size: 1.05rem; font-weight: 850; color: var(--ink); margin-bottom: 6px; }
.form-label { display: flex; flex-direction: column; gap: 6px; font-size: 0.88rem; font-weight: 750; color: var(--ink); }
.form-label input, .form-label select, .form-label textarea { padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; font-family: inherit; font-size: 0.95rem; background: #fff; }
.form-label textarea { resize: vertical; }
.angle-options-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px; }
.angle-option-card { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #fdfcfa; cursor: pointer; transition: all 0.15s ease; }
.angle-option-card:hover { border-color: var(--forest); background: #fbf8f0; }
.angle-option-card:has(input:checked) { border-color: var(--forest); background: #f9f4ea; box-shadow: 0 0 0 1px var(--forest); }
.angle-copy strong { display: block; font-size: 0.88rem; font-weight: 800; color: var(--ink); }
.angle-copy small { display: block; font-size: 0.75rem; color: var(--muted); margin-top: 2px; }
.script-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 10px; flex-wrap: wrap; }
.voice-promise-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 750; color: var(--forest-dark); }


/* Script Detail Layout */
.script-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; flex-wrap: wrap; }
.script-detail-title-wrap { max-width: 720px; }
.script-detail-title-wrap h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 6px 0; }
.script-badges-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.script-pacing-pill { font-size: 0.78rem; font-weight: 800; background: #f2eee3; color: var(--ink); padding: 3px 10px; border-radius: 20px; }
.script-detail-top-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex-shrink: 0; }
.script-detail-layout { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(280px, 1fr); gap: 24px; }
@media (max-width: 900px) { .script-detail-layout { grid-template-columns: 1fr; } }
.script-main-column { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.script-sidebar-column { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
@media (min-width: 901px) {
  .script-sidebar-column {
    position: sticky;
    top: 24px;
    align-self: start;
  }
}
.script-section-card { padding: 22px; border-radius: 16px; }
.script-section-header { margin-bottom: 16px; }
.script-section-header h2 { font-size: 1.35rem; margin: 4px 0 2px; }

/* Hook Selector */
.hook-choices-list { display: flex; flex-direction: column; gap: 10px; }
.hook-choice-card { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 12px; background: #fffdfa; cursor: pointer; transition: all 0.15s ease; }
.hook-choice-card:hover { border-color: var(--forest); background: #fdfaf3; }
.hook-choice-card:has(input:checked) { border-color: var(--forest); background: #f9f4ea; box-shadow: 0 0 0 1.5px var(--forest); }
.hook-choice-content { flex: 1; min-width: 0; }
/* Radios/checkboxes inside flex option cards keep their natural size.
   Without this, the global `input { width: 100% }` rule lets them swallow
   the whole card and squeezes the option text into a sliver. */
.hook-choice-card > input[type="radio"],
.angle-option-card > input[type="radio"],
.research-paper-card > input[type="checkbox"],
.source-radio-pill > input[type="radio"],
.checkbox-label > input[type="checkbox"] { flex: none; width: 18px; height: 18px; margin: 3px 0 0; padding: 0; border: none; background: transparent; accent-color: var(--forest); }
.hook-type-label { display: inline-block; font-size: 0.7rem; font-weight: 850; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gold); margin-bottom: 4px; }
.hook-text { margin: 0 0 4px; font-size: 1.05rem; font-weight: 750; color: var(--ink); line-height: 1.35; }

/* Beats */
.beats-container { display: flex; flex-direction: column; gap: 16px; }
.beat-block { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fdfcfa; }
.beat-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.beat-num-badge { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--forest); color: #fff; font-size: 0.75rem; font-weight: 900; }
.beat-title-wrap { flex: 1; min-width: 0; }
.beat-title-wrap strong { display: block; font-size: 0.95rem; font-weight: 800; }
.beat-visual-badge { font-size: 0.72rem; font-weight: 750; color: var(--muted); background: #f3efe6; padding: 3px 8px; border-radius: 8px; min-width: 0; flex: 1 1 100%; }
.beat-textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-family: inherit; font-size: 0.92rem; line-height: 1.45; background: #fff; }
.story-opening { border-left: 3px solid var(--gold); padding: 8px 12px; background: #f9f4ea; margin-bottom: 12px; }
.story-opening > strong { display: block; margin-bottom: 6px; }

/* Script Sidebar */
.script-sidebar-card { padding: 20px; border-radius: 16px; }
.script-cards-preview { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; }
.script-preview-card { padding: 14px; border: 1.5px solid var(--line); border-radius: 14px; background: #22201d; color: #fff; }
.script-card-grid { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 480px) {
  .script-card-grid { grid-template-columns: 80px minmax(0, 1fr); gap: 10px; }
}
.script-card-thumb-frame { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; position: relative; }
.script-card-thumb-frame.thumb-broken .script-card-thumb { visibility: hidden; }
.script-card-thumb-frame.thumb-broken .script-card-thumb-hint { display: none; }
.script-card-thumb-frame.thumb-broken::after { content: "Preview unavailable"; position: absolute; inset: 0; display: grid; place-items: center; padding: 8px; text-align: center; font-size: 0.68rem; font-weight: 700; color: #9c9281; background: #141311; border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 8px; }
.script-card-thumb { display: block; width: 100%; aspect-ratio: 9/16; object-fit: cover; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.18); background: #141311; cursor: zoom-in; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35); transition: transform 0.15s ease, border-color 0.15s ease; }
.script-card-thumb:hover { transform: scale(1.03); border-color: var(--gold); }
.script-card-thumb-hint { font-size: 0.65rem; color: #9c9281; text-align: center; font-weight: 600; }
.script-card-body { display: flex; flex-direction: column; min-width: 0; }
.preview-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.preview-card-kind { font-size: 0.68rem; font-weight: 900; letter-spacing: 0.08em; color: var(--gold-soft); }
.card-edit-fields { display: flex; flex-direction: column; gap: 8px; }
.card-field-label { display: flex; flex-direction: column; gap: 3px; font-size: 0.68rem; font-weight: 750; color: #bdae95; text-transform: uppercase; letter-spacing: 0.05em; }
.card-edit-title { width: 100%; border: 1px solid #443e35; border-radius: 8px; padding: 7px 10px; font-family: inherit; font-size: 0.9rem; font-weight: 750; background: #141311; color: #fff; line-height: 1.3; box-sizing: border-box; }
.card-edit-title:focus, .card-edit-items:focus, .card-kind-select:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 2px rgba(202, 138, 4, 0.25); }
.card-edit-items { width: 100%; border: 1px solid #443e35; border-radius: 8px; padding: 7px 10px; font-family: inherit; font-size: 0.82rem; line-height: 1.4; background: #141311; color: #e5e0d8; resize: vertical; box-sizing: border-box; }
.card-kind-select { background: #141311; color: var(--gold-soft); border: 1px solid #443e35; border-radius: 6px; padding: 3px 8px; font-size: 0.72rem; font-weight: 800; text-transform: uppercase; cursor: pointer; }
.card-kind-select option { background: #22201d; color: #fff; }
.card-delete-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: #c4b9a3;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 750;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
  margin-left: auto;
}
.card-delete-btn:hover {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
  transform: scale(1.08);
}
.script-cards-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.script-cards-count-badge { font-size: 0.72rem; font-weight: 850; background: var(--forest); color: #fff; padding: 2px 8px; border-radius: 12px; }
.cards-actions-bar { margin: 12px 0; display: flex; flex-direction: column; gap: 14px; }
#btn-suggest-cards { width: 100%; padding: 10px; font-size: 0.85rem; font-weight: 800; justify-content: center; }
.button-add-card { width: 100%; border: 1.5px dashed var(--line); border-radius: 12px; justify-content: center; font-size: 0.85rem; font-weight: 800; padding: 10px; cursor: pointer; color: var(--forest); background: transparent; transition: all 0.15s ease; display: inline-flex; align-items: center; text-decoration: none; }
.button-add-card:hover { border-style: solid; border-color: var(--forest); background: #946b1615; color: var(--forest-dark); }
.script-preview-card.is-deleting { opacity: 0; transform: scale(0.95); transition: all 0.15s ease; }
.empty-cards-note { font-size: 0.82rem; font-style: italic; margin: 12px 0; }
.card-preplan-note { display: flex; align-items: center; gap: 8px; font-size: 0.75rem; font-weight: 750; color: var(--forest-dark); }
.word-budget-meter { display: flex; align-items: center; justify-content: space-around; gap: 12px; margin: 16px 0 10px; padding: 12px; background: #f7f2e7; border-radius: 10px; }
.budget-stat { text-align: center; }
.stat-number { display: block; font-size: 1.4rem; font-weight: 900; color: var(--ink); line-height: 1.1; }
.stat-label { font-size: 0.68rem; font-weight: 800; text-transform: uppercase; color: var(--muted); }
.small-pacing-note { font-size: 0.75rem; margin: 0 0 10px; }
.budget-progress-track { height: 6px; background: #e5ded0; border-radius: 3px; overflow: hidden; }
.budget-progress-bar { height: 100%; background: #4ade80; border-radius: 3px; }
.script-danger-zone { text-align: center; margin-top: 10px; }
.danger-text-button { background: transparent; border: none; color: #b91c1c; font-size: 0.8rem; font-weight: 750; cursor: pointer; text-decoration: underline; }
.danger-ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 6px 12px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 800;
  border: 1px solid rgba(220, 38, 38, 0.35);
  background: transparent;
  color: #dc2626;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  font-size: 0.82rem;
}
.danger-ghost-btn:hover {
  background: #fef2f2;
  border-color: #dc2626;
  color: #b91c1c;
}
.inline-delete-form {
  margin: 0;
  display: inline-flex;
}
.script-takes-section {
  margin: 24px 0;
  padding: 20px;
  border-radius: 16px;
  border: 1.5px solid var(--line);
}
.script-takes-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.script-takes-head h3 {
  margin: 0 0 4px;
}
.script-takes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.script-take-card {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.script-take-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88rem;
}
.take-duration-badge {
  font-size: 0.72rem;
  font-weight: 800;
  background: #e0e7ff;
  color: #3730a3;
  padding: 2px 8px;
  border-radius: 10px;
}
.script-take-card video {
  width: 100%;
  aspect-ratio: 9/16;
  max-height: 280px;
  object-fit: cover;
  border-radius: 8px;
  background: #141311;
}
.script-take-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}
.script-take-actions form {
  margin: 0;
}
.script-take-actions .ghostdark,
.script-take-actions .danger-ghost-btn {
  font-size: 0.75rem;
  min-height: 32px;
  padding: 4px 10px;
}
.script-settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px; margin-bottom: 16px; }
@media (max-width: 640px) { .script-settings-grid { grid-template-columns: 1fr; } }

/* Scientific Paper Research Grounding */
.research-grounding-fieldset { border: 1.5px solid var(--gold-soft); border-radius: 14px; padding: 18px 20px; background: #fdfbf7; display: flex; flex-direction: column; gap: 14px; }
.research-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.checkbox-label { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 0.95rem; color: var(--ink); }
.research-vault-badge { font-size: 0.75rem; font-weight: 800; background: #fef3c7; color: #92400e; padding: 3px 10px; border-radius: 20px; }
.small-help { margin: 0; font-size: 0.82rem; }
.research-grounding-body { display: flex; flex-direction: column; gap: 14px; }
.research-source-selector { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.selector-label { font-size: 0.8rem; font-weight: 800; color: var(--muted); }
.source-radio-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 20px; background: #fff; font-size: 0.8rem; font-weight: 750; cursor: pointer; transition: all 0.15s ease; }
.source-radio-pill:has(input:checked) { background: #fef9c3; border-color: #ca8a04; color: #854d0e; }
.research-search-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.research-search-input { flex: 1 1 100%; min-width: 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; font-family: inherit; font-size: 0.92rem; background: #fff; }
.research-results-container { border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.results-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.research-results-list { display: flex; flex-direction: column; gap: 10px; max-height: 380px; overflow-y: auto; }
.research-paper-card { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #faf9f6; transition: border-color 0.15s ease; cursor: pointer; }
.research-paper-card:hover { border-color: var(--forest); background: #fdfbf7; }
.research-paper-card:has(input:checked) { border-color: #ca8a04; background: #fefce8; }
.research-paper-check { margin-top: 3px; cursor: pointer; }
.research-paper-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.research-paper-meta { display: flex; align-items: center; gap: 8px; font-size: 0.72rem; font-weight: 800; color: var(--muted); }
.paper-source-tag { background: #e2e8f0; color: #334155; padding: 2px 7px; border-radius: 6px; text-transform: uppercase; font-size: 0.65rem; }
.research-paper-title { font-size: 0.88rem; font-weight: 800; color: var(--ink); line-height: 1.35; }
.research-paper-summary { font-size: 0.78rem; color: #555; line-height: 1.4; margin: 2px 0 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }

/* Scientific Evidence on Detail Page */
.script-evidence-card { border-left: 4px solid var(--gold); }
.evidence-sources-list { display: flex; flex-direction: column; gap: 14px; }
.evidence-source-item { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #faf8f2; display: flex; flex-direction: column; gap: 6px; }
.evidence-item-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.evidence-source-pill { font-size: 0.68rem; font-weight: 850; background: #ca8a04; color: #fff; padding: 2px 8px; border-radius: 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.evidence-year-pill { font-size: 0.72rem; font-weight: 750; color: var(--muted); }
.evidence-link { font-size: 0.75rem; font-weight: 750; color: var(--forest); text-decoration: none; margin-left: auto; }
.evidence-link:hover { text-decoration: underline; }
.evidence-title { font-size: 0.95rem; font-weight: 800; color: var(--ink); line-height: 1.35; }
.evidence-authors { font-size: 0.78rem; }
.evidence-abstract-details { margin-top: 6px; border-top: 1px dashed var(--line); padding-top: 6px; }
.evidence-summary-toggle { font-size: 0.78rem; font-weight: 750; color: var(--forest); cursor: pointer; user-select: none; }
.evidence-summary-toggle:hover { text-decoration: underline; }
.evidence-abstract-details[open] .evidence-summary-toggle { margin-bottom: 6px; color: var(--ink); }
.evidence-summary { font-size: 0.82rem; color: #444; line-height: 1.45; margin: 4px 0 0; white-space: pre-wrap; word-break: break-word; }
.danger-text-button:hover { color: #991b1b; }

/* Voice DNA Persona Grounding */
.voice-dna-fieldset { border: 1.5px solid var(--gold-soft); border-radius: 14px; padding: 18px 20px; background: #fdfbf7; display: flex; flex-direction: column; gap: 10px; }
.voice-dna-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.voice-dna-meta-tags { display: flex; align-items: center; gap: 10px; }
.voice-dna-badge { font-size: 0.75rem; font-weight: 800; background: #fef3c7; color: #92400e; padding: 3px 10px; border-radius: 20px; }
.voice-dna-manage-link { font-size: 0.8rem; font-weight: 750; color: var(--forest); text-decoration: none; }
.voice-dna-manage-link:hover { text-decoration: underline; }

/* Voice DNA Dashboard */
.dna-summary-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 22px; margin-bottom: 24px; border-radius: 14px; flex-wrap: wrap; background: #fffdf9; border: 1.5px solid var(--gold-soft); }
.dna-summary-stat { display: flex; align-items: baseline; gap: 8px; font-size: 0.88rem; }
.dna-summary-stat strong { font-size: 1.25rem; font-weight: 900; color: var(--ink); }
.dna-stat-badge { font-size: 0.78rem; font-weight: 850; padding: 4px 12px; border-radius: 20px; }
.dna-badge-active { background: #dcfce7; color: #166534; }
.dna-badge-disabled { background: #f3f4f6; color: #6b7280; }

.dna-studio-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; }
@media (max-width: 900px) { .dna-studio-grid { grid-template-columns: 1fr; } }
.dna-column { display: flex; flex-direction: column; gap: 20px; }
.dna-panel { padding: 24px; border-radius: 16px; }
.dna-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.dna-panel-head h2 { font-size: 1.3rem; margin: 0 0 4px; }

.dna-add-sample-details { margin-bottom: 18px; }
.dna-add-sample-details > summary { cursor: pointer; list-style: none; display: inline-flex; }
.dna-add-sample-details > summary::-webkit-details-marker { display: none; }
.dna-add-sample-form { margin-top: 14px; padding: 16px; background: #faf9f6; border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; gap: 12px; }

.dna-samples-list { display: flex; flex-direction: column; gap: 12px; max-height: 600px; overflow-y: auto; }
.dna-sample-card { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fffdfa; display: flex; flex-direction: column; gap: 8px; }
.dna-sample-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dna-sample-title-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dna-source-tag { font-size: 0.65rem; font-weight: 850; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; letter-spacing: 0.03em; }
.dna-source-transcript { background: #e0e7ff; color: #3730a3; }
.dna-source-manual { background: #fef3c7; color: #92400e; }
.dna-source-script { background: #d1fae5; color: #065f46; }
.dna-sample-wordcount { font-size: 0.72rem; font-weight: 750; color: var(--muted); }
.dna-sample-delete-btn { background: transparent; border: none; color: var(--muted); font-size: 1.25rem; line-height: 1; cursor: pointer; padding: 2px 7px; border-radius: 4px; transition: all 0.15s ease; }
.dna-sample-delete-btn:hover { color: #b91c1c; background: #fee2e2; }
.dna-sample-quote { margin: 0; font-size: 0.84rem; color: #3f3933; font-style: italic; line-height: 1.45; max-height: 120px; overflow-y: auto; background: #faf8f3; padding: 10px 12px; border-radius: 8px; border-left: 3px solid var(--gold-soft); }

.dna-empty-samples { padding: 28px; text-align: center; background: #faf9f6; border-radius: 12px; border: 1px dashed var(--line); }
.dna-rules-form { display: flex; flex-direction: column; gap: 18px; }
.dna-toggle-box { padding: 12px 14px; background: #fdfbf7; border: 1.5px solid var(--gold-soft); border-radius: 10px; display: flex; flex-direction: column; gap: 4px; }
.dna-form-actions { display: flex; justify-content: flex-end; margin-top: 8px; }


/* Draft feedback spans the editor; it must never displace a content column. */
.script-draft-status { margin: 0; overflow-wrap: anywhere; }
.script-draft-status:empty { display: none; }
.script-detail-layout > .script-draft-status { grid-column: 1 / -1; }
.script-detail-layout > .script-main-column { grid-column: 1; }
.script-detail-layout > .script-sidebar-column { grid-column: 2; }
.script-section-card, .script-sidebar-card, .script-fieldset { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .script-detail-layout > .script-sidebar-column { grid-column: 1; }
}
@media (min-width: 1100px) {
  .script-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .script-form > .script-draft-status,
  .script-form > .script-fieldset:first-of-type,
  .script-form > .script-form-foot { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .script-form { padding: 18px; }
  .angle-options-grid { grid-template-columns: minmax(0, 1fr); }
  .research-search-bar { flex-wrap: wrap; }
  .research-search-input { min-width: 0; width: 100%; flex-basis: 100%; }
  .research-grounding-fieldset { padding: 14px; }
}

.script-detail-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
}
.script-detail-top-actions .button,
.script-detail-top-actions a.button {
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 800;
  text-decoration: none;
}
.script-detail-top-actions a.ghostdark,
.script-card-actions a.ghostdark {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 10px 14px; border-radius: 12px; text-decoration: none; font-weight: 800;
}
.script-detail-top-actions > a,
.script-detail-top-actions > button { max-width: 100%; overflow-wrap: anywhere; }

.prompt-speed-slider { display: flex; flex-direction: column; gap: 2px; width: 160px; max-width: 100%; font-size: .75rem; }
.prompt-speed-slider input { width: 100%; padding: 0; accent-color: var(--gold-dark); }

/* Upload reading studio: camera and script occupy separate spaces. */
.camera-reading-layout { min-width: 0; }
.camera-panel.is-reviewing .camera-reading-layout { display: none !important; }
.camera-panel.has-prompt .camera-reading-layout { display: grid; grid-template-columns: minmax(0, 1fr) 220px; align-items: start; }
.camera-panel.has-prompt #camera-live-stage { grid-column: 2; grid-row: 1; min-height: 190px; max-height: 280px; }
.camera-panel.has-prompt #camera-live-video { max-height: 280px; }
.camera-panel.has-prompt .camera-guide-box { height: 160px; max-height: 180px; width: auto; }
.camera-panel.has-prompt .camera-guide-label { top: 4px; font-size: .6rem; }
.camera-panel.has-prompt .camera-rec-badge { top: 32px; }
.camera-panel.has-prompt .camera-off-placeholder { padding: 8px; }
.camera-panel.has-prompt .camera-off-card p { display: none; }
.camera-panel.has-prompt .camera-off-icon { font-size: 1.3rem; }
.camera-panel.has-prompt .camera-teleprompter {
  --reading-bg: #0d0c0a; --reading-ink: #f5f2eb; --reading-panel: #181611;
  --reading-muted: #a39c8e; --reading-border: #574a33; --reading-accent: #e5b94f;
  position: relative; top: auto; left: auto; transform: none; width: 100%; max-height: none;
  grid-column: 1; grid-row: 1; border: 0; border-radius: 0; box-shadow: none;
  background: var(--reading-bg); color: var(--reading-ink); backdrop-filter: none;
}
.camera-panel.has-prompt .camera-teleprompter.reading-theme-amber { --reading-bg: #191006; --reading-ink: #f3e3c3; --reading-panel: #241808; --reading-muted: #c9b48b; --reading-border: #6b4c1c; --reading-accent: #f0c561; }
.camera-panel.has-prompt .camera-teleprompter.reading-theme-paper { --reading-bg: #f4f0e6; --reading-ink: #2a251d; --reading-panel: #fbf8f1; --reading-muted: #756c58; --reading-border: #d9d1bf; --reading-accent: #8d6410; }
.camera-panel.has-prompt .teleprompter-bar, .camera-panel.has-prompt .teleprompter-footer,
.camera-panel.has-prompt .teleprompter-source-panels { background: var(--reading-panel); color: var(--reading-ink); border-color: var(--reading-border); padding: 8px; }
.camera-panel.has-prompt .teleprompter-tools { gap: 6px; }
.prompt-theme-choice { display: flex; flex-direction: column; gap: 2px; margin: 0; font-size: .75rem; }
.camera-panel.has-prompt #prompt-theme-select { width: auto; min-width: 104px; border-radius: 5px; font-size: 16px; cursor: pointer; touch-action: manipulation; }
.camera-panel.has-prompt #prompt-theme-select option { background: var(--reading-panel); color: var(--reading-ink); }
.camera-panel.has-prompt .prompt-tool-btn, .camera-panel.has-prompt .prompt-speed-btn,
.camera-panel.has-prompt .prompt-action-btn, .camera-panel.has-prompt .teleprompter-tab {
  min-height: 44px; min-width: 44px; padding: 8px; font-size: .85rem;
  color: var(--reading-ink); background: transparent; border: 1px solid var(--reading-border); line-height: 1.25;
}
.camera-panel.has-prompt .teleprompter-tab.is-active, .camera-panel.has-prompt .prompt-speed-btn.is-active,
.camera-panel.has-prompt .prompt-tool-btn[aria-pressed=true] { background: var(--reading-accent); color: var(--reading-bg); }
.camera-panel.has-prompt .prompt-select, .camera-panel.has-prompt .prompt-textarea { font-size: 16px; min-height: 44px; background: var(--reading-bg); color: var(--reading-ink); border-color: var(--reading-border); }
.camera-panel.has-prompt .prompt-file-drop { min-height: 44px; font-size: 16px; color: var(--reading-ink); border-color: var(--reading-border); }
.camera-panel.has-prompt .teleprompter-content { color: var(--reading-ink); text-shadow: none; line-height: 1.55; font-weight: 600; }
.camera-panel.has-prompt .teleprompter-viewport { min-height: 260px; max-height: 460px; padding: 16px 20px 80px; }
.camera-panel.has-prompt .is-size-s .teleprompter-viewport { min-height: 180px; max-height: 280px; }
.camera-panel.has-prompt .is-size-l .teleprompter-viewport { min-height: 360px; max-height: 600px; }
.camera-panel.has-prompt .teleprompter-content.is-outline { white-space: normal; }
.prompt-hook-card { padding: 16px; margin-bottom: 24px; border: 1px solid var(--reading-border); border-radius: 12px; }
.prompt-hook-card blockquote { margin: 10px 0 0; }
.prompt-story-meta { display: block; color: var(--reading-accent); font-size: .8rem; font-weight: 750; line-height: 1.5; }
.prompt-beat-section { margin-bottom: 28px; }
.prompt-story-points { margin: 16px 0; padding-left: 1.1em; }
.prompt-story-points li { margin-bottom: 16px; }
.prompt-story-cue { color: var(--reading-muted); font-size: .85rem; font-weight: 500; line-height: 1.5; }
.camera-panel.has-prompt .prompt-placeholder, .camera-panel.has-prompt .prompt-status-label { color: var(--reading-muted); }
.camera-panel.has-prompt .teleprompter-footer { flex-wrap: wrap; }
.camera-panel.has-prompt .prompt-status-label { white-space: normal; }
.camera-panel.has-prompt .teleprompter-content.is-mirrored { transform: scaleX(-1); }
.camera-panel.has-prompt .is-collapsed { max-height: none; }
.camera-panel.has-prompt .is-collapsed .teleprompter-viewport,
.camera-panel.has-prompt .is-collapsed .teleprompter-footer { display: block !important; }
.camera-panel.has-prompt .is-collapsed .teleprompter-footer { display: flex !important; }
.camera-controls-bar, .camera-controls-btns { flex-wrap: wrap; }
body.has-reading-focus { overflow: hidden; }
.camera-panel.is-reading-focus {
  position: fixed; inset: 0; z-index: 110; margin: 0; border: 0; border-radius: 0;
  height: 100vh; height: var(--reading-screen-height, 100dvh); display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.camera-panel.is-reading-focus .camera-reading-layout { flex: 1; min-height: 0; overflow: hidden; align-items: stretch; }
.camera-panel.is-reading-focus #camera-live-stage { align-self: start; }
.camera-panel.is-reading-focus .camera-teleprompter { min-height: 0; height: 100%; }
.camera-panel.is-reading-focus .teleprompter-viewport { min-height: 80px; max-height: none; flex: 1; }
.camera-panel.is-reading-focus .teleprompter-bar { flex-shrink: 0; max-height: 42vh; overflow-y: auto; }
.camera-panel.is-reading-focus .camera-controls-bar { flex-shrink: 0; }
.camera-panel.is-reading-focus .camera-controls-info { display: none; }
.camera-panel.is-reading-focus .camera-controls-btns { justify-content: center; flex: 1; }
.camera-panel.is-reading-focus .camera-controls-btns button { min-height: 44px; }
.camera-panel.has-prompt .prompt-controls-collapsed .teleprompter-bar,
.camera-panel.has-prompt .prompt-controls-collapsed .teleprompter-source-panels { display: none; }
@media (max-width: 900px) {
  .camera-panel.has-prompt .camera-reading-layout { display: flex; flex-direction: column; }
  .camera-panel.has-prompt #camera-live-stage { min-height: 150px; max-height: 180px; width: 100%; flex: none; }
  .camera-panel.has-prompt #camera-live-video { max-height: 180px; }
  .camera-panel.has-prompt .camera-guide-box { height: 120px; max-height: 135px; }
  .camera-panel.is-reading-focus #camera-live-stage { min-height: 110px; max-height: 140px; }
  .camera-panel.is-reading-focus #camera-live-video { max-height: 140px; }
  .camera-panel.is-reading-focus .camera-guide-box { height: 90px; max-height: 100px; }
  .camera-panel.is-reading-focus .camera-teleprompter { flex: 1; height: auto; min-height: 0; }
  .camera-panel.is-reading-focus .camera-controls-bar { padding: 6px; }
  .camera-panel.is-reading-focus .camera-controls-btns { gap: 6px; }
  .camera-panel.is-reading-focus .camera-controls-btns button { font-size: .8rem; padding: 6px 10px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .camera-panel.is-reading-focus .camera-reading-layout { display: grid; grid-template-columns: minmax(0, 1fr) 160px; }
  .camera-panel.is-reading-focus #camera-live-stage { grid-column: 2; grid-row: 1; }
  .camera-panel.is-reading-focus .camera-teleprompter { grid-column: 1; grid-row: 1; height: 100%; }
}

#prompt-exit-focus { display: none; }
.camera-panel.is-reading-focus #prompt-exit-focus { display: inline-flex; align-items: center; }
@media (max-width: 1100px) {
  .upload-page { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .upload-intro { position: static; }
}
.upload-page > * { min-width: 0; }

/* ==========================================================================
   Script Studio: Reference Source & Video Preview Modal
   ========================================================================== */
.video-preview-dialog {
  width: min(94vw, 840px);
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: transparent;
  color: var(--ink);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.65);
}

.video-preview-dialog.is-short {
  width: min(92vw, 420px);
}

.video-preview-modal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--border, #3a322b);
  border-radius: 20px;
  background: var(--card, #1c1815);
  overflow: hidden;
}

.video-preview-header {
  margin-bottom: 14px;
  padding-right: 40px;
}

.video-preview-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: #f4e7bc;
  color: #7b5914;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.video-preview-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
}

.video-preview-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
}

.video-preview-dialog.is-short .video-preview-stage,
.video-preview-modal-card.is-short .video-preview-stage {
  aspect-ratio: 9 / 16;
  max-height: 70vh;
  margin: 0 auto;
}

.video-preview-stage iframe,
.video-preview-stage video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: contain;
}

.video-preview-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.video-preview-extlink {
  font-size: 0.88rem;
  color: var(--muted);
}

/* Reference Material card in Script Detail */
.script-source-card {
  border-color: rgba(212, 175, 55, 0.3);
}

.source-card-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 14px;
}

.source-video-preview-row {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px;
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 14px;
  background: rgba(255, 250, 240, 0.03);
}

@media (max-width: 680px) {
  .source-video-preview-row {
    flex-direction: column;
    align-items: stretch;
  }
}

.source-video-thumb-wrap {
  position: relative;
  width: 170px;
  aspect-ratio: 16 / 9;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.source-video-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.source-video-thumb-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #fff;
  font-size: 1.5rem;
}

.source-video-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.45);
  border: 0;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.source-video-play-overlay:hover {
  background: rgba(0, 0, 0, 0.25);
}

.source-play-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e52d27;
  color: #fff;
  font-size: 0.9rem;
  padding-left: 2px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  transition: transform 0.15s ease;
}

.source-video-play-overlay:hover .source-play-icon {
  transform: scale(1.1);
}

.source-play-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px #000;
}

.source-video-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.source-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.source-type-badge {
  background: #f4e7bc;
  color: #7b5914;
}

.source-type-badge.is-short-badge {
  background: #fce8e6;
  color: #c5221f;
}

.source-domain-pill {
  font-size: 0.78rem;
  color: var(--muted);
}

.source-title-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
}

.source-url-text {
  margin: 0;
  font-size: 0.84rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-external-link {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.source-actions-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.source-edit-row {
  padding-top: 10px;
}

.source-input {
  width: 100%;
}

/* Source pills for header and script list cards */
.script-header-source-pill,
.script-source-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  border: 1px solid rgba(212, 175, 55, 0.4);
  background: rgba(212, 175, 55, 0.1);
  color: var(--gold, #d4af37);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.script-header-source-pill:hover,
.script-source-pill:hover {
  background: rgba(212, 175, 55, 0.22);
  border-color: var(--gold, #d4af37);
  transform: translateY(-1px);
}

.script-header-source-pill.is-video-pill,
.script-source-pill.is-video-pill {
  border-color: rgba(229, 45, 39, 0.35);
  background: rgba(229, 45, 39, 0.08);
  color: #e52d27;
}

.script-header-source-pill.is-video-pill:hover,
.script-source-pill.is-video-pill:hover {
  background: rgba(229, 45, 39, 0.18);
  border-color: #e52d27;
}

/* Live Preview Card in /scripts/new */
.reference-url-preview-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(212, 175, 55, 0.06);
  border: 1px solid rgba(212, 175, 55, 0.22);
}

.ref-preview-thumb-wrap {
  position: relative;
  width: 90px;
  aspect-ratio: 16 / 9;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

.ref-preview-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ref-preview-play-btn {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.4);
  border: 0;
  color: #fff;
  cursor: pointer;
  font-size: 0.9rem;
}

.ref-preview-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.ref-preview-badge-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ref-preview-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.button-small {
  align-self: flex-start;
  padding: 4px 10px;
  font-size: 0.76rem;
  min-height: 0;
}

/* Generation Progress Overlay */
.script-gen-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(18, 14, 10, 0.82);
  backdrop-filter: blur(8px);
}

.script-gen-card {
  width: min(94vw, 540px);
  padding: 32px 30px;
  border-radius: 24px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  background: var(--card, #1c1815);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.65);
  color: var(--ink);
}

.gen-card-header {
  text-align: center;
}

.gen-pulse-icon {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f4e7bc, #d9bd72);
  color: #5d4410;
  font-size: 1.4rem;
  animation: genPulse 1.8s infinite ease-in-out;
}

@keyframes genPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.6); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 16px rgba(212, 175, 55, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
}

.gen-subtitle {
  margin: 6px auto 0;
  font-size: 0.95rem;
  color: var(--muted);
  max-width: 420px;
}

.gen-progress-wrap {
  margin: 24px 0 18px;
}

.gen-progress-track {
  width: 100%;
  height: 10px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.gen-progress-bar {
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, #d4af37, #f7d774);
  transition: width 0.35s ease-out;
}

.gen-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--muted);
}

.gen-status-text {
  font-weight: 600;
  color: var(--ink);
}

.gen-progress-pct {
  font-weight: 700;
  color: var(--gold, #d4af37);
}

.gen-steps-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.gen-step-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
  color: var(--muted);
  transition: color 0.2s ease;
}

.step-num {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.gen-step-item.is-active {
  color: var(--ink);
  font-weight: 700;
}

.gen-step-item.is-active .step-num {
  border-color: #d4af37;
  background: #d4af37;
  color: #1c1815;
}

.gen-step-item.is-done {
  color: var(--muted);
}

.gen-step-item.is-done .step-num {
  border-color: #2f6a39;
  background: #2f6a39;
  color: #fff;
}

/* Source Transcript Card & Cues */
.source-transcript-card {
  margin-top: 14px;
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--paper, #fff);
}

.source-transcript-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.source-transcript-meta h3 {
  margin: 2px 0 4px;
  font-size: 1.05rem;
}

.transcript-count-badge {
  display: inline-block;
  font-size: 0.76rem;
  color: var(--muted);
  font-weight: 600;
}

.source-transcript-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.transcript-view-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.transcript-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.transcript-tab-btn:hover {
  color: var(--ink);
  background: rgba(28, 25, 23, 0.05);
}

.transcript-tab-btn.is-active {
  color: var(--forest-dark, #3c5226);
  background: rgba(217, 239, 89, 0.25);
  border-color: var(--forest, #6b8f45);
}

.source-transcript-cues {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 420px;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper, #fff);
}

.transcript-cue-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 8px;
  background: transparent;
  transition: background 0.15s ease;
}

.transcript-cue-row:hover {
  background: rgba(217, 239, 89, 0.14);
}

.transcript-cue-time {
  font: 600 0.72rem/1.7 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--muted);
  flex-shrink: 0;
  min-width: 52px;
  text-align: right;
}

.transcript-cue-text {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--ink);
  min-width: 0;
}

.source-transcript-body {
  max-height: 260px;
  overflow-y: auto;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--paper, #fff);
}

.source-transcript-text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--ink);
  white-space: pre-wrap;
}

.source-transcript-edit-area {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.source-transcript-edit-area textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.5;
}

.empty-transcript-notice {
  font-size: 0.86rem;
  margin: 8px 0 0;
}

/* Video modal transcript drawer */
.video-preview-transcript-drawer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 14px;
  max-height: 180px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 0 0 10px 10px;
  margin-top: 10px;
}

.video-transcript-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.82rem;
  color: var(--gold, #d4af37);
}

.video-transcript-drawer-body {
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--ink);
  white-space: pre-wrap;
}

.video-preview-footer-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Script Studio: source recordings grounding + outline takes */
.script-sources-uploader { display: grid; gap: 10px; margin-bottom: 12px; }
.script-source-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
.script-source-item > label { display: flex; gap: 10px; align-items: flex-start; flex: 1; min-width: 0; cursor: pointer; }
.script-source-item input[type="checkbox"] { margin-top: 4px; }
.script-source-item small { display: block; color: var(--muted); font-weight: 600; }
.script-source-item em { display: block; color: var(--muted); font-size: .78rem; margin-top: 2px; overflow-wrap: anywhere; }
.script-source-remove { border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: 1rem; padding: 2px 6px; }
.script-source-remove:hover { color: #b91c1c; }
.script-variants { display: grid; gap: 10px; }
.variant-takes-row { display: flex; gap: 8px; flex-wrap: wrap; }
.variant-take { display: inline-flex; padding: 4px 10px; border: 1px solid var(--line); border-radius: 16px; font-size: .8rem; font-weight: 700; text-decoration: none; color: var(--ink); }
a.variant-take:hover { border-color: var(--forest); }
.variant-take.is-current { background: var(--paper); border-color: var(--forest); color: var(--forest-dark); }

.upload-previous-notice {
  grid-column: 1 / -1;
  margin: 14px 0 18px;
  padding: 16px 18px;
  border-radius: 16px;
  background: #f3e5f5;
  border: 1px solid rgba(156, 77, 255, 0.28);
}
.upload-previous-notice .eyebrow { margin-bottom: 6px; }
.upload-previous-notice .button-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.upload-page:has(.upload-previous-notice:not([hidden])) .upload-intro { position: static; }
.upload-previous-notice .button-row form { margin: 0; min-width: 0; }
.upload-previous-notice button { white-space: normal; }

.progress-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}
.progress-actions .progress-label { margin: 0; }


/* Trash organiser: summary + segmented sort/view controls, date group headers, card and list views */
.trash-hero { margin-bottom: 22px; }
.trash-eyebrow-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--forest);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.trash-eyebrow-badge svg { color: var(--forest); }

/* Trash Toolbar & Sort Controls */
.trash-toolbar {
  position: sticky;
  top: 14px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 20px;
  flex-wrap: wrap;
  margin: 0 0 24px;
  padding: 12px 18px;
  border: 1px solid rgba(201, 154, 46, 0.22);
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 4px 20px rgba(40, 30, 15, 0.05), 0 1px 3px rgba(40, 30, 15, 0.02);
}
.trash-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--muted);
  font-size: .84rem;
}
.trash-summary strong { color: var(--ink); font-weight: 800; }
.trash-storage-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 8px;
  background: #f4ecdc;
  border: 1px solid #e5dcc7;
  color: #7d530c;
  font-size: 0.8rem;
  font-weight: 750;
}
.trash-storage-pill svg { color: #c9972e; flex-shrink: 0; }
.trash-count-pill { color: var(--muted); }

.trash-controls {
  display: flex;
  align-items: center;
  gap: 12px 18px;
  flex-wrap: wrap;
}
.trash-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.trash-control-label {
  color: var(--muted);
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: .09em;
  text-transform: uppercase;
}

/* Premium Segmented Controls (Sort & View) */
.trash-seg {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid #dfd5be;
  border-radius: 12px;
  background: #ede6d4;
  box-shadow: inset 0 1px 3px rgba(35, 25, 10, 0.06);
}
.trash-seg-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 5px 12px;
  border-radius: 9px;
  color: #736752;
  font-size: .82rem;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.16s ease;
}
.trash-seg-option svg {
  flex-shrink: 0;
  stroke-width: 2.2;
}
.trash-seg-option:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.55);
}
.trash-seg-option:focus-visible {
  outline: 2px solid var(--gold-brand);
  outline-offset: 1px;
}
.trash-seg-option.is-active {
  background: #ffffff;
  color: #8c6014;
  box-shadow: 0 1px 4px rgba(40, 30, 15, 0.1), 0 0 0 1px rgba(201, 154, 46, 0.35);
}

/* Date Group Headers */
.trash-group-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 28px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: .78rem;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.trash-list > .trash-group-header:first-child { margin-top: 0; }
.trash-group-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
}
.trash-group-badge svg {
  color: var(--gold-dark);
  flex-shrink: 0;
}
.trash-group-count {
  font-size: .75rem;
  font-weight: 700;
  color: var(--muted);
}

/* Card View Layout & Items */
.trash-list {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr));
}
.trash-list > * { min-width: 0; }
.trash-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid #e5dcc7;
  background: #fffdfa;
  box-shadow: 0 4px 16px rgba(40, 30, 15, 0.04);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}
.trash-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(40, 30, 15, 0.08);
  border-color: rgba(201, 154, 46, 0.45);
}
.trash-preview {
  position: relative;
  background: #0d0c0a;
  aspect-ratio: 16 / 9;
  max-height: 220px;
  overflow: hidden;
}
.trash-preview video, .trash-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #0d0c0a;
}
.trash-preview-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #635742;
  background: linear-gradient(135deg, #1f1b15, #12100d);
}
.trash-preview .cover-format {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 6px;
  background: rgba(14, 12, 9, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #f7f2e7;
  font-size: 0.65rem;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.trash-item-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.trash-card-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.trash-item-eyebrow {
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--forest);
  margin: 0 0 4px;
}
.trash-card-title {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 1.05rem;
  font-weight: 750;
  line-height: 1.35;
  color: var(--ink);
  margin: 0 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.trash-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 16px;
}
.trash-pill-size {
  font-weight: 800;
  color: var(--ink);
}
.trash-meta-sep { color: #d0c7b4; }
.trash-meta-date { color: var(--muted); }

.trash-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid #f2ecdd;
}
.trash-card-actions form {
  margin: 0;
  flex: 1;
}

/* Action buttons */
.btn-restore {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid #dfd3ba;
  background: #f7f2e7;
  color: #7d530c;
  font-size: 0.82rem;
  font-weight: 750;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn-restore:hover {
  background: #ecddbc;
  border-color: var(--gold-brand);
  color: #523204;
}
.btn-purge {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid #f1c7c2;
  background: transparent;
  color: #b9382b;
  font-size: 0.82rem;
  font-weight: 750;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn-purge:hover {
  background: #fdf2f1;
  border-color: #b9382b;
  color: #942116;
}

/* List View Row Overhaul */
.trash-list.trash-rows { grid-template-columns: 1fr; gap: 8px; }
.trash-rows { display: grid; gap: 8px; }
.trash-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  border: 1px solid #e5dcc7;
  border-radius: 12px;
  background: #fffdfa;
  box-shadow: 0 1px 3px rgba(40, 30, 15, 0.02);
  transition: all 0.15s ease;
}
.trash-row:hover {
  border-color: rgba(201, 154, 46, 0.4);
  box-shadow: 0 4px 14px rgba(40, 30, 15, 0.06);
  transform: translateX(2px);
}
.trash-row-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background: #14120f;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.trash-row-thumb-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #b8861d;
  background: #1f1b15;
  font-size: 1rem;
}
.trash-row-main {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 3px;
}
.trash-row-name {
  font-size: 0.94rem;
  font-weight: 750;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.trash-row-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.trash-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.trash-row-actions form { margin: 0; }
.trash-row-actions .btn-restore,
.trash-row-actions .btn-purge {
  width: auto;
  min-height: 34px;
  padding: 6px 12px;
  font-size: 0.8rem;
}

@media (max-width: 640px) {
  .trash-row { flex-wrap: wrap; }
  .trash-row-main { flex-basis: calc(100% - 64px); }
  .trash-row-actions { width: 100%; justify-content: flex-end; }
  .trash-toolbar { padding: 12px; }
  .trash-controls { width: 100%; justify-content: space-between; }
  .trash-control { max-width: 100%; min-width: 0; }
  .trash-seg { display: flex; flex-wrap: wrap; max-width: 100%; }
  .trash-seg-option { flex: 1 1 auto; justify-content: center; }
  .trash-seg-icons .trash-seg-option span { display: none; }
  .trash-seg-icons .trash-seg-option { padding: 5px 10px; }
  .trash-card-actions { flex-direction: column; }
  .btn-restore, .btn-purge { width: 100%; }
  .source-transcript-head { flex-wrap: wrap; }
  .source-transcript-actions { flex-wrap: wrap; }
}

/* Opening title suggestions: chips under the Apply row */
.hook-suggest-row { display: grid; gap: 6px; margin-top: 8px; }
.hook-suggest-list { display: flex; flex-wrap: wrap; gap: 8px; }
.hook-suggest-chip { padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); font-size: .78rem; font-weight: 800; letter-spacing: .02em; cursor: pointer; }
.hook-suggest-chip:hover { border-color: var(--forest); background: rgba(217, 239, 89, .18); }
.card-suggest-row { margin: 8px 0; }

/* Script form: example chips, angle examples, research browse */
.topic-example-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.topic-example-chip { padding: 4px 12px; border: 1px dashed var(--line); border-radius: 14px; background: transparent; color: var(--muted); font-size: .76rem; font-weight: 700; cursor: pointer; }
.topic-example-chip:hover { color: var(--ink); border-color: var(--forest); background: rgba(217, 239, 89, .15); }
.angle-example { display: block; margin-top: 4px; font-size: .74rem; color: var(--muted); font-style: italic; }
.research-suggested-chip { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 10px; background: rgba(217, 239, 89, .3); border: 1px solid var(--forest); color: var(--forest-dark); font-size: .62rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; vertical-align: middle; }
.research-advanced { margin: 6px 0 10px; }
.research-advanced > summary { cursor: pointer; font-size: .78rem; font-weight: 700; color: var(--muted); }
.research-advanced[open] > summary { margin-bottom: 8px; }

/* Upload summaries remain readable with long filenames and Yapping descriptions. */
.upload-plan-summary dd { white-space: normal; overflow-wrap: anywhere; }
.upload-outcomes small { font-size: inherit; }
.cutaway-style-details:not([hidden]) { display: grid; }
@font-face { font-family: Poppins; src: url('/caption-fonts/Poppins-Regular.ttf') format('truetype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: Poppins; src: url('/caption-fonts/Poppins-ExtraBoldItalic.ttf') format('truetype'); font-weight: 800; font-style: italic; font-display: swap; }
@font-face { font-family: Poppins; src: url('/caption-fonts/Poppins-ExtraBold.ttf') format('truetype'); font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: Montserrat; src: url('/caption-fonts/Montserrat-Bold.ttf') format('truetype'); font-weight: 700 800; font-display: swap; }
@font-face { font-family: Lato; src: url('/caption-fonts/Lato-Bold.ttf') format('truetype'); font-weight: 700 800; font-display: swap; }
.caption-highlight-controls { padding: 12px; border: 1px solid var(--line); border-radius: 12px; margin: 12px 0; }
.caption-highlight-controls summary { cursor: pointer; font-weight: 750; }
.caption-color-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,180px),1fr)); gap: 12px; margin: 12px 0; }
.caption-color-grid label { display: grid; gap: 5px; min-width: 0; font-size: .8rem; }
.caption-color-grid input[type=color] { width: 100%; min-height: 42px; }
.caption-keyword-preview { background: #786953; color: white; font: 400 25px/1.15 Poppins,sans-serif; text-align: center; padding: 16px 10px; border-radius: 9px; }
.caption-keyword-preview b, .caption-choice.keyword_highlights b { color: #D7F34B; font-family: Jost; font-weight: 800; font-style: italic; }
.caption-choice.keyword_highlights .caption-demo { font-family: Jost; font-weight: 400; text-transform: none; }

@font-face { font-family: BRCaptionSystem; src: url('/caption-fonts/Inter-Medium.ttf') format('truetype'); font-weight: 400 500; font-style: normal; font-display: swap; }
@font-face { font-family: BRCaptionSystem; src: url('/caption-fonts/Inter-ExtraBold.ttf') format('truetype'); font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: BRCaptionSystem; src: url('/caption-fonts/Inter-ExtraBoldItalic.ttf') format('truetype'); font-weight: 800; font-style: italic; font-display: swap; }
@font-face { font-family: Jost; src: url('/caption-fonts/Jost-Regular.ttf') format('truetype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: Jost; src: url('/caption-fonts/Jost-ExtraBoldItalic.ttf') format('truetype'); font-weight: 800; font-style: italic; font-display: swap; }
@font-face { font-family: Jost; src: url('/caption-fonts/Jost-ExtraBold.ttf') format('truetype'); font-weight: 800; font-style: normal; font-display: swap; }

/* Side-by-side finished Reel video + Yapping Clips Signature Cover */
.final-layout { grid-template-columns: minmax(320px, 640px) minmax(280px, 1fr); }
.reel-and-cover-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; align-items: start; }
.final-media-pane { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: #fffdf9; }
.media-pane-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.media-pane-badge { font-size: .66rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.button-tiny { padding: 4px 9px; font-size: .7rem; border-radius: 8px; }
.cover-stage-wrap { position: relative; width: 100%; aspect-ratio: 9 / 16; overflow: hidden; border-radius: 12px; background: #0c0c0c; transition: aspect-ratio .2s ease; }
.cover-stage-wrap.is-grid-crop { aspect-ratio: 4 / 5; box-shadow: inset 0 0 0 2px #d9ff24; }
.final-cover-img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }
.cover-grid-alignment { display:grid; gap:4px; font-size:.74rem; margin:8px 0; }
.cover-grid-alignment select { margin:0; padding:7px; font-size:.74rem; }
.cover-quick-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cover-quick-actions > * { flex: 1 1 110px; text-align: center; font-size: .76rem; padding: 8px 10px; }
.cover-designer-form { display: grid; gap: 12px; margin-top: 10px; }
.cover-designer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.cover-color-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #faf7f0; }
.cover-color-row label { display: grid; gap: 4px; font-size: .78rem; }
.cover-color-row input[type=color] { width: 56px; height: 34px; padding: 2px; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; }
.cover-frame-subdrawer { padding: 10px 12px; border: 1px dashed var(--line); border-radius: 12px; }
.cover-frame-subdrawer > summary { cursor: pointer; font-weight: 700; font-size: .82rem; }
.cover-frame-subdrawer[open] > summary { margin-bottom: 10px; }
.standalone-cover-editor { display:grid; grid-template-columns:minmax(200px,360px) minmax(0,1fr); gap:28px; align-items:start; }
.standalone-cover-editor video { width:100%; max-height:360px; background:#111; }
.standalone-cover-editor .cover-stage-wrap { margin:12px 0; }
.standalone-cover-library { display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,220px)); gap:20px; }
.standalone-cover-library img { display:block; width:100%; aspect-ratio:9 / 16; object-fit:contain; border-radius:12px; background:#e9e0cd; }
.standalone-cover-library span { display:block; overflow-wrap:anywhere; margin-top:8px; }
@media(max-width:700px) { .standalone-cover-editor { grid-template-columns:1fr; } .standalone-cover-editor > div { max-width:360px; width:100%; margin:auto; } .tabbar { overflow-x:auto; } .tab-link { flex-shrink:0; } }
@media(max-width:1100px) {
  .final-layout { grid-template-columns:minmax(0,1fr); }
}
@media(max-width:560px) {
  .reel-and-cover-pair { grid-template-columns:minmax(0,1fr); }
  .final-media-pane { min-width:0; }
}

/* Cover Studio: creation, reusable media and a unified visual history. */
#content:has(.covers-workspace) { width:100%; min-width:0; }
.covers-workspace { max-width:1240px; margin:0 auto; }
.covers-heading { display:flex; align-items:center; justify-content:space-between; gap:24px; margin:10px 0 30px; }
.covers-heading h1 { margin:0 0 10px; font-size:clamp(2.8rem,5vw,4.5rem); letter-spacing:-.055em; line-height:1.05; }
.covers-heading h1 em { font-family:Georgia,serif; font-weight:400; }
.covers-heading p:not(.eyebrow) { color:var(--muted); margin:0; }
.covers-heading > a { flex-shrink:0; }
.covers-create { display:grid; grid-template-columns:minmax(0,1.5fr) minmax(240px,1fr); border:1px solid var(--line); border-radius:26px; overflow:hidden; background:var(--card); box-shadow:var(--shadow); }
.covers-upload-panel { padding:clamp(24px,3vw,42px); }
.covers-step { color:var(--gold); font-size:.67rem; letter-spacing:.13em; font-weight:800; }
.covers-upload-panel h2 { font-size:clamp(1.8rem,3vw,2.7rem); line-height:1.12; letter-spacing:-.04em; margin:18px 0 12px; }
.covers-upload-panel > p { color:var(--muted); max-width:430px; margin:0 0 24px; font-size:.9rem; }
.covers-dropzone { position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; min-height:210px; padding:24px 16px; margin:0; border:1.5px dashed #bfaa7a; border-radius:16px; text-align:center; cursor:pointer; background:#f9f5eb; transition:background .15s,border-color .15s; }
.covers-dropzone:hover,.covers-dropzone.is-dragging { border-color:var(--gold-dark); background:#f4e8c9; }
.covers-dropzone:focus-within { outline:3px solid var(--gold); outline-offset:3px; }
.covers-dropzone input { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; margin:0; }
.covers-dropzone > span,.covers-dropzone > strong,.covers-dropzone > small { pointer-events:none; }
.covers-dropzone > span:not(.covers-upload-icon) { color:var(--muted); font-size:.83rem; font-weight:500; }
.covers-dropzone small { color:var(--muted); font-size:.69rem; line-height:1.7; margin-top:7px; font-weight:400; }
.covers-upload-icon { width:40px; height:40px; display:grid; place-items:center; color:var(--gold); background:#efe4c7; border-radius:12px; margin-bottom:4px; }
.covers-upload-icon svg { width:24px; height:24px; }
.covers-create-button { width:100%; margin-top:16px; justify-content:space-between; padding:14px 19px; }
.covers-library-link { display:flex; justify-content:center; gap:14px; font-size:.81rem; color:var(--gold-dark); margin:16px 0 0; text-decoration:none; font-weight:700; }
.covers-file-preview { display:flex; align-items:center; gap:12px; margin-top:14px; padding:10px; border:1px solid var(--line); border-radius:12px; min-width:0; }
.covers-file-preview[hidden],.covers-workspace [hidden] { display:none!important; }
.covers-file-preview > div:nth-child(2) { flex:1; min-width:0; }
.covers-file-preview strong { display:block; font-size:.8rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.covers-file-preview small { display:block; color:var(--muted); font-size:.7rem; }
#cover-file-media img,#cover-file-media video { width:44px; height:52px; object-fit:cover; border-radius:6px; display:block; }
.covers-file-preview button { padding:6px 10px; }
.covers-upload-progress { margin-top:14px; font-size:.8rem; color:var(--gold-dark); }
.covers-upload-progress progress { display:block; width:100%; height:7px; margin-bottom:8px; accent-color:var(--gold); }
.covers-inspiration { display:flex; flex-direction:column; justify-content:center; align-items:center; gap:22px; padding:30px; background:#e9e0cd; background-image:radial-gradient(ellipse at 80% 20%,#f9f3e5,transparent 70%); border-left:1px solid var(--line); }
.covers-inspiration-label { color:#73674e; font-size:.62rem; letter-spacing:.18em; font-weight:800; }
.covers-example { position:relative; width:min(100%,230px); aspect-ratio:9/16; background:#302e25; border-radius:13px; overflow:hidden; transform:rotate(3deg); box-shadow:0 22px 35px #4d391d30; border:5px solid #fffdf8; }
.covers-example > img { display:block; width:100%; height:100%; object-fit:contain; background:#302e25; }
.covers-format { position:absolute; right:10px; bottom:10px; border-radius:5px; padding:3px 7px; font-size:.6rem; color:white; background:#17150ec9; }
.covers-example-type { display:flex; flex-direction:column; align-items:flex-start; padding:65px 12px; font-size:2.7rem; font-weight:950; letter-spacing:-.06em; line-height:1.06; }
.covers-example-type span { background:#080808; color:white; padding:2px 7px; }
.covers-example-type .neon { color:#d9ff24; }
.covers-example-type i { width:78%; height:7px; background:#d9ff24; transform:rotate(-4deg); border-radius:80%; margin:12px 6px; }
.covers-inspiration-footer { display:flex; align-items:center; justify-content:space-between; width:100%; max-width:260px; color:#73674e; font-size:.72rem; line-height:1.7; }
.covers-inspiration-footer strong { color:var(--ink); font-weight:600; }
.covers-spark { font-size:2.3rem; color:var(--gold); }
.covers-video-section,.covers-history { margin-top:44px; scroll-margin-top:24px; }
.covers-section-heading { display:flex; align-items:center; justify-content:space-between; gap:20px; }
.covers-section-heading h2 { margin:0; font-size:1.55rem; letter-spacing:-.035em; }
.covers-section-heading h2 > span { display:inline-block; vertical-align:middle; padding:3px 8px; font-size:.7rem; font-weight:600; background:#ebe3d1; color:var(--gold-dark); border-radius:7px; margin-left:6px; letter-spacing:0; }
.covers-video-section > .muted { font-size:.83rem; margin:9px 0 18px; }
.covers-video-strip { display:flex; gap:14px; overflow-x:auto; padding:2px 2px 14px; scrollbar-width:thin; }
.covers-video-item { flex:0 0 285px; display:flex; gap:14px; align-items:center; border:1px solid var(--line); background:var(--card); border-radius:15px; padding:12px; }
.covers-video-thumb { position:relative; width:65px; height:88px; flex-shrink:0; border-radius:9px; overflow:hidden; background:#e9e0cd; }
.covers-video-thumb img { width:100%; height:100%; object-fit:cover; }
.covers-video-thumb > span { position:absolute; left:21px; top:31px; width:25px; height:25px; display:grid; place-items:center; border-radius:50%; background:#fffdf8e6; color:var(--gold-dark); font-size:.65rem; }
.covers-video-item > div:last-child { min-width:0; }
.covers-video-item h3 { font-size:.78rem; margin:0 0 10px; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; overflow-wrap:anywhere; }
.covers-video-item button { padding:7px 9px; font-size:.69rem; border-radius:7px; }
.covers-search { display:flex; align-items:center; gap:9px; padding:0 12px; border:1px solid var(--line); border-radius:10px; background:var(--card); margin:0; width:240px; }
.covers-search svg { width:18px; height:18px; flex-shrink:0; color:var(--muted); }
.covers-search input { background:transparent; border:0; margin:0; padding:10px 0; min-width:0; font-size:.8rem; box-shadow:none; }
.covers-filters { display:flex; align-items:center; flex-wrap:wrap; gap:7px; margin:22px 0; }
.covers-filters button { background:transparent; color:var(--muted); padding:8px 13px; border:1px solid transparent; border-radius:9px; font-size:.76rem; font-weight:600; }
.covers-filters button.is-active { color:var(--gold-dark); border-color:#d8c494; background:#eee3c9; }
.covers-filters > span { margin-left:auto; color:var(--muted); font-size:.68rem; }
.covers-history-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,200px),1fr)); gap:22px; }
.covers-history-item { min-width:0; overflow:hidden; border:1px solid var(--line); border-radius:16px; background:var(--card); transition:box-shadow .2s,transform .2s; }
.covers-history-item:hover { transform:translateY(-3px); box-shadow:0 12px 25px #47341512; }
.covers-history-image { display:block; position:relative; aspect-ratio:9 / 16; overflow:hidden; background:#e9e0cd; }
.covers-history-image img { display:block; width:100%; height:100%; object-fit:contain; background:#e9e0cd; }
.covers-origin { position:absolute; top:10px; left:10px; font-size:.58rem; padding:4px 8px; background:#fffdf8ed; color:var(--ink); border-radius:5px; font-weight:700; z-index:1; }
.covers-edit-overlay { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; color:white; font-size:.9rem; font-weight:700; background:#1f1a126b; opacity:0; transition:opacity .2s; z-index:2; }
.covers-history-image:hover .covers-edit-overlay,.covers-history-image:focus-visible .covers-edit-overlay { opacity:1; }
.covers-history-info { padding:14px 15px 10px; }
.covers-history-info > small { font-size:.65rem; color:var(--muted); }
.covers-history-info h3 { font-size:.82rem; margin:6px 0 12px; line-height:1.4; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.covers-history-actions { display:flex; align-items:center; justify-content:space-between; padding-top:8px; border-top:1px solid var(--line); }
.covers-history-actions > a { color:var(--gold-dark); text-decoration:none; font-size:.74rem; font-weight:700; }
.covers-download { display:grid; place-items:center; min-width:36px; min-height:36px; border-radius:7px; }
.covers-download:hover { background:var(--paper); }
.covers-download svg { width:18px; height:18px; }
.covers-empty,.covers-inline-empty { border:1px dashed var(--line); border-radius:16px; padding:28px; text-align:center; color:var(--muted); background:#ffffff40; }
.covers-empty > span { font-size:2rem; color:var(--gold); }
.covers-empty h3 { color:var(--ink); font-size:1.1rem; }
.covers-empty p { font-size:.85rem; max-width:460px; margin:0 auto; }
.covers-result-count { font-size:.72rem; color:var(--muted); margin:18px 0 0; }
@media(max-width:1100px) { .covers-create { grid-template-columns:minmax(0,1.4fr) minmax(210px,1fr); } .covers-inspiration { padding:24px; } .covers-history-grid { gap:16px; } }
@media(max-width:700px) { .covers-heading { align-items:flex-start; margin:5px 0 24px; } .covers-heading > a { padding:8px 10px; font-size:.7rem; } .covers-heading p:not(.eyebrow) { font-size:.82rem; max-width:260px; } .covers-heading .eyebrow { font-size:.6rem; } .covers-create { grid-template-columns:1fr; } .covers-inspiration { display:none; } .covers-upload-panel { padding:24px; } .covers-section-heading { align-items:flex-start; flex-direction:column; gap:16px; } .covers-section-heading h2 { font-size:1.3rem; } .covers-search { width:100%; } .covers-filters > span { width:100%; margin:5px 0 0; } .covers-history-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; } .covers-history-info { padding:10px; } .covers-history-info h3 { font-size:.73rem; } .covers-video-section,.covers-history { margin-top:32px; } }
@media(prefers-reduced-motion:reduce) { .covers-history-item,.covers-edit-overlay { transition:none; } }

.covers-source-name { margin:-6px 0 12px; font-size:.63rem; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* Credit packs (Stripe) on the billing page. */
.yc-pack-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin: 14px 0 4px; }
.yc-pack { display: flex; flex-direction: column; gap: 12px; justify-content: space-between; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: #fffdf899; }
.yc-pack h3 { margin: 0; font-size: .95rem; font-weight: 800; color: var(--ink); }
.yc-pack .button { width: 100%; }
