@font-face {
  font-family: "Geist";
  src: url("/static/fonts/geist.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/static/fonts/geist-mono.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  /* An editing bay: warm graphite surfaces, paper-white text, and amber for the clip markers. Amber is the
     one signal colour: the main button, what is chosen, progress, and the markers on a timeline. */
  --bg: #100f0d;
  --surface: #181613;
  --surface-2: #201d19;
  --surface-hover: #29251f;
  --border: #2c2822;
  --border-input: #3d372e;
  --text: #f5f0e6;
  --text-muted: #a8a093;
  --accent: #ffb224;
  --accent-rgb: 255, 178, 36;
  --accent-strong: #ffc552;
  --accent-fill: #ffb224; /* dark text on it: 10:1 */
  --accent-fill-hover: #ffc552;
  --on-accent: #1a1206;
  --link: #ffcf70;
  --link-hover: #ffe1a3;
  --signal: #ffb224;
  --on-signal: #1a1206;
  --ink: #0a0908;
  --on-ink: #f5f0e6;
  --tile: #6b6358;
  --chart: #d08010; /* the chart's columns: amber, darker for a quieter mark (lightness band 0.48-0.67) */
  --danger: #f05252;
  --success: #3ecf8e;

  --sans: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 14px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --sidebar: 15rem;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 0.9375rem/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
h1:focus { outline: none; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--link); transition: color 120ms var(--ease); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
img, video { display: block; max-width: 100%; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.tc { font-family: var(--mono); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }

/* ---------- shell ---------- */

.app {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100dvh;
}
.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.25rem 0.75rem;
  background: var(--surface);
  border-inline-end: 1px solid var(--border);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 0.5rem;
  font-weight: 650;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-mark { display: block; flex: none; width: 1.75rem; height: 1.75rem; }
.nav { display: flex; flex-direction: column; gap: 0.125rem; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.625rem;
  border-radius: var(--r-md);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: all 120ms var(--ease);
}
.nav-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-link[aria-current="page"] {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.sidebar-foot { margin-top: auto; display: grid; gap: 0.75rem; padding: 0 0.5rem; }
.credit-pill {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
  transition: all 120ms var(--ease);
}
.credit-pill:hover { border-color: var(--border-input); background: var(--surface-hover); text-decoration: none; }
.credit-pill strong { font-size: 1.25rem; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--accent); }
.credit-pill span { color: var(--text-muted); font-size: 0.8125rem; }
.who { font-size: 0.8125rem; color: var(--text-muted); overflow-wrap: anywhere; }

.main { padding: clamp(1.25rem, 3vw, 2.5rem); min-width: 0; }
.page { max-width: 68rem; margin-inline: auto; display: grid; gap: 1.75rem; }
.page-narrow { max-width: 44rem; }

h1 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.125rem); line-height: 1.15; letter-spacing: -0.02em; font-weight: 650; color: var(--text); }
h2 { font-size: 1.125rem; line-height: 1.3; letter-spacing: -0.01em; font-weight: 650; color: var(--text); }
h3 { font-size: 1rem; line-height: 1.35; font-weight: 600; color: var(--text); }
.lede { color: var(--text-muted); max-width: 52ch; }
.muted { color: var(--text-muted); }
.small { font-size: 0.8125rem; }

@media (max-width: 52rem) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    padding: 0.625rem 0.75rem;
    border-inline-end: 0;
    border-block-end: 1px solid var(--border);
  }
  .nav { flex-direction: row; overflow-x: auto; order: 3; width: 100%; padding-bottom: 0.125rem; }
  .nav-link { white-space: nowrap; }
  .sidebar-foot { margin: 0 0 0 auto; display: flex; align-items: center; padding: 0; }
  .who { display: none; }
  .credit-pill { padding: 0.25rem 0.625rem; }
  .credit-pill span { display: none; }
}

/* ---------- controls ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 550;
  text-decoration: none;
  cursor: pointer;
  transition: all 120ms var(--ease);
}
.btn:hover { background: var(--surface-hover); border-color: var(--border-input); color: var(--text); text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-fill-hover); border-color: var(--accent-fill-hover); box-shadow: 0 0 16px rgba(var(--accent-rgb), 0.4); }
.btn-danger { background: rgba(239, 68, 68, 0.15); border-color: rgba(239, 68, 68, 0.4); color: #f87171; }
.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-quiet { border-color: transparent; background: transparent; }
.btn-quiet:hover { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.btn-sm { min-height: 2rem; padding: 0.25rem 0.75rem; font-size: 0.875rem; }
.btn-block { width: 100%; }
.btn[aria-pressed="true"] { background: var(--surface-hover); border-color: var(--accent); color: var(--text); }

.field { display: grid; gap: 0.375rem; }
.field > label, .field > .label, legend { font-weight: 550; font-size: 0.875rem; color: var(--text); }
.hint { color: var(--text-muted); font-size: 0.8125rem; }
.input, .select, .textarea {
  width: 100%;
  min-height: 2.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-input);
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--text);
  transition: border-color 120ms var(--ease), box-shadow 120ms var(--ease);
}
.textarea { min-height: 5rem; resize: vertical; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.25);
}
.input::placeholder, .textarea::placeholder { color: var(--text-muted); opacity: 0.6; }
.input:user-invalid { border-color: var(--danger); }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
input[type="range"] { accent-color: var(--accent); width: 100%; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }

.seg { justify-self: start; display: inline-flex; border: 1px solid var(--border-input); border-radius: var(--r-md); overflow: hidden; background: var(--surface-2); }
.seg label { display: block; position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: block; padding: 0.4rem 0.9rem; font-weight: 550; font-size: 0.875rem; color: var(--text-muted); transition: all 120ms var(--ease); }
.seg label + label { border-inline-start: 1px solid var(--border-input); }
.seg input:checked + span { background: var(--accent-fill); color: var(--on-accent); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -3px; }

.badge {
  display: inline-block;
  padding: 0.125rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}
.badge-ok { color: #34d399; border-color: rgba(16, 185, 129, 0.4); background: rgba(16, 185, 129, 0.12); }
.badge-bad { color: #f87171; border-color: rgba(239, 68, 68, 0.4); background: rgba(239, 68, 68, 0.12); }
.badge-busy { color: var(--link); background: rgba(var(--accent-rgb), 0.15); border-color: rgba(var(--accent-rgb), 0.4); }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: clamp(1rem, 2.5vw, 1.5rem);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}
.empty { display: grid; gap: 0.75rem; justify-items: start; padding: 2rem 0; }

.alert { padding: 0.75rem 1rem; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface-2); }
.alert-bad { border-color: rgba(239, 68, 68, 0.4); color: #fca5a5; background: rgba(239, 68, 68, 0.12); }
.alert-ok { border-color: rgba(16, 185, 129, 0.4); color: #6ee7b7; background: rgba(16, 185, 129, 0.12); }

progress { width: 100%; height: 0.5rem; accent-color: var(--accent); }

/* ---------- login ---------- */

.login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.login-card { width: min(26rem, 100%); display: grid; gap: 1.25rem; }
.login-card .brand { padding: 0; }
.code-input { font-family: var(--mono); font-size: 1.5rem; letter-spacing: 0.4em; text-align: center; }

/* ---------- composer (home) ---------- */

.composer { display: grid; gap: 1.25rem; }
.dropzone {
  display: grid;
  gap: 0.25rem;
  justify-items: center;
  padding: 2rem 1rem;
  border: 2px dashed var(--border-input);
  border-radius: var(--r-lg);
  background: var(--surface-2);
  text-align: center;
  cursor: pointer;
}
.dropzone:hover, .dropzone[data-over="true"] { border-color: var(--accent); background: var(--surface-hover); color: var(--text); }
.dropzone:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.dropzone strong { font-weight: 600; color: var(--text); }

.settings { border-top: 1px solid var(--border); padding-top: 1rem; }
.settings > summary { cursor: pointer; font-weight: 600; padding: 0.25rem 0; color: var(--text); }
.settings-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); padding-top: 1rem; }
.span-all { grid-column: 1 / -1; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }

.styles { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: 0.5rem; }
.style-opt { position: relative; display: block; }
.style-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.style-card {
  display: grid;
  gap: 0.375rem;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
  transition: all 120ms var(--ease);
}
.style-card:hover { border-color: var(--border-input); background: var(--surface-hover); }
.style-opt input:checked + .style-card { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); background: var(--surface-hover); }
.style-opt input:focus-visible + .style-card { outline: 2px solid var(--accent); outline-offset: 3px; }
.style-sample {
  display: grid;
  place-items: center;
  height: 3.5rem;
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, #3b352c, #1a1714);
  line-height: 1.1;
  overflow: hidden;
  white-space: nowrap;
}
.style-sample.none { color: #9aa3ad; font-weight: 500; font-size: 0.8125rem; }
.style-name { font-size: 0.8125rem; font-weight: 600; text-align: center; }

.stage-list { display: grid; gap: 0.625rem; counter-reset: stage; }
.stage { display: flex; align-items: center; gap: 0.75rem; color: var(--text-muted); }
.stage-dot { width: 0.75rem; height: 0.75rem; border-radius: 50%; border: 2px solid var(--border-input); flex: none; }
.stage[data-state="done"] { color: var(--text); }
.stage[data-state="done"] .stage-dot { background: var(--accent); border-color: var(--accent); }
.stage[data-state="active"] { color: var(--text); font-weight: 600; }
.stage[data-state="active"] .stage-dot { background: var(--signal); border-color: var(--ink); }

/* ---------- projects ---------- */

.proj-list { display: grid; }
.proj {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
}
.proj:first-child { border-top: 0; }
.proj-cover-wrap {
  position: relative;
  width: 3.75rem;
  aspect-ratio: 9 / 16;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--ink);
  flex-shrink: 0;
}
.proj-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.proj-cover-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #2e2923, #1a1714);
}
.proj-eta-pill {
  position: absolute;
  bottom: 0.25rem;
  left: 0.2rem;
  right: 0.2rem;
  padding: 0.15rem 0.2rem;
  border-radius: 4px;
  background: rgb(0 0 0 / 0.85);
  color: #ffcc00;
  font-size: 0.5875rem;
  font-weight: 750;
  text-align: center;
  backdrop-filter: blur(2px);
  line-height: 1.1;
  white-space: nowrap;
  letter-spacing: -0.02em;
}
.proj-cover {
  width: 3.75rem;
  aspect-ratio: 9 / 16;
  border-radius: var(--r-sm);
  background: var(--ink);
  object-fit: cover;
}
.proj-title { font-weight: 600; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.proj-title:hover { text-decoration: underline; }
.proj-meta { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; align-items: center; color: var(--text-muted); font-size: 0.8125rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; justify-content: space-between; }

/* ---------- results ---------- */

.timeline { display: grid; gap: 0.5rem; }
.timeline-bar {
  position: relative;
  height: 2.25rem;
  border-radius: var(--r-md);
  background: var(--ink);
  background-image: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgb(255 255 255 / 0.12) calc(10% - 1px) 10%);
  overflow: hidden;
}
.timeline-mark {
  position: absolute;
  top: 0.375rem;
  bottom: 0.375rem;
  min-width: 0.375rem;
  border: 0;
  padding: 0;
  border-radius: 3px;
  background: var(--signal);
  box-shadow: 0 0 0 1px var(--ink);
  cursor: pointer;
}
.timeline-mark:hover, .timeline-mark:focus-visible { background: #ffd166; outline: 2px solid #fff; outline-offset: 1px; }
.timeline-mark[data-hidden="true"] { opacity: 0.3; }
.timeline-scale { display: flex; justify-content: space-between; }

.clip {
  display: grid;
  grid-template-columns: minmax(9rem, 12rem) minmax(0, 1fr);
  gap: 1.25rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--border);
  scroll-margin-top: 1rem;
}
.clip:first-child { border-top: 0; }
.clip[data-flash="true"] { animation: flash 1.2s var(--ease); }
@keyframes flash { from { background: rgba(var(--accent-rgb), 0.2); } }
.clip-media { position: relative; width: 100%; }
.clip-video {
  width: 100%;
  border-radius: var(--r-md);
  background: #000;
  border: 1px solid var(--border);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  max-height: 70dvh;
  object-fit: contain;
}
.clip-body { display: grid; gap: 0.5rem; align-content: start; min-width: 0; }
.clip-head { display: flex; gap: 1rem; justify-content: space-between; align-items: start; }
.clip-title { overflow-wrap: anywhere; color: var(--text); }
.score {
  flex: none;
  display: grid;
  justify-items: center;
  min-width: 3.5rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  line-height: 1.1;
}
.score strong { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.score span { font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }

.score-viral {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.55);
  color: #34d399;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.18);
}
.score-strong {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.55);
  color: #fbbf24;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.15);
}

.clip-meta { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; color: var(--text-muted); font-size: 0.8125rem; align-items: center; }
.clip-desc { max-width: 62ch; overflow-wrap: anywhere; }
.clip-reason { color: var(--text-muted); font-size: 0.875rem; max-width: 62ch; }
.clip-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.25rem; }
.clip[data-liked="false"] { opacity: 0.6; }
.flip { display: inline-flex; transform: rotate(180deg); }
.stack { display: grid; gap: 1.75rem; }
.stack .stack { gap: 1rem; }
.rendering-note, .clip-media .rendering-note { display: grid; place-items: center; aspect-ratio: 9 / 16; border-radius: var(--r-md); background: var(--surface-2); border: 1px dashed var(--border-input); font-weight: 600; text-align: center; padding: 1rem; }

@media (max-width: 40rem) {
  .clip { grid-template-columns: minmax(0, 1fr); }
  .clip-media { max-width: 14rem; }
}

/* ---------- tabs & filters ---------- */
.tab-bar {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.25rem;
}
.tab-btn {
  background: transparent;
  border: 0;
  padding: 0.5rem 1rem;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--r-md) var(--r-md) 0 0;
  position: relative;
  transition: color 120ms var(--ease);
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  color: var(--accent);
}
.tab-btn.active::after {
  content: "";
  position: absolute;
  bottom: -0.25rem;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
}

.search-box {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border-input);
  border-radius: var(--r-md);
  padding: 0 0.5rem;
  color: var(--text-muted);
}
.search-box .input {
  border: 0;
  padding: 0.25rem 0.25rem;
  min-height: 2rem;
  background: transparent;
}
.search-box .input:focus { outline: none; }

/* ---------- custom clipper / transcript ---------- */
.custom-clip-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.custom-clip-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}
.custom-time-readout {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.875rem;
}
.transcript-lines-scroll {
  display: grid;
  gap: 0.375rem;
  max-height: 32rem;
  overflow-y: auto;
  padding: 0.75rem;
}
.transcript-line-row {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.375rem 0.5rem;
  border-radius: var(--r-sm);
  transition: background 100ms var(--ease);
}
.transcript-line-row:hover { background: var(--surface-2); }
.transcript-line-row.in-selection {
  background: rgba(11, 110, 90, 0.12);
  border-left: 3px solid var(--accent);
}
.transcript-line-actions {
  display: flex;
  gap: 0.25rem;
}
.btn-active {
  background: var(--accent-fill);
  color: var(--on-accent);
}

/* ---------- editor ---------- */

.editor { display: grid; grid-template-columns: minmax(16rem, 24rem) minmax(0, 1fr); gap: clamp(1rem, 3vw, 2.5rem); align-items: start; }
.editor-preview { position: sticky; top: 1rem; display: grid; gap: 0.75rem; }
.editor-sections { display: grid; gap: 1.25rem; }
.editor-sections section { display: grid; gap: 0.75rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--border); }
.editor-sections section:last-of-type { border-bottom: 0; }
.pv { position: relative; overflow: hidden; cursor: pointer; width: min(100%, calc(72dvh * var(--ar, 0.5625))); margin-inline: auto; border-radius: var(--r-md); background: #000; border: 1px solid var(--border); }
.pv-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.pv-headline { position: absolute; inset-inline: 8%; text-align: center; line-height: 1.5; color: #111; pointer-events: none; }
.pv-headline span { background: #fff; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.pv-mark { position: absolute; top: 2%; right: 3.5%; color: #fff; opacity: 0.7; font-weight: 700; text-shadow: 0 0 2px #000; pointer-events: none; }
.pv-caption { position: absolute; inset-inline: 5.5%; text-align: center; line-height: 1.25; pointer-events: none; }
.pv-caption.middle { top: 50%; transform: translateY(-50%); }
.pv-controls { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.625rem; align-items: center; }
.pv-controls .btn { min-width: 4.25rem; }
.color-input { width: 3rem; height: 2.25rem; padding: 0.125rem; border: 1px solid var(--border-input); border-radius: var(--r-sm); background: var(--surface-2); cursor: pointer; }
.editor-save { position: sticky; bottom: 0; padding: 0.75rem 0; background: var(--bg, #100f0d); border-top: 1px solid var(--border); justify-content: space-between; }
.trim-readout { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.cap-lines { display: grid; gap: 0.5rem; max-height: 22rem; overflow: auto; padding-inline-end: 0.25rem; }
.cap-line { display: grid; grid-template-columns: 4.25rem minmax(0, 1fr); gap: 0.5rem; align-items: center; }
.cap-line .input { min-height: 2.25rem; }
@media (max-width: 52rem) {
  .editor { grid-template-columns: minmax(0, 1fr); }
  .editor-preview { position: static; max-width: 20rem; }
}

/* ---------- billing ---------- */

.balance { display: flex; flex-wrap: wrap; gap: 1.5rem 3rem; align-items: end; }
.balance-n { font-size: clamp(2.5rem, 2rem + 3vw, 3.75rem); font-weight: 650; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; }
.plan { display: grid; gap: 0.75rem; align-content: start; padding: 1.25rem; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.plan[data-current="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.plan-price { font-size: 2rem; font-weight: 650; letter-spacing: -0.02em; color: var(--text); }
.plan-price small { font-size: 0.875rem; font-weight: 500; color: var(--text-muted); }
.plan ul { display: grid; gap: 0.375rem; color: var(--text-muted); font-size: 0.875rem; }
.table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.table th, .table td { text-align: start; padding: 0.5rem 0.75rem 0.5rem 0; border-bottom: 1px solid var(--border); }
.table th { color: var(--text-muted); font-weight: 600; }
.table td.num, .table th.num { text-align: end; font-variant-numeric: tabular-nums; }

/* ---------- brand templates ---------- */

.tpl-list { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); }
.tpl { display: grid; gap: 0.75rem; padding: 1rem; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); align-content: start; }
.tpl-swatch { width: 1rem; height: 1rem; border-radius: 50%; border: 1px solid var(--border-input); display: inline-block; vertical-align: -0.125rem; }

/* ---------- dialog + toast (native <dialog>, popover) ---------- */

dialog {
  width: min(30rem, calc(100% - 2rem));
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75);
}
dialog:modal { overscroll-behavior: contain; }
dialog::backdrop { background: rgba(0, 0, 0, 0.75); backdrop-filter: blur(8px); overflow: hidden; overscroll-behavior: contain; }
.dialog-body { display: grid; gap: 1rem; }
.dialog-actions { display: flex; gap: 0.5rem; justify-content: flex-end; flex-wrap: wrap; }
.copy-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.5rem; }

.toasts { position: absolute; width: 0; height: 0; overflow: visible; }
.toast {
  position: fixed;
  inset: auto 1rem auto auto;
  bottom: 1rem;
  margin: 0;
  min-width: 14rem;
  max-width: min(24rem, calc(100vw - 2rem));
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: #fff;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  transition: bottom 160ms var(--ease);
}
.toast[data-kind="error"] { background: #b91c1c; color: #fff; } /* white on this red passes AA contrast; --danger does not */
@media (prefers-reduced-motion: no-preference) {
  .toast { animation: toast-in 180ms var(--ease); }
  @keyframes toast-in { from { opacity: 0; translate: 0 0.5rem; } }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- legal pages ---------- */

.legal-bar { padding: 1rem clamp(1rem, 4vw, 2.5rem); border-bottom: 1px solid var(--border); background: var(--surface); }
.legal { max-width: 44rem; margin: 0 auto; padding: 2.5rem 1.25rem 3rem; display: grid; gap: 1rem; }
.legal h2 { margin-top: 1.25rem; }
.legal ul { display: grid; gap: 0.5rem; padding-inline-start: 1.25rem; list-style: disc; }
.legal-foot { display: flex; gap: 1.25rem; justify-content: center; padding: 2rem 1rem; border-top: 1px solid var(--border); }

/* ---------- landing ---------- */

.btn-lg { min-height: 3rem; padding: 0.625rem 1.5rem; font-size: 1rem; }
.landing { min-height: 100dvh; background: var(--bg); }
.lp-nav { display: flex; align-items: center; justify-content: space-between; padding: 1rem clamp(1rem, 4vw, 2.5rem); background: var(--surface); border-bottom: 1px solid var(--border); }
.landing main { max-width: 72rem; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2.5rem); }
.lp-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: center; padding: clamp(2rem, 6vw, 5rem) 0; }
.lp-hero h1 { font-size: clamp(2rem, 1.2rem + 3.4vw, 3.5rem); line-height: 1.05; letter-spacing: -0.03em; text-wrap: balance; }
.lp-hero-copy { display: grid; gap: 1.25rem; justify-items: start; }
.lp-hero .lede { font-size: 1.125rem; }
.lp-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.demo { display: grid; gap: 1rem; padding: 1.25rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); margin: 0; }
.demo .timeline-mark { cursor: default; }
.demo-rows { display: grid; }
.demo-row { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr) auto; gap: 0.875rem; align-items: center; padding: 0.75rem 0; border-top: 1px solid var(--border); }
.demo-row:first-child { border-top: 0; }
.demo-thumb { aspect-ratio: 9 / 16; border-radius: var(--r-sm); background: linear-gradient(160deg, #3b352c, var(--ink)); overflow: hidden; }
.demo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.demo-row .score { min-width: 2.75rem; }
.demo-row .score strong { font-size: 1.125rem; }
.lp-section { padding: clamp(2rem, 5vw, 4rem) 0; border-top: 1px solid var(--border); display: grid; gap: 1.5rem; }
.lp-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.5rem; }
.lp-steps li { display: grid; grid-template-columns: auto 1fr; gap: 0.875rem; align-items: start; }
.lp-step-n { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--ink); color: var(--signal); font-weight: 700; font-variant-numeric: tabular-nums; }
.lp-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1.5rem 2.5rem; margin: 0; }
.lp-features dt { font-weight: 650; }
.lp-features dd { margin: 0.25rem 0 0; max-width: 40ch; }
.lp-faq { display: grid; max-width: 46rem; }
.lp-faq details { padding: 0.875rem 0; border-top: 1px solid var(--border); }
.lp-faq summary { cursor: pointer; font-weight: 600; }
.lp-faq p { margin-top: 0.5rem; max-width: 62ch; }
.lp-final { display: grid; gap: 1.25rem; justify-items: start; padding: clamp(2rem, 5vw, 4rem) 0; border-top: 1px solid var(--border); }
@media (max-width: 52rem) {
  .lp-hero { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- social accounts ---------- */

.acct-list { display: grid; }
.acct { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.875rem; align-items: center; padding: 0.625rem 0; border-top: 1px solid var(--border); }
.acct:first-child { border-top: 0; }
.avatar { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--ink); color: var(--signal); font-weight: 700; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
dialog .stack { gap: 0.875rem; }
dialog { max-height: calc(100dvh - 2rem); overflow: auto; }

/* ---------- clip setup modal (Opus-style preflight) ---------- */
dialog.setup-dialog {
  width: min(58rem, calc(100% - 2rem));
  max-width: 58rem;
  padding: 1.5rem;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--surface);
}
.setup-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(15rem, 1fr);
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 52rem) {
  .setup-layout { grid-template-columns: minmax(0, 1fr); }
}
.setup-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
.setup-side { display: grid; gap: 1rem; position: sticky; top: 0; }

.setup-video-card {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  gap: 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 0.75rem;
  align-items: center;
}
.setup-thumb-box {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--ink);
}
.setup-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.setup-res-badge {
  position: absolute;
  top: 0.25rem;
  left: 0.25rem;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  background: rgb(0 0 0 / 0.75);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
}
.setup-dur-badge {
  position: absolute;
  bottom: 0.25rem;
  right: 0.25rem;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  background: rgb(0 0 0 / 0.75);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 600;
}
.setup-video-meta { display: grid; gap: 0.5rem; }
.setup-video-title {
  font-weight: 650;
  font-size: 0.9375rem;
  line-height: 1.25;
  color: var(--text);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.setup-section-title {
  font-weight: 650;
  font-size: 0.875rem;
  color: var(--text);
  margin-bottom: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.setup-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.setup-pill {
  flex: 1;
  min-width: 4.5rem;
  text-align: center;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.8125rem;
  transition: all 120ms var(--ease);
}
.setup-pill:hover { border-color: var(--border-input); color: var(--text); background: var(--surface-hover); }
.setup-pill[aria-pressed="true"] {
  background: var(--accent-fill);
  color: var(--on-accent);
  border-color: var(--accent-fill);
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.3);
}

.toggle-switch-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
}
.toggle-switch-info strong { display: block; font-size: 0.875rem; }
.toggle-switch-info span { font-size: 0.75rem; color: var(--text-muted); }

.switch {
  position: relative;
  display: inline-block;
  width: 2.75rem;
  height: 1.5rem;
  flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--border-input);
  border-radius: 999px;
  transition: 180ms ease;
}
.switch-slider:before {
  position: absolute;
  content: "";
  height: 1.125rem;
  width: 1.125rem;
  left: 0.1875rem;
  bottom: 0.1875rem;
  background-color: white;
  border-radius: 50%;
  transition: 180ms ease;
}
.switch input:checked + .switch-slider {
  background-color: var(--accent);
}
.switch input:checked + .switch-slider:before {
  transform: translateX(1.25rem);
}

.setup-summary-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1.25rem;
  display: grid;
  gap: 0.75rem;
}
.setup-summary-title { font-weight: 650; font-size: 0.9375rem; }
.setup-line-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.setup-line-item.total {
  border-top: 1px solid var(--border);
  padding-top: 0.625rem;
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--text);
}
.setup-balance-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
}
.setup-range-readout {
  font-size: 0.8125rem;
  color: var(--accent);
  font-weight: 600;
}


/* ---------- editor: tabs, transcript trimming, overlays ---------- */

.editor-tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: thin; }
.editor-tabs .tab-btn { white-space: nowrap; }
.editor-panel { display: grid; gap: 0.875rem; padding-block: 0.25rem 1rem; }
.editor-sections .editor-panel { border-bottom: 0; padding-bottom: 1rem; }
.tw-box { max-height: 17rem; overflow-y: auto; padding: 0.625rem 0.75rem; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); line-height: 2; }
.tw { all: unset; cursor: pointer; padding: 0.0625rem 0.1875rem; border-radius: 0.25rem; color: var(--text-muted); font-size: 0.9375rem; }
.tw.in { color: var(--text); font-weight: 550; }
.tw.cut { text-decoration: line-through; color: var(--text-muted); font-weight: 400; }
.tw.now { box-shadow: 0 2px 0 var(--accent); }
.tw.sel { background: var(--accent-fill); color: var(--on-accent); }
.tw:hover { background: var(--surface-hover); }
.tw.sel:hover { background: var(--accent-fill-hover); }
.tw:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.tw-actions { gap: 0.5rem; flex-wrap: wrap; }
.check { display: flex; gap: 0.625rem; align-items: center; font-size: 0.9375rem; cursor: pointer; }
.keys { line-height: 2; }
kbd { font-family: var(--mono); font-size: 0.75rem; padding: 0.125rem 0.375rem; border: 1px solid var(--border-input); border-bottom-width: 2px; border-radius: 0.25rem; background: var(--surface-2); color: var(--text); }
.pv-canvas { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; }
.pv-bar { position: absolute; left: 0; bottom: 0; width: 0; pointer-events: none; }
.pv-card { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding-inline: 8%; background: rgba(0, 0, 0, 0.65); color: #111; line-height: 1.5; pointer-events: none; }
.pv-card span { background: #fff; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.pv-pop { display: inline-block; animation: pv-pop 110ms ease-out; }
@keyframes pv-pop { from { transform: scale(1.14); } to { transform: scale(1); } }
.pv-tilt { display: inline-block; transform: rotate(-5deg) scale(1.18); margin-inline: 0.12em; }
.style-sample .pv-pop { animation-duration: 160ms; }
@media (prefers-reduced-motion: reduce) { .pv-pop { animation: none; } }
@media (max-width: 52rem) {
  /* on a phone the preview stays in view while you work through the tabs */
  .editor-preview { position: sticky; top: 0; z-index: 2; max-width: none; background: var(--bg, #100f0d); padding-bottom: 0.5rem; }
  .editor-preview .pv { width: min(100%, calc(38dvh * var(--ar, 0.5625))); }
  .editor-preview .keys, .editor-preview > .hint { display: none; }
}

/* ---------- posting calendar ---------- */

.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.5rem; }
.cal-day { display: grid; gap: 0.5rem; align-content: start; min-height: 8rem; padding: 0.625rem; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.cal-day[data-today="true"] { border-color: var(--accent); }
.cal-date { display: flex; justify-content: space-between; align-items: baseline; color: var(--text-muted); font-size: 0.8125rem; }
.cal-date strong { font-size: 1.125rem; color: var(--text); font-variant-numeric: tabular-nums; }
.cal-posts { display: grid; gap: 0.375rem; list-style: none; margin: 0; padding: 0; }
.cal-post { display: grid; gap: 0.125rem; justify-items: start; padding: 0.375rem 0.5rem; border-radius: var(--r-sm); background: var(--surface-2); border-inline-start: 3px solid var(--accent); font-size: 0.8125rem; }
.cal-post[data-platform="tiktok"] { border-inline-start-color: #25f4ee; }
.cal-post[data-platform="youtube"] { border-inline-start-color: #ff4e45; }
.cal-where { font-weight: 600; }
.cal-title { color: var(--text-muted); overflow-wrap: anywhere; }
.cal-empty { color: var(--text-muted); font-size: 0.8125rem; margin: 0; }
@media (max-width: 60rem) {
  .cal { grid-template-columns: minmax(0, 1fr); }
  .cal-day { min-height: 0; grid-template-columns: 4.5rem minmax(0, 1fr); align-items: start; }
  .cal-date { flex-direction: column; }
}

/* framing picker */
.lays { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.25rem, 1fr)); gap: 0.5rem; }
.lay-opt { position: relative; display: block; }
.lay-opt[hidden] { display: none; }
.lay-opt input { position: absolute; opacity: 0; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.lay-card { display: grid; justify-items: center; gap: 0.375rem; height: 100%; padding: 0.5rem 0.375rem; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); transition: border-color 120ms var(--ease), background 120ms var(--ease); }
.lay-card:hover { border-color: var(--border-input); background: var(--surface-hover); }
.lay-opt input:checked + .lay-card { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); background: var(--surface-hover); }
.lay-opt input:focus-visible + .lay-card { outline: 2px solid var(--accent); outline-offset: 3px; }
.lay-ico { position: relative; display: block; width: 1.6875rem; height: 3rem; border-radius: 3px; background: var(--ink); overflow: hidden; }
.lay-tile { position: absolute; display: grid; place-items: center; background: var(--tile); }
.lay-opt input:checked + .lay-card .lay-tile { background: var(--accent); }
.lay-face { width: 0.375rem; height: 0.375rem; border-radius: 50%; background: #fff; }
.lay-name { font-size: 0.75rem; font-weight: 600; text-align: center; line-height: 1.25; }

/* brand kit files */
.kit-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); align-items: start; }
.kit-files { display: grid; gap: 0.5rem; list-style: none; margin: 0; padding: 0; }
.kit-file { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.75rem; align-items: center; padding-top: 0.5rem; border-top: 1px solid var(--border); }
.kit-file[data-kind="music"] { grid-template-columns: minmax(0, 1fr) auto; }
.kit-file[data-kind="music"] .kit-audio { grid-column: 1 / -1; width: 100%; height: 2.25rem; }
.kit-thumb { width: 4rem; height: 4rem; object-fit: contain; border-radius: var(--r-sm); background: var(--ink); }
.kit-name { display: grid; overflow-wrap: anywhere; }

/* choosing several clips */
.clip-pick { display: grid; place-items: center; min-width: 1.5rem; min-height: 1.5rem; cursor: pointer; }
.clip-pick input { width: 1.125rem; height: 1.125rem; accent-color: var(--accent); cursor: pointer; }
.pick-bar { position: sticky; top: 0.5rem; z-index: 5; display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; justify-content: space-between; padding: 0.625rem 0.875rem; border: 1px solid var(--accent); border-radius: var(--r-md); background: var(--surface); }
.pick-bar[hidden] { display: none; }
.who-team { display: block; }
.clip-head .clip-title { flex: 1; }

/* ---------- headline look cards ---------- */
.hl-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); gap: 0.5rem; }
.hl-opt { position: relative; display: block; }
.hl-opt input { position: absolute; opacity: 0; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.hl-card-box { display: grid; gap: 0.375rem; padding: 0.375rem; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); transition: border-color 120ms var(--ease), background 120ms var(--ease); }
.hl-card-box:hover { border-color: var(--border-input); background: var(--surface-hover); }
.hl-opt input:checked + .hl-card-box { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); background: var(--surface-hover); }
.hl-opt input:focus-visible + .hl-card-box { outline: 2px solid var(--accent); outline-offset: 3px; }
.hl-frame { position: relative; display: block; aspect-ratio: 9 / 13; border-radius: 6px; overflow: hidden; background: linear-gradient(160deg, #4a4236 0%, #221f1a 55%, #0c0b0a 100%); }
.hl-frame::after { content: ""; position: absolute; left: 30%; right: 30%; bottom: 0; height: 52%; border-radius: 50% 50% 0 0; background: #2c3a50; }
.hl-sample { position: absolute; z-index: 1; left: 8%; right: 8%; top: 9%; display: grid; gap: 0.1rem; line-height: 1.05; color: #fff; }
.hl-card { justify-items: center; text-align: center; }
.hl-card b { padding: 0.15rem 0.3rem; border-radius: 3px; font: 700 0.5625rem/1.2 var(--sans); }
.hl-card b.hl-outline { font-size: 0.6875rem; text-shadow: 0.06em 0.06em 0 #000, -0.06em 0.06em 0 #000, 0.06em -0.06em 0 #000, -0.06em -0.06em 0 #000; }
.hl-magazine { font-family: "DM Serif Display", Georgia, serif; font-size: 0.5625rem; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7); }
.hl-magazine b { font-weight: 400; font-size: 1.05rem; color: #d9f05b; }
.hl-statement { font: 600 0.5rem/1.1 var(--sans); text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7); }
.hl-statement b { font: 400 0.95rem/0.95 "Anton", Impact, sans-serif; text-transform: uppercase; }
.hl-name { font-size: 0.75rem; font-weight: 550; text-align: center; }

/* ---------- video shape cards ---------- */
.shape-cards { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.shape-opt { position: relative; display: block; }
.shape-opt input { position: absolute; opacity: 0; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.shape-opt input:disabled { cursor: not-allowed; }
.shape-card { display: grid; justify-items: center; align-content: end; gap: 0.375rem; min-width: 5.5rem; height: 100%; padding: 0.625rem 0.625rem 0.5rem; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); transition: border-color 120ms var(--ease), background 120ms var(--ease); }
.shape-card:hover { border-color: var(--border-input); background: var(--surface-hover); }
.shape-box { display: block; border: 2px solid var(--tile); border-radius: 4px; }
.shape-name { font-weight: 600; font-size: 0.8125rem; }
.shape-lock { font-size: 0.6875rem; font-weight: 600; color: var(--signal); }
.shape-opt input:checked + .shape-card { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); background: var(--surface-hover); }
.shape-opt input:checked + .shape-card .shape-box { border-color: var(--accent); background: rgba(var(--accent-rgb), 0.15); }
.shape-opt input:focus-visible + .shape-card { outline: 2px solid var(--accent); outline-offset: 3px; }
.shape-opt input:disabled + .shape-card { opacity: 0.6; }

/* ---------- blueprints ---------- */
.bp-art { display: grid; place-items: center; padding: 0.375rem 0; border-radius: 6px; background: var(--ink); }
.bp-phone { position: relative; display: block; width: 2.25rem; aspect-ratio: 9 / 16; border-radius: 4px; overflow: hidden; background: #221f1a; outline: 1px solid var(--border-input); }
.bp-blk { position: absolute; display: block; border-radius: 1px; }
.bp-face { background: #3b4c66; }
.bp-wide { background: #4b5d78; }
.bp-game { background: repeating-linear-gradient(135deg, #2f6b4f 0 4px, #285c44 4px 8px); }
.bp-cap, .bp-cap2 { background: #fde047; border-radius: 2px; }
.bp-cap2 { background: #f1f5f9; }
.bp-hook { background: #f8fafc; border-radius: 2px; }
.bp-bar { background: var(--accent); }
.bp-frame { border: 2px solid var(--accent); border-radius: 2px; background: rgba(var(--accent-rgb), 0.12); }

.bp-strip { display: flex; gap: 0.5rem; overflow-x: auto; padding: 2px 2px 0.375rem; scroll-snap-type: x proximity; }
.bp-pick { position: relative; flex: 0 0 8.25rem; scroll-snap-align: start; }
.bp-pick input { position: absolute; opacity: 0; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.bp-pick-card { display: grid; align-content: start; gap: 0.25rem; height: 100%; padding: 0.5rem; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); transition: border-color 120ms var(--ease), background 120ms var(--ease); }
.bp-pick-card strong { font-size: 0.8125rem; line-height: 1.25; }
.bp-pick-card .hint { font-size: 0.75rem; }
.bp-pick-card:hover { border-color: var(--border-input); background: var(--surface-hover); }
.bp-pick input:checked + .bp-pick-card { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); background: var(--surface-hover); }
.bp-pick input:focus-visible + .bp-pick-card { outline: 2px solid var(--accent); outline-offset: 3px; }
.bp-pick:first-child .bp-pick-card { align-content: center; }
.bp-manage { flex: 0 0 auto; align-self: center; }

dialog.bp-dialog { width: min(60rem, calc(100vw - 2rem)); padding: 1.5rem; }
.bp-head { display: flex; justify-content: space-between; align-items: start; gap: 1rem; margin-bottom: 1rem; }
.bp-head .hint { margin-top: 0.25rem; max-width: 52ch; }
.bp-tabs { display: flex; gap: 1.25rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; }
.bp-tab { padding: 0.5rem 0; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--text-muted); font-weight: 600; cursor: pointer; }
.bp-tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--text); }
.bp-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.75rem; }
.bp-card { display: grid; grid-template-rows: auto 1fr auto; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface-2); overflow: hidden; }
.bp-card .bp-art { border-radius: 0; padding: 0.75rem 0; }
.bp-card .bp-phone { width: 3rem; }
.bp-card-body { display: grid; align-content: start; gap: 0.375rem; padding: 0.75rem 0.875rem; }
.bp-card h3 { font-size: 1rem; }
.bp-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-top: 0.25rem; }
.bp-card-actions { display: flex; gap: 0.25rem; padding: 0 0.5rem 0.5rem; }
.bp-empty { grid-column: 1 / -1; padding: 1rem 0; }
.bp-save { display: grid; gap: 0.375rem; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.bp-save label { font-weight: 550; font-size: 0.875rem; }
.bp-save-row { display: flex; gap: 0.5rem; }
.bp-save-row .input { flex: 1; }
.bp-home { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.75rem; }

/* ---------- analytics ---------- */
.an-head { align-items: end; }
.an-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.an-filters .select { width: auto; max-width: 18rem; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0.75rem; }
.stat-tile { display: grid; gap: 0.125rem; padding: 0.875rem 1rem; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.stat-label { color: var(--text-muted); font-size: 0.8125rem; font-weight: 550; }
.stat-value { font-size: 1.75rem; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.chart-wrap { position: relative; }
.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid { stroke: var(--border); stroke-width: 1; }
.chart-base { stroke: var(--border-input); stroke-width: 1; }
.chart-axis { fill: var(--text-muted); font-size: 11px; font-family: var(--sans); }
.chart-bar { fill: var(--chart); }
.chart-hit { fill: transparent; cursor: default; }
.chart-hit:hover, .chart-hit:focus { fill: rgba(148, 163, 184, 0.08); outline: none; }
.chart-tip { position: absolute; top: 0; transform: translate(-50%, 0); padding: 0.375rem 0.625rem; border: 1px solid var(--border-input); border-radius: var(--r-md); background: var(--surface-2); font-size: 0.8125rem; white-space: nowrap; pointer-events: none; }
.table-scroll { overflow-x: auto; }
.learn-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: 1.25rem; }
.learn-col { gap: 0.5rem; min-width: 0; }
.learn-col h3 { font-size: 0.875rem; color: var(--text-muted); font-weight: 600; }
.learn-list { list-style: none; margin: 0; padding: 0; display: grid; }
.learn-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1rem; padding: 0.5rem 0; border-top: 1px solid var(--border); font-size: 0.875rem; }
.learn-title { flex: 1 1 14rem; min-width: 0; overflow-wrap: break-word; }
.learn-meta { display: flex; gap: 0.75rem; flex: none; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.learn-meta strong { color: var(--text); font-weight: 600; }
.bp-home, .bp-strip, .setup-main > .field { min-width: 0; }
.bp-strip { scrollbar-width: thin; scrollbar-color: var(--border-input) transparent; }
.bp-field { grid-template-columns: minmax(0, 1fr); }

/* =================== redesign: the editing bay =================== */

/* A timeline strip with amber clip markers: the product's own motif, used in the hero and in empty states. */
.reel {
  position: relative;
  height: 1.75rem;
  border-radius: 6px;
  background:
    repeating-linear-gradient(90deg, transparent 0 calc(10% - 2px), rgba(245, 240, 230, 0.06) calc(10% - 2px) 10%),
    var(--ink);
  border: 1px solid var(--border);
  overflow: hidden;
}
.reel::after {  /* the playhead line along the middle */
  content: "";
  position: absolute;
  inset: 50% 0 auto;
  height: 1px;
  background: rgba(245, 240, 230, 0.08);
}
.reel-mark {
  position: absolute;
  top: 0.3rem;
  bottom: 0.3rem;
  width: 3.2%;
  min-width: 0.6rem;
  border-radius: 3px;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.45);
}
@media (prefers-reduced-motion: no-preference) {
  .hero .reel-mark { animation: mark-in 520ms var(--ease) both; animation-delay: calc(var(--d) * 110ms + 120ms); }
  @keyframes mark-in { from { transform: scaleY(0.2); opacity: 0; } }
}

/* nav: the current page carries a marker, like a clip on the timeline */
.nav-link[aria-current="page"] {
  background: var(--surface-2);
  border: 1px solid var(--border);
  box-shadow: inset 3px 0 0 var(--accent);
}
.brand-mark { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
h1 { letter-spacing: -0.025em; }

/* ---------- home ---------- */
.home { gap: 2.5rem; }
.hero { display: grid; gap: 1rem; max-width: 52rem; padding-top: 0.5rem; }
.hero .reel { max-width: 22rem; }
.hero-title { font-size: clamp(1.875rem, 1.2rem + 2.4vw, 2.875rem); line-height: 1.05; letter-spacing: -0.035em; font-weight: 700; max-width: 18ch; }
.hero .lede { font-size: 1.0625rem; max-width: 46ch; }
.hero-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding: 0.5rem 0.5rem 0.5rem 1rem;
  border: 1px solid var(--border-input);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  transition: border-color 140ms var(--ease), box-shadow 140ms var(--ease);
}
.hero-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.18), 0 10px 40px rgba(0, 0, 0, 0.35); }
.hero-icon { display: grid; color: var(--text-muted); }
.hero-url { flex: 1; min-width: 0; min-height: 3rem; border: 0; background: transparent; font-size: 1.0625rem; outline: none; }
.hero-url::placeholder { color: var(--text-muted); }
.hero-go { flex: 0 0 auto; border-radius: 10px; }
.hero-alt { color: var(--text-muted); font-size: 0.9375rem; }
.hero-cost { display: block; margin-top: 0.25rem; font-size: 0.8125rem; }
.linklike { color: var(--link); cursor: pointer; text-decoration: underline; text-underline-offset: 0.15em; }
.linklike:hover { color: var(--link-hover); }
.linklike:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.hero-using { padding: 0.5rem 0.75rem; border-radius: var(--r-md); background: rgba(var(--accent-rgb), 0.1); border: 1px solid rgba(var(--accent-rgb), 0.3); font-size: 0.875rem; justify-self: start; }
.home[data-dropping]::after {
  content: "Drop the video to start";
  position: fixed;
  inset: 1rem;
  z-index: 50;
  display: grid;
  place-items: center;
  border: 2px dashed var(--accent);
  border-radius: 18px;
  background: rgba(16, 15, 13, 0.85);
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 650;
  pointer-events: none;
}
@media (max-width: 40rem) {
  .hero-box { flex-wrap: wrap; padding: 0.5rem; }
  .hero-icon { display: none; }
  .hero-url { flex-basis: 100%; padding: 0 0.5rem; }
  .hero-go { width: 100%; }
}

/* blueprint gallery on the home page */
.bp-home-grid { min-width: 0; }
.bp-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 0.75rem; overflow: visible; padding: 0; }
.bp-gallery .bp-pick { flex: none; }
.bp-gallery .bp-pick-card { grid-template-columns: 4.5rem 1fr; align-items: start; gap: 0.75rem; padding: 0.625rem; border-radius: var(--r-lg); }
.bp-gallery .bp-art { padding: 0; background: none; }
.bp-gallery .bp-pick-none { order: 99; }
.bp-gallery .bp-pick-none .bp-pick-card { grid-template-columns: 1fr; align-content: center; min-height: 100%; border-style: dashed; background: transparent; }
.bp-pick-text { display: grid; gap: 0.25rem; align-content: start; }
.bp-pick-desc { color: var(--text-muted); font-size: 0.8125rem; line-height: 1.4; }
.bp-tag { justify-self: start; margin-top: 0.125rem; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.01em; color: var(--text-muted); }
.bp-pick input:checked + .bp-pick-card .bp-tag { color: var(--accent); }
.bp-art-shot { padding: 0; background: none; }
.bp-shot { display: block; width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 8px; background: var(--ink); }
.bp-strip:not(.bp-gallery) .bp-shot { width: 3rem; margin: 0 auto; }
.bp-card .bp-art-shot { padding: 0.75rem 0; background: var(--ink); }
.bp-card .bp-shot { width: 5.5rem; }

/* headline look cards with rendered stills */
.hl-frame-shot { background: var(--ink); }
.hl-frame-shot::after { display: none; }
.hl-frame-shot img { width: 100%; height: 100%; object-fit: cover; }

/* empty states */
.empty-reel { display: grid; gap: 0.75rem; max-width: 26rem; padding: 1.25rem 0; }

/* ---------- clip settings: tabs and live preview ---------- */
dialog.setup-dialog { width: min(72rem, calc(100vw - 2rem)); }
.setup-tabs { display: flex; gap: 0.25rem; padding: 0.25rem; border: 1px solid var(--border); border-radius: 12px; background: var(--ink); overflow-x: auto; }
.setup-tab {
  flex: 1 0 auto;
  min-height: 2.5rem;
  padding: 0.375rem 0.875rem;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 120ms var(--ease), color 120ms var(--ease);
}
.setup-tab:hover { color: var(--text); background: var(--surface-2); }
.setup-tab[aria-selected="true"] { background: var(--surface-hover); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.setup-panel { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
.setup-panel > .field { min-width: 0; }

.lp { display: grid; justify-items: center; gap: 0.5rem; margin: 0; padding: 1rem 0.5rem 0.25rem; border-radius: 12px; background: var(--ink); }
.lp-phone {
  position: relative;
  width: 12.5rem;
  max-height: 22rem;
  border-radius: 16px;
  padding: 5px;
  background: #050505;
  box-shadow: 0 0 0 1px #2c2822, 0 16px 40px rgba(0, 0, 0, 0.5);
  transition: aspect-ratio 200ms var(--ease);
}
.lp-phone[data-wide="true"] { width: 100%; max-width: 17rem; }
.lp-screen { position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: 12px; background: #000; container-type: inline-size; }
.lp-screen img { position: absolute; inset: 0; width: 100%; height: 100%; }
.lp-cover { object-fit: cover; }
.lp-contain { object-fit: contain; }
.lp-blur { object-fit: cover; filter: blur(10px) brightness(0.75); transform: scale(1.15); }
.lp-dim { background: #000; }
.lp-zoom { transform: scale(1.6); }
.lp-tiles { position: absolute; inset: 0; display: grid; gap: 2px; background: #000; }
.lp-tiles img { position: relative; inset: auto; height: 100%; min-height: 0; overflow: hidden; }
.lp-tiles > * { min-height: 0; overflow: hidden; }
.lp-rows-2 { grid-template-rows: 1fr 1fr; }
.lp-rows-3 { grid-template-rows: 1fr 1fr 1fr; }
.lp-grid-4 { grid-template: 1fr 1fr / 1fr 1fr; }
.lp-stack { grid-template-columns: 1fr; }
.lp-hook { position: absolute; left: 7%; right: 7%; top: 8%; z-index: 2; }
.lp-hook .hl-sample { position: static; }
.lp-hook .hl-card b { font-size: 0.6875rem; }
.lp-cap { position: absolute; left: 4%; right: 4%; z-index: 2; text-align: center; line-height: 1.15; }
.lp-bar { position: absolute; left: 0; bottom: 0; z-index: 2; width: 38%; height: 3px; background: var(--accent); }
.lp-mark { position: absolute; top: 3%; right: 4%; z-index: 2; color: #fff; font-size: 0.5625rem; font-weight: 700; opacity: 0.75; text-shadow: 0 0 2px #000; }
.lp-note { text-align: center; font-size: 0.75rem; }

/* ---------- plans ---------- */
.plan[data-recommended="true"] { border-color: rgba(var(--accent-rgb), 0.55); background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.07), transparent 55%), var(--surface); }
.plan-flag { justify-self: start; padding: 0.125rem 0.5rem; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 0.75rem; font-weight: 650; }

/* bigger touch targets on phones */
@media (pointer: coarse) {
  .btn-sm { min-height: 2.75rem; }
  .seg span { padding: 0.65rem 1rem; }
}

/* hero: the form on the left, three fanned phones on the right */
.hero { max-width: none; grid-template-columns: minmax(0, 1fr); }
.hero > :not(.hero-show) { grid-column: 1; max-width: 46rem; }
.hero-show { display: none; }
@media (min-width: 70rem) {
  .hero { grid-template-columns: minmax(0, 1fr) 20rem; column-gap: 3rem; align-items: start; }
  .hero-show { display: block; position: relative; grid-column: 2; grid-row: 1 / span 7; height: 24rem; }
}
.hero-phone {
  position: absolute;
  top: calc(1.5rem + var(--i) * -0.75rem);
  left: calc(var(--i) * 5.25rem);
  width: 9.5rem;
  aspect-ratio: 9 / 16;
  padding: 4px;
  border-radius: 16px;
  background: #050505;
  box-shadow: 0 0 0 1px #2c2822, 0 18px 40px rgba(0, 0, 0, 0.55);
  transform: rotate(calc((var(--i) - 1) * 5deg));
  overflow: hidden;
}
.hero-phone:nth-child(2) { z-index: 2; top: 0.25rem; box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.6), 0 22px 50px rgba(0, 0, 0, 0.6); }
.hero-phone img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }
.bp-gallery { grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); }
.bp-gallery .bp-pick-card { grid-template-columns: 4.25rem 1fr; }
.bp-gallery .bp-pick-none .bp-pick-card { min-height: 0; padding: 1rem; }
.bp-pick-none input:checked + .bp-pick-card { box-shadow: none; border-color: var(--border-input); background: transparent; }
.hero > .reel { max-width: 22rem; width: 100%; }

/* ---------- range bar: which part of the video to use ---------- */
.rb { display: grid; gap: 0.25rem; }
.rb > .btn { justify-self: start; }
.rb-track { position: relative; height: 3rem; }
.rb-rail {
  position: absolute;
  inset: 0.625rem 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background:
    repeating-linear-gradient(90deg, transparent 0 calc(5% - 1px), rgba(245, 240, 230, 0.07) calc(5% - 1px) 5%),
    var(--ink);
}
.rb-fill {
  position: absolute;
  top: 0.625rem;
  bottom: 0.625rem;
  border-radius: 6px;
  background: rgba(var(--accent-rgb), 0.28);
  border: 2px solid var(--accent);
  box-shadow: 0 0 14px rgba(var(--accent-rgb), 0.3);
  pointer-events: none;
}
.rb-handle {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  background: none;
  pointer-events: none;  /* only the handles take the pointer, so both sliders can sit on one track */
  -webkit-appearance: none;
  appearance: none;
}
.rb-handle::-webkit-slider-runnable-track { background: none; border: 0; height: 100%; }
.rb-handle::-moz-range-track { background: none; border: 0; }
.rb-handle::-webkit-slider-thumb {
  -webkit-appearance: none;
  pointer-events: auto;
  width: 1rem;
  height: 3rem;
  border-radius: 6px;
  background: var(--accent);
  border: 2px solid var(--on-accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  cursor: ew-resize;
}
.rb-handle::-moz-range-thumb {
  pointer-events: auto;
  width: 1rem;
  height: 3rem;
  border-radius: 6px;
  background: var(--accent);
  border: 2px solid var(--on-accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  cursor: ew-resize;
}
.rb-handle:focus-visible { outline: none; }
.rb-handle:focus-visible::-webkit-slider-thumb { outline: 3px solid var(--link-hover); outline-offset: 2px; }
.rb-handle:focus-visible::-moz-range-thumb { outline: 3px solid var(--link-hover); outline-offset: 2px; }
.rb-ticks { position: relative; height: 1.1rem; margin: 0 0.5rem; }
.rb-tick { position: absolute; transform: translateX(-50%); font-size: 0.6875rem; color: var(--text-muted); white-space: nowrap; }
.rb-tick:first-child { transform: none; }
.rb-tick:last-child { transform: translateX(-100%); }
.rb-times .field { gap: 0.25rem; }
.inapp-note { display: grid; gap: 0.5rem; border-color: rgba(var(--accent-rgb), 0.45); background: rgba(var(--accent-rgb), 0.08); }
.inapp-note p { font-size: 0.875rem; color: var(--text-muted); }

/* film strip in the range bar: frames along the video, everything outside the chosen part dimmed */
.rb-track { height: 4rem; }
.rb-rail { inset: 0.375rem 0; overflow: hidden; }
.rb-film { position: absolute; inset: 0; display: flex; gap: 1px; }
.rb-frame { flex: 1 1 0; min-width: 0; background-color: #1a1714; background-repeat: no-repeat; background-size: cover; background-position: center; }
@media (prefers-reduced-motion: no-preference) {
  .rb-frame-in { animation: frame-in 240ms var(--ease) both; }
  @keyframes frame-in { from { opacity: 0; } }
}
.rb-fill { top: 0; bottom: 0; box-shadow: 0 0 0 100vmax rgba(10, 9, 8, 0.62); background: rgba(var(--accent-rgb), 0.08); }
.rb-handle::-webkit-slider-thumb { height: 4rem; }
.rb-handle::-moz-range-thumb { height: 4rem; }
.rb { container-type: inline-size; }
@container (max-width: 24rem) { .rb-tick:nth-child(2), .rb-tick:nth-child(4) { display: none; } }
@container (max-width: 14rem) { .rb-tick:nth-child(3) { display: none; } }

/* ---------- auto-clip ---------- */
.ch-form { max-width: 46rem; }
.check-row { display: flex; gap: 0.5rem; align-items: center; font-size: 0.9375rem; cursor: pointer; }
.check-row input { width: 1.125rem; height: 1.125rem; }
.ch-list { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 24rem), 1fr)); }
.ch-card { display: grid; gap: 0.875rem; align-content: start; }
.ch-card[data-off="true"] { opacity: 0.65; }
.ch-card .toolbar { align-items: start; flex-wrap: nowrap; }
.ch-card h3 { font-size: 1.0625rem; }
.ch-note { font-size: 0.875rem; padding: 0.5rem 0.75rem; }
.ch-recent { display: grid; gap: 0.375rem; border-top: 1px solid var(--border); padding-top: 0.75rem; }
.ch-recent li { display: flex; justify-content: space-between; gap: 0.75rem; font-size: 0.875rem; }
.ch-recent a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-actions { display: flex; gap: 0.25rem; flex-wrap: wrap; justify-content: end; }

/* Links inside grey hint text: an underline, not only a colour, sets them apart. */
.hint a, .lede a { text-decoration: underline; text-underline-offset: 2px; }

/* ---------- posting ---------- */
dialog.dialog-wide { width: min(54rem, calc(100% - 2rem)); max-height: calc(100dvh - 2rem); }
.post-layout { display: grid; grid-template-columns: minmax(10rem, 15rem) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.post-preview { position: sticky; top: 0; display: grid; gap: 0.375rem; }
.post-video { width: 100%; max-height: 62dvh; object-fit: contain; border-radius: var(--r-md); background: var(--ink); }
.post-form { gap: 1rem; min-width: 0; }
.post-counts { margin-top: 0.25rem; font-variant-numeric: tabular-nums; }
.acct-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.acct-chip { position: relative; display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.375rem 0.75rem 0.375rem 0.375rem; border: 1px solid var(--border-input); border-radius: 999px; background: transparent; color: var(--text-muted); cursor: pointer; }
.acct-chip:not(:has(input:checked)) .avatar { filter: grayscale(1); }
.acct-chip .avatar { width: 1.75rem; height: 1.75rem; font-size: 0.8125rem; }
.acct-chip-text { display: grid; line-height: 1.2; }
.acct-chip-text strong { font-size: 0.875rem; font-weight: 600; }
.acct-chip-text span { font-size: 0.75rem; color: var(--text-muted); }
.acct-chip:has(input:checked) { color: var(--text); border-color: var(--accent); background: rgba(var(--accent-rgb), 0.12); }
.acct-chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.post-sections { gap: 0.625rem; }
.post-sec { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); padding: 0.75rem 1rem; }
.post-sec > summary { display: flex; justify-content: space-between; gap: 1rem; cursor: pointer; font-weight: 600; font-size: 0.9375rem; }
.post-sec[open] > summary { margin-bottom: 0.75rem; }
.post-sec-value { color: var(--text-muted); font-weight: 400; }
.post-sec-open { display: grid; gap: 0.75rem; }
.post-sec-open > legend { padding: 0 0.25rem; font-weight: 600; font-size: 0.9375rem; }
.post-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.post-result { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.75rem; align-items: center; padding: 0.75rem; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); }
.post-state { margin: 0; color: var(--text-muted); overflow-wrap: anywhere; }
.post-state.good { color: var(--success); }
.post-state.bad { color: var(--danger); }
@media (max-width: 40rem) {
  .post-layout { grid-template-columns: minmax(0, 1fr); }
  .post-preview { position: static; justify-self: center; width: min(11rem, 60%); }
}
