:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --text: #16181d;
  --muted: #5d6370;
  --border: #e2e5ec;
  --accent: #5b3df5;
  --accent-ink: #ffffff;
  --ok: #107a45;
  --ok-bg: #e5f6ec;
  --err: #b42318;
  --err-bg: #fdecea;
  --warn: #8a5a00;
  --warn-bg: #fff4dc;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115; --surface: #171a21; --text: #eef0f4; --muted: #a0a6b3;
    --border: #2a2f3a; --accent: #8b74ff; --ok: #5fd39a; --ok-bg: #11291d;
    --err: #ff8a80; --err-bg: #2d1515; --warn: #f5c35b; --warn-bg: #2b2210;
  }
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.7rem; margin: 0 0 .4rem; }
h2 { font-size: 1.15rem; margin: 1.6rem 0 .6rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

.topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem 16px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 700; color: var(--text); font-size: 1.05rem; }
.brand-mark { color: var(--accent); }
.topbar nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.topbar nav a { color: var(--text); }
.inline { display: inline; margin: 0; }

.container { max-width: 960px; margin: 0 auto; padding: 24px 16px 64px; }
.narrow { max-width: 440px; margin: 0 auto; padding: 40px 16px 64px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.btn { display: inline-block; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 10px; padding: .65rem 1.1rem; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn-secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: transparent; color: var(--err); border: 1px solid var(--border); }
.btn-small { padding: .4rem .8rem; font-size: .9rem; color: var(--accent-ink) !important; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--text); cursor: pointer; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.2rem; }

label { display: block; font-weight: 600; margin: 1rem 0 .3rem; }
input[type=text], input[type=email], input[type=password], input[type=tel], select {
  width: 100%; padding: .65rem .75rem; border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg); color: var(--text); font: inherit;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.check { display: flex; gap: .5rem; align-items: center; font-weight: 500; }
.help { color: var(--muted); font-size: .85rem; margin-top: .25rem; }
.errorlist { color: var(--err); margin: .3rem 0 0; padding-left: 1.1rem; font-size: .9rem; }

.alert { padding: .75rem 1rem; border-radius: 10px; margin-bottom: 1rem; border: 1px solid var(--border); }
.alert-success { background: var(--ok-bg); color: var(--ok); }
.alert-error { background: var(--err-bg); color: var(--err); }
.alert-warning, .alert-info { background: var(--warn-bg); color: var(--warn); }

.badge { display: inline-block; font-size: .78rem; font-weight: 600; padding: .15rem .55rem; border-radius: 999px; background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
.badge-ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.badge-err { background: var(--err-bg); color: var(--err); border-color: transparent; }

.provider { display: flex; justify-content: space-between; align-items: center; gap: .75rem; color: var(--text); }
.provider:hover { text-decoration: none; border-color: var(--accent); }

table.routing { width: 100%; border-collapse: collapse; }
table.routing td, table.routing th { padding: .6rem .4rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
@media (max-width: 640px) {
  table.routing thead { display: none; }
  table.routing tr { display: block; padding: .6rem 0; border-bottom: 1px solid var(--border); }
  table.routing td { display: block; border: 0; padding: .25rem 0; }
}

.hero { text-align: center; padding: 64px 16px 40px; max-width: 760px; margin: 0 auto; }
.hero h1 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.15; }
.hero p { font-size: 1.15rem; color: var(--muted); }

textarea { width: 100%; padding: .65rem .75rem; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); font: inherit; resize: vertical; }
input[type=number], input[type=url] { width: 100%; padding: .65rem .75rem; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); font: inherit; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.center { text-align: center; }
.scene { margin-top: 12px; }
.scene label { margin-top: .7rem; }
.scene-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
@media (max-width: 640px) { .scene-grid { grid-template-columns: 1fr; } }
.scene-tools { display: flex; gap: 4px; }
.icon-btn { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); cursor: pointer; font-size: 1rem; }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn.danger { color: var(--err); }
.warn-text { color: var(--warn); font-weight: 600; }
.sticky-actions { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; margin: 12px 0; border-top: 1px solid var(--border); }
.spinner { width: 36px; height: 36px; margin: 8px auto 16px; border: 4px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.seo-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.seo-main > .card + .card, .seo-side > .card + .card { margin-top: 12px; }
.seo-side { position: sticky; top: 72px; }
@media (max-width: 860px) { .seo-layout { grid-template-columns: 1fr; } .seo-side { position: static; } }
.title-list { margin-top: .8rem; display: grid; gap: 6px; }
.title-option { display: flex; gap: .7rem; align-items: flex-start; margin: 0; font-weight: 400; padding: .6rem .7rem; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.title-option:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.title-option input { margin-top: .3rem; }
.title-body { display: flex; flex-direction: column; gap: 2px; }
.title-text { font-weight: 600; }
.score { font-size: 3rem; font-weight: 800; line-height: 1; }
.score span { font-size: 1rem; color: var(--muted); font-weight: 600; }
.score-good { color: var(--ok); } .score-mid { color: var(--warn); } .score-low { color: var(--err); }
.checks, .plain { list-style: none; padding: 0; margin: .8rem 0 0; display: grid; gap: 6px; font-size: .9rem; }
.checks .ok { color: var(--muted); } .checks .fix { font-weight: 600; }
.hook-box { border-bottom: 1px solid var(--border); padding-bottom: .6rem; margin-bottom: .6rem; }
.ok-text { color: var(--ok); }
.yt-preview { display: grid; gap: 6px; }
.yt-thumb { aspect-ratio: 16 / 9; border-radius: 10px; background: var(--bg); border: 1px dashed var(--border); display: grid; place-items: center; color: var(--muted); font-size: .85rem; }
.yt-title { font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nav-toggle { display: none; margin-left: auto; font-size: 1.4rem; line-height: 1; padding: .2rem .5rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); cursor: pointer; }
@media (max-width: 1240px) {  /* the full menu needs about 1240px (more in Bangla) */
  .topbar { padding: .6rem 12px; flex-wrap: wrap; }
  .brand { font-size: .95rem; }
  .nav-toggle { display: inline-block; }
  .topbar nav.collapsible { display: none; width: 100%; flex-direction: column; align-items: stretch; gap: 0; padding-top: .4rem; }
  .topbar nav.collapsible.open { display: flex; }
  .topbar nav.collapsible a, .topbar nav.collapsible form { padding: .6rem 4px; border-top: 1px solid var(--border); }
  .topbar nav.collapsible form.inline { display: block; }
  .topbar nav.collapsible .link { padding: 0; font-size: 1rem; }
}
.seo-main > form > .card + .card, .seo-main > form + .card { margin-top: 12px; }
.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: .8rem; }
.thumb-tile { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--bg); }
.thumb-tile:hover { outline: 2px solid var(--accent); }
.thumb-tile img, .yt-thumb-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.yt-thumb-img { aspect-ratio: 16 / 9; border-radius: 10px; }
.thumb-msg { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 6px; color: var(--muted); font-size: .85rem; text-align: center; padding: 8px; }
.thumb-flag { position: absolute; top: 6px; left: 6px; }
.small-spin { width: 22px; height: 22px; border-width: 3px; margin: 0; }
.thumb-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
@media (max-width: 900px) { .thumb-layout { grid-template-columns: 1fr; } }
.thumb-big { width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; display: block; background: var(--bg); object-fit: cover; }
.previews { display: grid; grid-template-columns: 1fr; gap: 18px; margin-top: 12px; }
.pv-home { max-width: 360px; }
.pv-search { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 10px; align-items: start; }
.pv-search img { width: 168px; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; }
.pv-home img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 10px; }
.pv-title { font-weight: 600; line-height: 1.3; font-size: .95rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.color-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
input[type=color] { width: 100%; height: 42px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); padding: 4px; }
input[type=range] { width: 100%; }
.sibling-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.sibling-row a img { width: 120px; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); display: block; }
input[type=radio], input[type=checkbox] { accent-color: var(--accent); width: 18px; height: 18px; }
.progress { height: 12px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border); overflow: hidden; margin: .6rem 0; }
.progress-bar { height: 100%; background: var(--accent); transition: width .6s ease; }
.player { display: block; width: 100%; aspect-ratio: 16 / 9; max-height: 72vh; border-radius: 12px; background: #000; margin: 0 auto; }
.player-916 { width: auto; max-width: 100%; height: 72vh; aspect-ratio: 9 / 16; }
.player-11 { width: auto; max-width: 100%; height: 70vh; aspect-ratio: 1; }
.track-row { padding: 12px 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.track-row:last-child { border-bottom: 0; }
details summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.icon-row { display: grid; grid-template-columns: 80px 1fr; gap: 10px; }
.icon-row-wide { grid-template-columns: 1fr 90px; }
.icon-input { text-align: center; font-size: 1.4rem; padding: .35rem; }
.promo-block { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px 4px; margin-top: 6px; }
.field-row, .promo-block .field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.promo-block label { font-size: .85rem; }
.promo-block [hidden] { display: none !important; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: middle; }
input[type=color] { max-width: 120px; }
.voice-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.voice-row select { flex: 1 1 260px; width: auto; min-width: 0; max-width: 100%; }

/* AI usage & costs */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; margin: 1rem 0; }
.stat-row .card { margin: 0; }
.stat-num { font-size: 1.5rem; font-weight: 700; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.empty { text-align: center; padding: 28px 16px; color: var(--muted); border: 1px dashed var(--border); border-radius: 12px; }
.empty .btn { margin-top: 10px; }
.usage-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.usage-table th, .usage-table td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.usage-table td:first-child { white-space: normal; }
.usage-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.usage-table tfoot th { border-bottom: 0; }

/* YouTube publishing */
input[type=datetime-local] { width: 100%; padding: .65rem .75rem; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); font: inherit; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .two-col { grid-template-columns: 1fr; } }
.thumb-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.thumb-option { margin: 0; position: relative; border: 2px solid var(--border); border-radius: 10px; overflow: hidden; cursor: pointer; font-weight: 500; }
.thumb-option input { position: absolute; top: 6px; left: 6px; }
.thumb-option img { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.thumb-option:has(input:checked) { border-color: var(--accent); }
.thumb-none { display: flex; align-items: center; justify-content: center; aspect-ratio: 16/9; color: var(--muted); }
.yt-avatar { width: 32px; height: 32px; border-radius: 50%; vertical-align: middle; margin-right: .5rem; }
.container > .card + .card { margin-top: 12px; }
.publish-steps { margin: .4rem 0 0; padding-left: 1.3rem; display: grid; gap: .9rem; }
.publish-steps li > * { display: block; margin-top: .3rem; }
.publish-steps li > form, .publish-steps li > .btn { display: inline-block; margin-top: .5rem; }
.publish-steps li.done::marker { color: var(--ok); }
.site-footer { text-align: center; padding: 24px 16px 32px; border-top: 1px solid var(--border); }
.legal { max-width: 760px; }
.legal h2 { margin-top: 1.8rem; }
.legal li { margin: .3rem 0; }
.day-pick { display: flex; flex-wrap: wrap; gap: .4rem .9rem; }
.day-pick .day { margin: 0; }
input[type=time] { width: 100%; padding: .65rem .75rem; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); font: inherit; }
.topic-list { padding-left: 1.3rem; margin: .4rem 0 0; }
.topic-list li { padding: .3rem 0; border-bottom: 1px solid var(--border); }
.topic-list li > span { margin-right: .5rem; }
.attach-form { display: flex; gap: .4rem; margin-top: .35rem; align-items: center; }
.attach-form select { padding: .3rem .5rem; font-size: .85rem; max-width: 260px; }
.row-gap { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.lang-toggle { display: inline-flex; gap: .25rem; }
.filter-bar { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.filter-bar input[type=text] { flex: 1 1 220px; width: auto; }
.filter-bar select { width: auto; flex: 0 1 auto; }
.badge-warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.library td:first-child { min-width: 260px; }
.usage-table.library td { white-space: normal; vertical-align: top; }
.usage-table.library td:nth-child(2), .usage-table.library td:nth-child(4), .usage-table.library td:nth-child(5), .usage-table.library td:nth-child(6) { white-space: nowrap; }
.usage-table.library td:nth-child(3) { min-width: 170px; }
.cost-chip { display: inline-block; font-size: .75rem; font-weight: 600; padding: .05rem .4rem; border-radius: 999px;
  background: var(--ok-bg); color: var(--ok); text-decoration: none; white-space: nowrap; }
.cost-chip:hover { outline: 1px solid var(--ok); }
.owner-cost { display: inline-block; margin-left: .5rem; font-size: .85rem; color: var(--ok); }

/* billing */
.billing-now { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; }
.big { font-size: 1.6rem; font-weight: 700; margin: .1rem 0; }
.plan-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.plan h3 { margin: .3rem 0 0; }
.plan-hot { border-color: var(--accent); }
.plan-current { outline: 2px solid var(--ok); }
.price { font-size: 1.5rem; font-weight: 700; margin: .4rem 0 0; }
.plan-list { padding-left: 1.1rem; line-height: 1.7; }
.pay-option { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; margin: 6px 0; cursor: pointer; font-weight: 400; }
.pay-option input { width: auto; margin-top: 4px; }
.invoice { max-width: 680px; }
.invoice-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.nav-credits { font-size: .85rem; padding: .2rem .55rem; border: 1px solid var(--border); border-radius: 999px; }
.nav-low { color: var(--err); border-color: var(--err); }
@media print { .topbar, footer, .no-print { display: none !important; } .card { border: 0; } }

/* landing */
.landing { padding-top: 0; }
.land-section { margin: 56px 0; }
.land-section h2.center { font-size: clamp(1.4rem, 3vw, 1.9rem); margin-bottom: .3rem; }
.land-section > p.center { max-width: 680px; margin: 0 auto 20px; }
.demo-frame { position: relative; max-width: 860px; margin: 0 auto; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.demo-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.steps-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-top: 20px; }
.steps-grid h3, .landing .grid h3 { margin: .4rem 0 .3rem; font-size: 1.05rem; }
.step-no { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: .9rem; }
.landing .grid { margin-top: 20px; }
.honest .card { max-width: 760px; margin: 0 auto; }
.faq { max-width: 760px; margin-left: auto; margin-right: auto; }
.faq details { border-bottom: 1px solid var(--border); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: .6rem 0 0; }
.cookie-note { position: fixed; left: 16px; right: 16px; bottom: 16px; max-width: 640px; margin: 0 auto; display: flex; gap: 12px; align-items: center; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; font-size: .9rem; box-shadow: 0 8px 24px rgba(0,0,0,.25); z-index: 20; }
.cookie-note[hidden] { display: none; }
.hero h2 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); }

/* admin */
.ops-nav { margin-top: -.4rem; }
.filter-row { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1rem 0; }
.filter-row input, .filter-row select { max-width: 260px; }
.stat-num.warn-text { color: var(--err); }

/* sign-in & security */
.google-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; color: var(--text) !important; margin-top: .4rem; }
.or-line { display: flex; align-items: center; gap: 10px; margin: 14px 0 0; }
.or-line::before, .or-line::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.qr-box { background: #fff; padding: 10px; width: 220px; border-radius: 12px; }
.qr-box svg { width: 200px; height: 200px; display: block; }
.backup-codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 10px 0; }
.backup-codes code { padding: 8px; text-align: center; border: 1px solid var(--border); border-radius: 8px; font-size: 1rem; }

/* research */
.research-tabs .btn-secondary { color: var(--text) !important; }

/* analytics */
.retention { width: 100%; height: 160px; color: var(--accent); background: var(--bg); border-radius: 10px; }
.retention-mark { stroke: var(--err); stroke-width: 2; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.spark { width: 120px; height: 32px; color: var(--accent); }
.coach-list { margin: .3rem 0 0; padding-left: 1.2rem; }
.coach-list li { padding: .2rem 0; }
.btn-secondary.btn-small { color: var(--text) !important; }
.btn-danger.btn-small { color: var(--err) !important; }
.research-title { overflow-wrap: anywhere; }
.action-plan { border-left: 4px solid var(--accent); }

/* Bangla screens: a proper Bangla font, a touch larger */
html[lang="bn"] body { font-family: "Hind Siliguri", system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 17px; line-height: 1.6; }
html[lang="bn"] .small { font-size: .92rem; }

/* storyboard: scene picture / own upload */
.scene-media { display: grid; grid-template-columns: 220px 1fr; gap: 12px; margin-top: .8rem; align-items: start; }
.scene-media-preview { aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: var(--bg); border: 1px solid var(--border); }
.scene-media-preview img, .scene-media-preview video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scene-media-empty { height: 100%; display: grid; place-items: center; align-content: center; gap: 6px; padding: 8px; text-align: center; color: var(--muted); font-size: .8rem; }
.scene-media-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.scene-media-tools .help { flex-basis: 100%; margin: 0; }
.file-btn { cursor: pointer; margin: 0; }
@media (max-width: 640px) { .scene-media { grid-template-columns: 1fr; } }
.quota-card { margin-bottom: 12px; }
.meter { height: 10px; border-radius: 999px; background: var(--border); overflow: hidden; margin: .6rem 0 .4rem; }
.meter > span { display: block; height: 100%; background: var(--ok); border-radius: 999px; }
.meter > span.meter-warn { background: #d9a400; }
.meter > span.meter-full { background: #d0453a; }
.danger-text { color: var(--err) !important; }
.cat-row { display: grid; grid-template-columns: minmax(120px, 200px) 1fr auto; gap: .6rem; align-items: center; margin: .35rem 0; }
.cat-bar { height: 10px; border-radius: 999px; background: var(--border); overflow: hidden; }
.cat-bar > span { display: block; height: 100%; background: var(--accent); }
.doctor-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin: .8rem 0 .2rem; }
.doctor-stats .stat-num { font-size: 1.3rem; }
.doctor-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.doctor-list li { border: 1px solid var(--border); border-radius: 10px; padding: .6rem .8rem; }
.doctor-list .doc-bad { border-color: var(--err); }
.doctor-list .doc-ok { border-color: var(--ok); }

/* New explainer: look picker */
.form-step { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; margin: 1.4rem 0 .6rem; }
.form-step span { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-size: .85rem; }
.style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin: 6px 0 10px; }
.style-card { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 2px solid var(--border); border-radius: 12px; cursor: pointer; background: var(--card); font-weight: normal; }
.style-card input { position: absolute; opacity: 0; width: 0; height: 0; }
.style-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; display: block; }
.style-card strong { font-size: .95rem; }
.style-card .help { margin: 0; }
.style-card.is-on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.theme-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }

/* Dashboard */
.needs-row { display: flex; flex-wrap: wrap; gap: 10px; }
.need { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .8rem; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); color: var(--text); text-decoration: none; }
.need-warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.need-err { background: var(--err-bg); color: var(--err); border-color: transparent; }
.start-steps { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.start-steps li { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: center; }
.start-steps a { color: var(--text); text-decoration: none; display: flex; flex-direction: column; }
.start-steps .tick { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--bg); border: 1px solid var(--border); }
.start-steps li.done .tick { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.start-steps li.done strong { text-decoration: line-through; color: var(--muted); }
.recent-row { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; }
.recent-row:last-child { border-bottom: 0; }
.recent-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) {
  table:not(.routing) { display: block; overflow-x: auto; max-width: 100%; }
  table:not(.routing) th { white-space: nowrap; }
}

/* Landing page */
.hero-split { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; text-align: left; max-width: 1180px; padding: 56px 16px 32px; }
.hero-split h1 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); margin: .4rem 0 .6rem; }
.hero-split .actions { justify-content: flex-start; }
.eyebrow { display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); padding: .25rem .7rem; border-radius: 999px; }
.hero-points { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: .95rem; }
.hero-points li::before { content: "✓"; color: var(--ok); font-weight: 700; margin-right: 6px; }
.shot-frame { border-radius: 14px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 24px 60px rgba(40, 20, 120, .16); }
.shot-bar { height: 30px; display: flex; align-items: center; gap: 6px; padding: 0 12px; background: var(--bg); border-bottom: 1px solid var(--border); }
.shot-bar i { width: 9px; height: 9px; border-radius: 50%; background: #ff5f57; }
.shot-bar i:nth-child(2) { background: #febc2e; } .shot-bar i:nth-child(3) { background: #28c840; }
.shot-bar span { margin-left: 10px; flex: 1; height: 18px; border-radius: 9px; background: var(--surface); border: 1px solid var(--border); font-size: .7rem; color: var(--muted); display: flex; align-items: center; padding-left: 8px; }
.shot-frame img { display: block; width: 100%; height: auto; }
.hero-shot { transform: rotate(-1.5deg); }
.showcase .show-row { display: grid; grid-template-columns: 1fr 1.15fr; gap: 40px; align-items: center; margin: 48px 0; }
.showcase .show-row.reverse .show-copy { order: 2; }
.showcase h2 { font-size: clamp(1.3rem, 2.6vw, 1.8rem); margin: .4rem 0 .5rem; }
.tick-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; }
.tick-list li { padding-left: 26px; position: relative; }
.tick-list li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 18px; height: 18px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); font-size: .75rem; font-weight: 700; display: grid; place-items: center; margin-top: 3px; }
.promo-strip { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.promo-strip img { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--border); box-shadow: 0 10px 30px rgba(40, 20, 120, .12); }
.promo-strip img:first-child { grid-column: 1 / -1; }
@media (max-width: 860px) {
  .hero-split { grid-template-columns: 1fr; text-align: center; padding-top: 36px; }
  .hero-split .actions, .hero-points { justify-content: center; }
  .hero-shot { transform: none; }
  .showcase .show-row { grid-template-columns: 1fr; gap: 20px; margin: 36px 0; }
  .showcase .show-row.reverse .show-copy { order: 0; }
}

@media (max-width: 700px) { .pub-link { display: none; } }
html { scroll-behavior: smooth; }
.land-section { scroll-margin-top: 70px; }

/* Brand chip card (promo videos) */
.brand-row { display: grid; grid-template-columns: 150px 1fr; gap: 18px 24px; align-items: start; }
.brand-row .brand-form:last-child { grid-column: 2; }
.brand-preview { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); text-align: center; }
.brand-preview img, .brand-preview span { width: 64px; height: 64px; border-radius: 16px; object-fit: contain; background: #fff; padding: 6px; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.brand-preview span { display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 800; font-size: 1.6rem; padding: 0; }
.brand-preview strong { font-size: .95rem; word-break: break-word; }
@media (max-width: 700px) { .brand-row { grid-template-columns: 1fr; } .brand-row .brand-form:last-child { grid-column: auto; } }

/* Examples page */
.ex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.ex-card { margin: 0; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--surface); box-shadow: 0 10px 30px rgba(40, 20, 120, .08); }
.ex-card video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.ex-card video.tall { aspect-ratio: 9 / 16; max-height: 520px; margin: 0 auto; }
.ex-card figcaption { padding: 10px 14px 12px; display: grid; gap: 2px; }

/* My voice (voice cloning) */
.clone-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--border); }
.clone-row:last-of-type { border-bottom: 0; }
.clone-row .voice-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.clone-row select { width: auto; margin: 0; }
.read-aloud { background: var(--bg); border: 1px dashed var(--border); border-radius: 12px; padding: 12px 16px; margin: 10px 0 14px; }
.read-aloud p { font-size: 1.08rem; line-height: 1.7; margin: 4px 0 0; }
.recorder { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 12px 0 6px; }
.recorder .rec-time { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 3.2em; }
#rec-btn.recording { background: #e5484d; animation: recpulse 1.2s infinite; }
@keyframes recpulse { 50% { box-shadow: 0 0 0 8px rgba(229, 72, 77, .18); } }

/* Own narration per scene */
.own-voice { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.own-voice audio { height: 32px; max-width: 220px; }
.own-voice .rec-state { color: var(--muted); }
[data-rec].recording { background: #e5484d !important; color: #fff !important; border-color: #e5484d; }

/* Admin → Today */
.today-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin: 14px 0; }
.today-stats .card { margin: 0; padding: 12px 14px; }
.today-stats strong { font-size: 1.5rem; }
.today-list { margin: 0; padding-left: 1.2rem; display: grid; gap: 8px; }

/* Product ad studio */
.ad-card { display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; }
.ad-card img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; flex: none; background: var(--bg); }
.ad-price { font-size: 1.3rem; font-weight: 700; }
.ad-steps { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 4px 0 14px; counter-reset: s; }
.ad-steps li { counter-increment: s; padding: .3rem .8rem; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); background: var(--surface); }
.ad-steps li::before { content: counter(s) ". "; }
.ad-steps li.done { color: var(--ok); border-color: var(--ok); }
.ad-steps li.now { color: var(--accent); border-color: var(--accent); font-weight: 700; }
.dropzone { display: grid; place-items: center; gap: 4px; text-align: center; padding: 26px 16px; border: 2px dashed var(--border); border-radius: 14px; background: var(--bg); cursor: pointer; }
.dropzone.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--bg)); }
.dropzone input { display: none; }
.upload-list { display: grid; gap: 6px; margin: 10px 0; }
.upload-row { display: grid; grid-template-columns: minmax(0, 1fr) 140px auto; gap: 10px; align-items: center; font-size: .9rem; }
.upload-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-row progress { width: 100%; }
.upload-row.failed .state { color: var(--err); }
.tag-summary { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.clip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.clip-card { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); display: flex; flex-direction: column; }
.clip-thumb { position: relative; aspect-ratio: 1; background: #111; }
.clip-thumb.tall { aspect-ratio: 9 / 14; }
.clip-thumb video, .clip-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: pointer; }
.clip-len { position: absolute; right: 6px; bottom: 6px; background: rgba(0,0,0,.65); color: #fff; font-size: .75rem; padding: 1px 6px; border-radius: 6px; }
.clip-tags { padding: 8px 10px 0; display: grid; gap: 2px; }
.clip-tags input[type=text] { margin-top: 4px; padding: .35rem .5rem; font-size: .85rem; }
.clip-actions { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px 8px; }
.photo-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.photo-item { position: relative; margin: 0; }
.photo-item img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
.photo-item button { position: absolute; top: 2px; right: 4px; background: rgba(255,255,255,.9); border-radius: 50%; width: 22px; height: 22px; }
.feed-item { display: flex; flex-direction: column; gap: 6px; }
.feed-item img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: var(--bg); }
.feed-item .btn { margin-top: auto; align-self: flex-start; }
.brand-logo-row { display: flex; align-items: center; gap: 12px; }
.brand-logo-row img { width: 56px; height: 56px; object-fit: contain; border-radius: 10px; border: 1px solid var(--border); background: #fff; }
.swatch-row { display: flex; gap: 8px; align-items: center; }
.swatch { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border); flex: none; }
.brand-sample { margin-top: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px; border-radius: 12px; background: var(--bg); color: var(--ink); border: 1px solid var(--border); }
.brand-sample .tag { background: var(--acc); color: #fff; font-weight: 800; padding: .3rem .8rem; border-radius: 8px; }
.brand-sample .cta { background: var(--ink); color: var(--bg); font-weight: 700; padding: .3rem .9rem; border-radius: 999px; }
@media (max-width: 600px) { .upload-row { grid-template-columns: 1fr; } }
.clip-tags label.check { margin: 0; padding: 2px 0; line-height: 1.3; }

/* ad studio: scripts */
.fmt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.fmt-card { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--surface); cursor: pointer; margin: 0; font-weight: 500; }
.fmt-card:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.fmt-card input { width: auto; margin: 0 0 2px; }
.fmt-card.off { opacity: .65; cursor: not-allowed; }
.fmt-title { margin: 22px 0 8px; }
.script-card { margin-bottom: 12px; }
.script-card.unchosen { opacity: .6; }
.script-name { font-size: 1.05rem; letter-spacing: .02em; }
.script-card .hook-input { font-size: 1.1rem; font-weight: 700; }
.ad-texts { margin-top: 10px; border-top: 1px dashed var(--border); padding-top: 8px; }
.ad-texts summary { cursor: pointer; font-weight: 600; }
.field-row > div { min-width: 0; }

/* ad studio: videos */
.ad-video-grid { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
.ad-video { display: flex; flex-direction: column; gap: 6px; width: 240px; max-width: 100%; }
.ad-video video, .ad-video-box { width: 100%; border-radius: 12px; background: #111; }
.ad-video.r9x16 video { aspect-ratio: 9 / 16; }
.ad-video.r4x5 video { aspect-ratio: 4 / 5; }
.ad-video-box { background: var(--bg); border: 1px dashed var(--border); display: flex; flex-direction: column; justify-content: center; padding: 12px; text-align: center; min-height: 140px; }
.ad-video .btn-small { margin-right: 6px; }
.ad-video-row .row-between form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
@media (max-width: 560px) { .ad-video { width: calc(50% - 7px); } }

/* account menu (keeps the top bar on one line) */
.nav-more { position: relative; }
.nav-more > summary { list-style: none; cursor: pointer; color: var(--text); white-space: nowrap; padding: .2rem .5rem; border: 1px solid var(--border); border-radius: 999px; }
.nav-more > summary::-webkit-details-marker { display: none; }
.nav-more[open] > summary { border-color: var(--accent); color: var(--accent); }
.nav-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 14px 40px rgba(0,0,0,.14); padding: 6px; display: flex; flex-direction: column; z-index: 50; }
.nav-menu a, .nav-menu form, .nav-menu .link { display: block; padding: .5rem .7rem; border-radius: 8px; text-align: left; width: 100%; color: var(--text); }
.nav-menu a:hover, .nav-menu .link:hover { background: var(--bg); text-decoration: none; }
.topbar nav a { white-space: nowrap; }
@media (max-width: 1240px) {
  .nav-more > summary { border: 0; padding: .6rem 4px; border-top: 1px solid var(--border); border-radius: 0; }
  .nav-menu { position: static; box-shadow: none; border: 0; padding: 0 0 0 12px; min-width: 0; }
  .topbar nav.collapsible .nav-menu a, .topbar nav.collapsible .nav-menu form { border-top: 0; }
}

/* ===== product ad studio: friendlier layout ===== */
.ad-hero { display: flex; gap: 16px; align-items: center; margin: 4px 0 14px; }
.ad-hero-thumb { width: 76px; height: 76px; flex: none; border-radius: 16px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); display: grid; place-items: center; font-size: 2rem; }
.ad-hero-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ad-hero-text h1 { margin: 0 0 4px; font-size: 1.5rem; line-height: 1.25; }
.ad-hero-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ad-wizard { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.ad-wizard a { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; min-width: 0; }
.ad-wizard a:hover { border-color: var(--accent); text-decoration: none; }
.ad-wizard a > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.ad-wizard small { color: var(--muted); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-wizard .n { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--bg); border: 1px solid var(--border); color: var(--muted); }
.ad-wizard a.done .n { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.ad-wizard a.now { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.ad-wizard a.now .n { background: var(--accent); color: #fff; border-color: transparent; }
@media (max-width: 560px) { .ad-wizard { gap: 6px; } .ad-wizard a { flex-direction: column; text-align: center; padding: 8px 4px; gap: 4px; } .ad-wizard small { display: none; } .ad-wizard strong { font-size: .85rem; } }

.ad-section { margin-bottom: 14px; }
.ad-section-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
summary.ad-section-head { cursor: pointer; list-style: none; margin: 0; }
summary.ad-section-head::-webkit-details-marker { display: none; }
summary.ad-section-head::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform .2s; }
details[open] > summary.ad-section-head { margin-bottom: 12px; }
details[open] > summary.ad-section-head::after { transform: rotate(180deg); }
.ad-section-head > span:nth-child(2) { display: flex; flex-direction: column; gap: 2px; }
.ad-section-head strong { font-size: 1.08rem; }
.ad-step-icon { width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--bg); display: grid; place-items: center; font-size: 1.25rem; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.photo-tile { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); background: #fff; margin: 0; }
.photo-tile img { width: 100%; height: 100%; object-fit: contain; }
.photo-x { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; font-size: .8rem; }
.photo-add label { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; font-size: 1.8rem; color: var(--accent); border: 2px dashed var(--border); border-radius: 14px; margin: 0; background: var(--bg); }
.photo-add label:hover { border-color: var(--accent); }

.ad-nextbar { position: sticky; bottom: 0; z-index: 20; display: flex; justify-content: flex-end; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; margin: 16px 0; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 -6px 24px rgba(0,0,0,.06); }

.script-card { padding-top: 14px; }
.script-top { display: flex; flex-direction: column; gap: 8px; }
.script-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.script-meta .script-name { background: var(--accent); color: #fff; border-radius: 8px; padding: 2px 9px; font-size: .9rem; }
.choose-toggle { margin: 0 0 0 auto; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; font-size: .9rem; padding: 4px 12px 4px 6px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg); }
.choose-toggle input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.choose-toggle:has(input:checked) { border-color: var(--ok); background: var(--ok-bg); color: var(--ok); }
.script-hook { font-size: 1.25rem; font-weight: 800; line-height: 1.4; }
.script-hook.small-hook { font-size: 1rem; }
.script-lines { margin: 0; padding-left: 1.3rem; display: grid; gap: 3px; color: var(--text); }
.script-lines li::marker { color: var(--muted); }
.script-lines .script-price { color: var(--accent); font-weight: 700; }
.script-lines .script-cta { font-weight: 700; }
.script-edit { margin-top: 10px; border-top: 1px dashed var(--border); padding-top: 8px; }
.script-edit > summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.ad-texts-title { margin: 14px 0 4px; font-size: .95rem; }
.script-card.unchosen .script-top { opacity: .55; }

.ad-make { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; border-color: var(--accent); }
.btn-big { padding: .8rem 1.5rem; font-size: 1.05rem; }
.ad-dl { display: block; text-align: center; }
.ad-old { color: var(--muted); }

.ad-how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 6px 0 16px; }
.ad-how > div { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.ad-how small { color: var(--muted); }
.ad-how-n { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .85rem; margin-bottom: 4px; }
@media (max-width: 700px) { .ad-how { gap: 6px; } .ad-how > div { padding: 10px 8px; align-items: center; text-align: center; font-size: .85rem; } .ad-how small { display: none; } }
.ad-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-bottom: 14px; }
.ad-tile { display: flex; flex-direction: column; padding: 0; overflow: hidden; color: var(--text); text-decoration: none; transition: transform .15s, box-shadow .15s; }
.ad-tile:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(0,0,0,.08); text-decoration: none; }
.ad-tile-img { aspect-ratio: 4 / 3; background: #fff; display: grid; place-items: center; font-size: 2.5rem; border-bottom: 1px solid var(--border); }
.ad-tile-img img { width: 100%; height: 100%; object-fit: contain; }
.ad-tile-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.ad-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.ad-price-sm { color: var(--accent); font-weight: 700; }
.ad-more { margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 10px; }
.ad-more > summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.ad-section-head > span:nth-child(2) > .badge { align-self: flex-start; }
.script-meta .quick-rewrite { margin-left: auto; }
.script-meta .quick-rewrite + .choose-toggle { margin-left: 0; }
.rewrite-box { margin-top: 14px; padding: 10px 12px; border-radius: 12px; background: var(--bg); border: 1px dashed var(--border); }
.rewrite-box label { margin: 0; }
.nav-group .nav-menu { left: 0; right: auto; min-width: 250px; }
.nav-menu a small { display: block; color: var(--muted); font-size: .78rem; font-weight: 400; margin-top: 1px; }
.nav-group > summary { border-color: transparent; }
/* one menu open at a time feels natural; a click outside closes it (see base.html) */
/* long addresses and wide tables never push the page sideways on phones */
code { overflow-wrap: anywhere; word-break: break-word; }
@media (max-width: 700px) { table { display: block; max-width: 100%; overflow-x: auto; } }
.ab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.ab-item { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; background: var(--bg); margin: 0; }
.shot-guide { margin: 4px 0 12px; border: 1px dashed var(--border); border-radius: 12px; padding: 8px 12px; background: var(--bg); }
.shot-guide > summary { cursor: pointer; font-weight: 700; color: var(--accent); }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-top: 10px; }
.guide-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.guide-card.done { border-color: var(--ok); }
.guide-card ol { padding-left: 1.1rem; margin: 6px 0; display: grid; gap: 3px; }
.guide-tips { margin: 10px 0 2px; padding-left: 1.1rem; color: var(--muted); }

/* ===== AI video editor ===== */
.ed-features { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin: 8px 0 16px; }
.ed-features > div { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.ed-features small { color: var(--muted); }
.ed-thumb { background: #111; }
.ed-thumb img { object-fit: cover; }
.ed-title { margin: 0; font-size: 1.4rem; }
.ed-wait { display: flex; gap: 14px; align-items: center; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--accent); animation: spin 1s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.ed-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 16px; align-items: start; margin-top: 12px; }
.ed-side { position: sticky; top: 72px; }
.ed-player video { width: 100%; max-height: 62vh; border-radius: 12px; background: #000; display: block; }
.ed-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; text-align: center; }
.ed-stats > div { background: var(--bg); border-radius: 10px; padding: 6px; }
.ed-stats small { display: block; color: var(--muted); font-size: .72rem; }
.ed-stats strong { font-size: 1.05rem; }
.ed-player .actions form { margin: 0; }
@media (max-width: 900px) { .ed-layout { grid-template-columns: 1fr; } .ed-side { position: static; } }
.ed-tools { margin-bottom: 10px; }
.ed-transcript { max-height: 60vh; overflow-y: auto; padding: 4px 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); line-height: 2; font-size: 1.02rem; }
.ed-line { margin: 0 0 6px; }
.ed-time, .ed-cutline { border: 0; background: var(--surface); color: var(--muted); border-radius: 6px; font-size: .72rem; padding: 1px 6px; cursor: pointer; margin-right: 2px; }
.ed-cutline:hover { color: var(--err); }
.ed-transcript .w { cursor: pointer; border-radius: 4px; padding: 1px 1px; }
.ed-transcript .w:hover { background: color-mix(in srgb, var(--accent) 15%, transparent); }
.ed-transcript .w.x { text-decoration: line-through; color: var(--muted); opacity: .55; background: color-mix(in srgb, var(--err) 10%, transparent); }
.ed-transcript .w.now { background: var(--accent); color: #fff; }
.ed-clips { display: grid; gap: 8px; }
.ed-clip { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--bg); margin: 0; display: flex; flex-direction: column; gap: 2px; }
.ed-seo { display: grid; gap: 6px; }
.copy-row { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; background: var(--bg); }
.copy-row .pre { white-space: pre-wrap; }
.ed-export { border-top: 1px solid var(--border); padding: 10px 0; display: flex; flex-direction: column; gap: 6px; }
.ed-export:first-of-type { border-top: 0; }
.ed-out { width: 100%; max-width: 320px; max-height: 420px; border-radius: 12px; background: #000; }
.ed-export > .btn { align-self: flex-start; }
.price-opts{margin:10px 0 4px;padding:10px 12px;border:1px dashed var(--border, #ddd);border-radius:12px}
.price-opts .check{margin-top:6px}
/* supplier-writing eraser */
.spinner.spinner-sm { width: 16px; height: 16px; border-width: 2px; margin: 0 6px 0 0; display: inline-block; vertical-align: -3px; }
.clean-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }
.clean-badge { position: absolute; left: 6px; bottom: 6px; display: flex; gap: 4px; align-items: center; z-index: 2; }
.clean-badge > * { background: rgba(255,255,255,.92); border-radius: 999px; min-width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; text-decoration: none; box-shadow: 0 2px 6px rgba(0,0,0,.18); }
.clean-badge .spinner { background: transparent; box-shadow: none; min-width: 0; }
.eraser-stage { position: relative; max-width: 560px; margin: 10px auto 0; touch-action: none; user-select: none; cursor: crosshair; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: #fff; }
.eraser-stage img { display: block; width: 100%; height: auto; pointer-events: none; }
.eraser-stage .eraser-before { position: absolute; inset: 0; }
.erase-box { position: absolute; border: 2px dashed #E2574C; background: rgba(226,87,76,.22); border-radius: 4px; }
.erase-box button { position: absolute; top: -12px; right: -12px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: #E2574C; color: #fff; font-size: .7rem; cursor: pointer; }
.erase-box.drawing { border-style: solid; }
.eraser-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; margin: 10px 0; }
.eraser-video { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 12px 0; }
.eraser-video video { width: 100%; max-height: 420px; background: #000; border-radius: 10px; }
.eraser-actions { margin-top: 12px; }
.ad-manage { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 12px 16px; }
.ad-manage-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; }
.btn-danger-soft { color: #c0392b; }
.ad-video-tools { margin: 4px 0 0; text-align: right; }
.progress-bar.progress-paused { background: #b9b2a8; }
.ad-video-tools { display: flex; gap: 10px; justify-content: flex-end; align-items: center; }
.style-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin: 6px 0; }
.style-pick .fmt-card { display: flex; gap: 8px; align-items: flex-start; font-size: .92rem; }
/* story reels */
.reel-themes { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.reel-theme input { display: none; }
.reel-theme span { display: inline-block; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border); cursor: pointer; font-size: .92rem; }
.reel-theme input:checked + span { background: var(--primary, #6d4aff); color: #fff; border-color: transparent; }
.reel-tile-img img { object-fit: cover; }
.reel-layout { display: grid; grid-template-columns: minmax(220px, 340px) 1fr; gap: 18px; align-items: start; }
@media (max-width: 760px) { .reel-layout { grid-template-columns: 1fr; } }
.reel-preview { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.reel-preview img, .reel-preview video { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 14px; background: #111; }
.reel-empty { aspect-ratio: 9 / 16; border-radius: 14px; border: 1px dashed var(--border); display: flex; align-items: center; justify-content: center; color: var(--muted, #888); }
.reel-edit textarea#lines { line-height: 1.7; }
.link.danger { color: #c0392b; }
.reel-costs { padding: 10px 12px; display: grid; gap: 4px; }
.reel-brands { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0; }
.reel-brand input { position: absolute; opacity: 0; }
.reel-brand span { display: block; background: #1d2547; border: 2px solid transparent; border-radius: 10px; padding: 8px 12px; cursor: pointer; }
.reel-brand img { height: 56px; display: block; }
.reel-brand input:checked + span { border-color: var(--primary, #6d5dfc); box-shadow: 0 0 0 3px rgba(109,93,252,.25); }
.reel-posts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.reel-post { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--border, #e5e5e5); border-radius: 10px; padding: 10px; }
.reel-post textarea { width: 100%; font-size: 14px; resize: vertical; }
.reel-post .btn { align-self: flex-start; }
.reel-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.reel-option { border: 1px solid var(--border); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; margin: 0; }
.reel-option.picked { border-color: var(--primary, #6d4aff); box-shadow: 0 0 0 2px var(--primary, #6d4aff) inset; }
.reel-option-lines { font-size: .92rem; line-height: 1.7; flex: 1; }
.reel-rewrite { display: grid; gap: 8px; margin-bottom: 14px; }
.reel-rewrite-row { display: flex; gap: 8px; flex-wrap: wrap; }
.reel-rewrite-row select { flex: 1; min-width: 180px; }
