/* =======================================================================
   SPOOFER — single-screen flow (drop → copies → Spoof).
   Ported from the design canvas (styles/spoofer.css) onto the production
   panel [data-mode-panel="video"]. Tokens come from styles/tokens.css; the
   --spoof family is the red accent everywhere in this panel.
   ======================================================================= */

.spf-panel { --spf-shell: 56px; }
.spf { display: flex; flex-direction: column; gap: var(--s-4); flex: 1 1 auto; min-height: 0; }
@media (min-width: 1000px) {
  .spf { height: calc(100vh - var(--spf-shell) - var(--s-5) * 2); min-height: 600px; }
}
/* Server activity + compare sit below the fixed-height box. */
.spf-panel > .queue-panel { margin-top: var(--s-5); }

/* ── head ─────────────────────────────────────────────────────────────── */
.spf-head.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; margin: 0; }
.spf-head .page-head-main { display: flex; flex-direction: column; gap: 0; }
.spf-head .page-title { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -0.02em; color: var(--fg-0); line-height: 1.1; }
.spf-head .page-sub { margin: 6px 0 0; color: var(--fg-2); font-size: 14px; max-width: none; text-wrap: pretty; }
.spf-head .wfx-trigger { margin-top: 10px; align-self: flex-start; }
.spf .cost-tag.spoof { background: var(--spoof-soft); border-color: color-mix(in srgb, var(--spoof) 20%, transparent); color: var(--spoof-text); }

.spf-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); gap: var(--s-5); flex: 1; min-height: 0; }
/* (RG-3) minmax(0, 1fr): a bare 1fr can't shrink below its content, which
   pushed the page 64 px sideways at 390. */
@media (max-width: 1000px) { .spf-body { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1440px) {
  body.wfx-rail-expanded .spf-body { grid-template-columns: minmax(0, 1fr); }
  body.wfx-rail-expanded .spf { height: auto; }
}
.spf-col { display: flex; flex-direction: column; gap: var(--s-3); min-height: 0; }
.spf-col.side { gap: var(--s-5); }
.spf-block { display: flex; flex-direction: column; gap: var(--s-3); }
.spf-step { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--fg-0); }
.spf-step .n {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 12px; color: var(--spoof-text);
  background: var(--spoof-soft); border: 1px solid color-mix(in srgb, var(--spoof) 35%, transparent); flex-shrink: 0;
}
.spf-step .hint { margin-left: auto; font-weight: 400; font-size: 12px; color: var(--fg-3); font-family: var(--font-mono); }

/* ── drop zone that becomes the queue ─────────────────────────────────── */
.spf-drop {
  flex: 1; min-height: 300px; display: flex; flex-direction: column;
  border: 1.5px dashed var(--line-3); border-radius: var(--r-xl); background: var(--bg-2);
  position: relative; overflow: hidden;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.spf-drop.empty { cursor: pointer; justify-content: center; align-items: center; text-align: center; padding: var(--s-6); }
/* (RG-5) This drop area also carries the .empty primitive's class; keep its
   own fill, spacing and type now that .empty is transparent (hr.css). */
.spf-drop.empty { background: var(--bg-2); gap: 0; color: var(--fg-3); font-size: 13px; }
.spf-drop.empty:hover { border-color: var(--fg-3); background: var(--bg-3); }
.spf-drop.dragover {
  border-color: var(--spoof); border-style: solid;
  background: radial-gradient(ellipse 60% 50% at 50% 40%, var(--spoof-soft), var(--bg-2) 100%);
}
.spf-drop:focus-visible { outline: 2px solid var(--spoof-bright); outline-offset: 3px; }
.spf-drop-empty { display: flex; flex-direction: column; align-items: center; }
.spf-drop-icon {
  width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center;
  background: var(--spoof-soft); border: 1px solid color-mix(in srgb, var(--spoof) 30%, transparent); color: var(--spoof-text);
  margin-bottom: var(--s-4); transition: transform 0.25s var(--ease);
}
.spf-drop.empty:hover .spf-drop-icon, .spf-drop.dragover .spf-drop-icon { transform: translateY(-4px) scale(1.06); }
.spf-drop-title { font-size: 22px; font-weight: 600; letter-spacing: -0.015em; color: var(--fg-0); }
.spf-drop-sub { margin-top: 6px; font-size: 15px; color: var(--fg-2); }
.spf-drop-sub .link { color: var(--spoof-text); text-decoration: underline; text-underline-offset: 3px; }
.spf-drop-meta { margin-top: var(--s-4); font-family: var(--font-mono); font-size: 12px; color: var(--fg-3); }
.spf-queue { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.spf-tiles {
  flex: 1; min-height: 0; overflow: auto; padding: var(--s-4);
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; align-content: start;
}
.spf-tile {
  position: relative; border-radius: var(--r-md); overflow: hidden;
  background: var(--bg-3); border: 1px solid var(--line-1); transition: border-color 0.2s var(--ease);
}
.spf-tile:hover { border-color: var(--line-3); }
.spf-tile .thumb { position: relative; aspect-ratio: 1 / 1; background: var(--bg-1); }
.spf-tile .thumb > img, .spf-tile .thumb > video { display: block; width: 100%; height: 100%; object-fit: cover; }
.spf-tile .play-overlay {
  position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255, 255, 255, 0.85);
  pointer-events: none; filter: drop-shadow(0 2px 8px color-mix(in srgb, var(--shadow-ink) 60%, transparent));
}
.spf-tile .ttl { display: block; padding: 8px 10px 9px; font-size: 12px; color: var(--fg-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spf-tile .kind {
  position: absolute; bottom: 8px; left: 8px; z-index: 2; display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px; border-radius: 5px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--fg-1); background: rgba(8, 8, 11, 0.7); border: 1px solid rgba(255, 255, 255, 0.1);
}
.spf-tile .spoofed-badge {
  position: absolute; top: 8px; left: 8px; z-index: 2; padding: 3px 7px; border-radius: 5px;
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--spoof-bright); background: rgba(80, 15, 20, 0.7); border: 1px solid color-mix(in srgb, var(--spoof) 35%, transparent);
  backdrop-filter: blur(4px);
}
.spf-tile .duration {
  position: absolute; bottom: 8px; right: 8px; z-index: 2; padding: 2px 6px; border-radius: 5px;
  font-family: var(--font-mono); font-size: 10px; color: var(--fg-1); background: rgba(8, 8, 11, 0.7); border: 1px solid rgba(255, 255, 255, 0.1);
}
.spf-tile .rm {
  position: absolute; top: 6px; right: 6px; z-index: 3; width: 26px; height: 26px; border-radius: 50%;
  background: rgba(8, 8, 11, 0.78); border: 1px solid var(--line-3); color: var(--fg-1);
  display: grid; place-items: center; opacity: 0; cursor: pointer; padding: 0; transition: all 0.15s var(--ease);
}
.spf-tile:hover .rm, .spf-tile .rm:focus-visible { opacity: 1; }
.spf-tile .rm:hover { background: var(--spoof); border-color: var(--spoof); color: #fff; }
.spf-add {
  border: 1.5px dashed var(--line-3); border-radius: var(--r-md); background: transparent; color: var(--fg-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  min-height: 150px; font-size: 13px; font-weight: 500; font-family: inherit; transition: all 0.2s var(--ease);
}
.spf-add:hover { border-color: var(--spoof); color: var(--spoof-text); background: var(--spoof-soft); }
.spf-add .plus { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-3); border: 1px solid var(--line-2); }
.spf-add:hover .plus { border-color: color-mix(in srgb, var(--spoof) 40%, transparent); }
.spf-drop-foot {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  padding: 10px var(--s-4); border-top: 1px solid var(--line-1); font-size: 13px; color: var(--fg-2); background: var(--bg-2);
}
.spf-drop-foot strong { color: var(--fg-0); }
.spf-drop-hint {
  position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; pointer-events: none;
  background: color-mix(in srgb, var(--bg-1) 70%, transparent); backdrop-filter: blur(3px);
  font-size: 18px; font-weight: 600; color: var(--fg-0); opacity: 0; transition: opacity 0.15s;
}
.spf-drop.dragover .spf-drop-hint { opacity: 1; }
.spf-drop.empty .spf-drop-hint { display: none; }

/* ── copies pills ─────────────────────────────────────────────────────── */
.spf-pills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.spf-pill {
  position: relative; appearance: none; border: 1px solid var(--line-2); background: var(--bg-3); border-radius: var(--r-lg);
  padding: 20px 8px 16px; text-align: center; cursor: pointer; color: var(--fg-2);
  display: flex; flex-direction: column; align-items: center; gap: 4px; font-family: inherit;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.spf-pill:hover { transform: translateY(-2px); border-color: var(--line-3); background: var(--bg-4); }
.spf-pill:active { transform: scale(0.97); }
.spf-pill:focus-visible { outline: 2px solid var(--spoof-bright); outline-offset: 3px; }
.spf-pill .n { font-size: 40px; font-weight: 700; letter-spacing: -0.045em; line-height: 1; color: var(--fg-1); font-variant-numeric: tabular-nums; display: inline-flex; align-items: baseline; }
.spf-pill .n .x { font-size: 20px; font-weight: 500; color: var(--fg-3); margin-right: 1px; letter-spacing: 0; }
.spf-pill .l { font-size: 12px; color: var(--fg-3); }
.spf-pill.on {
  border-color: var(--spoof);
  background: linear-gradient(180deg, color-mix(in srgb, var(--spoof) 20%, transparent), color-mix(in srgb, var(--spoof) 5%, transparent));
  box-shadow: 0 0 0 1px var(--spoof) inset, 0 16px 36px -16px color-mix(in srgb, var(--spoof) 70%, transparent);
}
.spf-pill.on .n { color: var(--fg-0); } /* (RG-5) on a translucent wash, not a red fill */
.spf-pill.on .n .x, .spf-pill.on .l { color: var(--spoof-text); }
/* (RG-5) In light the red wash lowers --spoof-text to 4:1; a slightly inkier
   red reads 5.3:1 and stays red. */
html[data-theme="light"] .spf-pill.on .n .x,
html[data-theme="light"] .spf-pill.on .l { color: color-mix(in srgb, var(--spoof-text) 80%, var(--fg-0)); }
.spf-pill .tick {
  position: absolute; top: 8px; right: 8px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--spoof); color: var(--on-accent); display: grid; place-items: center;
  opacity: 0; transform: scale(0.5); transition: all 0.2s var(--ease);
}
.spf-pill.on .tick { opacity: 1; transform: scale(1); }
.spf-pills-note { margin: 0; font-size: 13.5px; color: var(--fg-2); line-height: 1.5; text-wrap: pretty; }
.spf-pills-note strong { color: var(--fg-0); }
.spf-pills-note .custom {
  font-family: var(--font-mono); font-size: 11px; color: var(--spoof-text); background: var(--spoof-soft);
  border: 1px solid color-mix(in srgb, var(--spoof) 25%, transparent); border-radius: 5px; padding: 1px 6px; margin-left: 6px;
}

/* ── the one button ───────────────────────────────────────────────────── */
.spf-go {
  width: 100%; height: 66px; border-radius: var(--r-lg); border: 0;
  background: linear-gradient(180deg, var(--spoof-bright), var(--spoof)); color: var(--on-accent);
  font-size: 20px; font-weight: 600; letter-spacing: -0.01em; font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--fg-0) 14%, transparent) inset, 0 18px 44px -14px color-mix(in srgb, var(--spoof) 75%, transparent);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), filter 0.2s var(--ease);
}
.spf-go:hover { transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 0 0 1px color-mix(in srgb, var(--fg-0) 18%, transparent) inset, 0 24px 50px -14px color-mix(in srgb, var(--spoof) 85%, transparent); }
.spf-go:active { transform: translateY(0); }
.spf-go:focus-visible { outline: 2px solid var(--fg-0); outline-offset: 3px; }
.spf-go[disabled] { cursor: not-allowed; transform: none; filter: none; background: var(--bg-3); color: var(--fg-3); box-shadow: 0 0 0 1px var(--line-2) inset; }
.spf-go.warn { background: var(--bg-3); color: var(--fg-0); box-shadow: 0 0 0 1px var(--line-3) inset; }
.spf-go.warn:hover { filter: none; background: var(--bg-4); }
.spf-go.warn .spf-go-ic { display: none; }
.spf-go .btn-spinner {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--fg-0) 35%, transparent); border-top-color: var(--on-accent);
  animation: spfSpin 0.8s linear infinite;
}
@keyframes spfSpin { to { transform: rotate(360deg); } }
.spf-go-sub {
  display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 12px; color: var(--fg-3); text-align: center; min-height: 18px;
}
.spf-go-sub strong { color: var(--fg-1); font-weight: 500; }
.spf-go-sub .bad { color: var(--spoof-text); }
.spf-go-sub .sep { color: var(--fg-4); }

/* run + done states share the button slot */
.spf-run {
  border: 1px solid var(--line-2); border-radius: var(--r-lg); background: var(--bg-2);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; min-height: 66px; justify-content: center;
}
.spf-run-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; color: var(--fg-0); font-weight: 600; }
.spf-run-head strong { display: flex; align-items: center; gap: 8px; }
.spf-run-head strong::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--spoof); box-shadow: 0 0 8px var(--spoof);
  animation: spfPulse 1.2s ease-in-out infinite;
}
@keyframes spfPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.8); } }
.spf-run-head .cnt { color: var(--fg-3); font-family: var(--font-mono); font-weight: 400; font-size: 12px; }
.spf-waiting { display: flex; flex-direction: column; gap: 2px; }
.spf-waiting strong { font-size: 13px; color: var(--fg-1); }
.spf-waiting .desc { font-size: 12px; color: var(--fg-3); }
.spf-run .progress-track { height: 6px; border-radius: 3px; background: var(--bg-1); overflow: hidden; position: relative; }
.spf-run .progress-fill.spoof { background: linear-gradient(90deg, var(--spoof-deep), var(--spoof-bright)); box-shadow: 0 0 12px var(--spoof-glow); }
.spf-run .progress-list { margin-top: 4px; max-height: 180px; overflow: auto; }
.spf-run.done { border-color: color-mix(in srgb, var(--green) 40%, transparent); background: linear-gradient(180deg, color-mix(in srgb, var(--green) 8%, transparent), var(--bg-2) 70%); }
.spf-run-ok { display: flex; align-items: center; gap: 8px; min-width: 0; }
.spf-run.done .ok { width: 22px; height: 22px; border-radius: 50%; background: var(--green); color: var(--on-green); display: grid; place-items: center; flex-shrink: 0; }
.spf-run-acts { display: flex; gap: 8px; }
.spf-run-acts .btn { flex: 1; }
.spf .btn-spoof, .spf-drawer .btn-spoof {
  background: var(--spoof); border-color: transparent; color: var(--on-accent); font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--spoof) 40%, transparent) inset, 0 8px 24px -8px color-mix(in srgb, var(--spoof) 50%, transparent);
}
.spf .btn-spoof:hover, .spf-drawer .btn-spoof:hover { background: var(--spoof-bright); transform: translateY(-1px); }

/* status line + queue notice under the slot */
.spf .status { margin: 0; }
.spf .queue-notice {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap;
  padding: 10px 14px; background: var(--bg-2); border: 1px solid var(--line-2); border-left: 3px solid var(--spoof);
  border-radius: var(--r-md); font-size: 13px; color: var(--fg-1);
}
.spf .queue-notice-actions { display: flex; gap: 6px; }

/* ── "More options" row + drawer ──────────────────────────────────────── */
.spf-more {
  margin-top: auto; display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px;
  border-radius: var(--r-md); background: transparent; border: 1px solid var(--line-1); color: var(--fg-2);
  cursor: pointer; text-align: left; font-size: 13px; font-family: inherit; transition: all 0.2s var(--ease);
}
.spf-more:hover { background: var(--bg-3); border-color: var(--line-2); color: var(--fg-0); }
.spf-more .ic { color: var(--fg-3); display: inline-flex; }
.spf-more .t { font-weight: 600; color: var(--fg-1); white-space: nowrap; }
.spf-more .s { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--fg-3); font-size: 12px; }
.spf-more .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--spoof); box-shadow: 0 0 8px var(--spoof-glow); flex-shrink: 0; }
.spf-more .chev { flex-shrink: 0; color: var(--fg-3); }
@media (max-width: 1000px) { .spf-more { margin-top: var(--s-2); } }
@keyframes spfFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes spfSlide { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.spf-drawer-backdrop { position: fixed; inset: 0; background: color-mix(in srgb, var(--scrim-ink) 55%, transparent); z-index: 80; animation: spfFade 0.2s var(--ease); }
.spf-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100vw); background: var(--bg-2);
  border-left: 1px solid var(--line-2); z-index: 81; display: flex; flex-direction: column;
  box-shadow: -30px 0 80px color-mix(in srgb, var(--shadow-ink) 60%, transparent); animation: spfSlide 0.25s var(--ease-out);
}
body.spf-drawer-open { overflow: hidden; }
.spf-drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line-1); }
.spf-drawer-head h2 { margin: 0; font-size: 16px; font-weight: 600; color: var(--fg-0); }
.spf-drawer-head p { margin: 4px 0 0; font-size: 12.5px; color: var(--fg-3); }
/* (RG-5) The close button uses the shared .icon-btn (shell.css). */
.spf-drawer-body { flex: 1; overflow: auto; padding: var(--s-4) 20px var(--s-6); display: flex; flex-direction: column; gap: var(--s-5); }
.spf-opt { display: flex; flex-direction: column; gap: 10px; }
.spf-opt-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.spf-opt h3 { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--fg-0); display: flex; align-items: center; gap: 8px; }
.spf-opt h3 .num-badge {
  font-family: var(--font-mono); font-size: 11px; background: var(--spoof-soft); border: 1px solid color-mix(in srgb, var(--spoof) 30%, transparent);
  color: var(--spoof-text); padding: 1px 7px; border-radius: 5px; font-weight: 500;
}
.spf-opt .desc { font-size: 12.5px; color: var(--fg-3); margin: 0; line-height: 1.5; }
.spf-opt .cap-warn { color: var(--amber-text); }
.spf-quick { display: flex; gap: 4px; flex-wrap: wrap; }
.spf-exact { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--fg-2); }
.spf-num { width: 88px; height: 40px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--bg-1); color: var(--fg-0); font-family: var(--font-mono); font-size: 15px; text-align: center; }
.spf-num:focus-visible { outline: 2px solid var(--spoof-bright); outline-offset: 2px; }
.spf-switches { display: flex; flex-direction: column; gap: 8px; }
.spf-switch {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px;
  border: 1px solid var(--line-1); border-radius: var(--r-md); background: var(--bg-3); cursor: pointer; transition: border-color 0.2s;
}
.spf-switch:hover { border-color: var(--line-3); }
.spf-switch .txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.spf-switch .lbl { font-size: 13px; color: var(--fg-1); font-weight: 500; }
.spf-switch .sub { font-size: 11.5px; color: var(--fg-3); }
.spf-switch input { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); pointer-events: none; }
.spf-switch { position: relative; }
.tgl { width: 36px; height: 20px; border-radius: 999px; background: var(--bg-4); border: 1px solid var(--line-3); position: relative; flex-shrink: 0; transition: all 0.2s var(--ease); }
.tgl::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--fg-2); transition: all 0.2s var(--ease); }
.spf-switch input:checked + .tgl { background: var(--spoof); border-color: var(--spoof); }
.spf-switch input:checked + .tgl::after { left: 18px; background: var(--on-accent); }
.spf-switch input:focus-visible + .tgl { outline: 2px solid var(--spoof-bright); outline-offset: 2px; }
.spf-layer { display: flex; flex-direction: column; gap: 10px; padding: 2px 0 6px 12px; border-left: 2px solid var(--line-2); }
.spf-text { width: 100%; resize: vertical; min-height: 56px; padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--bg-1); color: var(--fg-0); font-family: inherit; font-size: 13px; line-height: 1.45; box-sizing: border-box; }
.spf-text:focus-visible { outline: 2px solid var(--spoof-bright); outline-offset: 2px; }
.spf-drawer .chip-grid { grid-template-columns: repeat(2, 1fr); }
.spf-drawer .chip.active { border-color: var(--spoof); background: var(--spoof-soft); }
.spf-drawer .chip.active .chip-dot { background: var(--spoof); border-color: var(--spoof); }
.spf-drawer .seg-btn.active { background: var(--spoof); color: var(--on-accent); }
.spf-drawer-foot { padding: 14px 20px; border-top: 1px solid var(--line-1); display: flex; gap: 8px; justify-content: space-between; align-items: center; }

/* (DR-1503/DR-1504) Caption option rows + the 9:16 preview stage, inside the drawer. */
.cap-rows { display: flex; flex-direction: column; gap: 8px; }
.cap-field { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cap-lbl { flex: none; width: 62px; font-size: 11px; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; color: var(--fg-3); }
.cap-opts { display: flex; gap: 6px; flex-wrap: wrap; }
.cap-opts button {
  font: inherit; font-size: 12.5px; color: var(--fg-2); background: var(--bg-3); border: 1px solid var(--line-2); border-radius: 999px;
  padding: 5px 12px; cursor: pointer; transition: border-color 120ms var(--ease), background 120ms var(--ease), color 120ms var(--ease);
}
.cap-opts button:hover { border-color: var(--line-3); }
.cap-opts button.selected { border-color: var(--spoof); color: var(--fg-0); background: var(--spoof-soft); }
.cap-colors button { width: 26px; height: 26px; padding: 0; border-radius: 999px; background: var(--sw); border: 2px solid var(--line-2); }
.cap-colors button.selected { border-color: var(--spoof); box-shadow: 0 0 0 3px var(--spoof-soft); }
.cap-preview {
  width: 150px; aspect-ratio: 9 / 16; align-self: center; border-radius: var(--r-md); border: 1px solid var(--line-2);
  background: linear-gradient(160deg, var(--bg-4) 0%, var(--bg-4) 60%, var(--bg-2) 100%); position: relative; overflow: hidden;
}
.cap-preview-text { position: absolute; left: 50%; transform: translateX(-50%); max-width: 92%; text-align: center; line-height: 1.28; overflow-wrap: break-word; word-break: break-word; }
.cap-preview-text.is-pill { padding: 4px 10px; border-radius: 10px; }

/* ── Server activity (collapsed disclosure) ───────────────────────────── */
.spf-panel .queue-toggle {
  width: 100%; margin: 0; padding: 0; background: transparent; border: 0; color: inherit; font: inherit; cursor: pointer; text-align: left;
  display: flex; align-items: center; justify-content: flex-start; gap: 10px;
}
.spf-panel .queue-toggle .chev { flex: none; color: var(--spoof-text); transition: transform 160ms var(--ease); }
.spf-panel .queue-toggle.is-open .chev { transform: rotate(90deg); }
.spf-panel .queue-toggle #queueSummary { flex: 1 1 auto; text-align: right; }
.spf-panel .queue-toggle:focus-visible { outline: 2px solid var(--spoof-bright); outline-offset: 4px; border-radius: var(--r-sm); }
.spf-panel .queue-list:not([hidden]) { margin-top: var(--s-4); }
/* Compare view with no pinned originals (older resume): outputs only. */
.spf-panel .spf-compare.spf-cmp-outputs-only { grid-template-columns: 1fr; }

@media (max-width: 640px) {
  .spf-head h1 { font-size: 22px; }
  .spf-drop { min-height: 240px; }
  .spf-drop.empty { padding: var(--s-5) var(--s-4); }
  .spf-drop-title { font-size: 18px; }
  .spf-pill { padding: 14px 6px 12px; }
  .spf-pill .n { font-size: 32px; }
  .spf-go { height: 60px; font-size: 18px; }
  .spf-panel .queue-toggle #queueSummary { width: 100%; text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  .spf-drawer, .spf-drawer-backdrop, .spf-pill, .spf-go, .spf-drop-icon { animation: none; transition: none; }
  .spf-run-head strong::before { animation: none; }
}
