/* Design tokens: cool paper, ink navy, highlighter yellow. The highlighter is the one loud thing. */
:root {
  --paper: #F2F4F8;
  --surface: #FFFFFF;
  --ink: #14123A;
  --muted: #5E6380;
  --line: #D9DDE8;
  --mark: #FFE14D;
  --mark-soft: #FFF0A6;
  --signal: #4B3FD6;
  --danger: #C2362B;
  --ok: #1F8A5B;
  --radius-s: 6px;
  --radius-m: 12px;
  --display: "Archivo", system-ui, sans-serif;
  --body: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #14123A; --surface: #1E1B4B; --ink: #F5F3FF; --muted: #ABA6D6;
    --line: #2F3460; --signal: #8C9BFF; --mark-soft: #6B5A14; color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 17px/1.55 var(--body); font-feature-settings: "ss01";
}
img, video { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

h1, h2, h3 { font-family: var(--display); line-height: 1.05; margin: 0; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.6rem, 6.4vw, 4.9rem); font-weight: 700; font-variation-settings: "wdth" 85; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 650; letter-spacing: -0.01em; }
p { margin: 0; }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 34ch; }
.small { font-size: 0.875rem; color: var(--muted); }

/* the highlighter stroke: used for marked text everywhere */
.hl {
  background: linear-gradient(transparent 12%, var(--mark) 12%, var(--mark) 88%, transparent 88%);
  color: #14123A; padding: 0 0.15em; margin: 0 -0.05em;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
}

/* buttons & inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 1rem/1 var(--body); padding: 14px 20px; border-radius: var(--radius-s);
  border: 2px solid var(--ink); background: var(--ink); color: var(--paper);
  cursor: pointer; text-decoration: none; transition: transform .12s ease, background .12s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.mark { background: var(--mark); border-color: var(--mark); color: #14123A; }
.btn.small { padding: 9px 14px; font-size: .9rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--signal); cursor: pointer; text-decoration: underline; }

label { font-weight: 600; font-size: .95rem; display: block; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], select, textarea {
  width: 100%; font: 1rem/1.4 var(--body); color: var(--ink); background: var(--surface);
  border: 2px solid var(--line); border-radius: var(--radius-s); padding: 12px 14px;
}
input:focus, select:focus, textarea:focus { border-color: var(--signal); outline: none; }
textarea { resize: vertical; min-height: 70px; }

/* top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 0; }
.logo { font: 800 1.35rem/1 var(--display); text-decoration: none; display: inline-flex; align-items: center; gap: 10px; letter-spacing: -0.03em; }
.logo-mark { width: 28px; height: 28px; border-radius: 7px; background: url("/static/img/logo-mark.svg") center / cover no-repeat; flex: none; }
.nav { display: flex; gap: 20px; align-items: center; }
.nav a:not(.btn) { text-decoration: none; color: var(--muted); font-weight: 500; }
.nav a:not(.btn):hover { color: var(--ink); }
@media (max-width: 640px) { .nav .hide-sm { display: none; } }

/* ---------- landing ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px; padding: 48px 0 72px; align-items: center; }
@media (min-width: 920px) { .hero { grid-template-columns: 1.05fr 1fr; padding: 72px 0 96px; } }
.hero-copy { display: grid; gap: 24px; justify-items: start; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.transcript {
  margin: 0; min-width: 0;
  background: var(--surface); border: 2px solid var(--ink); border-radius: var(--radius-m);
  padding: 22px 22px 18px; box-shadow: 8px 8px 0 var(--ink);
}
.transcript-head { display: flex; justify-content: space-between; color: var(--muted); font-size: .85rem; margin-bottom: 14px; }
.transcript p { font-size: 1.02rem; line-height: 1.9; color: var(--muted); }
.transcript .pick {
  color: #14123A;
  background: linear-gradient(var(--mark), var(--mark)) no-repeat 0 55% / 100% 82%;
}
.transcript .tc { font-size: .78rem; color: var(--signal); font-weight: 600; margin-right: 6px; font-variant-numeric: tabular-nums; }
.reels { display: flex; gap: 12px; margin-top: 18px; }
.reel {
  flex: 1; aspect-ratio: 9/16; border-radius: 10px; background: var(--ink); color: #fff;
  display: flex; flex-direction: column; justify-content: flex-end; padding: 10px; position: relative; overflow: hidden;
  font-size: .78rem; line-height: 1.25;
}
.reel b { overflow-wrap: anywhere; font: 800 clamp(.72rem, 2.6vw, .95rem)/1.1 var(--display); text-transform: uppercase; }
.reel b em { font-style: normal; color: var(--mark); }
.reel .dur { position: absolute; top: 8px; left: 8px; background: var(--mark); color: #14123A; font-weight: 700; padding: 2px 6px; border-radius: 3px; font-size: .72rem; }
.reel:nth-child(1) { background: linear-gradient(160deg, #2B3166, #14123A 70%); }
.reel:nth-child(2) { background: linear-gradient(160deg, #3347E6, #14123A 75%); }
.reel:nth-child(3) { background: linear-gradient(160deg, #5A3D8A, #14123A 70%); }

@media (prefers-reduced-motion: no-preference) {
  /* one orchestrated moment: the highlighter sweeps across each picked line in turn */
  .transcript .pick { animation: swipe .7s cubic-bezier(.6,.1,.3,1) both; }
  .transcript .pick:nth-of-type(1) { animation-delay: .5s; }
  .transcript .pick:nth-of-type(2) { animation-delay: 1.15s; }
  .transcript .pick:nth-of-type(3) { animation-delay: 1.8s; }
  @keyframes swipe {
    from { background-size: 0% 82%; color: var(--muted); }
    to { background-size: 100% 82%; color: #14123A; }
  }
}

.section { padding: 72px 0; border-top: 2px solid var(--ink); }
.section-head { display: grid; gap: 12px; margin-bottom: 40px; max-width: 640px; }

.steps { display: grid; gap: 32px; counter-reset: step; list-style: none; padding: 0; margin: 0; }
@media (min-width: 820px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li { display: grid; gap: 10px; align-content: start; }
.steps li::before {
  counter-increment: step; content: counter(step);
  font: 800 3.2rem/1 var(--display); color: var(--ink); -webkit-text-stroke: 0;
  width: 64px; height: 64px; display: grid; place-items: center; background: var(--mark); border-radius: 50%;
}
.steps p { color: var(--muted); }

.features { display: grid; gap: 0; border: 2px solid var(--ink); border-radius: var(--radius-m); overflow: hidden; background: var(--surface); }
@media (min-width: 820px) { .features { grid-template-columns: 1fr 1fr; } }
.features div { padding: 24px; border-bottom: 1px solid var(--line); display: grid; gap: 6px; }
@media (min-width: 820px) { .features div:nth-child(odd) { border-right: 1px solid var(--line); } .features div:nth-last-child(-n+2) { border-bottom: 0; } }
.features p { color: var(--muted); }

/* pricing table */
.pricing { display: grid; gap: 16px; }
@media (min-width: 820px) { .pricing { grid-template-columns: repeat(4, 1fr); gap: 0; border: 2px solid var(--ink); border-radius: var(--radius-m); overflow: hidden; } }
.plan { background: var(--surface); padding: 26px 22px; display: grid; gap: 14px; align-content: start; border: 2px solid var(--ink); border-radius: var(--radius-m); }
@media (min-width: 820px) { .plan { border: 0; border-radius: 0; border-right: 1px solid var(--line); } .plan:last-child { border-right: 0; } }
.plan.featured { background: var(--mark); color: #14123A; }
.plan.featured .small, .plan.featured li { color: #3A3F5C; }
.plan .price { font: 800 2.6rem/1 var(--display); letter-spacing: -0.03em; }
.plan .price small { font: 500 .95rem var(--body); color: inherit; opacity: .7; }
.plan ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: .95rem; display: grid; gap: 4px; }
.plan .btn { width: 100%; }
.plan.featured .btn { background: #14123A; border-color: #14123A; color: #fff; }

.faq { display: grid; gap: 0; max-width: 760px; }
.faq details { border-bottom: 1px solid var(--line); padding: 18px 0; }
.faq summary { font-weight: 600; cursor: pointer; font-size: 1.08rem; }
.faq details p { color: var(--muted); margin-top: 10px; }

.footer { padding: 32px 0 48px; border-top: 2px solid var(--ink); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: .9rem; }

/* ---------- dashboard ---------- */
.app-top { border-bottom: 2px solid var(--ink); background: var(--surface); }
.credits {
  display: inline-flex; align-items: baseline; gap: 6px; font-weight: 600; padding: 8px 12px;
  border-radius: 999px; background: var(--paper); border: 1px solid var(--line); font-variant-numeric: tabular-nums;
}
.credits strong { font: 800 1.1rem/1 var(--display); }
.app-main { display: grid; gap: 32px; padding: 32px 0 80px; }
@media (min-width: 1000px) { .app-main { grid-template-columns: 380px 1fr; align-items: start; } }

.panel { background: var(--surface); border: 2px solid var(--ink); border-radius: var(--radius-m); padding: 22px; display: grid; gap: 18px; }
@media (min-width: 1000px) { .panel.sticky { position: sticky; top: 20px; } }
.tabs { display: flex; gap: 4px; background: var(--paper); padding: 4px; border-radius: 8px; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 10px; border-radius: 6px; font: 600 .95rem var(--body); color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 0 var(--line), 0 0 0 1px var(--line); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.seg { display: flex; border: 2px solid var(--line); border-radius: var(--radius-s); overflow: hidden; }
.seg label { flex: 1; margin: 0; text-align: center; padding: 10px 6px; cursor: pointer; font-weight: 500; font-size: .9rem; position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--ink); color: var(--paper); }
.seg label:has(input:focus-visible) { outline: 3px solid var(--signal); outline-offset: -3px; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 500; }
.check input { width: 20px; height: 20px; accent-color: var(--ink); }
.drop {
  border: 2px dashed var(--line); border-radius: var(--radius-s); padding: 22px; text-align: center; cursor: pointer; color: var(--muted);
}
.drop.has-file { border-style: solid; border-color: var(--ink); color: var(--ink); }
.drop.drag { border-color: var(--signal); background: color-mix(in srgb, var(--signal) 8%, transparent); }
.notice { font-size: .85rem; color: var(--muted); }
.error { color: var(--danger); font-weight: 500; font-size: .95rem; }
.banner { padding: 12px 16px; border-radius: var(--radius-s); background: var(--mark-soft); color: var(--ink); font-size: .95rem; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .banner { color: #FFF4C7; } }

.projects { display: grid; gap: 28px; }
.project { display: grid; gap: 14px; }
.project-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.project-head h3 { overflow-wrap: anywhere; }
.status { font-size: .9rem; color: var(--muted); }
.status.failed { color: var(--danger); }
.bar { height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--mark); transition: width .4s ease; }
.clips { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.clip { display: grid; gap: 10px; align-content: start; }
.clip-media { position: relative; aspect-ratio: 9/16; background: #000; border-radius: 10px; overflow: hidden; }
.clip-media img, .clip-media video { width: 100%; height: 100%; object-fit: cover; }
.clip-media button.play { position: absolute; inset: 0; border: 0; background: transparent; cursor: pointer; }
.clip-media button.play::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px;
  border-radius: 50%; background: rgba(27,31,59,.75) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23FFD23F' d='M8 5v14l11-7z'/%3E%3C/svg%3E") center/26px no-repeat;
}
.score { position: absolute; top: 8px; left: 8px; background: var(--mark); color: #14123A; font-weight: 700; font-size: .8rem; padding: 3px 8px; border-radius: 4px; font-variant-numeric: tabular-nums; }
.clip h4 { margin: 0; font: 650 1rem/1.3 var(--body); }
.clip .why { font-size: .85rem; color: var(--muted); }
.clip-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.empty { border: 2px dashed var(--line); border-radius: var(--radius-m); padding: 40px 24px; text-align: center; color: var(--muted); display: grid; gap: 8px; justify-items: center; }

.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth .panel { width: 100%; max-width: 420px; }

dialog { border: 2px solid var(--ink); border-radius: var(--radius-m); padding: 0; background: var(--surface); color: var(--ink); width: min(920px, calc(100% - 32px)); }
dialog::backdrop { background: rgba(20, 23, 44, .55); }
.dialog-body { padding: 24px; display: grid; gap: 20px; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.close { background: none; border: 0; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--ink); padding: 4px 8px; }
dialog .pricing { grid-template-columns: 1fr; }
@media (min-width: 820px) { dialog .pricing { grid-template-columns: repeat(3, 1fr); } }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: 8px; font-weight: 500; z-index: 10; max-width: calc(100% - 32px); }
[hidden] { display: none !important; }

.legal { max-width: 720px; padding: 32px 0 80px; display: grid; gap: 16px; }
.legal p, .legal li { color: var(--muted); }
.field { border: 0; padding: 0; margin: 0; min-width: 0; }
.legend { font-weight: 600; font-size: .95rem; margin-bottom: 6px; padding: 0; }

/* ---------- v2: modes, editor, score bars ---------- */
.form-stack { display: grid; gap: 18px; }
.mode-tabs { background: var(--ink); }
.mode-tabs button { color: color-mix(in srgb, var(--paper) 70%, transparent); }
.mode-tabs button[aria-selected="true"] { background: var(--mark); color: #14123A; box-shadow: none; }
details.more { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 12px 0; }
details.more summary { cursor: pointer; font-weight: 600; }
details.more[open] summary { margin-bottom: 16px; }
input[type=color] { width: 100%; height: 48px; padding: 4px; border: 2px solid var(--line); border-radius: var(--radius-s); background: var(--surface); cursor: pointer; }
.seg label { white-space: nowrap; }
@media (max-width: 420px) { .seg label { font-size: .82rem; padding: 10px 4px; } }

.project-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.tag { font-size: .75rem; font-weight: 700; background: var(--ink); color: var(--paper); padding: 3px 8px; border-radius: 4px; flex: none; }
.project-actions { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }

.clip-media.f1x1 { aspect-ratio: 1/1; }
.clip-media.f4x5 { aspect-ratio: 4/5; }
.clip-media.f16x9 { aspect-ratio: 16/9; }
.rendering { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; background: rgba(20,23,44,.72); color: #fff; font-weight: 600; }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid rgba(255,255,255,.25); border-top-color: var(--mark); }
@media (prefers-reduced-motion: no-preference) { .spinner { animation: spin .9s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } } }
.spinner.tiny { width: 14px; height: 14px; border-width: 2px; border-color: rgba(255,255,255,.35); border-top-color: var(--mark); }

/* ---------- v3: paid downloads and posting ---------- */
.copy-post { justify-self: start; }
.pubs { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: .82rem; }
.pub { display: flex; gap: 6px; align-items: baseline; color: var(--muted); min-width: 0; }
.pub b { color: var(--ink); flex: none; }
.pub span, .pub a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pub.done a { color: var(--ok); font-weight: 600; }
.pub.failed span { color: var(--danger); }

.small-dialog { width: min(480px, calc(100% - 32px)); }
.small-dialog h2 { font-size: 1.6rem; }
.platform-row { display: grid; gap: 8px; }
.platform-btn { justify-content: flex-start; }
.pdot { width: 12px; height: 12px; border-radius: 50%; flex: none; display: inline-block; }
.pdot.tiktok { background: #111827; box-shadow: 2px 0 0 #25F4EE, -2px 0 0 #FE2C55; }
.pdot.instagram { background: linear-gradient(45deg, #F9A23B, #E1306C 55%, #833AB4); }
.pdot.youtube { background: #E62117; border-radius: 3px; }
.platform-tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.p-account { display: grid; gap: 12px; justify-items: start; }
.p-account .account { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.checks-row { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.indent { padding-left: 30px; }
#publish-dialog { width: min(600px, calc(100% - 32px)); }
#publish-dialog .check a { color: var(--signal); }

.minis { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
.mini { display: grid; grid-template-columns: 1fr; gap: 2px; font-size: .74rem; color: var(--muted); }
.mini i { display: block; height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.mini b { display: block; height: 100%; background: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mini b { background: var(--mark); } }

.editor { display: grid; gap: 20px; }
@media (min-width: 760px) { .editor { grid-template-columns: 240px 1fr; } }
.editor-preview video { width: 100%; max-height: 430px; background: #000; border-radius: 10px; }
.nudge { display: flex; }
.nudge input { border-radius: 0; text-align: center; min-width: 0; border-left: 0; border-right: 0; }
.nudge button { flex: none; width: 44px; border: 2px solid var(--line); background: var(--paper); color: var(--ink); font: 600 .9rem var(--body); cursor: pointer; }
.nudge button:first-child { border-radius: var(--radius-s) 0 0 var(--radius-s); }
.nudge button:last-child { border-radius: 0 var(--radius-s) var(--radius-s) 0; }
.nudge button:disabled { opacity: .5; cursor: not-allowed; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.align-end { display: flex; align-items: flex-end; padding-bottom: 12px; }
dialog { max-height: calc(100vh - 32px); overflow: auto; }
.small.error { font-size: .85rem; }
@media (min-width: 820px) { .features { grid-template-columns: 1fr 1fr; } .features div:nth-last-child(-n+2) { border-bottom: 0; } }
.split { display: grid; gap: 32px; align-items: start; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; } }
.split .section-head { justify-items: start; }
.mini-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border: 2px solid var(--ink); border-radius: var(--radius-m); background: var(--surface); overflow: hidden; counter-reset: ms; }
.mini-steps li { display: grid; grid-template-columns: 44px 1fr; gap: 2px 14px; padding: 16px 18px; border-bottom: 1px solid var(--line); counter-increment: ms; }
.mini-steps li:last-child { border-bottom: 0; background: var(--mark); color: #14123A; }
.mini-steps li::before { content: counter(ms); grid-row: span 2; width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; font: 800 1.1rem var(--display); }
.mini-steps li:last-child::before { background: #14123A; color: #FFE14D; }
.mini-steps span { color: var(--muted); font-size: .95rem; }
.mini-steps li:last-child span { color: #3A3F5C; }

/* ---------- caption style picker ---------- */
.style-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.style-card { position: relative; margin: 0; display: grid; gap: 6px; justify-items: center; padding: 8px 6px 7px;
  border: 2px solid var(--line); border-radius: 8px; cursor: pointer; font-weight: 500; }
.style-card input { position: absolute; opacity: 0; pointer-events: none; }
.style-card:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.style-card:has(input:focus-visible) { outline: 3px solid var(--signal); outline-offset: 2px; }
.cs-sample { width: 100%; height: 40px; border-radius: 5px; display: grid; place-items: center;
  background: linear-gradient(160deg, #3A4170, #14123A); overflow: hidden; }
.cs-sample b { font: 800 .78rem/1 var(--display); letter-spacing: .01em; color: #fff; white-space: nowrap; }
.cs-sample i { font-style: normal; }
.cs-bold { text-shadow: 0 0 2px #000, 0 1px 0 #000; } .cs-bold i { color: var(--mark); }
.cs-marker i { color: #14123A; background: var(--mark); padding: 1px 3px; border-radius: 2px; }
.cs-pop { font-size: 1.05rem !important; color: var(--mark) !important; text-shadow: 0 1px 0 #000; }
.cs-boxed { background: rgba(0,0,0,.6); padding: 3px 5px; border-radius: 3px; }
.cs-clean { font-family: var(--body) !important; font-weight: 600 !important; }
.cs-off { color: rgba(255,255,255,.55) !important; font-weight: 500 !important; font-family: var(--body) !important; }
.cs-name { font-size: .82rem; }

/* ---------- trim by transcript ---------- */
.trim { display: grid; gap: 8px; border: 2px solid var(--line); border-radius: var(--radius-s); padding: 12px; }
.trim-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.seg-small label { padding: 6px 10px; font-size: .85rem; }
.trim-words { display: flex; flex-wrap: wrap; gap: 3px; max-height: 150px; overflow-y: auto; padding: 2px; }
.tw { border: 0; background: transparent; color: var(--muted); font: 500 .92rem/1.5 var(--body); padding: 1px 4px; border-radius: 4px; cursor: pointer; opacity: .55; }
.tw.in { color: var(--ink); opacity: 1; background: color-mix(in srgb, var(--mark) 45%, transparent); }
.tw:hover { outline: 2px solid var(--signal); opacity: 1; }

/* ---------- landing v3: live demo ---------- */
@media (min-width: 920px) { .hero-v2 { grid-template-columns: 1fr 1.08fr; } }
.hero-facts { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 6px 0 0; padding-top: 18px; border-top: 1px solid var(--line); }
.hero-facts div { display: grid; gap: 2px; }
.hero-facts dt { font-size: .8rem; color: var(--muted); }
.hero-facts dd { margin: 0; font: 700 1.15rem/1.2 var(--display); }
.hero-facts small { font: 500 .8rem var(--body); color: var(--muted); }

.demo { position: relative; margin: 0; padding: 0; min-width: 0; }
.demo-source { position: relative; border: 2px solid var(--ink); border-radius: var(--radius-m); overflow: hidden; background: #14123A; box-shadow: 8px 8px 0 var(--ink); width: 86%; }
.demo-svg { display: block; width: 100%; height: auto; }
.demo-tag { position: absolute; top: 10px; left: 10px; z-index: 1; background: rgba(15,18,40,.75); color: #fff; font-size: .75rem; font-weight: 600; padding: 4px 8px; border-radius: 4px; }
.wave rect { fill: #FFE14D; }
.wave { opacity: 0; transition: opacity .15s; }
.demo-phone { position: absolute; right: 0; top: 18%; width: 34%; aspect-ratio: 9/16; border-radius: 22px; overflow: hidden;
  border: 5px solid #0F1228; background: #14123A; box-shadow: 0 18px 40px rgba(15,18,40,.35); }
.demo-phone-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.demo-hook { position: absolute; top: 9%; left: 50%; transform: translate(-50%, -6px); background: var(--mark); color: #14123A;
  font: 800 clamp(.6rem, 1.4vw, .82rem)/1.15 var(--display); padding: 5px 8px; border-radius: 4px; white-space: nowrap; opacity: 0; transition: opacity .25s, transform .25s; }
.demo-hook.show { opacity: 1; transform: translate(-50%, 0); }
.demo-score { position: absolute; top: 3.5%; right: 6%; background: #fff; color: #14123A; border-radius: 999px; padding: 3px 8px;
  font-size: clamp(.55rem, 1.1vw, .7rem); font-weight: 600; opacity: 0; transform: scale(.8); transition: opacity .25s, transform .25s cubic-bezier(.3,1.6,.6,1); }
.demo-score b { font-family: var(--display); }
.demo-score.show { opacity: 1; transform: scale(1); }
.demo-caption { position: absolute; left: 6%; right: 6%; top: 67%; margin: 0; text-align: center; color: #fff;
  font: 800 clamp(.72rem, 1.75vw, 1.05rem)/1.15 var(--display); text-shadow: 0 0 3px #000, 0 2px 0 #000; }
.demo-caption .on, .sp-cap .on { color: var(--mark); }
.demo-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: rgba(255,255,255,.18); }
.demo-bar i { display: block; height: 100%; background: var(--mark); transform-origin: left; transform: scaleX(0); }
.demo-clips { list-style: none; margin: 18px 0 0; padding: 0; width: 60%; display: grid; gap: 6px; }
.demo-clip { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 2px solid var(--ink); border-radius: 8px;
  padding: 6px 10px; font-size: .82rem; font-weight: 600; opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .3s; }
.demo-clip.show { opacity: 1; transform: none; }
.demo-clip b { background: var(--mark); color: #14123A; font-family: var(--display); padding: 1px 6px; border-radius: 4px; }
.demo-clip span { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 500; }
@media (max-width: 919px) { .demo-clips { width: 62%; } }
@media (max-width: 520px) { .demo-clip { font-size: .72rem; padding: 5px 8px; } .demo-clips { width: 78%; } .demo-clip:nth-child(3) { display: none; } }

/* caption style showcase */
.style-showcase { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
@media (max-width: 900px) { .style-showcase { grid-template-columns: repeat(5, 150px); overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; } .sp { scroll-snap-align: start; } }
.sp { margin: 0; display: grid; gap: 8px; justify-items: center; }
.sp-frame { position: relative; width: 100%; aspect-ratio: 9/16; border-radius: 14px; overflow: hidden; border: 2px solid var(--ink); background: #14123A; }
.sp-frame svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.sp figcaption { font-weight: 600; }
.sp-cap { position: absolute; left: 6%; right: 6%; top: 69%; margin: 0; text-align: center; font: 800 .9rem/1.2 var(--display); color: #fff; }
.s-bold { text-shadow: 0 0 3px #000, 0 2px 0 #000; }
.s-marker { text-shadow: 0 0 3px #000; }
.s-marker .on { color: #14123A !important; background: var(--mark); padding: 0 3px; border-radius: 3px; text-shadow: none; }
.s-pop { font-size: 1.35rem; text-shadow: 0 2px 0 #000, 0 0 4px #000; }
.s-pop .on { color: #fff; display: inline-block; animation: pop .14s ease-out; }
.s-pop .on.hot { color: var(--mark); }
@keyframes pop { from { transform: scale(.7); } to { transform: scale(1); } }
.s-boxed span { background: rgba(0,0,0,.62); padding: 1px 2px; }
.s-boxed .on { color: var(--mark); }
.s-clean { font-family: var(--body); font-weight: 650; font-size: .82rem; text-shadow: 0 1px 3px rgba(0,0,0,.8); }
@media (prefers-reduced-motion: reduce) { .s-pop .on { animation: none; } }

/* pricing */
.price-hero { margin-bottom: 32px; max-width: 760px; display: grid; gap: 12px; }
.price-hero h2 { font-size: clamp(1.9rem, 4vw, 3rem); }
.plan .per { margin: 0; font-weight: 700; color: var(--signal); }
.plan.featured .per { color: #14123A; }
.compare { margin-top: 40px; display: grid; gap: 14px; }
.compare h3 { font-size: 1.15rem; }
.compare table { width: 100%; border-collapse: collapse; background: var(--surface); border: 2px solid var(--ink); border-radius: var(--radius-m); overflow: hidden; font-size: .95rem; }
.compare th, .compare td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.compare th { font-size: .82rem; color: var(--muted); font-weight: 600; }
.compare tr:last-child td { border-bottom: 0; }
.compare .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 700; }
.compare tr.us td { background: color-mix(in srgb, var(--mark) 28%, transparent); }
.compare tr.us td:first-child { font-weight: 700; }
@media (max-width: 560px) { .compare td:nth-child(2), .compare th:nth-child(2) { display: none; } }
.compare a { color: var(--signal); }

.hero-v2 h1 { font-size: clamp(2.5rem, 5.2vw, 4.3rem); }
.hero-v2 { padding-top: 40px; }
.buy-tabs .save { white-space: nowrap; display: inline-block; font-size: .72rem; font-weight: 700; background: var(--mark); color: #14123A; padding: 2px 6px; border-radius: 999px; margin-left: 4px; }
.buy-tabs button[aria-selected="false"] .save { opacity: .8; }
.price-tabs { max-width: 500px; margin-bottom: 20px; }
.price-tabs .save { white-space: nowrap; display: inline-block; font-size: .72rem; font-weight: 700; background: var(--mark); color: #14123A; padding: 2px 6px; border-radius: 999px; margin-left: 4px; }
.plan .price small { font: 500 .95rem var(--body); opacity: .7; }

/* ---------- scheduling + calendar ---------- */
.when-seg { margin-bottom: 8px; }
.when-seg label { font-size: .85rem; }
.bulk-preview { margin: 0; padding-left: 20px; color: var(--muted); font-size: .9rem; display: grid; gap: 2px; }
.slots { display: grid; gap: 14px; grid-template-columns: 1fr; align-items: end; border: 2px solid var(--line); border-radius: var(--radius-s); padding: 14px; }
@media (min-width: 700px) { .slots { grid-template-columns: 2fr 1fr auto; } }
.slot-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.slot { display: inline-flex; align-items: center; border: 2px solid var(--line); border-radius: var(--radius-s); background: var(--surface); }
.slot input { border: 0; padding: 8px; font: 600 .95rem var(--body); background: transparent; color: var(--ink); }
.slot .close { font-size: 1.2rem; padding: 4px 8px; }
#slot-tz { padding: 9px 12px; }
.cal { display: grid; gap: 18px; margin-top: 18px; max-height: 55vh; overflow-y: auto; }
.cal-day { display: grid; gap: 8px; }
.cal-day h4 { margin: 0; font: 700 1rem var(--display); border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.cal-row { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; }
.cal-row img, .cal-thumb { width: 44px; height: 58px; object-fit: cover; border-radius: 6px; background: var(--ink); }
.cal-info { display: grid; gap: 2px; min-width: 0; }
.cal-info b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pub.scheduled span { color: var(--signal); }

.length-note { background: #FFF6D6; border-left: 3px solid var(--mark, #FFE14D); padding: 6px 10px; border-radius: 6px; margin: 6px 0; color: #4a3f12; }

/* brand kit + thumbnails */
.brand-grid { display: grid; gap: 22px; }
@media (min-width: 700px) { .brand-grid { grid-template-columns: 220px 1fr; } }
.brand-logo { display: grid; gap: 10px; align-content: start; justify-items: start; }
.logo-box { width: 200px; height: 120px; border-radius: var(--radius-m); border: 1px dashed var(--line); display: grid; place-items: center;
  background: repeating-conic-gradient(var(--paper) 0 25%, var(--surface) 0 50%) 0 0 / 16px 16px; }
.logo-box img { max-width: 170px; max-height: 96px; }
.file-btn { cursor: pointer; }
.brand-form { display: grid; gap: 14px; }
.brand-form input[type=range] { width: 100%; }
.thumb-form { display: grid; gap: 14px; }
.thumb-out { margin: 16px 0 0; display: grid; gap: 10px; }
.thumb-out img { width: 100%; border-radius: var(--radius-m); border: 1px solid var(--line); }
.thumb-out.tall img { width: min(280px, 100%); }
