:root {
  --board: #F7F8FA;
  --paper: #FFFFFF;
  --ink: #1D2433;
  --ink-2: #4A5468;
  --ink-3: #7B8497;
  --rule: #D9DEE6;
  --red: #E63946;
  --blue: #118AB2;
  --yellow: #FFD166;
  --green: #0E9F6E;
  --font-head: "Baloo Bhaijaan 2", system-ui, sans-serif;
  --font-body: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--board);
  color: var(--ink);
  font: 400 16px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; margin: 0 0 .4em; font-weight: 700; }
h1 { font-size: clamp(30px, 4.4vw, 44px); }
h2 { font-size: 26px; }
h3 { font-size: 19px; }
p { margin: 0 0 1em; }
a { color: var(--blue); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

/* ---------- top bar */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 24px;
  padding: 12px clamp(16px, 4vw, 40px);
  background: var(--paper); border-bottom: 1px solid var(--rule);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink);
  font: 800 21px var(--font-head); }
.brand svg { width: 30px; height: 30px; }
.brand rect { fill: var(--ink); }
.brand path { stroke: var(--yellow); stroke-width: 3; fill: none; stroke-linecap: round; }
nav { display: flex; flex-wrap: wrap; gap: 4px; }
nav a { white-space: nowrap; text-decoration: none; color: var(--ink-2); padding: 6px 10px; border-radius: var(--r-sm); font-weight: 500; }
nav a:hover { color: var(--ink); background: var(--board); }
nav a.on { color: var(--ink); background: linear-gradient(transparent 62%, var(--yellow) 62%, var(--yellow) 90%, transparent 90%); }
.top-end { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }
.usage { font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.usage b { color: var(--ink); }

main { max-width: 860px; margin: 0 auto; padding: 32px clamp(16px, 4vw, 40px) 96px; outline: none; }
main.wide { max-width: 1120px; }

/* ---------- buttons & inputs */
button, .btn {
  font: 600 15px var(--font-body); cursor: pointer; border-radius: var(--r-md);
  padding: 11px 20px; border: 2px solid var(--ink); background: var(--ink); color: #fff;
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none; line-height: 1.2;
}
button:hover, .btn:hover { background: #2C3650; }
button:disabled { opacity: .45; cursor: not-allowed; }
button.secondary, .btn.secondary { background: var(--paper); color: var(--ink); }
button.secondary:hover, .btn.secondary:hover { background: var(--board); }
button.ghost { background: transparent; color: var(--ink-2); border-color: transparent; }
button.ghost:hover { color: var(--ink); background: var(--board); }
button.danger { background: var(--paper); color: var(--red); border-color: var(--red); }
button.small { padding: 6px 12px; font-size: 14px; }
button.big { padding: 15px 28px; font-size: 17px; }
label { display: block; font-weight: 600; margin: 0 0 6px; }
.hint { color: var(--ink-3); font-size: 14px; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=date], textarea, select {
  width: 100%; font: 400 16px/1.5 var(--font-body); color: var(--ink);
  padding: 11px 14px; border: 1.5px solid var(--rule); border-radius: var(--r-md); background: var(--paper);
}
input:focus, textarea:focus, select:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px rgba(17,138,178,.18); }
textarea { resize: vertical; min-height: 80px; }
.field { margin-bottom: 20px; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > .field { flex: 1 1 200px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 28px; }

/* chips: one choice from a short set */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span { display: inline-block; padding: 8px 16px; border: 1.5px solid var(--rule); border-radius: 999px;
  background: var(--paper); font-weight: 500; }
.chip input:checked + span { border-color: var(--ink); background: var(--ink); color: #fff; }
.chip input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }

/* ---------- the storyboard strip (signature) */
.story {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 0 0 36px;
}
.frame {
  position: relative; aspect-ratio: 16 / 10; border-radius: var(--r-md);
  border: 2px dashed var(--rule); background: transparent; padding: 10px 12px;
  display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden;
  text-align: start; color: var(--ink-3); font: inherit; cursor: default;
}
.frame small { font-size: 12px; color: var(--ink-3); }
.frame strong { font: 700 15px/1.2 var(--font-head); color: var(--ink); overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.frame.done { border: 2px solid var(--ink); background: var(--paper); cursor: pointer; }
.frame.done:hover { background: var(--board); }
.frame.now { border: 2px solid var(--blue); background: var(--paper); }
.frame.now strong { color: var(--blue); }
.frame .num { position: absolute; top: 8px; inset-inline-start: 10px; font: 700 13px var(--font-head); color: var(--ink-3); }
.frame.done .num { color: var(--ink); }
.frame.done::after { /* marker tick drawn in */
  content: ""; position: absolute; top: 9px; inset-inline-end: 10px; width: 18px; height: 10px;
  border-inline-start: 3px solid var(--red); border-bottom: 3px solid var(--red);
  transform: rotate(-45deg); transform-origin: center; animation: tick .35s ease-out both;
}
[dir=rtl] .frame.done::after { transform: rotate(45deg) scaleX(-1); }
@keyframes tick { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@media (max-width: 640px) {
  .story { grid-template-columns: repeat(5, minmax(96px, 1fr)); overflow-x: auto; padding-bottom: 6px; }
}

.step-title { margin-bottom: 4px; }
.step-sub { color: var(--ink-2); margin-bottom: 26px; }

/* ---------- option cards (style / voice / camera) */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.card {
  position: relative; text-align: start; background: var(--paper); color: var(--ink);
  border: 2px solid var(--rule); border-radius: var(--r-lg); padding: 16px; font-weight: 400;
  display: flex; flex-direction: column; gap: 6px; cursor: pointer;
}
.card:hover { background: var(--paper); border-color: var(--ink-3); }
.card.on { border-color: var(--ink); box-shadow: 4px 4px 0 var(--ink); }
[dir=rtl] .card.on { box-shadow: -4px 4px 0 var(--ink); }
.card h3 { margin: 4px 0 0; }
.card p { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.card .thumb { border-radius: var(--r-md); background: var(--board); display: block; width: 100%; height: auto; }
.card[disabled] { opacity: .5; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: var(--board); color: var(--ink-2); align-self: flex-start; }
.badge.free { background: #DDF5EC; color: #0B6E4D; }
.badge.paid { background: #FFF1CC; color: #7A5600; }

/* ---------- panels */
.panel { background: var(--paper); border: 1.5px solid var(--rule); border-radius: var(--r-lg); padding: 22px; margin-bottom: 20px; }
.panel h2 { font-size: 22px; }
.panel.quiet { background: transparent; }

/* script review: scene list */
.scenes { counter-reset: sc; display: flex; flex-direction: column; gap: 12px; }
.scene { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: start; }
.scene .n { counter-increment: sc; font: 800 22px var(--font-head); color: var(--ink-3); text-align: center; padding-top: 8px; }
.scene .n::before { content: counter(sc); }
.scene textarea { min-height: 72px; }
.scene .board { font-size: 14px; color: var(--ink-2); margin-top: 6px; padding-inline-start: 2px; }
.scene .board b { color: var(--ink); font-weight: 600; }

/* teleprompter */
.prompter { background: var(--ink); color: #fff; border-radius: var(--r-lg); padding: 24px 28px;
  font: 500 22px/1.7 var(--font-body); max-height: 360px; overflow: auto; white-space: pre-wrap; }

/* upload drop zone */
.drop { border: 2px dashed var(--ink-3); border-radius: var(--r-lg); padding: 28px; text-align: center; background: var(--paper); }
.drop.over { border-color: var(--blue); background: #EAF6FB; }
.drop input { display: none; }
.bar { height: 12px; border-radius: 999px; background: var(--rule); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--blue); width: 0; transition: width .4s ease; }
.bar.ink > i { background: var(--ink); }

/* progress (render) */
.render-stage { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 6px 0 12px; }
.render-stage strong { font: 700 22px var(--font-head); }
.render-stage span { font: 700 34px var(--font-head); }
.pen { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--red); margin-inline-end: 8px;
  animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
details summary { cursor: pointer; color: var(--ink-2); font-size: 14px; margin-top: 14px; }
pre.log { background: var(--board); border-radius: var(--r-md); padding: 12px; font-size: 12px; max-height: 260px; overflow: auto; white-space: pre-wrap; direction: ltr; text-align: left; }

/* downloads */
.player { width: 100%; max-height: 70vh; background: #000; border-radius: var(--r-lg); display: block; margin-bottom: 18px; }
.files { list-style: none; padding: 0; margin: 0; }
.files li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--rule); }
.files li:first-child { border-top: 0; }
.files .what { flex: 1; min-width: 0; }
.files .what b { display: block; }
.files .what small { color: var(--ink-3); overflow-wrap: anywhere; }
.expiry { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: #FFF1CC; color: #7A5600; font-size: 14px; }

/* jobs list */
.jobs { list-style: none; margin: 0; padding: 0; }
.jobs li a { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; padding: 16px 4px; text-decoration: none; color: var(--ink); border-top: 1px solid var(--rule); }
.jobs li:first-child a { border-top: 0; }
.jobs li a:hover { background: var(--paper); }
.jobs .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jobs .m { color: var(--ink-3); font-size: 14px; }
.jobs li { position: relative; }
.jobs li a { padding-inline-end: 96px; }
.jobs .jdel { position: absolute; inset-inline-end: 4px; bottom: 12px; }
.panel.prev { border-style: dashed; }
.status { font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 999px; align-self: center; grid-row: span 2; white-space: nowrap; }
.s-done { background: #DDF5EC; color: #0B6E4D; }
.s-rendering, .s-queued, .s-scripting { background: #E1F1F8; color: #0B5F7C; }
.s-script_ready, .s-awaiting_upload { background: #FFF1CC; color: #7A5600; }
.s-failed { background: #FDE4E6; color: #B4202D; }
.s-expired, .s-draft { background: var(--board); color: var(--ink-3); }

/* auth */
.auth { max-width: 420px; margin: 6vh auto 0; }
.auth h1 { margin-bottom: 8px; }
.auth .lede { color: var(--ink-2); margin-bottom: 28px; }
.auth .switch { margin-top: 18px; color: var(--ink-2); }
.auth .switch button { padding: 0; border: 0; background: none; color: var(--blue); font-weight: 600; text-decoration: underline; }

/* admin */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: start; padding: 10px 8px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
th { color: var(--ink-3); font-weight: 600; }
td input[type=number] { width: 80px; padding: 6px 8px; }
.stat-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.scroll-x { overflow-x: auto; }

/* admin tabs, filters, pager */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 2px solid var(--rule); margin: 8px 0 24px; }
.tab { padding: 10px 18px; margin-bottom: -2px; border-bottom: 3px solid transparent; color: var(--ink-2);
  font-weight: 600; text-decoration: none; border-radius: var(--r-sm) var(--r-sm) 0 0; }
.tab:hover { color: var(--ink); background: var(--paper); }
.tab.on { color: var(--ink); border-bottom-color: var(--ink); }
.tab:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
a.status { text-decoration: none; }
a.status:hover { filter: brightness(.95); text-decoration: underline; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filters .field { flex: 1 1 110px; margin-bottom: 8px; }
.filters .field.grow { flex: 3 1 200px; }
.filters input, .filters select { padding: 8px 10px; font-size: 15px; }
.filter-bar { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; min-height: 36px; margin-bottom: 4px; }
.pill { display: inline-flex; align-items: center; gap: 4px; background: var(--board); border: 1.5px solid var(--rule);
  border-radius: 999px; padding: 2px 4px 2px 14px; padding-inline: 14px 4px; font-size: 14px; }
.pill button { padding: 2px 8px; }
.pager { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.pager > span { padding: 0 6px; color: var(--ink-2); font-size: 14px; }
.per-page { display: inline-flex; align-items: center; gap: 8px; margin: 0; margin-inline-start: auto; font-weight: 400; font-size: 14px; color: var(--ink-2); }
.per-page select { width: auto; padding: 6px 10px; font-size: 14px; }
[aria-busy=true] { opacity: .55; transition: opacity .15s; }

.error-box { background: #FDE4E6; color: #8E1A24; border-radius: var(--r-md); padding: 12px 16px; margin: 12px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.note { background: var(--board); border-radius: var(--r-md); padding: 12px 16px; color: var(--ink-2); font-size: 14px; }

#toast { position: fixed; bottom: 24px; inset-inline-start: 50%; transform: translateX(-50%); background: var(--ink); color: #fff;
  padding: 12px 20px; border-radius: var(--r-md); font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: calc(100% - 32px); }
[dir=rtl] #toast { transform: translateX(50%); }
#toast.show { opacity: 1; }
#toast.bad { background: var(--red); }

.empty { text-align: center; padding: 48px 16px; color: var(--ink-2); }
.empty h2 { color: var(--ink); }

@media (max-width: 640px) {
  .top { gap: 10px; flex-wrap: wrap; }
  nav { order: 3; width: 100%; overflow-x: auto; }
  .usage { display: none; }
  .scene { grid-template-columns: 28px 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::after { animation: none !important; transition: none !important; }
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- brand kit editor + preview */
.story { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 640px) { .story { grid-template-columns: repeat(6, minmax(96px, 1fr)); } }
.frame.skip { opacity: .45; border-style: dotted; }
.brand-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.brand-side { position: sticky; top: 84px; }
@media (max-width: 760px) { .brand-grid { grid-template-columns: 1fr; } .brand-side { position: static; } }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border: 1.5px solid var(--rule);
  border-radius: var(--r-md); background: var(--paper); font-weight: 500; margin: 0; cursor: pointer; }
.swatch input { width: 34px; height: 34px; border: 0; padding: 0; background: none; cursor: pointer; }
.swatch code { font-size: 12px; color: var(--ink-3); }
.logo-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.logo-box { width: 64px; height: 64px; border: 1.5px dashed var(--rule); border-radius: var(--r-md); display: grid; place-items: center;
  background: repeating-conic-gradient(#f0f2f5 0% 25%, #fff 0% 50%) 0 0/12px 12px; overflow: hidden; }
.logo-box img { max-width: 56px; max-height: 56px; }
.logo-box .hint { font-size: 11px; text-align: center; background: var(--paper); padding: 2px; }
.pv { position: relative; border-radius: var(--r-md); overflow: hidden; box-shadow: 0 0 0 1.5px var(--rule); }
.pv-169 { aspect-ratio: 16 / 9; }
.pv-916 { aspect-ratio: 9 / 16; max-width: 200px; margin: 0 auto; display: flex; flex-direction: column; }
.pv-logo { max-height: 22px; max-width: 60px; object-fit: contain; vertical-align: middle; }
.pv-wb { padding: 14px 16px; color: #1d2433; }
.pv-wb .pv-h { font-size: 21px; line-height: 1.15; max-width: 82%; }
.pv-wb .pv-u { height: 4px; width: 44%; border-radius: 4px; margin: 6px 0 12px; }
.pv-wb .pv-row { display: flex; align-items: center; gap: 10px; font-size: 14px; max-width: 75%; }
.pv-wb .pv-pill { position: absolute; bottom: 8px; inset-inline-start: 10px; display: inline-flex; gap: 6px; align-items: center;
  background: #1d2433; color: #fff; font-size: 10px; padding: 3px 8px; border-radius: 99px; }
.pv-wb .pv-pill .pv-logo { max-height: 14px; }
.pv-wb .pv-face { position: absolute; right: 10px; bottom: 10px; width: 46px; height: 46px; border-radius: 50%; border: 3px solid;
  background: radial-gradient(circle at 50% 38%, #8a5a3c 0 26%, transparent 27%), radial-gradient(circle at 50% 110%, #8a5a3c 0 45%, #e9d3c1 46%); }
.pv-916 .pv-top { flex: 0 0 44%; display: grid; place-items: center; text-align: center; font-size: 17px; padding: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(0,0,0,.18)); }
.pv-916 .pv-band { background: #F4EFE6; color: #1b1b1b; padding: 8px; text-align: center; display: flex; flex-direction: column; gap: 2px; align-items: center; }
.pv-916 .pv-band b { font-size: 15px; } .pv-916 .pv-band span { font-size: 10px; color: #555; } .pv-916 .pv-band small { font-size: 8px; color: #777; }
.pv-916 .pv-cap { padding: 14px 10px; text-align: center; font-size: 14px; }
.pv mark { color: #1b1b1b; padding: 0 3px; border-radius: 3px; }
.pv-pod { display: grid; grid-template-columns: 1fr 0.8fr 1fr; gap: 8px; padding: 12px; }
.pv-pod .pv-panel { background: #F4EFE6; color: #1b1b1b; border-radius: 6px; padding: 8px; font-size: 11px; }
.pv-pod .pv-panel.dim { opacity: .7; }
.pv-pod .pv-mid { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; color: #ddd; }
.pv-pod .pv-mid b { font-size: 13px; } .pv-pod .pv-mid small { font-size: 8px; }
.pv-pod .pv-mid span { display: flex; gap: 6px; } .pv-pod .pv-mid i { width: 16px; height: 16px; border-radius: 50%; display: block; }
.kits { list-style: none; margin: 0; padding: 0; }
.kits li { display: flex; align-items: center; gap: 14px; padding: 14px 4px; border-top: 1px solid var(--rule); flex-wrap: wrap; }
.kits li:first-child { border-top: 0; }
.kit-logo { width: 44px; height: 44px; border-radius: var(--r-sm); background: var(--paper); border: 1px solid var(--rule); display: grid; place-items: center; overflow: hidden; }
.kit-logo img { max-width: 40px; max-height: 40px; }
.kit-what { flex: 1; min-width: 160px; } .kit-what small { display: block; color: var(--ink-3); }
.kit-sw { display: flex; gap: 4px; } .kit-sw i { width: 22px; height: 22px; border-radius: 50%; box-shadow: 0 0 0 1px var(--rule); display: block; }
.kit-act { display: flex; gap: 6px; }
/* six frames: tighter type so two lines fit */
.frame { padding: 8px 10px; }
.frame small { padding-inline-end: 22px; line-height: 1.3; }
.frame strong { font-size: 14px; }
/* checkbox chips read as checkboxes, not buttons */
.chip input[type=checkbox] + span { padding-inline-start: 38px; position: relative; }
.chip input[type=checkbox] + span::before { content: ""; position: absolute; inset-inline-start: 12px; top: 50%; width: 16px; height: 16px;
  margin-top: -8px; border: 2px solid var(--ink-3); border-radius: 4px; background: var(--paper); }
.chip input[type=checkbox]:checked + span { background: var(--paper); color: var(--ink); border-color: var(--ink); }
.chip.ai-opt > span { display: block; border-radius: 14px; line-height: 1.5; padding-block: 10px; }
.chip.ai-opt em { font-style: normal; margin-inline-start: 6px; }
.chip.ai-opt small { font-size: 13px; }
.chip input[type=checkbox]:checked + span::before { background: var(--ink); border-color: var(--ink);
.chip.ai-opt > span { display: block; border-radius: 14px; line-height: 1.5; padding-block: 10px; }
.chip.ai-opt em { font-style: normal; margin-inline-start: 6px; }
.chip.ai-opt small { font-size: 13px; }
  box-shadow: inset 0 0 0 3px var(--paper); }
.frame small { position: absolute; top: 8px; inset-inline-start: 26px; inset-inline-end: 30px; padding: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* ---------- reel layouts */
.card .thumb.tall { width: auto; height: 150px; margin: 0 auto; background: none; }
.layouts { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.rv { position: relative; background: #A9B4C2; color: #fff; }
.rv .rv-person { position: absolute; left: 50%; top: 30%; width: 44%; aspect-ratio: 1; transform: translateX(-50%);
  border-radius: 50%; background: radial-gradient(circle at 50% 40%, #8a5a3c 0 30%, transparent 31%), radial-gradient(circle at 50% 120%, #3a4a63 0 52%, transparent 53%); }
.rv-full .rv-person { width: 70%; top: 22%; }
.rv .rv-bug { position: absolute; top: 15.6%; inset-inline-start: 5.5%; display: inline-flex; gap: 4px; align-items: center;
  background: rgba(10,14,22,.6); border-radius: 99px; font-size: 9px; padding: 2px 7px; }
.rv .rv-bug .pv-logo { max-height: 12px; }
.rv .rv-head { position: absolute; top: 15.6%; left: 5.5%; right: 5.5%; border-radius: 8px; padding: 7px; text-align: center; font-size: 13px; line-height: 1.2; }
.rv-full .rv-head + .rv-bug { top: 28%; }
.rv .rv-cap { position: absolute; left: 6%; right: 6%; top: 62%; text-align: center; font-size: 15px; font-weight: 800;
  text-shadow: 0 0 3px #000, 0 0 3px #000; }
.rv .rv-bar { position: absolute; left: 0; top: 74.8%; height: 3px; width: 45%; }
.rv .rv-lt { position: absolute; top: 52.6%; inset-inline-start: 5.5%; width: 78%; background: #fff; color: #1d2433; border-radius: 6px;
  padding: 4px 8px; border-inline-start: 4px solid; display: flex; flex-direction: column; }
.rv .rv-lt b { font-size: 12px; } .rv .rv-lt small { font-size: 9px; color: #4a5468; }
.rv .rv-fhead { position: absolute; top: 15.6%; left: 5.5%; right: 5.5%; text-align: center; font-size: 12px; line-height: 1.2; }
.rv .rv-square { position: absolute; top: 23%; left: 8.3%; width: 83.4%; aspect-ratio: 1; border-radius: 8px; background: #A9B4C2; overflow: hidden; }
.rv .rv-square .rv-person { top: 18%; width: 60%; }
.rv .rv-square .rv-cap { top: 76%; font-size: 12px; }
.rv .rv-row { position: absolute; top: 70.5%; left: 0; right: 0; display: flex; gap: 6px; justify-content: center; align-items: center; font-size: 9px; }
.rv .rv-row .pv-logo { max-height: 14px; }

/* cartoon brand preview */
.tv { background: linear-gradient(#8ECAE6, #BDE0F0); position: relative; justify-content: center; align-items: center; }
.tv-pill { position: absolute; top: 16%; left: 50%; transform: translateX(-50%); display: inline-flex; gap: 4px; align-items: center;
  color: #fff; font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 999px; opacity: .85; white-space: nowrap; }
.tv-pill .pv-logo { width: 14px; height: 14px; }
.tv-stage { width: 80%; margin-top: 14%; }
.tv-art { width: 100%; height: auto; display: block; }
.tv-cap { color: #fff; font-size: 17px; font-weight: 800; text-align: center; margin-top: 6px; padding-inline-end: 12%;
  -webkit-text-stroke: 3px #111; paint-order: stroke fill; }

/* kinetic brand preview */
.kv { position: relative; align-items: center; color: #141824; }
.kv-handle { margin-top: 14%; font: 700 8px ui-monospace, monospace; color: #555; display: inline-flex; gap: 3px; align-items: center; }
.kv-handle i { width: 4px; height: 4px; border-radius: 50%; display: inline-block; }
.kv-head { margin-top: 6%; padding: 0 10px; font-size: 17px; font-weight: 800; text-align: center; line-height: 1.25; }
.kv-card { margin-top: 12%; width: 74%; background: #fff; border-radius: 8px; box-shadow: 0 4px 12px rgba(40,52,90,.14);
  padding: 6px 8px; display: flex; flex-direction: column; gap: 2px; text-align: left; }
.kv-card code { font: 8px ui-monospace, monospace; white-space: pre; color: #141824; }
.kv-card code.bad { background: #FBE1E2; color: #E5484D; border-radius: 3px; }
.kv-dots { display: flex; gap: 3px; margin-bottom: 3px; } .kv-dots i { width: 4px; height: 4px; border-radius: 50%; background: #E5E8F0; }
.kv-pill { position: absolute; bottom: 22%; width: 66%; background: #fff; border-radius: 999px; box-shadow: 0 3px 8px rgba(40,52,90,.12);
  display: flex; align-items: center; gap: 5px; padding: 4px 8px; font-size: 7px; color: #8A93A6; }
.kv-pill b { font: 700 8px ui-monospace, monospace; } .kv-pill i { flex: 1; height: 3px; background: #E5E8F0; border-radius: 2px; position: relative; }
.kv-pill u { position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 40%; border-radius: 2px; }

/* post copy */
.pc-card { border: 1px solid var(--rule); border-radius: var(--r-md); padding: 10px 14px; margin: 10px 0; background: var(--paper); }
.pc-card summary { cursor: pointer; font-weight: 700; }
.pc-field { margin-top: 12px; }
.pc-top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.pc-top b { flex: 1; }
.pc-top .over { color: var(--red); font-weight: 700; }
.pc-text { white-space: pre-wrap; word-break: break-word; background: var(--board); border-radius: var(--r-sm); padding: 10px 12px;
  font-size: 14px; line-height: 1.6; max-height: 320px; overflow: auto; unicode-bidi: plaintext; }

/* credits & plans */
.usage a { color: inherit; text-decoration: none; }
.cost-items { margin: 6px 0 0; padding-inline-start: 18px; font-size: 14px; color: var(--ink-2, #4A5468); }
.cost-items b { margin-inline-start: 4px; }
.balance { display: flex; flex-wrap: wrap; gap: 14px; }
.balance > div { flex: 1 1 180px; display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1.5px solid var(--rule); border-radius: 12px; }
.balance b { font-size: 26px; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.plan { position: relative; padding: 16px; border: 1.5px solid var(--rule); border-radius: 12px; }
.plan.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.plan h3 { margin: 0 0 4px; }
.plan .price { font-size: 24px; font-weight: 700; margin: 0 0 8px; }
.plan .badge { position: absolute; top: 12px; inset-inline-end: 12px; }
table.prices td.num, td.num { text-align: end; white-space: nowrap; }
td.neg { color: #B42318; } td.pos { color: #0B6E4D; }
.manage-box { padding: 6px 0 4px; }
.manage-box .row { align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.manage-box .row button { margin-bottom: 14px; }

/* ---------- thumbnails, retention note, footer */
.thumbs { display: grid; grid-template-columns: 1.6fr .62fr .9fr; gap: 14px; align-items: end; margin: 14px 0 6px; }
.thumb-card { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.thumb-card img { display: block; width: 100%; height: auto; border-radius: var(--r-md); border: 1px solid var(--rule);
  box-shadow: 0 2px 10px rgba(29,36,51,.08); background: var(--board); }
.thumb-card figcaption { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink-2); }
.thumb-card figcaption .btn { align-self: flex-start; }
.th-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-top: 12px; }
.th-form .field { flex: 1 1 260px; margin: 0; }
.th-form input { width: 100%; }
.retention { margin-top: 16px; padding: 12px 14px; border-radius: var(--r-md); background: #FFF8E6; border: 1px solid #F3DFA8; }
.retention p { margin: 0; }
.retention .hint { margin-top: 4px; }
.privacy-note a, .retention a { white-space: nowrap; }
.foot { max-width: 860px; margin: -64px auto 40px; padding: 0 clamp(16px, 4vw, 40px); display: flex; gap: 18px; flex-wrap: wrap;
  font-size: 14px; }
.foot a { color: var(--ink-3); }
@media (max-width: 640px) {
  .thumbs { grid-template-columns: 1fr 1fr; }
  .thumbs .f16x9 { grid-column: 1 / -1; }
}

/* saved cartoon characters (My characters page, job page, wizard picker) */
.char-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin-top: 12px; }
.char-card { margin: 0; display: flex; flex-direction: column; gap: 8px; border: 1.5px solid var(--rule); border-radius: 14px;
  padding: 10px; background: var(--paper); position: relative; }
.char-img { display: flex; align-items: flex-end; justify-content: center; aspect-ratio: 1; border-radius: 10px;
  background: linear-gradient(180deg, #EEF3F8 0 68%, #DCE5EE 68% 100%); overflow: hidden; }
.char-img img { max-width: 86%; max-height: 92%; object-fit: contain; }
.char-card figcaption { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.char-card small { color: #6B7385; font-size: 12px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden; }
.char-grid.pick .char-card { cursor: pointer; text-align: center; align-items: center; }
.char-grid.pick input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.char-grid.pick .char-card:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink) inset; }
.char-grid.pick .char-card:has(input:checked)::after { content: "✓"; position: absolute; top: 8px; inset-inline-end: 10px;
  background: var(--ink); color: #fff; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; }
.char-grid.pick .char-card:has(input:focus-visible) { outline: 3px solid var(--blue); outline-offset: 2px; }

/* per-speaker voices: wizard slots and the job page's "Cast & voices" panel (logical properties: works RTL) */
.voice-slots { display: flex; flex-direction: column; gap: 14px; max-width: 560px; }
.voice-slots + .hint { margin-top: 10px; }
.voice-slot { display: flex; align-items: flex-end; gap: 8px; }
.voice-slot .field { flex: 1; margin-bottom: 0; }
.voice-slot .field select { width: 100%; }
button.listen { white-space: nowrap; min-height: 40px; }
button.listen[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.cast { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.cast-row { display: grid; grid-template-columns: 52px minmax(110px, 1fr) minmax(180px, 2fr) auto; align-items: center; gap: 12px;
  border: 1.5px solid var(--rule); border-radius: 14px; padding: 8px 12px; background: var(--paper); }
.cast-img { width: 52px; height: 52px; border-radius: 12px; overflow: hidden; display: grid; place-items: center;
  background: linear-gradient(180deg, #EEF3F8 0 68%, #DCE5EE 68% 100%); }
.cast-img img { max-width: 90%; max-height: 90%; object-fit: contain; }
.cast-img.ph { font-weight: 700; font-size: 22px; color: var(--ink-3, #5A6275); }
.cast-who { display: flex; flex-direction: column; min-width: 0; }
.cast-who small { color: #6B7385; font-size: 12px; }
.cast-row select { width: 100%; }
@media (max-width: 640px) {
  .cast-row { grid-template-columns: 44px 1fr auto; }
  .cast-row select { grid-column: 1 / -1; grid-row: 2; }
  .cast-img { width: 44px; height: 44px; }
}

/* ---------- series (Pro) */
.eps { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.eps li { border: 1px solid var(--rule); border-radius: var(--r-md); padding: 10px 14px; }
.eps p { margin: 6px 0 0; color: var(--ink-2); font-size: 15px; line-height: 1.5; }
.ep-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ep-head .status { grid-row: auto; }
.small-link { margin-inline-start: auto; font-size: 14px; }
.ideas { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.idea { display: grid; grid-template-columns: 30px 1fr; gap: 10px; border: 1.5px solid var(--rule); border-radius: var(--r-md); padding: 12px 14px; background: var(--paper); }
.idea-n { width: 28px; height: 28px; border-radius: 50%; background: var(--board); display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.idea-body p { margin: 4px 0 10px; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.idea-body .field { margin-bottom: 10px; }
.idea-act { display: flex; gap: 8px; flex-wrap: wrap; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 16px; margin: 12px 0 18px; }
.facts div { background: var(--board); border-radius: var(--r-sm); padding: 8px 12px; }
.facts dt { font-size: 12px; color: var(--ink-3); } .facts dd { margin: 2px 0 0; font-weight: 600; }

/* sharing (docs/10) */
.nbadge { display: inline-block; min-width: 20px; margin-inline-start: 6px; padding: 0 6px; border-radius: 999px; background: var(--red); color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; }
.sh-people li { flex-wrap: wrap; gap: 8px 12px; }
.sh-people .what { flex: 1 1 100%; }
@media (min-width: 640px) { .sh-people .what { flex: 1 1 0; } }
.sh-people select { width: auto; }
.sh-req { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.sh-h3 { font-size: 18px; margin: 22px 0 4px; }
.sh-link { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.sh-link input { flex: 1 1 280px; min-width: 0; font-family: ui-monospace, Menlo, monospace; font-size: 14px; }

/* own voice: line list on the job page (docs/12) */
.ov-progress { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.ov-progress .bar { flex: 1; margin: 0; }
.ov-lines { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 8px; }
.ov-line { display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: start; padding: 12px 14px;
  border: 1px solid var(--rule); border-radius: var(--r-md, 12px); background: var(--paper, #fff); }
.ov-line.ok { border-inline-start: 4px solid #2EC4B6; }
.ov-line.todo { border-inline-start: 4px solid var(--ink-3, #C5CAD3); }
.ov-line.stale { border-inline-start: 4px solid #E8B33D; }
.ov-line.other { opacity: .6; background: transparent; }
.ov-n { font-weight: 700; color: var(--ink-2, #5B6372); text-align: center; padding-top: 2px; }
.ov-txt p { margin: 2px 0; font-size: 16px; line-height: 1.6; }
.ov-txt small { color: var(--ink-2, #5B6372); }
.ov-line.ok .ov-st { color: #1B8F84; } .ov-line.stale .ov-st { color: #A87A12; }
.ov-btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.error-box.warn { background: #FFF6E0; border-color: #E8B33D; color: #6B4E0A; }
@media (max-width: 600px) { .ov-line { grid-template-columns: 24px 1fr; } .ov-btns { grid-column: 2; justify-content: flex-start; } }

/* own voice: the teleprompter (full screen, dark, large text; the stage follows the video's language) */
body.tp-open { overflow: hidden; }
.tp { position: fixed; inset: 0; z-index: 1000; background: #0B1F3A; color: #fff; display: flex; flex-direction: column;
  padding: 16px clamp(16px, 4vw, 48px) 20px; font-family: var(--font-body); }
.tp-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.tp-count { font-size: 15px; letter-spacing: .02em; }
.tp-meter { flex: 1; min-width: 80px; max-width: 260px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.15); overflow: hidden; }
.tp-meter i { display: block; height: 100%; width: 0; background: #2EC4B6; transition: width 60ms linear; }
.tp-auto { display: flex; align-items: center; gap: 6px; font-size: 14px; color: rgba(255,255,255,.85); }
.tp .ghost, .tp .tp-close { color: #fff; }
.tp-close { margin-inline-start: auto; }
.tp-stage { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 22px; max-width: 980px;
  width: 100%; margin: 0 auto; overflow: auto; }
.tp-line { margin: 0; font: 600 clamp(26px, 4.4vw, 46px)/1.55 var(--font-body); }
.tp-ctx, .tp-next { margin: 0; font-size: clamp(16px, 2vw, 21px); line-height: 1.6; color: rgba(255,255,255,.42); }
.tp-ctx small, .tp-next small { display: block; font-size: 13px; letter-spacing: .03em; color: #E8B33D; opacity: .9; }
.tp-state { min-height: 1.6em; text-align: center; color: #2EC4B6; font-size: 16px; margin: 8px 0; }
.tp-ctrl { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.tp-ctrl .secondary { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.tp-rec { min-width: 170px; justify-content: center; text-align: center; background: #2EC4B6; color: #0B1F3A; border-color: #2EC4B6; }
.tp-rec.on { background: #E5484D; border-color: #E5484D; color: #fff; }
.tp-hint { text-align: center; color: rgba(255,255,255,.55); margin: 12px 0 0; }
@media (max-width: 600px) { .tp-ctrl button { flex: 1 1 40%; } .tp-rec { flex-basis: 100%; order: -1; } }

/* brand kit: previews for narrated + fixed-look templates, thumbnail strip */
.nv { background: linear-gradient(160deg, #55828b 0%, #2f4858 55%, #1f3340 100%); }
.nv .nv-card { margin: 14% 8% 0; background: #fff; color: #1d2433; border-radius: 6px; padding: 6px 8px 6px 14px; font-size: 12px; position: relative; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.nv .nv-card i { position: absolute; inset-block: 0; inset-inline-start: 0; width: 5px; border-radius: 6px 0 0 6px; }
.nv .nv-doodle { width: 56%; margin: 16% auto 0; display: block; }
.nv .nv-cap { margin-top: auto; padding: 0 8px 22%; text-align: center; color: #fff; font-size: 14px; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.nv .nv-pill, .fv .fv-pill { position: absolute; bottom: 7%; inset-inline-start: 8%; display: inline-flex; gap: 5px; align-items: center;
  background: rgba(255,255,255,.92); color: #111; font-size: 9px; padding: 3px 8px; border-radius: 99px; max-width: 70%; overflow: hidden; white-space: nowrap; }
.fv { background: #222; }
.fv .fv-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.fv-note { text-align: center; margin: 8px auto 0; max-width: 240px; }
.bk-thumbs-row { display: grid; grid-template-columns: 16fr 5.06fr 7.2fr; gap: 8px; align-items: end; }
.bk-th { margin: 0; }
.bk-th img { width: 100%; display: block; border-radius: 6px; background: var(--paper); box-shadow: 0 0 0 1px var(--rule); }
.bk-th-16x9 img { aspect-ratio: 16 / 9; } .bk-th-9x16 img { aspect-ratio: 9 / 16; } .bk-th-4x5 img { aspect-ratio: 4 / 5; }
.bk-th figcaption { font-size: 10px; color: var(--ink-3); margin-top: 3px; line-height: 1.2; }
.bk-pvas { display: flex; align-items: center; gap: 8px; margin-top: 10px; } .bk-pvas select { flex: 1; min-width: 0; }

/* ---------- edit my podcast (docs/14): wizard people, upload list, review page ---------- */
.pe-person { align-items: flex-end; }
.pe-person > .ghost, .pe-person > .pe-gap { margin-bottom: 18px; min-width: 70px; }
.pe-consent { display: inline-block; margin-top: 6px; }
.pe-files li { flex-wrap: wrap; }
.pe-who { display: flex; align-items: center; gap: 8px; }
.pe-who span { color: var(--ink-3); font-size: 14px; white-space: nowrap; }
.pe-photos { display: flex; flex-wrap: wrap; gap: 18px; }
.pe-photo { display: grid; justify-items: center; gap: 6px; min-width: 110px; }
.pe-photo .cast-img { width: 72px; height: 72px; border-radius: 50%; }
.pe-voice { grid-template-columns: 52px minmax(110px, 1fr) minmax(160px, 2fr) auto; }
.pe-ch { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.pe-ch input { flex: 1; }
.pe-t { color: var(--ink-3); font-variant-numeric: tabular-nums; font-size: 14px; min-width: 52px; }
.pe-refs { display: grid; gap: 14px; }
.pe-ref { display: grid; grid-template-columns: 84px 1fr auto; gap: 14px; align-items: start; padding: 12px;
  border: 1px solid var(--rule); border-radius: 14px; }
.pe-ref.off { opacity: .55; }
.pe-ref input { width: 100%; margin-top: 6px; }
.pe-ref small { color: var(--ink-3); }
.pe-cover { width: 84px; height: 120px; border-radius: 8px; overflow: hidden; background: #F1F4F8; display: grid; place-items: center; font-size: 34px; }
.pe-cover img { width: 100%; height: 100%; object-fit: cover; }
.pe-tx { max-height: 70vh; overflow-y: auto; padding-inline-end: 6px; }
.pe-turn { padding: 10px 0; border-top: 1px solid var(--rule); }
.pe-turn:first-child { border-top: 0; }
.pe-turn-h { display: flex; align-items: center; gap: 10px; }
.pe-turn-h select { max-width: 220px; }
.pe-turn p { margin: 6px 0 0; line-height: 1.9; }
.pe-turn [data-w] { cursor: pointer; border-radius: 4px; padding: 0 1px; }
.pe-turn [data-w]:hover { background: rgba(46, 196, 182, .18); }
.pe-turn [data-w].cut { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--ink-3); background: rgba(242, 95, 92, .10); }
.pe-turn [data-w].auto.cut { text-decoration-color: #F25F5C; }
.pe-save { position: sticky; bottom: 0; background: var(--board); padding: 10px 0; z-index: 2; }
@media (max-width: 640px) {
  .pe-ref { grid-template-columns: 64px 1fr; }
  .pe-ref > .chip { grid-column: 1 / -1; }
  .pe-cover { width: 64px; height: 92px; }
}
.pe-clips { display: grid; gap: 12px; }
.pe-clip { border: 1px solid var(--rule); border-radius: 14px; padding: 12px; }
.pe-clip.off { opacity: .55; }
.pe-clip-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.pe-clip-h .chip { margin-inline-start: auto; }
.pe-clip input[type=text] { width: 100%; }
.pe-cold { margin: 8px 0 10px; padding: 10px 14px; border-inline-start: 4px solid var(--rule); color: var(--ink-2); }
