/* Banner Hooks Engine — design port from claude.ai/design (chat1.md)
   Token system, type scale, and every component rule below is a 1:1
   port of /tmp/bannerdesign/bnrhook/project/styles.css with the
   production-only additions at the bottom (error screen, batch list,
   mobile drawer, reduced-motion, filter empty states, hook index). */

:root {
  --font-body: 'Inter Tight', 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --bg:        #0A0A0B;
  --bg-2:      #111113;
  --card:      #141416;
  --card-2:    #1A1A1D;
  --line:      rgba(255,255,255,0.07);
  --line-2:    rgba(255,255,255,0.12);
  --ink:       #EDEBE4;
  --ink-mute:  rgba(237,235,228,0.60);
  --ink-dim:   rgba(237,235,228,0.38);
  --ink-ghost: rgba(237,235,228,0.18);

  /* Crimson (design finalised). Only on icons / highlights / primary button. */
  --accent:        #D96A6A;
  --accent-soft:   rgba(217,106,106,0.16);
  --accent-ring:   rgba(217,106,106,0.42);

  --success:      #6EEBA0;
  --error:        #EF6B6B;
  --error-soft:   rgba(239,107,107,0.10);

  --radius:    16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-feature-settings: "ss01","cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

/* ──────────────── App shell ──────────────── */
.app { position: relative; min-height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.bg { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.bg__a, .bg__b { position: absolute; border-radius: 50%; filter: blur(120px); }
.bg__a { width: 640px; height: 640px; left: -160px; bottom: -240px; background: #FFFFFF; opacity: .035; }
.bg__b { width: 520px; height: 520px; right: -160px; top: -200px; background: #FFFFFF; opacity: .025; }

.topbar { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; gap: 10px; }
.topbar__history {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px; border-radius: 99px;
  font-size: 12px; color: var(--ink-mute);
  border: 1px solid var(--line); transition: all 150ms;
}
.topbar__history:hover { border-color: var(--line-2); color: var(--ink); background: var(--card); }
.topbar__kbd {
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--ink-dim); padding: 2px 6px;
  border: 1px solid var(--line); border-radius: 5px;
}

/* v16.0 — Topbar Clerk UserButton slot.
   The Clerk-mounted button replaces the inner content. We just give it
   a predictable anchor position on the right and a height that matches
   the History chip. */
.topbar__user {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  min-width: 34px;
}

/* ══════════════════════════════════════════════════════════════════
   v16.0 — Auth screens (splash + sign-in)
   ══════════════════════════════════════════════════════════════════ */

.auth-splash {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px;
  color: var(--ink-mute);
  padding: 40px 20px;
  text-align: center;
}
.auth-splash__logo {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--font-display, var(--font-sans));
  font-size: 24px;
  font-weight: 520;
  color: var(--ink);
  letter-spacing: -0.035em;
  margin-bottom: 8px;
}
.auth-splash__mark {
  color: var(--accent);
  display: inline-flex;
  align-items: center;
}
.auth-splash__word { line-height: 1; }
.auth-splash__msg {
  font-size: 14px;
  color: var(--ink-dim);
}
.auth-splash__dp {
  margin-top: 6px;
}
.auth-splash__err {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--error, #ef6b6b);
  background: rgba(239, 107, 107, 0.06);
  border: 1px solid rgba(239, 107, 107, 0.25);
  border-radius: 10px;
  padding: 10px 14px;
  max-width: 520px;
  word-break: break-word;
  margin-top: 6px;
}
.auth-splash__actions {
  display: flex; gap: 10px;
  margin-top: 12px;
}
.auth-splash__diag {
  margin-top: 16px;
  font-size: 12px;
  color: var(--ink-dim);
  max-width: 560px;
  width: 100%;
}
.auth-splash__diag summary {
  cursor: pointer;
  padding: 6px 0;
  color: var(--ink-mute);
}
.auth-splash__diag pre {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-mute);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  overflow: auto;
  max-height: 220px;
  white-space: pre-wrap;
  word-break: break-word;
}

.auth-screen {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center;
  padding: 60px 20px 40px;
  gap: 28px;
}
.auth-screen__brand {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px;
  max-width: 440px;
  text-align: center;
}
.auth-screen__mark {
  color: var(--accent);
  display: inline-flex;
  filter: drop-shadow(0 6px 20px rgba(217,106,106,0.25));
}
.auth-screen__logo {
  font-size: 36px;
  font-weight: 520;
  letter-spacing: -0.04em;
  color: var(--ink);
  line-height: 1;
}
.auth-screen__tag {
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink-dim);
}
.auth-screen__clerk {
  /* Clerk mounts its own card here; we just make sure the wrapper
     centres and caps at a reasonable width. */
  width: 100%;
  max-width: 440px;
  display: flex;
  justify-content: center;
}

/* Clerk's card sometimes ships a white background — force-match the
   dark palette via CSS variables passed to mountSignIn() */
.cl-card,
.cl-rootBox,
.cl-formButtonPrimary {
  font-family: 'Inter Tight', system-ui, sans-serif !important;
}

/* v16.0.4 — CSS failsafe for the UserButton dropdown. Clerk's internal
   classnames (cl-userButtonPopoverActionButton etc.) get baseline light-
   mode colours from their default stylesheet. The appearance={} prop
   should win, but occasional specificity inversions can leave action-
   button text dim on our dark background. These rules make sure the
   "Manage account" / "Sign out" rows are always legible. */
.cl-userButtonPopoverCard,
.cl-userButtonPopoverMain,
.cl-userButtonPopoverActions {
  background-color: #141416 !important;
}
.cl-userButtonPopoverActionButton,
.cl-userButtonPopoverActionButton__manageAccount,
.cl-userButtonPopoverActionButton__signOut {
  color: #F5F5F7 !important;
}
.cl-userButtonPopoverActionButton:hover,
.cl-userButtonPopoverActionButton__manageAccount:hover,
.cl-userButtonPopoverActionButton__signOut:hover {
  background-color: rgba(255, 255, 255, 0.06) !important;
}
.cl-userButtonPopoverActionButtonText {
  color: #F5F5F7 !important;
}
.cl-userButtonPopoverActionButtonIcon {
  color: #a5a5ac !important;
}
.cl-userButtonPopoverFooter {
  background-color: #0A0A0B !important;
  border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
}
.cl-userPreview .cl-userPreviewMainIdentifier {
  color: #F5F5F7 !important;
}
.cl-userPreview .cl-userPreviewSecondaryIdentifier {
  color: #a5a5ac !important;
}

.stage {
  position: relative; z-index: 1;
  flex: 1;
  display: flex; justify-content: center; align-items: center;
  padding: 32px 24px 80px;
  min-height: calc(100vh - 62px);
}

/* Screen visibility — kept mounted, toggled to preserve input DOM */
.screen { display: none; width: 100%; justify-content: center; align-items: center; }
.screen[data-active="true"] { display: flex; flex-direction: column; }

/* ──────────────── v19.0 Brand wordmark primitives ──────────────── */
/* `banner·hook.` — centred dot between the words + crimson period.
   Shared by hero, auth splash, sign-in, and any future lockup. */
.mid-dot {
  display: inline-block;
  width: 0.2em; height: 0.2em;
  border-radius: 50%;
  background: currentColor;
  margin: 0 0.14em;
  vertical-align: 0.32em;
  opacity: 0.85;
}
.brand-dot {
  color: var(--accent);
}

/* ──────────────── Hero (v19.0 logo port) ──────────────── */
.hero {
  width: 100%; max-width: 820px;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
}
/* The mark sits in a soft crimson glow, matching the design file's
   radial-gradient treatment. Bigger (140px) to let the new 120px
   fishing-hook SVG breathe. */
.hero__mark {
  width: 140px; height: 140px;
  display: grid; place-items: center;
  border-radius: 36px;
  background: radial-gradient(circle at 30% 30%, rgba(217,106,106,0.12), transparent 65%);
  color: var(--accent);
  margin-bottom: 24px;
  filter: drop-shadow(0 12px 32px rgba(217,106,106,0.18));
}
/* Wordmark: banner·hook. — hero size. Matches the design lockup. */
.hero__wordmark {
  font-size: 64px;
  line-height: 1.0;
  letter-spacing: -0.04em;
  font-weight: 520;
  margin: 0 0 12px;
  text-wrap: balance;
}
.hero__tag {
  font-size: 15px;
  color: var(--ink-mute);
  margin: 0 0 40px;
  max-width: 46ch;
  line-height: 1.5;
}
.hero__h {
  font-size: 52px;
  line-height: 1.04;
  letter-spacing: -0.035em;
  font-weight: 520;
  margin: 0 0 40px;
  text-wrap: balance;
  max-width: 16ch;
}

.picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 580px;
}
.pick {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 32px 16px 26px;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--line);
  transition: all 180ms cubic-bezier(.2,.7,.2,1);
  position: relative; overflow: hidden;
  text-align: center;
}
.pick:hover {
  transform: translateY(-3px);
  border-color: var(--accent-ring);
  background: var(--card-2);
}
.pick:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: 3px; }
.pick__icon {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent);
}
.pick__title { font-size: 14.5px; font-weight: 540; letter-spacing: -0.01em; color: var(--ink); }

/* ──────────────── Input Card ──────────────── */
.card {
  width: 100%; max-width: 620px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 24px 26px 20px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.45);
  position: relative;
}
.card__back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--ink-mute);
  padding: 5px 10px 5px 6px; border-radius: 8px;
  margin-bottom: 10px; margin-left: -8px;
}
.card__back:hover { color: var(--ink); background: rgba(255,255,255,0.04); }
.card__head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.card__badge {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--accent-soft); color: var(--accent);
}
.card__title { font-size: 20px; letter-spacing: -0.02em; font-weight: 540; margin: 0; }
.card__body { margin-bottom: 16px; }

.stack { display: flex; flex-direction: column; gap: 12px; }
.stack__item { display: flex; flex-direction: column; gap: 6px; }
.stack__head { display: flex; justify-content: space-between; align-items: center; padding: 0 2px; }
.stack__n { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-dim); }
.stack__x {
  width: 22px; height: 22px; border-radius: 6px;
  display: grid; place-items: center;
  color: var(--ink-dim);
}
.stack__x:hover { background: rgba(255,255,255,0.06); color: var(--ink); }
.stack__item--row { flex-direction: row; align-items: center; gap: 10px; }
.stack__rownum {
  font-family: var(--font-mono);
  font-size: 11px; color: var(--ink-dim);
  width: 20px; text-align: center;
}
.stack__x--align { align-self: center; }
.stack__foot { padding: 4px 2px 0; }

.ta {
  width: 100%; min-height: 120px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  resize: vertical;
  font-size: 14px; line-height: 1.6;
  outline: none;
  transition: border-color 150ms, box-shadow 150ms;
}
.ta::placeholder { color: var(--ink-dim); }
.ta:focus { border-color: var(--accent-ring); box-shadow: 0 0 0 3px var(--accent-soft); }

.urlbox {
  flex: 1;
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-color 150ms, box-shadow 150ms;
}
.urlbox:focus-within { border-color: var(--accent-ring); box-shadow: 0 0 0 3px var(--accent-soft); }
.urlbox__icon { color: var(--ink-dim); display: inline-flex; }
.urlbox__input { flex: 1; background: transparent; border: 0; outline: none; font-size: 14px; min-width: 0; }
.urlbox__input::placeholder { color: var(--ink-dim); }

.addmore {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 99px;
  border: 1px dashed var(--line-2);
  font-size: 12.5px; color: var(--ink-mute);
  transition: all 150ms;
}
.addmore:hover {
  border-color: var(--accent-ring);
  background: var(--accent-soft);
  color: var(--accent);
  border-style: solid;
}

.drop {
  width: 100%; min-height: 180px;
  background: var(--bg-2);
  border: 1px dashed var(--line-2);
  border-radius: 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; transition: all 180ms;
  position: relative;
}
.drop:hover { border-color: var(--accent-ring); background: var(--accent-soft); }
.drop--over {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: scale(1.003);
  box-shadow: 0 0 0 6px var(--accent-ring);
}
.drop__ring {
  width: 44px; height: 44px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04); color: var(--accent);
  display: grid; place-items: center;
}
.drop__title { font-size: 14px; color: var(--ink); }
.drop__sub { font-size: 12px; color: var(--ink-dim); }

.files { display: flex; flex-direction: column; gap: 2px; }
.fileline {
  display: grid;
  grid-template-columns: 28px 1fr auto 28px;
  align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 10px;
  transition: background 120ms;
}
.fileline:hover { background: rgba(255,255,255,0.025); }
.fileline__n { font-family: var(--font-mono); font-size: 11px; color: var(--ink-dim); }
.fileline__name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fileline__size { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-dim); }
.fileline__x { width: 24px; height: 24px; border-radius: 6px; color: var(--ink-dim); display: grid; place-items: center; }
.fileline__x:hover { background: rgba(255,255,255,0.06); color: var(--ink); }

.files__drop {
  margin-top: 10px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  border: 1px dashed var(--line-2);
  border-radius: 12px;
  font-size: 13px; color: var(--ink-dim);
  cursor: pointer;
  transition: all 160ms;
}
.files__drop:hover { border-color: var(--accent-ring); color: var(--ink); background: var(--accent-soft); }
.files__drop--over {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
  box-shadow: 0 0 0 4px var(--accent-ring);
}
.files__drop-hint { font-size: 11.5px; opacity: 0.7; }

.foot { display: flex; justify-content: space-between; padding: 8px 2px 0; }
.foot--pad { padding-top: 12px; }
.foot__hint { font-size: 12px; color: var(--ink-dim); transition: color 160ms; }
.foot__hint--ok { color: var(--accent); }
.foot__hint--err { color: var(--error); }

.card__cta { display: flex; justify-content: flex-end; align-items: center; gap: 14px; padding-top: 6px; }
.card__kbd {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--ink-dim);
}
.card__kbd kbd {
  display: inline-grid; place-items: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  color: var(--ink-dim);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  border-radius: 5px;
}

/* ─── Count selector ("How many banner hooks?") ─── */
.countrow {
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px 0 6px;
  border-top: 1px solid var(--line);
  margin-top: 4px;
}
.countrow__label { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.countrow__title { font-size: 13px; font-weight: 540; color: var(--ink); }
.countrow__hint { font-size: 11.5px; color: var(--ink-dim); }
.countrow__control {
  display: flex; align-items: center; gap: 14px;
}
.countrow__slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px; border-radius: 99px;
  background: linear-gradient(to right, var(--accent-soft), var(--accent-ring));
  outline: none;
  cursor: pointer;
}
.countrow__slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-2);
  box-shadow: 0 0 0 3px var(--accent-ring);
  cursor: pointer;
  transition: transform 120ms;
}
.countrow__slider::-webkit-slider-thumb:hover { transform: scale(1.1); }
.countrow__slider::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg-2);
  box-shadow: 0 0 0 3px var(--accent-ring); cursor: pointer;
}
.countrow__value {
  font-family: var(--font-mono);
  font-size: 18px; font-weight: 600;
  color: var(--accent);
  min-width: 30px; text-align: right;
}
.countrow__presets { display: flex; gap: 6px; }
.chip--preset {
  font-family: var(--font-mono);
  min-width: 44px; justify-content: center; display: inline-flex; align-items: center;
}

/* v23.0 — segmented count selector (replaces slider + presets) */
.countrow__seg {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  align-self: flex-start;
}
.countrow__segbtn {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  min-width: 52px;
  padding: 10px 18px;
  border-radius: 8px;
  color: var(--ink-mute);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 120ms, color 120ms, transform 90ms;
}
.countrow__segbtn:hover {
  color: var(--ink);
  background: rgba(255,255,255,0.04);
}
.countrow__segbtn[data-on="true"] {
  color: #111;
  background: var(--accent);
  box-shadow: 0 1px 0 rgba(255,255,255,0.25) inset, 0 6px 14px rgba(0,0,0,0.18);
}
.countrow__segbtn:active { transform: translateY(1px); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px;
  border-radius: 12px;
  font-size: 14px; font-weight: 560;
  letter-spacing: -0.005em;
  transition: all 160ms;
}
.btn--primary {
  background: var(--accent); color: #111;
  box-shadow: 0 1px 0 rgba(255,255,255,0.25) inset, 0 10px 28px rgba(0,0,0,0.3);
}
.btn--primary:hover:not([disabled]) { transform: translateY(-1px); filter: brightness(1.04); }
.btn--primary[disabled] { opacity: 0.4; cursor: not-allowed; }
.btn--ghost {
  color: var(--ink-mute); border: 1px solid var(--line-2);
  padding: 9px 14px;
}
.btn--ghost:hover { color: var(--ink); border-color: var(--ink-ghost); }

/* ──────────────── Generating ──────────────── */
.gen {
  display: flex; flex-direction: column; align-items: center;
  width: 100%; max-width: 440px; gap: 0;
  align-self: center;
  margin-left: auto; margin-right: auto;
}
.gen__ring { display: grid; place-items: center; }
.gen__ring--overrun { animation: genpulse 1.8s ease-in-out infinite; }
@keyframes genpulse {
  0%, 100% { opacity: 0.7; }
  50%      { opacity: 1; }
}
.gen__title { font-size: 20px; letter-spacing: -0.015em; margin-top: 14px; }
.gen__sub { font-size: 13px; color: var(--ink-mute); margin-top: 6px; }

/* ──────────────── Results (Done - list variant) ──────────────── */
.res {
  width: 100%; max-width: 760px;
  display: flex; flex-direction: column; gap: 18px;
  /* Centered column on any viewport width. The surrounding .screen is
     flex-direction:column, so align-self controls horizontal placement. */
  align-self: center;
  margin-left: auto; margin-right: auto;
}
.res__back {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--ink-mute);
  padding: 5px 10px 5px 6px; border-radius: 8px;
  margin-left: -8px;
}
.res__back:hover { color: var(--ink); background: rgba(255,255,255,0.04); }
.res__head { padding: 4px 0 0; }
.res__source {
  font-family: var(--font-mono);
  font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-dim); margin-bottom: 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.res__title {
  margin: 0 0 12px;
  font-size: 34px; line-height: 1.08;
  letter-spacing: -0.028em; font-weight: 520;
  text-wrap: balance;
}
.res__pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill {
  font-size: 11.5px; padding: 4px 10px;
  border-radius: 99px; border: 1px solid var(--line);
  color: var(--ink-mute);
}
.pill--accent { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-ring); }
.pill--warn { color: var(--error); border-color: rgba(239,107,107,0.35); background: var(--error-soft); }

.thinkbtn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  font-size: 13px; color: var(--ink-mute);
  align-self: flex-start; border: 1px solid transparent;
}
.thinkbtn:hover { background: var(--card); color: var(--ink); border-color: var(--line); }
.thinkbtn__chev { font-size: 10px; color: var(--ink-dim); transition: transform 200ms; }
.thinkbtn[data-open="true"] .thinkbtn__chev { transform: rotate(90deg); color: var(--accent); }
.thinkbtn__hint { color: var(--ink-dim); font-size: 12px; }

.think {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 4px 2px;
}
.think__row {
  display: grid; grid-template-columns: 120px 1fr; gap: 16px;
  padding: 12px 16px; border-top: 1px solid var(--line);
}
.think__row:first-child { border-top: 0; }
.think__k { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em; color: var(--ink-dim); padding-top: 3px; }
.think__v { font-size: 13.5px; line-height: 1.55; text-wrap: pretty; }
.think__v[data-accent="true"] { color: var(--accent); }

/* v15 — Transcript block (collapsible, sits above "The thinking") */
.transcript {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px 10px;
  display: flex; flex-direction: column; gap: 10px;
}
.transcript__body {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink);
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
  text-wrap: pretty;
}
.transcript__foot {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

/* Magnets — the deep-analysis diagnosis row at the top of The Thinking */
.magnets { display: flex; flex-direction: column; gap: 6px; }
.magnet {
  display: grid; grid-template-columns: 38px 1fr auto; gap: 10px;
  align-items: center;
  padding: 6px 10px; border-radius: 8px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-ring);
}
.magnet--miss {
  background: var(--error-soft);
  border-color: rgba(239,107,107,0.35);
}
.magnet__code {
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.06em; color: var(--accent); font-weight: 600;
}
.magnet--miss .magnet__code { color: var(--error); }
.magnet__name { font-size: 13px; color: var(--ink); }
.magnet__pct {
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--ink-mute);
  padding: 2px 7px; border-radius: 99px;
  background: rgba(255,255,255,0.04);
}

.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chips__spacer { flex: 1; }
.chip {
  font-size: 12px; padding: 6px 11px; border-radius: 99px;
  color: var(--ink-mute); border: 1px solid var(--line-2);
  transition: all 140ms;
}
.chip:hover:not([disabled]) { color: var(--ink); border-color: var(--ink-ghost); }
.chip[data-on="true"] { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-ring); }
.chip--ghost { color: var(--ink-dim); border-color: transparent; }
.chip--ghost:hover:not([disabled]) { background: rgba(255,255,255,0.04); color: var(--ink); }
.chip[disabled] { opacity: 0.4; cursor: not-allowed; }

/* Hooks list — one-to-one with design's Done v1 */
.hooks {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
}
.hook {
  display: grid;
  grid-template-columns: 28px 22px 1fr auto auto auto auto;
  align-items: center; gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  transition: background 120ms;
  cursor: pointer;
}
.hook:first-child { border-top: 0; }
.hook:hover { background: rgba(255,255,255,0.022); }
.hook[data-kind="allcaps"] .hook__text {
  text-transform: uppercase; letter-spacing: 0.04em;
  font-weight: 560; font-size: 14px;
}
.hook__idx {
  font-family: var(--font-mono);
  font-size: 10.5px; color: var(--ink-dim);
  text-align: right;
}
.hook__fav { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: var(--ink-ghost); transition: all 120ms; }
.hook__fav:hover { color: var(--accent); background: var(--accent-soft); }
.hook__fav[data-on="true"] { color: var(--accent); }
.hook__text { font-size: 14.5px; line-height: 1.4; text-wrap: pretty; }
.hook__len { font-family: var(--font-mono); font-size: 11px; color: var(--ink-dim); padding: 2px 8px; border-radius: 99px; background: rgba(255,255,255,0.035); }
.hook__copy {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; color: var(--ink-dim);
  padding: 6px 9px; border-radius: 7px;
  opacity: 0; transition: all 120ms;
}
.hook:hover .hook__copy, .hook:focus-within .hook__copy { opacity: 1; }
.hook__copy:hover { background: rgba(255,255,255,0.05); color: var(--ink); }
.hook__copy[data-copied="true"] { color: var(--success); opacity: 1; }

.hook__refine {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 6px;
  color: var(--ink-ghost);
  opacity: 0; transition: all 120ms;
}
.hook:hover .hook__refine { opacity: 1; }
.hook__refine:hover { color: var(--accent); background: var(--accent-soft); }

/* v15.4 — Per-banner Refine button. Distinct color from Copy/Star so
   the user sees it's a different kind of action (edit this one, rather
   than capture it). Always visible on wider screens to satisfy the
   "each banner should have a side button" requirement. */
.hook__refine-btn {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 500;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-ring);
  padding: 6px 10px; border-radius: 7px;
  transition: all 160ms;
  cursor: pointer;
  white-space: nowrap;
}
.hook__refine-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.hook__refine-btn--on {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Flash animation when a banner was just refined — catches the eye so
   the user sees the change landed without visually diffing the list. */
@keyframes hook-flash {
  0%   { background: var(--accent-soft); }
  100% { background: transparent; }
}
.hook--flash {
  animation: hook-flash 1.6s ease-out;
}

/* v15.4 — Inline per-banner refine panel (slides in right under the
   banner being refined). Looks like a speech bubble attached to the
   banner above it. */
.hook-refine {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--line);
  background: rgba(180, 60, 90, 0.04);
}
.hook-refine__inner {
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px 18px 18px;
}
.hook-refine__hint {
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; color: var(--accent);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.hook-refine__arrow {
  font-size: 14px;
  transform: rotate(180deg) scaleX(-1);
  display: inline-block;
  color: var(--accent);
}
.hook-refine__hintlabel {
  font-weight: 500;
}
.hook-refine__row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
}
.hook-refine__input {
  background: var(--bg);
  border: 1px solid var(--accent-ring);
  border-radius: 8px;
  color: var(--ink);
  font-size: 13.5px;
  padding: 10px 12px;
  line-height: 1.4;
  transition: border-color 120ms, box-shadow 120ms;
}
.hook-refine__input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.hook-refine__input::placeholder {
  color: var(--ink-dim);
}
.hook-refine__send {
  padding: 9px 14px;
  font-size: 12.5px;
}
.hook-refine__cancel {
  font-size: 11.5px;
  padding: 6px 10px;
}

/* v15.4 — Intent toggle chips (Refine all vs Add more).
   Two side-by-side chip-style buttons with a clear active state,
   positioned above the text input in both chat panels. */
.intent {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
  padding: 6px 0;
}
.intent__chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 500;
  color: var(--ink-mute);
  background: transparent;
  border: 1px solid var(--line);
  padding: 7px 12px; border-radius: 8px;
  transition: all 140ms;
  cursor: pointer;
}
.intent__chip:hover {
  color: var(--ink);
  border-color: var(--ink-dim);
}
.intent__chip[data-on="true"] {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent-ring);
}
.intent__chip-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 4px;
  background: rgba(255,255,255,0.04);
  font-size: 11px;
  font-weight: 600;
}
.intent__chip[data-on="true"] .intent__chip-icon {
  background: var(--accent);
  color: #fff;
}
.intent__sep {
  color: var(--ink-dim);
  margin: 0 2px;
}
.intent__count-label {
  font-size: 11.5px;
  color: var(--ink-dim);
  letter-spacing: 0.02em;
}
.intent__count {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-mute);
  background: transparent;
  border: 1px solid var(--line);
  padding: 5px 10px; border-radius: 6px;
  transition: all 140ms;
  cursor: pointer;
  min-width: 32px;
}
.intent__count:hover { color: var(--ink); border-color: var(--ink-dim); }
.intent__count[data-on="true"] {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent-ring);
  font-weight: 600;
}

/* v18.1 custom count input. Sits next to the 3/5/10 preset chips,
   lets the user type any number 1..25. Styled to match the chip row. */
.intent__count-input {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 5px 8px;
  border-radius: 6px;
  width: 56px;
  text-align: center;
  appearance: textfield;
  -moz-appearance: textfield;
}
.intent__count-input::-webkit-inner-spin-button,
.intent__count-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.intent__count-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.intent__count-input::placeholder {
  color: var(--ink-dim);
}

/* v18.1 compact live-progress bar used during refines. Reuses the
   overall-bar visuals from .live but scoped smaller (no step strip). */
.live--mini {
  padding: 12px 14px;
  gap: 8px;
}
.live--mini .live__overall-top {
  padding-bottom: 0;
}
.live--mini .live__overall-pct {
  font-size: 18px;
}
.live--mini .live__sub {
  font-size: 11.5px;
  color: var(--ink-mute);
}
.live--mini .live__overall-track {
  height: 6px;
}
.live--mini .live__retry {
  color: var(--accent);
  font-size: 11px;
}

/* ─── Chat panel (talk to your banners) ─── */
.chat {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  padding: 18px 18px 14px;
  display: flex; flex-direction: column; gap: 14px;
}
.chat__head {
  display: flex; flex-direction: column; gap: 3px;
}
.chat__title { margin: 0; font-size: 14.5px; font-weight: 560; letter-spacing: -0.01em; }
.chat__sub { font-size: 12px; color: var(--ink-dim); }

.chat__log { display: flex; flex-direction: column; gap: 8px; }
.chat__turn {
  display: flex; flex-direction: column; gap: 6px;
  padding: 10px 12px; border-radius: 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
}
.chat__turn--user { background: var(--accent-soft); border-color: var(--accent-ring); }
.chat__turn--assistant { background: var(--bg-2); border-color: var(--line); }
.chat__meta { display: flex; align-items: center; gap: 8px; }
.chat__role {
  font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-mute);
}
.chat__turn--user .chat__role { color: var(--accent); }
.chat__scope {
  font-family: var(--font-mono);
  font-size: 10px; color: var(--ink-dim);
  padding: 1px 6px; border-radius: 99px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--line);
}
.chat__body {
  font-size: 13.5px; line-height: 1.45;
  color: var(--ink); text-wrap: pretty;
}
.chat__note {
  font-size: 12px; color: var(--ink-mute);
  font-style: italic;
  border-left: 2px solid var(--accent-ring);
  padding-left: 10px;
}
.chat__diff { display: flex; flex-direction: column; gap: 4px; padding-top: 4px; }
.chat__change {
  display: flex; gap: 8px; flex-wrap: wrap;
  font-size: 12.5px; line-height: 1.4;
  align-items: baseline;
}
.chat__change-n {
  font-family: var(--font-mono);
  font-size: 10px; color: var(--ink-dim);
  min-width: 24px;
}
.chat__change del {
  color: var(--ink-dim);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(237,235,228,0.3);
}
.chat__change ins {
  color: var(--accent);
  text-decoration: none;
}
.chat__change-more { font-size: 11.5px; color: var(--ink-dim); margin-top: 2px; }

.chat__scopes {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
}
.chip__close { font-size: 13px; margin-left: 4px; opacity: 0.6; }

.chat__input-row {
  display: flex; gap: 10px; align-items: stretch;
}
.chat__input {
  flex: 1;
  min-height: 52px; max-height: 200px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: inherit; font-size: 14px; line-height: 1.5;
  resize: vertical;
  outline: none;
  transition: border-color 150ms, box-shadow 150ms;
}
.chat__input::placeholder { color: var(--ink-dim); }
.chat__input:focus { border-color: var(--accent-ring); box-shadow: 0 0 0 3px var(--accent-soft); }
.chat__input[disabled] { opacity: 0.6; cursor: not-allowed; }
.chat__send {
  align-self: flex-end;
  height: 40px;
  padding: 0 16px;
}
.chat__kbd {
  display: flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--ink-dim);
  justify-content: flex-end;
}
.chat__kbd kbd {
  font-family: var(--font-mono); font-size: 10.5px;
  padding: 1px 5px; border-radius: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
}

/* Empty filter state */
.hooks--empty {
  padding: 36px 24px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-dim);
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* ──────────────── Drawer (history) ──────────────── */
.drawer {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(6px);
  display: flex; justify-content: flex-end;
}
.drawer__sheet {
  width: 380px; max-width: 90vw; height: 100%;
  background: var(--bg-2);
  border-left: 1px solid var(--line-2);
  padding: 20px 18px;
  display: flex; flex-direction: column; gap: 12px;
  overflow-y: auto;
}
.drawer__head { display: flex; justify-content: space-between; align-items: center; padding: 4px 4px 8px; }
.drawer__head h3 { margin: 0; font-size: 15px; letter-spacing: -0.01em; font-weight: 560; }
.drawer__head-actions { display: flex; gap: 6px; }
.drawer__head button { width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; color: var(--ink-dim); }
.drawer__head button:hover { background: var(--line); color: var(--ink); }
.drawer__clear { padding: 0 10px; width: auto !important; font-size: 11px; color: var(--ink-dim); }
.drawer__clear[disabled] { opacity: 0.5; cursor: wait; }
.drawer__empty { padding: 20px 10px; font-size: 13px; color: var(--ink-dim); }
.drawer__list { display: flex; flex-direction: column; gap: 2px; }
.drawer__item { text-align: left; padding: 12px 12px; border-radius: 10px; display: flex; flex-direction: column; gap: 3px; }
.drawer__item:hover { background: var(--card); }
.drawer__title { font-size: 13.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer__sub { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-dim); }

/* v16.2 — Drawer TTL footer. Sits beneath the history list; quiet
   reminder that history isn't stored forever. */
.drawer__ttl {
  margin-top: auto;
  padding: 16px 12px 4px;
  font-size: 11.5px;
  color: var(--ink-dim);
  border-top: 1px solid var(--line);
  line-height: 1.5;
}

/* ──────────────── Batch results list (multi-clip summary) ──────────────── */
.batch {
  width: 100%; max-width: 760px;
  display: flex; flex-direction: column; gap: 14px;
  align-self: center;
  margin-left: auto; margin-right: auto;
}
.batch__head { display: flex; justify-content: space-between; align-items: baseline; }
.batch__title { font-size: 28px; letter-spacing: -0.025em; font-weight: 520; margin: 0; }
.batch__sub { font-size: 13px; color: var(--ink-dim); }
.batch__list { display: flex; flex-direction: column; gap: 8px; }
.batch__row {
  display: grid;
  grid-template-columns: 36px 1fr auto auto;
  gap: 14px; align-items: center;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  text-align: left;
  transition: border-color 150ms, transform 150ms;
}
.batch__row:hover { border-color: var(--accent-ring); transform: translateY(-1px); }
.batch__row[data-status="error"] { border-color: rgba(239,107,107,0.25); }
.batch__row[data-status="error"]:hover { border-color: rgba(239,107,107,0.45); }
.batch__n { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-dim); text-align: center; }
.batch__name { font-size: 14px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.batch__status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; padding: 3px 10px; border-radius: 99px;
}
.batch__status[data-status="processing"] { color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-ring); }
.batch__status[data-status="done"] { color: var(--success); background: rgba(110,235,160,0.08); border: 1px solid rgba(110,235,160,0.25); }
.batch__status[data-status="error"] { color: var(--error); background: var(--error-soft); border: 1px solid rgba(239,107,107,0.3); }
.batch__status[data-status="queued"] { color: var(--ink-dim); border: 1px solid var(--line); }
.batch__chev { color: var(--ink-dim); display: inline-flex; }
.batch__error {
  grid-column: 1 / -1;
  font-size: 12px; color: var(--error);
  padding: 8px 10px; background: var(--error-soft);
  border: 1px solid rgba(239,107,107,0.2);
  border-radius: 10px;
  margin-top: 6px;
}

/* v15 — batch header: title + mode toggle, stacked left-right */
.batch__head {
  flex-wrap: wrap;
  gap: 12px;
}
.batch__headleft {
  display: flex; flex-direction: column; gap: 2px;
  min-width: 0;
}
.batch__modebar {
  display: inline-flex; gap: 4px;
  margin-left: auto;
}

/* v15 — scroll-through batch view */
.batch--scroll { gap: 16px; }

/* Sticky mini-nav: jump chips for each clip section */
.batch__nav {
  position: sticky;
  top: 10px;
  z-index: 5;
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 8px 10px;
  background: rgba(10, 10, 11, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  align-self: stretch;
}
.batch__navchip {
  font-family: var(--font-mono);
  padding: 5px 10px;
  text-decoration: none;
}

/* v15.1 — Each clip is a distinct card in scroll-through view */
.clip-section {
  display: flex; flex-direction: column; gap: 16px;
  padding: 32px 32px 28px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: 0 16px 40px rgba(0,0,0,0.25);
  scroll-margin-top: 80px;   /* leave room for sticky nav when jumping */
}
/* Extra spacing between cards — user reads "one clip, one card" */
.batch--scroll .clip-section + .clip-section { margin-top: 8px; }

.clip-section__head {
  display: flex; align-items: baseline; gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.clip-section__num {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.14em;
  color: var(--accent); flex-shrink: 0;
}
.clip-section__title {
  margin: 0;
  font-size: 24px; letter-spacing: -0.022em; font-weight: 540;
  line-height: 1.2;
  flex: 1;
  min-width: 0;
  text-wrap: pretty;
}
.clip-section__open {
  font-size: 11.5px;
  color: var(--ink-mute);
  padding: 5px 11px;
  border: 1px solid var(--line-2);
  border-radius: 99px;
  transition: all 140ms;
}
.clip-section__open:hover {
  color: var(--accent);
  border-color: var(--accent-ring);
  background: var(--accent-soft);
}

.clip-section__status {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--ink-mute);
  padding: 10px 0;
}
.clip-section__err {
  font-size: 13px; color: var(--error);
  padding: 16px 18px;
  background: var(--error-soft);
  border: 1px solid rgba(239,107,107,0.25);
  border-radius: 14px;
  display: flex; flex-direction: column; gap: 12px;
}
.clip-section__errmsg {
  font-weight: 500;
  line-height: 1.45;
}
.clip-section__erractions {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.clip-section__err .thinkbtn--transcript {
  margin-top: 4px;
}
.clip-section__err .transcript {
  background: rgba(0,0,0,0.12);
  border-color: rgba(239,107,107,0.2);
}
.clip-section__err .transcript__body {
  color: var(--ink);   /* transcript text stays neutral, not red */
}

/* v15.3 — Live backend progression panel (replaces the old fake ring).
   Rendered inside .clip-section while the clip is still processing. */
.live {
  display: flex; flex-direction: column; gap: 14px;
  padding: 18px 20px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
}

/* v16.1 — Overall progress header (headline ETA + big bar above strip).
   Shows % complete across the whole pipeline plus a live ETA so users
   always know where they are. Drawn first inside .live. */
.live__overall {
  display: flex; flex-direction: column; gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--line);
}
.live__overall-top {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px;
}
.live__overall-pct {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.live__overall-meta {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
}
.live__eta {
  color: var(--accent);
  font-weight: 500;
}
.live__total {
  color: var(--ink-mute);
}
.live__overall-track {
  height: 8px;
  border-radius: 4px;
  background: var(--line);
  overflow: hidden;
}
.live__overall-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent) 0%, #d96a6a 100%);
  border-radius: 4px;
  transition: width 220ms linear;
  box-shadow: 0 0 12px rgba(180, 60, 90, 0.35);
}
/* v19.9 — RAF-driven variant: the JS animator writes .style.width at
   ~60fps, so the CSS transition would fight it and cause stutter.
   Disable transitions on any fill tagged --raf. Will-change hints the
   compositor to promote to its own layer for smoother width changes. */
.live__overall-fill--raf {
  transition: none;
  will-change: width;
}
/* v19.9 — smooth fade-out when a clip's progress completes. Applied by
   the animator ~250ms after the 'done' snapshot so the 100% flash
   lingers briefly before the panel dissolves. */
.live--fading {
  transition: opacity 260ms ease-out;
  opacity: 0;
}

/* v19.10 — minimal single-bar UI. One clean track, full width, nothing
   else. Replaces the multi-row layout (percent / ETA / step dots /
   substep / retry counts) that was too noisy. All the backend accuracy
   still drives the fill width via the RAF animator. */
.live--minimal {
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}
.live--minimal .live__overall-track {
  height: 6px;
  border-radius: 3px;
}
.live--minimal .live__overall-fill {
  border-radius: 3px;
}
.live--mini.live--minimal .live__overall-track {
  height: 4px;
  border-radius: 2px;
}

/* v20 — compact info row under the bar: substep on the left, pct% on
   the right. Single line only; no wrapping, no multi-row return to
   the pre-v19.10 noise. */
.live__info {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 6px;
  font-size: 13px;
  color: var(--ink-mute);
  font-feature-settings: "tnum";
  min-width: 0;
}
.live__info .live__substep {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 0;
  padding-right: 12px;
}
.live__info .live__pct {
  flex: 0 0 auto;
  color: var(--ink);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* v20 — skeleton banner rows under the live progress bar while a clip
   is generating. Variable widths + gentle shimmer so the space feels
   alive instead of empty. */
.banner-skeleton-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}
.banner-skeleton {
  height: 22px;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(255, 255, 255, 0.09) 50%,
    rgba(255, 255, 255, 0.04) 100%
  );
  background-size: 200% 100%;
  animation: banner-skeleton-shimmer 1.6s ease-in-out infinite;
}
@keyframes banner-skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* v20 — error card: friendly message + hint + 3-button action row +
   collapsed technical details. Replaces the raw-error-text wall that
   used to be the only UX on a failed clip. */
.clip-section__errhint {
  margin-top: 6px;
  color: var(--ink-mute);
  font-size: 14px;
  line-height: 1.45;
}
.clip-section__erractions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.clip-section__errdetails {
  margin-top: 12px;
  font-size: 13px;
}
.clip-section__errdetails summary {
  cursor: pointer;
  color: var(--ink-mute);
  user-select: none;
  padding: 4px 0;
}
.clip-section__errdetails summary:hover { color: var(--ink); }
.clip-section__errraw {
  margin-top: 6px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  color: var(--ink-mute);
  font-family: ui-monospace, SF Mono, Menlo, monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

/* v20 — disabled chip state for Copy-All + filter chips during
   processing. */
.chip[disabled],
.chip[aria-disabled="true"] {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}
.live__strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 8px;
  align-items: start;
  padding-bottom: 4px;
  border-bottom: 1px dashed var(--line);
}
.live__step {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px;
  opacity: 0.5;
  transition: opacity 220ms ease;
}
.live__step[data-state="done"] { opacity: 0.85; }
.live__step[data-state="active"] { opacity: 1; }
.live__step-dot {
  width: 10px; height: 10px; border-radius: 50%;
  border: 1.5px solid var(--ink-dim);
  background: transparent;
  transition: all 220ms ease;
}
.live__step[data-state="done"] .live__step-dot {
  background: var(--success, #6eeba0);
  border-color: var(--success, #6eeba0);
}
.live__step[data-state="active"] .live__step-dot {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  animation: live-pulse 1.4s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 4px var(--accent-soft); }
  50%      { box-shadow: 0 0 0 8px transparent; }
}
.live__step-label {
  font-size: 10.5px;
  color: var(--ink-dim);
  text-align: center;
  line-height: 1.2;
  letter-spacing: 0.01em;
}
.live__step[data-state="active"] .live__step-label {
  color: var(--ink);
  font-weight: 500;
}

.live__head {
  display: flex; align-items: flex-start; gap: 14px;
}
.live__dotpulse {
  margin-top: 6px;
}
.live__textcol {
  display: flex; flex-direction: column; gap: 4px;
  min-width: 0; flex: 1;
}
.live__label {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.live__sub {
  font-size: 13px;
  color: var(--ink-mute);
  line-height: 1.4;
  word-break: break-word;
}
.live__timing {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}
.live__elapsed {
  font-weight: 500;
  color: var(--ink-mute);
}
.live__dot {
  opacity: 0.5;
}
.live__retry {
  color: var(--accent);
  font-weight: 500;
}

.live__bar {
  height: 6px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}
.live__bar-fill {
  height: 100%;
  background: var(--accent);
  transition: width 400ms linear;
  border-radius: 3px;
}
.live__bar--retry .live__bar-fill {
  background: linear-gradient(90deg, var(--accent) 0%, rgba(239,107,107,0.5) 100%);
}

/* v15.3 — live progression renders inside error-state cards too when
   a retry is in flight. Slightly tighter padding inside the already-
   padded error box. */
.clip-section__err .live {
  padding: 14px 16px;
}

/* v15.2 — Retry button for failed rows in the compact batch view */
.batch__retry {
  grid-column: 1 / -1;
  margin-top: 8px;
  justify-self: start;
}
.batch__status[data-status="retrying"] {
  color: var(--accent); background: var(--accent-soft);
  border: 1px solid var(--accent-ring);
}

/* Transcript inside the card sits tighter (no double border) */
.clip-section .transcript {
  background: var(--bg-2);
  border: 1px solid var(--line);
}
.clip-section .transcript__body { max-height: 300px; }

/* v15.1 — Per-clip inline refine input at the bottom of each card */
.clip-refine {
  display: flex; flex-direction: column; gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.clip-refine__head {
  display: flex; flex-direction: column; gap: 2px;
}
.clip-refine__label {
  font-size: 13px; font-weight: 540; color: var(--ink);
}
.clip-refine__hint {
  font-size: 11.5px; color: var(--ink-dim);
}
.clip-refine__row {
  display: flex; gap: 10px; align-items: stretch;
}
.clip-refine__input {
  flex: 1;
  min-height: 44px; max-height: 140px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: inherit; font-size: 13.5px; line-height: 1.5;
  resize: vertical;
  outline: none;
  transition: border-color 150ms, box-shadow 150ms;
}
.clip-refine__input::placeholder { color: var(--ink-dim); }
.clip-refine__input:focus { border-color: var(--accent-ring); box-shadow: 0 0 0 3px var(--accent-soft); }
.clip-refine__input[disabled] { opacity: 0.6; cursor: not-allowed; }
.clip-refine__send {
  align-self: flex-end;
  height: 38px;
  padding: 0 14px;
  font-size: 13px;
}
.clip-refine__lastnote {
  font-size: 12px;
  color: var(--ink-mute);
  font-style: italic;
  padding: 6px 10px;
  border-left: 2px solid var(--accent-ring);
  background: var(--accent-soft);
  border-radius: 0 8px 8px 0;
}

@media (max-width: 640px) {
  .batch__nav { top: 4px; padding: 6px 8px; }
  .clip-section { padding: 20px 16px 18px; border-radius: 18px; }
  .clip-section__title { font-size: 20px; }
  .clip-refine__row { flex-direction: column; }
  .clip-refine__send { align-self: stretch; }
}

/* ──────────────── Error screen ──────────────── */
.errscreen {
  width: 100%; max-width: 520px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 16px;
}
.errscreen__ring {
  width: 56px; height: 56px; border-radius: 16px;
  display: grid; place-items: center;
  background: var(--error-soft); color: var(--error);
  border: 1px solid rgba(239,107,107,0.28);
}
.errscreen__title { font-size: 22px; letter-spacing: -0.02em; font-weight: 540; margin: 0; }
.errscreen__body {
  font-size: 15px; color: var(--ink); line-height: 1.55;
  text-align: center;
  font-weight: 500;
  margin-top: 4px;
}
/* v20.1 — platform-specific hint under the headline message. */
.errscreen__hint {
  font-size: 13.5px; color: var(--ink-mute); line-height: 1.55;
  text-align: center;
  max-width: 440px;
  margin: -6px 0 4px;
}
.errscreen__actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* v20.1 — collapsed technical details (raw error). Users rarely need
   the raw text; hide it by default and let operators click. */
.errscreen__details {
  margin-top: 18px;
  width: 100%;
  max-width: 520px;
  font-size: 12.5px;
}
.errscreen__details summary {
  cursor: pointer;
  color: var(--ink-mute);
  user-select: none;
  padding: 4px 0;
  text-align: center;
  list-style: none;
}
.errscreen__details summary::-webkit-details-marker { display: none; }
.errscreen__details summary:hover { color: var(--ink); }
.errscreen__raw {
  margin-top: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  color: var(--ink-mute);
  font-family: ui-monospace, SF Mono, Menlo, monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  text-align: left;
}

/* Spinner dots */
.dotpulse { display: inline-flex; gap: 3px; align-items: center; }
.dotpulse span {
  width: 4px; height: 4px; border-radius: 99px;
  background: currentColor;
  animation: dp 1.2s ease-in-out infinite;
}
.dotpulse span:nth-child(2) { animation-delay: .15s; }
.dotpulse span:nth-child(3) { animation-delay: .3s; }
@keyframes dp { 0%,80%,100%{opacity:.2}40%{opacity:1} }

/* Toast — errors that don't warrant a screen */
.toast {
  position: fixed; left: 50%; top: 24px; transform: translateX(-50%);
  z-index: 80;
  padding: 10px 16px; border-radius: 12px;
  background: var(--card-2); border: 1px solid var(--line-2);
  font-size: 13px; color: var(--ink);
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
  max-width: calc(100vw - 32px);
}
.toast[data-kind="error"] { color: var(--error); border-color: rgba(239,107,107,0.35); }

/* ──────────────── Responsive ──────────────── */
@media (max-width: 640px) {
  .hero__h { font-size: 36px; }
  .hero__wordmark { font-size: 44px; }
  .hero__mark { width: 104px; height: 104px; margin-bottom: 18px; }
  .hero__mark svg { width: 84px !important; height: 84px !important; }
  .picker { grid-template-columns: 1fr; max-width: 400px; }
  .pick { padding: 24px 16px 22px; }
  .pick__icon { width: 52px; height: 52px; }
  .card { padding: 20px 18px 16px; }
  .res__title, .batch__title { font-size: 24px; }
  .res { gap: 14px; }
  .think__row { grid-template-columns: 90px 1fr; gap: 10px; padding: 10px 12px; }
  .hook { grid-template-columns: 22px 18px 1fr auto auto; padding: 12px 14px; gap: 8px; }
  .hook__copy, .hook__refine, .hook__len { display: none; }
  .hook__refine-btn { padding: 5px 8px; font-size: 11px; }
  .hook__refine-btn span { display: none; }
  .hook__refine-btn svg { width: 14px; height: 14px; }
  .hook-refine__row { grid-template-columns: 1fr; gap: 8px; }
  .hook-refine__send, .hook-refine__cancel { justify-self: stretch; text-align: center; }
  .chat__input-row { flex-direction: column; gap: 8px; }
  .chat__send { align-self: stretch; }
  .stage { padding: 20px 16px 80px; }
  .topbar { padding: 14px 16px; }

  /* Drawer as bottom-sheet on mobile */
  .drawer { align-items: flex-end; }
  .drawer__sheet {
    width: 100%; max-width: 100%;
    height: 78vh; max-height: 78vh;
    border-left: 0;
    border-top: 1px solid var(--line-2);
    border-radius: 22px 22px 0 0;
  }
}

/* ──────────────── Reduced motion ──────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .pick:hover { transform: none; }
  .btn--primary:hover:not([disabled]) { transform: none; }
  .batch__row:hover { transform: none; }
}

/* ─── v23.3 — Site footer (legal links) ────────────────────────── */
.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 20px 14px;
  text-align: center;
  font-size: 11px;
  color: var(--ink-dim);
  background: linear-gradient(to top, rgba(10, 10, 11, 0.92) 50%, rgba(10, 10, 11, 0) 100%);
  pointer-events: none;
  z-index: 1;
}
.site-footer nav { pointer-events: auto; display: inline-flex; align-items: center; gap: 6px; }
.site-footer a {
  color: var(--ink-dim);
  text-decoration: none;
  padding: 4px 6px;
  border-radius: 3px;
  transition: color 140ms ease;
}
.site-footer a:hover { color: var(--ink); }
.site-footer a:focus-visible {
  outline: 1px solid var(--ink-dim);
  outline-offset: 1px;
}
.site-footer span { color: var(--ink-ghost); }

/* On the legal doc pages, the footer can be in-flow (not fixed). */
.doc-page + .site-footer {
  position: static;
  background: none;
  padding-top: 0;
}

@media (max-width: 560px) {
  .site-footer { font-size: 10.5px; padding-bottom: 10px; }
}
