/* ClipBot Studio. One accent, used for the one thing to do next. */
:root {
  --bg: #0c0c0e;
  --surface: #151518;
  --surface-2: #1c1c20;
  --surface-3: #25252a;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f5f5f7;
  --muted: #a1a1a8;
  --faint: #6e6e76;
  --accent: #ff5b3a;
  --accent-hover: #ff7152;
  --accent-soft: rgba(255, 91, 58, 0.12);
  --accent-line: rgba(255, 91, 58, 0.55);
  --ok: #34c759;
  --warn: #ffb020;
  --err: #ff453a;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', 'Segoe UI', Roboto, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: rgba(255, 91, 58, 0.35); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }

/* ── top bar ───────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20; height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; background: rgba(12, 12, 14, 0.82); backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--accent); color: #fff; }
.brand-mark svg { width: 18px; height: 18px; }
.brand-text { font: 650 16px/1 var(--display); letter-spacing: -0.01em; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav a { padding: 8px 14px; border-radius: 999px; color: var(--muted); font-size: 14px; font-weight: 500; transition: color .15s, background .15s; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.on { color: var(--text); background: var(--surface-2); }
.nav .nav-create { color: var(--text); border: 1px solid var(--line-strong); }

.service-status { max-width: 1120px; margin: 16px auto 0; padding: 12px 16px; border-radius: var(--radius-sm); background: rgba(255, 176, 32, 0.1); color: #ffd58a; font-size: 14px; display: flex; gap: 10px; align-items: center; }

.view { outline: none; }
.page { max-width: 1120px; margin: 0 auto; padding: 40px 28px 140px; }
.page-narrow { max-width: 760px; }

/* ── buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface-2); color: var(--text); font-weight: 600; font-size: 14.5px; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .08s, opacity .15s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); border-color: transparent; color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-lg { height: 52px; padding: 0 26px; font-size: 16px; }
.btn-quiet { background: transparent; border-color: transparent; color: var(--muted); }
.btn-quiet:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { height: 34px; padding: 0 13px; font-size: 13.5px; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.link { color: var(--muted); font-size: 14px; background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.link:hover { color: var(--text); }

/* ── home / step 1 ─────────────────────────────────────── */
.hero { text-align: center; padding: 56px 0 28px; }
.hero h1 { font: 700 clamp(34px, 5vw, 52px)/1.06 var(--display); letter-spacing: -0.035em; margin: 0 0 14px; }
.hero p { color: var(--muted); font-size: 17px; margin: 0 auto; max-width: 520px; }

.url-card { max-width: 680px; margin: 0 auto; }
.url-bar {
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 18px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px;
  transition: border-color .15s, box-shadow .15s;
}
.url-bar:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-soft); }
.url-bar .i { color: var(--faint); }
.url-bar input { flex: 1; min-width: 0; height: 44px; border: 0; background: transparent; outline: none; font-size: 16px; }
.url-bar input::placeholder { color: var(--faint); }

.video-card {
  margin-top: 18px; display: grid; grid-template-columns: 208px 1fr; gap: 18px; align-items: center;
  padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
  animation: rise .25s ease-out;
}
.video-thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 11px; background: var(--surface-3) center/cover no-repeat; overflow: hidden; }
.video-thumb .duration { position: absolute; right: 7px; bottom: 7px; padding: 2px 7px; border-radius: 6px; background: rgba(0, 0, 0, 0.75); font: 600 12px/1.5 var(--font); font-variant-numeric: tabular-nums; }
.video-title { font: 650 17px/1.3 var(--display); letter-spacing: -0.01em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.video-meta { color: var(--muted); font-size: 14px; margin-top: 4px; }
.video-card .placeholder-line { height: 12px; border-radius: 6px; background: var(--surface-3); margin: 8px 0; animation: pulse 1.4s ease-in-out infinite; }
.inline-error { margin-top: 14px; color: #ff8a80; font-size: 14px; display: flex; gap: 8px; align-items: center; justify-content: center; }

.start-row { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 22px; }
.options-toggle { font-size: 13.5px; }
.length-row { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 4px; }
.length-row .label { color: var(--faint); font-size: 13px; }
.wishes textarea {
  width: 100%; box-sizing: border-box; min-height: 78px; padding: 11px 13px; border-radius: 12px; resize: vertical;
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); font: inherit; font-size: 14.5px; line-height: 1.45;
}
.wishes textarea:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-soft); }
.wish-feedback { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.wish-feedback:empty { display: none; }
.wish-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.wish-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px 4px 7px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.wish-chip svg { width: 13px; height: 13px; }
.wish-chip.ok { background: rgba(61, 245, 107, 0.12); color: #9bf5b3; }
.wish-chip.noop { background: var(--surface-3); color: var(--muted); }
.wish-unclear { display: flex; align-items: flex-start; gap: 6px; font-size: 12.5px; color: #ffcf8a; }
.wish-unclear svg { width: 14px; height: 14px; flex: none; margin-top: 1px; }
.wish-hint { margin: 8px 0 0; font-size: 12px; color: var(--faint); }
.lang-field { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); }
.lang-field select, .lang-change select {
  height: 34px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); font-size: 13.5px;
}
.lang-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: -6px 0 18px; font-size: 13.5px; color: var(--muted); }
.lang-line strong { color: var(--text); }
.lang-change { display: inline-flex; align-items: center; gap: 8px; color: var(--faint); }

.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 72px auto 0; max-width: 860px; }
.how-step { padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.how-step .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); font: 650 13px/1 var(--font); margin-bottom: 12px; }
.how-step strong { display: block; font-size: 15px; margin-bottom: 4px; }
.how-step span { color: var(--muted); font-size: 14px; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 64px 0 16px; }
.section-head h2 { font: 650 20px/1.2 var(--display); letter-spacing: -0.02em; margin: 0; }

/* ── projects ──────────────────────────────────────────── */
.page-title { font: 700 32px/1.1 var(--display); letter-spacing: -0.03em; margin: 0 0 24px; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.project-card { display: block; border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--line); transition: border-color .15s, transform .15s; }
.project-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.project-card .thumb { aspect-ratio: 16 / 9; background: var(--surface-3) center/cover no-repeat; }
.project-card .body { padding: 12px 14px 14px; }
.project-card .title { font-weight: 600; font-size: 14.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 39px; }
.project-card .meta { margin-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--faint); font-size: 12.5px; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--muted); }
.status.busy { color: var(--text); }
.status.ready { background: var(--accent-soft); color: #ffb3a3; }
.status.done { background: rgba(52, 199, 89, 0.12); color: #8ee6a4; }
.status.bad { background: rgba(255, 69, 58, 0.12); color: #ff8a80; }
.empty { padding: 56px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.empty .btn { margin-top: 16px; }

/* ── project shell + stepper ───────────────────────────── */
.project-head { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.project-head .thumb { width: 88px; aspect-ratio: 16 / 9; border-radius: 9px; background: var(--surface-3) center/cover no-repeat; flex: none; }
.project-head .title { font: 650 18px/1.3 var(--display); letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-head .meta { color: var(--muted); font-size: 13.5px; }
.project-head > div { min-width: 0; flex: 1; }

.stepper { display: flex; gap: 6px; margin: 0 0 34px; padding: 5px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); width: fit-content; }
.stepper .step { display: flex; align-items: center; gap: 8px; padding: 8px 16px 8px 10px; border-radius: 999px; color: var(--faint); font-size: 14px; font-weight: 600; }
.stepper .step .n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: var(--surface-3); color: var(--muted); }
.stepper .step.done { color: var(--muted); }
.stepper .step.done .n { background: rgba(255, 255, 255, 0.12); color: var(--text); }
.stepper .step.on { color: var(--text); background: var(--surface-3); }
.stepper .step.on .n { background: var(--accent); color: #fff; }
.stepper a.step:hover { color: var(--text); }
.stepper .step[aria-disabled="true"] { cursor: default; }

.step-title { font: 700 30px/1.12 var(--display); letter-spacing: -0.03em; margin: 0 0 6px; }
.step-sub { color: var(--muted); margin: 0 0 26px; font-size: 16px; }

/* ── progress (stages, no fake percentages) ────────────── */
.progress { max-width: 520px; margin: 18px 0 8px; padding: 22px 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.stages { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.stages li { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 15px; }
.stages .mark { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line-strong); flex: none; }
.stages .mark .i { width: 13px; height: 13px; stroke-width: 2.6; }
.stages li.done { color: var(--muted); }
.stages li.done .mark { background: var(--ok); border-color: var(--ok); color: #0c0c0e; }
.stages li.active { color: var(--text); font-weight: 600; }
.stages li.active .mark { border-color: var(--accent); }
.stages li.active .mark::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: beat 1.2s ease-in-out infinite; }
.stages .count { margin-left: auto; color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.progress-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--faint); font-size: 13px; font-variant-numeric: tabular-nums; }

.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-sm); margin: 14px 0; background: var(--surface); border: 1px solid var(--line); font-size: 14.5px; max-width: 720px; }
.notice small { display: block; color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.notice.warn { border-color: rgba(255, 176, 32, 0.35); background: rgba(255, 176, 32, 0.07); }
.notice.warn .i { color: var(--warn); }
.notice.error { border-color: rgba(255, 69, 58, 0.35); background: rgba(255, 69, 58, 0.07); }
.notice.error .i { color: var(--err); }
.notice .actions { margin-top: 10px; display: flex; gap: 8px; }

/* ── moments ───────────────────────────────────────────── */
.moments-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.player { position: sticky; top: 84px; }
.player-frame { aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000 center/cover no-repeat; border: 1px solid var(--line); position: relative; }
.player-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.player-frame .play-cover { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, 0.35); border: 0; color: #fff; }
.player-frame .play-cover span { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.16); backdrop-filter: blur(10px); }
.player-frame .play-cover .i { width: 26px; height: 26px; fill: currentColor; stroke: none; }
.player-info { margin-top: 14px; }
.player-info .quote { font: 600 17px/1.4 var(--display); letter-spacing: -0.01em; }
.player-info .time { color: var(--muted); font-size: 14px; margin-top: 6px; font-variant-numeric: tabular-nums; }

.trim { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); }
.trim .edge { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.trim .edge strong { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; min-width: 58px; text-align: center; }
.nudge { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface-2); display: grid; place-items: center; font-weight: 700; }
.nudge:hover { background: var(--surface-3); }
.trim .reset { margin-left: auto; }

.moments-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.count-picker { display: flex; align-items: center; gap: 10px; }
.count-picker .label { color: var(--muted); font-size: 14px; }
.segmented { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); gap: 2px; }
.segmented button { height: 32px; min-width: 40px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-weight: 600; font-size: 14px; }
.segmented button:hover { color: var(--text); }
.segmented button.on { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
.segmented input { width: 54px; height: 32px; border: 0; background: transparent; text-align: center; font-weight: 600; outline: none; }
.selected-count { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.selected-count strong { color: var(--text); }

.moment-list { display: flex; flex-direction: column; gap: 10px; }
.moment {
  display: grid; grid-template-columns: 34px 1fr auto; gap: 14px; align-items: start;
  padding: 14px 14px 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.moment:hover { border-color: var(--line-strong); }
.moment.focus { border-color: var(--line-strong); background: var(--surface-2); }
.moment.selected { border-color: var(--accent-line); }
.moment .num { font: 650 15px/1.6 var(--display); color: var(--faint); font-variant-numeric: tabular-nums; }
.moment.selected .num { color: var(--accent); }
.moment .quote { font-weight: 600; font-size: 15px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.moment .time { color: var(--muted); font-size: 13px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.moment .time .edited { color: #ffb3a3; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.tag { padding: 2px 9px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: 12px; font-weight: 500; }
.check { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; background: transparent; color: transparent; margin-top: 2px; }
.check .i { width: 15px; height: 15px; stroke-width: 2.6; }
.moment.selected .check { background: var(--accent); border-color: var(--accent); color: #fff; }
.moment.pending { cursor: default; opacity: 0.7; }
.moment.pending .check { visibility: hidden; }

/* ── style ─────────────────────────────────────────────── */
.style-groups { display: flex; flex-direction: column; gap: 30px; max-width: 860px; }
.group h3 { font: 650 13px/1 var(--font); letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); margin: 0 0 12px; }
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.choice {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left;
  padding: 14px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line);
  transition: border-color .15s, background .15s;
}
.choice:hover { border-color: var(--line-strong); }
.choice.on { border-color: var(--accent-line); background: var(--accent-soft); }
.choice strong { font-size: 14.5px; }
.choice span { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.choice .sample { height: 44px; width: 100%; border-radius: 8px; background: #2b2b31 linear-gradient(160deg, #34343b, #202025); display: grid; place-items: center; margin-bottom: 4px; overflow: hidden; }
.choice .shape { border: 2px solid currentColor; border-radius: 4px; color: var(--muted); }
.choice.on .shape { color: var(--accent); }
.choice .ratio-box { height: 44px; display: grid; place-items: center; margin-bottom: 4px; }
.s-clean { font: 600 13px/1 var(--font); color: #fff; }
.s-bold { font: 900 14px/1 var(--display); color: #fff; text-transform: uppercase; -webkit-text-stroke: 0.6px #000; text-shadow: 0 2px 0 #000; }
.s-bold em { font-style: normal; color: #ffd60a; }
.s-karaoke { font: 800 13px/1 var(--display); color: rgba(255, 255, 255, 0.55); }
.s-karaoke b { color: #fff; }
.s-karaoke em { font-style: normal; color: var(--accent); }
.s-minimal { font: 500 12px/1 var(--font); color: #e8e8ea; letter-spacing: 0.02em; }
.s-off { font: 500 12px/1 var(--font); color: var(--faint); text-decoration: line-through; }

details.advanced { max-width: 860px; margin-top: 34px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
details.advanced summary { list-style: none; cursor: pointer; padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; font-weight: 600; }
details.advanced summary::-webkit-details-marker { display: none; }
details.advanced summary span { color: var(--faint); font-weight: 500; font-size: 13.5px; margin-left: 10px; }
details.advanced summary .i { transition: transform .2s; color: var(--muted); }
details.advanced[open] summary .i { transform: rotate(180deg); }
.advanced-body { padding: 4px 18px 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--muted); }
.field-wide { grid-column: 1 / -1; }
.field select, .field textarea, .field input[type="text"] {
  height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); font-size: 14px;
}
.field textarea { height: 76px; padding: 10px 12px; resize: vertical; }
.switch-row { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text); cursor: pointer; align-self: end; height: 40px; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch { width: 38px; height: 22px; border-radius: 999px; background: var(--surface-3); position: relative; transition: background .15s; flex: none; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch-row input:checked + .switch { background: var(--accent); }
.switch-row input:checked + .switch::after { transform: translateX(16px); }

/* ── sticky action bar: one primary action per step ─────── */
.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  background: rgba(12, 12, 14, 0.86); backdrop-filter: saturate(180%) blur(18px); border-top: 1px solid var(--line);
}
.actionbar-inner { max-width: 1120px; margin: 0 auto; padding: 14px 28px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.actionbar .summary { color: var(--muted); font-size: 14px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actionbar .summary strong { color: var(--text); }
.actionbar .right { display: flex; align-items: center; gap: 10px; }
.dot-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }

/* ── results ───────────────────────────────────────────── */
.results-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.results-head .secondary { display: flex; gap: 6px; }
.clip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px; }
.clip-card { display: flex; flex-direction: column; gap: 12px; }
.clip-media { position: relative; border-radius: var(--radius); overflow: hidden; background: #000; border: 1px solid var(--line); aspect-ratio: 9 / 16; }
.clip-media[data-aspect="4:5"] { aspect-ratio: 4 / 5; }
.clip-media[data-aspect="1:1"] { aspect-ratio: 1 / 1; }
.clip-media[data-aspect="16:9"] { aspect-ratio: 16 / 9; }
.clip-media video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.clip-media .busy { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 10px; background: rgba(0, 0, 0, 0.62); font-size: 14px; }
.clip-card .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.clip-card .name { font-weight: 600; }
.clip-card .meta { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.clip-card .hook { color: var(--muted); font-size: 13.5px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clip-card .actions { display: flex; gap: 6px; }
.clip-card.skeleton .clip-media { background: var(--surface); animation: pulse 1.4s ease-in-out infinite; display: grid; place-items: center; color: var(--faint); font-size: 13px; }

/* ── debug (only with ?debug=1) ─────────────────────────── */
.debug { margin-top: 48px; border-radius: var(--radius-sm); border: 1px dashed var(--line-strong); padding: 14px 16px; font: 12px/1.55 var(--mono); color: var(--muted); max-height: 360px; overflow: auto; }
.debug h4 { font: 600 12px/1 var(--mono); color: var(--text); margin: 4px 0 10px; }
.debug table { border-collapse: collapse; margin-bottom: 12px; }
.debug td { padding: 1px 16px 1px 0; }
.debug .warn { color: var(--warn); }

/* ── dialog, toasts, misc ───────────────────────────────── */
.dialog { border: 1px solid var(--line-strong); border-radius: 20px; background: var(--surface); color: var(--text); padding: 0; width: min(440px, calc(100vw - 32px)); box-shadow: var(--shadow); }
.dialog::backdrop { background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px); }
.dialog form { padding: 20px 22px 18px; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; }
.dialog-head h2 { font: 650 18px/1.2 var(--display); margin: 0; }
.dialog-note { color: var(--muted); font-size: 14px; margin: 8px 0 18px; }
.trim-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }

.toasts { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 50; align-items: center; }
.toast { display: flex; gap: 10px; align-items: center; padding: 11px 16px; border-radius: 999px; background: #f5f5f7; color: #111; font-size: 14px; font-weight: 500; box-shadow: var(--shadow); animation: rise .2s ease-out; max-width: calc(100vw - 32px); }
.toast small { display: block; font-weight: 400; color: #555; }
.toast.error .i { color: var(--err); }
.toast.ok .i { color: #1f9d45; }

.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.2); border-top-color: currentColor; animation: spin .8s linear infinite; display: inline-block; flex: none; }
.loading { display: flex; gap: 10px; align-items: center; color: var(--muted); padding: 40px 0; }
.muted { color: var(--muted); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: 0.55; } }
@keyframes beat { 50% { transform: scale(0.6); opacity: 0.6; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

@media (max-width: 900px) {
  .moments-layout { grid-template-columns: 1fr; }
  .player { position: static; }
  .how { grid-template-columns: 1fr; }
  .advanced-body { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .page { padding: 24px 16px 150px; }
  .topbar { padding: 0 16px; }
  .video-card { grid-template-columns: 1fr; }
  .stepper .step .label { display: none; }
  .stepper .step { padding: 8px; }
  .actionbar-inner { padding: 12px 16px; flex-direction: column; align-items: stretch; }
  .actionbar .right .btn-lg { width: 100%; }
}

/* ── button system ─────────────────────────────────────────
   primary   = the one thing to do next on this screen (one per screen)
   secondary = useful, not the main path (preview, other moments, change style)
   tertiary  = back, cancel, reset (.btn-quiet)
   icon      = compact controls (.icon-btn, .nudge)                        */
.btn { will-change: transform; }
.btn-primary { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 6px 18px rgba(255, 91, 58, 0.28); }
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 10px 26px rgba(255, 91, 58, 0.36); }
.btn-primary:active:not(:disabled) { transform: translateY(0) scale(0.98); box-shadow: 0 3px 10px rgba(255, 91, 58, 0.25); }
.btn-secondary { background: var(--surface-2); border-color: var(--line-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-3); transform: translateY(-1px); }
.btn.is-loading { cursor: progress; }
.btn.is-loading .spinner { width: 15px; height: 15px; }
.btn.is-done { color: #8ee6a4; border-color: rgba(52, 199, 89, 0.35); }
.btn.is-done .i { color: #8ee6a4; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .btn:hover, .btn:active { transform: none !important; }
}

/* ── style step: options + live preview ───────────────── */
.style-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 36px; align-items: start; }
.style-layout .style-groups { max-width: none; }
.choices { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
.choice { padding: 12px; gap: 5px; transition: border-color .15s, background .15s, transform .15s; }
.choice:hover { transform: translateY(-1px); }
.choice:active { transform: scale(0.98); }
.choice.on { box-shadow: 0 0 0 1px var(--accent-line) inset; }
.choice span:not(.mock):not(.mock *) { font-size: 12px; }

.preview-pane { position: sticky; top: 84px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.phone-lg {
  position: relative; width: 100%; max-width: 300px; aspect-ratio: 9 / 16; border-radius: 26px; overflow: hidden;
  background: #000; border: 6px solid #1f1f24; box-shadow: var(--shadow), 0 0 0 1px var(--line-strong);
}
.phone-lg[data-aspect="4:5"] { aspect-ratio: 4 / 5; border-radius: 18px; }
.phone-lg[data-aspect="1:1"] { aspect-ratio: 1 / 1; border-radius: 18px; }
.phone-lg[data-aspect="16:9"] { aspect-ratio: 16 / 9; border-radius: 14px; }
.phone-lg video { width: 100%; height: 100%; object-fit: cover; display: block; }
.phone-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--faint); font-size: 13px; }
.phone-busy { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 10px; background: rgba(0, 0, 0, 0.55); font-size: 13.5px; }
.phone-stale { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); padding: 4px 10px; border-radius: 999px; background: rgba(255, 176, 32, 0.92); color: #1a1200; font-size: 12px; font-weight: 700; white-space: nowrap; }
/* Caption editor: drag the box to move it, pull the corner to resize. */
.cap-layer { position: absolute; inset: 0; pointer-events: none; }
.cap-box {
  position: absolute; transform: translate(-50%, -50%); pointer-events: auto; cursor: grab; touch-action: none; user-select: none;
  width: max-content; box-sizing: border-box; padding: 0.04em 0.12em;
  border: 1.5px dashed rgba(255, 255, 255, 0.55); border-radius: 6px;
  font-weight: normal; line-height: 1.2; text-align: center; white-space: normal; overflow-wrap: normal;
}
/* The text is drawn exactly like the burned-in caption (font, colours, outline and shadow are set inline). */
.cap-text { display: block; paint-order: stroke fill; }
.cap-box.boxed .cap-text { background: rgba(0, 0, 0, 0.72); padding: 0 0.2em; }
.cap-box:hover, .cap-box:focus-visible, .cap-box.active { border-color: var(--accent); background: rgba(255, 91, 58, 0.1); outline: none; }
.cap-box.active { cursor: grabbing; }
.cap-box.ghost .cap-text { visibility: hidden; }
.cap-box.ghost:hover .cap-text, .cap-box.ghost:focus-visible .cap-text, .cap-box.ghost.active .cap-text { visibility: visible; }
.cap-handle {
  position: absolute; right: -7px; bottom: -7px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); border: 2px solid #fff; cursor: nwse-resize; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}
.cap-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px; max-width: 300px; font-size: 12.5px; color: var(--muted); text-align: center; }
.cap-tools:empty { display: none; }
.cap-size { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; }
.preview-caption { color: var(--faint); font-size: 12.5px; text-align: center; max-width: 300px; line-height: 1.4; }

/* ── option pictures ──────────────────────────────────────
   Tiny phones that show what an option does, drawn in CSS.              */
.mock { position: relative; display: block; width: 46px; height: 80px; border-radius: 8px; background: #26262c; overflow: hidden; margin-bottom: 6px; border: 1px solid rgba(255, 255, 255, 0.08); }
.choice.on .mock { border-color: var(--accent-line); }
.mock::before, .mock::after { content: ''; position: absolute; }
/* a person: head + shoulders */
.mock-layout-full::before { left: 50%; top: 22%; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: #d9a27c; }
.mock-layout-full::after { left: 50%; top: 46%; width: 34px; height: 30px; margin-left: -17px; border-radius: 16px 16px 4px 4px; background: #5b7cfa; }
.mock-layout-two { background: linear-gradient(#26262c 49%, #0c0c0e 49%, #0c0c0e 51%, #26262c 51%); }
.mock-layout-two::before { left: 50%; top: 10%; width: 13px; height: 13px; margin-left: -6px; border-radius: 50%; background: #d9a27c; box-shadow: 0 40px 0 #c98f6a; }
.mock-layout-two::after { left: 50%; top: 29%; width: 26px; height: 12px; margin-left: -13px; border-radius: 10px 10px 2px 2px; background: #5b7cfa; box-shadow: 0 40px 0 #34c759; }
.mock-layout-center { background: linear-gradient(160deg, #5a4a6b, #2b3a55); filter: saturate(0.9); }
.mock-layout-center::before { left: 0; right: 0; top: 36%; height: 28%; background: linear-gradient(90deg, #8e6a55, #5b7cfa); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6); }
.mock-layout-title { background: linear-gradient(160deg, #3b3b44, #25252b); }
.mock-layout-title::before { left: 12%; right: 12%; top: 10%; height: 16%; border-radius: 5px; background: #fff; }
.mock-layout-title::after { left: 0; right: 0; top: 38%; height: 28%; background: linear-gradient(90deg, #8e6a55, #5b7cfa); }
.mock-layout-screen { background: #000; }
.mock-layout-screen::before { left: 0; right: 0; top: 36%; height: 28%; background: repeating-linear-gradient(#e8e8ea 0 3px, #9aa0ad 3px 6px); }
.mock-layout-auto::before, .mock-title-auto::before { inset: 0; margin: auto; width: 20px; height: 20px; background: var(--accent); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
.mock-title-opening::before, .mock-title-persistent::before { left: 12%; right: 12%; top: 10%; height: 15%; border-radius: 5px; background: #fff; }
.mock-title-opening::after { content: '3s'; left: 50%; top: 32%; transform: translateX(-50%); font: 700 9px/1 var(--font); color: var(--warn); }
.mock-title-persistent::after { left: 44%; right: 44%; top: 30%; bottom: 8%; background: repeating-linear-gradient(transparent 0 4px, rgba(255, 255, 255, 0.35) 4px 6px); }
.mock-title-none::before { left: 12%; right: 12%; top: 10%; height: 15%; border-radius: 3px; border: 1px dashed rgba(255, 255, 255, 0.3); }
.mock-caption { width: 100%; height: 54px; display: grid; place-items: center; background: linear-gradient(160deg, #3a3a42, #1f1f25); border-radius: 8px; }
.mock-caption .s-bold { font: 900 13px/1 var(--display); letter-spacing: 0.01em; -webkit-text-stroke: 0.8px #000; text-shadow: 0 2px 0 #000; }
.mock-caption .s-bold em { color: #ffd60a; }
.mock-caption .s-karaoke { font: 900 13px/1 var(--display); -webkit-text-stroke: 0.8px #000; color: #fff; }
.mock-caption .s-karaoke b { color: #3df56b; }
.mock-caption .s-clean { font: 800 13px/1 var(--display); color: #fff; -webkit-text-stroke: 0.5px #000; text-shadow: 0 2px 3px rgba(0, 0, 0, 0.6); }
.mock-caption .s-clean em { font-style: normal; color: #ffd60a; }
.mock-energy { width: 46px; height: 40px; background: transparent; border: 0; display: flex; align-items: flex-end; gap: 4px; margin-bottom: 4px; }
.mock-energy i { flex: 1; border-radius: 2px; background: var(--muted); }
.choice.on .mock-energy i { background: var(--accent); }
.mock-aspect { width: auto; height: 40px; background: transparent; border: 0; display: grid; place-items: center; }

@media (max-width: 1000px) {
  .style-layout { grid-template-columns: 1fr; }
  .preview-pane { position: static; order: -1; }
  .phone-lg { max-width: 240px; }
}

/* ── clip wish (what kind of moments) ─────────────────── */
.wish { margin-top: 22px; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-align: left; }
.wish h2 { margin: 0 0 12px; font: 650 16px/1.3 var(--display); letter-spacing: -0.01em; }
.intent-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: 13.5px; }
.chip .i { width: 14px; height: 14px; display: none; }
.chip:hover { color: var(--text); }
.chip.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--text); }
.chip.on .i { display: inline; }
.intent-query { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; font-size: 13.5px; color: var(--muted); }
.intent-query textarea { width: 100%; resize: vertical; min-height: 54px; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); font: inherit; font-size: 14.5px; line-height: 1.45; }
.intent-query textarea:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-soft); }
.intent-note { margin: 10px 0 0; font-size: 12.5px; color: var(--faint); line-height: 1.45; }
.count-row { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.count-row .label { color: var(--muted); font-size: 14px; }
.wish-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: -6px 0 14px; font-size: 14px; color: var(--muted); }
.wish-bar strong { color: var(--text); }
.wish-editor { margin: 0 0 18px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); max-width: 760px; }
.wish-editor .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.small { font-size: 12.5px; }
.wish-line { margin-top: 4px; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* moments: editorial title, why it fits, the spoken fragment as context */
.moment .moment-title { font: 650 15.5px/1.35 var(--display); letter-spacing: -0.01em; }
.moment .why, .player-info .why { margin-top: 5px; font-size: 13px; line-height: 1.45; color: #d6d6dc; }
.moment .quote.muted { font-weight: 500; font-size: 13px; color: var(--faint); -webkit-line-clamp: 1; margin-top: 4px; }
.player-info .quote.muted { font: 500 13.5px/1.45 var(--font); color: var(--faint); margin-top: 8px; }
.fit { padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--muted); }
.fit.high { background: rgba(52, 199, 89, 0.14); color: #7ee2a0; }
.fit.mid { background: rgba(255, 176, 32, 0.13); color: #ffd58a; }
.title-edit { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--faint); }
.title-edit input { height: 44px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); font: 650 16px/1.3 var(--display); }
.title-edit input:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-soft); }
.title-meta { margin-top: 6px; font-size: 12px; color: var(--faint); min-height: 1em; }

/* progress: pause */
.progress-actions { display: inline-flex; gap: 6px; }
.progress.is-paused .stages li.active { opacity: 0.6; }
.paused-note { margin: 14px 0 0; font-size: 13px; color: #ffd58a; }

/* ── light style previews: a real frame, composed like the render ───── */
.shot { position: relative; display: block; width: 64px; aspect-ratio: 9 / 16; border-radius: 9px; overflow: hidden; background: #111; margin-bottom: 6px; container-type: size; border: 1px solid rgba(255, 255, 255, 0.08); }
.shot[data-aspect="4:5"] { aspect-ratio: 4 / 5; width: 80px; }
.shot[data-aspect="1:1"] { aspect-ratio: 1 / 1; width: 88px; }
.shot[data-aspect="16:9"] { aspect-ratio: 16 / 9; width: 118px; }
.choice.on .shot { border-color: var(--accent-line); box-shadow: 0 0 0 2px var(--accent-soft); }
.shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.shot .shot-img.contain { object-fit: contain; }
.shot .shot-bg { filter: blur(6px) brightness(0.8) saturate(0.9); transform: scale(1.15); }
.shot[data-layout="title"] .shot-img.contain { top: 12%; }
.shot-two { position: absolute; inset: 0; display: grid; grid-template-rows: 1fr 1fr; gap: 1.5%; background: #000; }
.shot-two img { position: static; width: 100%; height: 100%; }
.shot-two .left { object-position: 25% 50%; }
.shot-two .right { object-position: 75% 50%; }
.shot-title { position: absolute; left: 50%; transform: translateX(-50%); width: max-content; text-align: center; z-index: 2; }
.shot-title > span { font-weight: 800; -webkit-box-decoration-break: clone; box-decoration-break: clone; box-shadow: 0 0 0.6cqh rgba(0, 0, 0, 0.28); }
.shot-cap { position: absolute; left: 50%; transform: translate(-50%, -50%); width: 90%; text-align: center; z-index: 2; }
.shot-cap > span { display: inline; font-weight: 800; }
.shot-lg { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; border: 0; border-radius: inherit; aspect-ratio: auto; }
.phone-lg .shot-lg { width: 100%; }

.cap-box.tiktok .cap-text { display: inline; }
.s-tiktok { font: 800 12px/1 var(--display); color: #161823; background: #fff; padding: 3px 7px; border-radius: 6px; }

/* backend: sign-in and queue */
.login { max-width: 420px; margin: 60px auto; }
.login-form { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.login-form input { min-width: 200px; }
.login-form input { flex: 1; height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); font: inherit; }
.queue-note { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 13.5px; color: var(--muted); }
.expired { display: grid; place-items: center; height: 100%; padding: 16px; text-align: center; color: var(--faint); font-size: 13px; }
