/* Kino: a light studio in the same family as jamesliuzx.com. Warm paper, ink,
   one violet accent with a cyan partner, Instrument Serif headings with an
   italic accent, small mono labels, grain and slow glows. Media gets the room. */

@font-face { font-family: "Inter"; src: url("../fonts/inter-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("../fonts/instrument-serif.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("../fonts/instrument-serif-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono-latin.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
  --paper: #faf8f4;
  --paper-2: #f3efe7;
  --paper-3: #ebe6dc;
  --surface: #ffffff;
  --ink: #15131a;
  --ink-2: #2b2832;
  --muted: #6c6875;
  --faint: #9b97a3;
  --line: rgba(21, 19, 26, 0.08);
  --line-2: rgba(21, 19, 26, 0.14);
  --line-3: rgba(21, 19, 26, 0.22);
  --accent: #6345e5;
  --accent-deep: #4b31c4;
  --accent-soft: rgba(99, 69, 229, 0.09);
  --accent-line: rgba(99, 69, 229, 0.34);
  --accent-2: #0da2e7;
  --accent-grad: linear-gradient(120deg, #6345e5 0%, #7b5cf0 40%, #0da2e7 100%);
  --ok: #138a5b;
  --ok-soft: rgba(19, 138, 91, 0.1);
  --warn: #b26e0c;
  --warn-soft: rgba(201, 138, 12, 0.12);
  --bad: #cf3e3e;
  --bad-soft: rgba(207, 62, 62, 0.09);
  --radius: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-soft: 0 1px 2px rgba(21, 19, 26, 0.04), 0 10px 30px -14px rgba(21, 19, 26, 0.16);
  --shadow-lift: 0 2px 6px rgba(21, 19, 26, 0.05), 0 28px 60px -26px rgba(21, 19, 26, 0.32);
  --shadow-pop: 0 18px 50px -12px rgba(21, 19, 26, 0.22), 0 0 0 1px var(--line);
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-display: "Instrument Serif", "Iowan Old Style", Georgia, "Songti SC", "Noto Serif SC", serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --top: 64px;
  --grain: url("data:image/svg+xml,%3Csvg viewBox='0 0 240 240' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 14.5px/1.55 var(--font-sans);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.5; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.015em; }
h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(34px, 4.2vw, 48px); line-height: 1.04; letter-spacing: -0.02em; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0; }
em { font-style: italic; }
img, video { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
::selection { background: rgba(99, 69, 229, 0.18); }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: rgba(21, 19, 26, 0.12); border-radius: 10px; border: 3px solid var(--paper); }
::-webkit-scrollbar-track { background: transparent; }

.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.center { text-align: center; }
.error { color: var(--bad); }
.warn { color: var(--warn); }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.row.center { justify-content: center; }
.grow { flex: 1; }
.spacer { flex: 1; }
.serif { font-family: var(--font-display); font-weight: 400; }
.serif-accent, h1 em, .display em { font-family: var(--font-display); font-style: italic; font-weight: 400; color: var(--accent); padding-right: 0.04em; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 500 11px/1 var(--font-mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.mono { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.02em; }

/* ------------------------------------------------------------ motion */
@keyframes rise { from { opacity: 0; transform: translate3d(0, var(--rise, 14px), 0); } }
@keyframes fade { from { opacity: 0; } }
@keyframes mask-up { from { transform: translate3d(0, 105%, 0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: 0.45; } }
@keyframes pulse-ring { 0% { transform: scale(1); opacity: 0.7; } 80%, 100% { transform: scale(2.6); opacity: 0; } }
@keyframes drift { 0%, 100% { transform: translate3d(0, 0, 0) scale(1); } 33% { transform: translate3d(4%, -3%, 0) scale(1.06); } 66% { transform: translate3d(-3%, 4%, 0) scale(0.96); } }
@keyframes shimmer { from { background-position: 160% 0; } to { background-position: -60% 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(0.985); } }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.rise { animation: rise 0.7s var(--ease) both; animation-delay: var(--d, 0s); }
.fade-in { animation: fade 0.6s var(--ease) both; animation-delay: var(--d, 0s); }
.words { display: inline; }
.word { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.word > span { display: inline-block; animation: mask-up 0.9s var(--ease) both; animation-delay: var(--d, 0s); }

/* Fine grain over hero surfaces; skipped on phones (invisible there, costs a paint). */
.grain { position: relative; isolation: isolate; }
.grain::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1; opacity: 0.045; background-image: var(--grain); mix-blend-mode: multiply; }
.orb { position: absolute; border-radius: 50%; filter: blur(90px); pointer-events: none; animation: drift 26s ease-in-out infinite; }
.orb.violet { background: rgba(99, 69, 229, 0.22); }
.orb.cyan { background: rgba(13, 162, 231, 0.16); animation-duration: 34s; animation-direction: reverse; }
.orb.warm { background: rgba(240, 168, 96, 0.16); animation-duration: 40s; }
.spotlight { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(520px circle at var(--sx, 50%) var(--sy, 30%), rgba(99, 69, 229, 0.08), transparent 65%); transition: background 0.1s; }
.grid-lines { position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(rgba(21, 19, 26, 0.09) 1px, transparent 1px); background-size: 22px 22px; -webkit-mask-image: linear-gradient(180deg, #000 10%, transparent 85%); mask-image: linear-gradient(180deg, #000 10%, transparent 85%); }

::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.26s; animation-timing-function: var(--ease); }

/* ------------------------------------------------------------ shell */
#app { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-rows: var(--top) 1fr; }
.booting, .fatal { grid-row: 1 / -1; display: grid; place-items: center; min-height: 100dvh; }
.fatal { place-content: center; gap: 10px; text-align: center; padding: 24px; }

.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark { position: relative; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: var(--paper); font: italic 400 20px/1 var(--font-display); padding-bottom: 2px; transition: transform 0.5s var(--ease); }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.05); }
.brand-mark.big { width: 64px; height: 64px; font-size: 38px; }
.booting .brand-mark { animation: pulse 1.2s ease-in-out infinite; }
.brand-word { font: 400 24px/1 var(--font-display); letter-spacing: -0.01em; }
.brand-word small { margin-left: 6px; font: 500 10px/1 var(--font-mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--faint); vertical-align: 3px; }

.topbar {
  position: sticky; top: 0; z-index: 50; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  height: var(--top); padding: 0 20px; background: rgba(250, 248, 244, 0.82); backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid transparent; transition: border-color 0.3s, background 0.3s;
}
.topbar.scrolled { border-bottom-color: var(--line); background: rgba(250, 248, 244, 0.94); }
.top-left, .top-right { display: flex; align-items: center; gap: 10px; }
.top-right { justify-content: flex-end; }
.nav { display: flex; gap: 2px; padding: 4px; border-radius: 999px; background: rgba(21, 19, 26, 0.035); }
.nav-link { position: relative; display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 16px; border-radius: 999px; color: var(--muted); font-weight: 500; transition: color 0.2s, background 0.25s var(--ease); }
.nav-link .icon { width: 16px; height: 16px; }
.nav-link:hover { color: var(--ink); }
.nav-link.active { color: var(--ink); background: var(--surface); box-shadow: 0 1px 2px rgba(21, 19, 26, 0.06), 0 0 0 1px var(--line); }

.mode-toggle { position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 999px; background: rgba(21, 19, 26, 0.05); border: 1px solid var(--line); }
.mode-toggle button { position: relative; z-index: 1; height: 28px; padding: 0 12px; border: 0; background: transparent; border-radius: 999px; font: 500 12px/1 var(--font-sans); color: var(--muted); transition: color 0.25s; }
.mode-toggle button.on { color: var(--ink); }
.mode-toggle .thumb { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 999px; background: var(--surface); box-shadow: 0 1px 2px rgba(21, 19, 26, 0.08), 0 0 0 1px var(--line); transition: transform 0.45s var(--ease); }
.mode-toggle.is-advanced .thumb { transform: translateX(100%); }

.status-pill { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 12.5px; color: var(--muted); white-space: nowrap; transition: border-color 0.2s; }
.status-pill:hover { border-color: var(--line-3); color: var(--ink); }
.dot { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.ok { background: #22b07a; }
.dot.warn { background: #e2a33b; }
.dot.bad { background: var(--bad); }
.dot.live::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit; animation: pulse-ring 2.4s ease-out infinite; }

.activity-btn { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px 0 6px; border-radius: 999px; border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--accent-deep); font-size: 12.5px; font-weight: 600; animation: pop 0.3s var(--ease); }
.activity-btn .ring { width: 22px; height: 22px; }
.activity-btn .ring-track { stroke: rgba(99, 69, 229, 0.18); }

.view { position: relative; min-width: 0; }
.view[data-view="studio"] { height: calc(100dvh - var(--top)); overflow: hidden; }
.bottom-nav { display: none; }

/* ------------------------------------------------------------ controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px;
  border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 550; white-space: nowrap;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.25s var(--ease), transform 0.15s;
}
.btn:hover:not(:disabled) { border-color: var(--line-3); box-shadow: var(--shadow-soft); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.primary:hover:not(:disabled) { background: #000; box-shadow: 0 10px 26px -12px rgba(21, 19, 26, 0.55); }
.btn.accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.accent:hover:not(:disabled) { background: var(--accent-deep); box-shadow: 0 12px 28px -12px rgba(99, 69, 229, 0.7); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover:not(:disabled) { color: var(--ink); background: rgba(21, 19, 26, 0.05); box-shadow: none; }
.btn.danger { color: var(--bad); border-color: rgba(207, 62, 62, 0.3); background: var(--bad-soft); }
.btn.small { height: 32px; padding: 0 13px; font-size: 13px; }
.btn.large { height: 52px; padding: 0 26px; font-size: 15.5px; }
.btn.block { width: 100%; }
.btn .icon { width: 17px; height: 17px; }
.btn.busy, .chip.busy, .icon-btn.busy, .dropzone.busy, .make-btn.busy, .generate.busy { position: relative; pointer-events: none; opacity: 0.8; }
.btn.busy::after, .icon-btn.busy::after { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite; }

.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); flex: none; transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.icon-btn:hover { border-color: var(--line-3); }
.icon-btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.icon-btn.ghost:hover { color: var(--ink); background: rgba(21, 19, 26, 0.05); }
.icon-btn.small { width: 32px; height: 32px; }
.icon-btn.danger:hover { color: var(--bad); border-color: rgba(207, 62, 62, 0.35); }
.icon-btn.busy .icon { opacity: 0; }
.icon-btn.busy::after { position: absolute; }

.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface); font-size: 13px; font-weight: 500; white-space: nowrap; color: var(--ink-2);
  transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
}
.chip:hover { border-color: var(--line-3); }
.chip .icon { width: 15px; height: 15px; color: var(--muted); }
.chip.small { height: 28px; padding: 0 10px; font-size: 12px; gap: 5px; }
.chip.small .icon { width: 13px; height: 13px; }
.chip.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.chip.ghost:hover { background: rgba(21, 19, 26, 0.05); color: var(--ink); }
.chip.toggle.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-deep); }
.chip.toggle.on .icon { color: var(--accent); }
.chip .muted { margin-right: -3px; }
.swatch { width: 16px; height: 16px; border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(21, 19, 26, 0.12); }
.aspect-glyph { display: inline-block; border: 1.6px solid currentColor; border-radius: 3px; }

.input {
  width: 100%; height: 42px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface);
  transition: border-color 0.2s, box-shadow 0.2s;
}
textarea.input { height: auto; padding: 11px 14px; resize: vertical; line-height: 1.5; }
.input:hover { border-color: var(--line-3); }
.input:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 4px rgba(99, 69, 229, 0.1); }
.input::placeholder { color: var(--faint); }
.input.small { height: 32px; width: auto; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.field { display: grid; gap: 7px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field.inline { display: flex; align-items: center; gap: 8px; }
.field.compact { gap: 4px; }
.fields { display: grid; gap: 14px; margin: 16px 0; }
.input-wrap { position: relative; }
.input-wrap .flag { position: absolute; right: 10px; top: 11px; }
.flag .icon { width: 16px; height: 16px; }
.flag.bad { color: var(--bad); }
.flag.warn { color: var(--warn); }
input[type="range"] { width: 100%; accent-color: var(--accent); }
input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }

.tabs { display: flex; gap: 2px; padding: 4px; background: rgba(21, 19, 26, 0.04); border-radius: 999px; width: fit-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { height: 32px; padding: 0 15px; border-radius: 999px; border: 0; background: transparent; color: var(--muted); font-weight: 500; white-space: nowrap; transition: color 0.2s, background 0.2s; }
.tab:hover { color: var(--ink); }
.tab.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(21, 19, 26, 0.06), 0 0 0 1px var(--line); }
.tabs.small .tab { height: 28px; font-size: 13px; padding: 0 12px; }

.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: rgba(21, 19, 26, 0.045); }
.segmented button { border: 0; background: transparent; color: var(--muted); height: 32px; padding: 0 15px; border-radius: 999px; font-weight: 500; transition: color 0.2s, background 0.2s; }
.segmented button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(21, 19, 26, 0.07), 0 0 0 1px var(--line); }
.segmented.small button { height: 26px; padding: 0 11px; font-size: 12px; }

.pill { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 999px; background: rgba(21, 19, 26, 0.05); color: var(--muted); font-size: 12px; font-weight: 550; white-space: nowrap; }
.pill .icon { width: 13px; height: 13px; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.busy { background: var(--accent-soft); color: var(--accent-deep); }
.pill.busy::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1s infinite; }
.pill.small { height: 20px; font-size: 11px; padding: 0 8px; }
.pill.mono { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; }

.link { color: var(--accent); background: none; border: 0; padding: 0; font-weight: 550; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; transition: text-decoration-color 0.2s; }
.link:hover { text-decoration-color: currentColor; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: 0 1px 2px rgba(21, 19, 26, 0.03); }

/* ------------------------------------------------------------ toasts, popovers, sheets */
.toasts { position: fixed; z-index: 95; right: 18px; bottom: 18px; display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 11px 10px 11px 14px; border-radius: 16px; background: var(--ink); color: #f4f2ee;
  box-shadow: 0 20px 50px -18px rgba(21, 19, 26, 0.6); animation: rise 0.35s var(--ease) both; --rise: 10px; font-size: 13.5px;
}
.toast span { flex: 1; }
.toast .icon { color: #b9b4c4; }
.toast.error .icon:first-child { color: #ff8a8a; }
.toast.ok .icon:first-child { color: #6be0a9; }
.toast.info .icon:first-child { color: #b6a6ff; }
.toast .link { color: #c9bcff; }
.toast .icon-btn.ghost { color: #b9b4c4; }
.toast .icon-btn.ghost:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.toast.leaving { opacity: 0; transform: translateY(6px); transition: 0.18s; }

.popover {
  position: fixed; z-index: 80; min-width: 220px; max-width: min(560px, calc(100vw - 16px)); max-height: min(72vh, 600px); overflow: auto;
  padding: 10px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-pop); animation: pop 0.2s var(--ease);
}
.menu { display: grid; gap: 2px; min-width: 240px; }
.menu-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; border: 0; background: transparent; text-align: left; }
.menu-item:hover { background: var(--paper); }
.menu-item.selected { background: var(--accent-soft); }
.menu-item span { display: grid; flex: 1; }
.menu-item small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.menu-item .icon { color: var(--muted); }
.menu-item.selected .icon { color: var(--accent); }

.aspect-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; width: 330px; }
.aspect-opt { display: grid; justify-items: center; gap: 3px; padding: 12px 6px 10px; border-radius: 14px; border: 1px solid transparent; background: var(--paper); }
.aspect-opt:hover { border-color: var(--line-2); }
.aspect-opt.selected { border-color: var(--accent-line); background: var(--accent-soft); }
.aspect-box { height: 32px; display: grid; place-items: center; color: var(--muted); }
.aspect-opt.selected .aspect-box { color: var(--accent); }
.aspect-opt small { color: var(--muted); font-size: 11px; }
.style-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 420px; }
.style-opt { display: grid; gap: 6px; padding: 6px; border-radius: 14px; border: 1px solid transparent; background: transparent; font-size: 12px; color: var(--muted); }
.style-opt:hover { background: var(--paper); color: var(--ink); }
.style-opt.selected { border-color: var(--accent-line); color: var(--ink); background: var(--accent-soft); }
.style-swatch { aspect-ratio: 1; border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(21, 19, 26, 0.1); }
.dur { display: grid; gap: 10px; width: 260px; padding: 4px; }
.dur-value { font: 400 26px/1 var(--font-display); }

.sheet-backdrop { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; background: rgba(21, 19, 26, 0.32); backdrop-filter: blur(8px); animation: fade 0.2s var(--ease); }
.sheet-backdrop.leaving { opacity: 0; transition: 0.16s; }
.sheet { width: min(580px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; border-radius: 24px; background: var(--surface); box-shadow: var(--shadow-lift); animation: pop 0.26s var(--ease); }
.sheet.wide { width: min(1080px, 100%); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 16px 6px 24px; }
.sheet-head h2 { font: 400 26px/1.1 var(--font-display); letter-spacing: -0.01em; }
.sheet-body { padding: 8px 24px 24px; overflow: auto; }
.confirm { display: grid; gap: 18px; }

/* ------------------------------------------------------------ home (simple) */
.home { position: relative; }
.hero { position: relative; overflow: hidden; padding: 64px 24px 40px; }
.hero-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.hero-inner { position: relative; z-index: 2; max-width: 1180px; margin: 0 auto; }
.hero .display { margin-top: 18px; font: 400 clamp(44px, 7vw, 88px)/0.98 var(--font-display); letter-spacing: -0.025em; max-width: 14ch; }
.hero .lede { margin-top: 18px; max-width: 46ch; font-size: 17px; line-height: 1.6; color: var(--muted); }
.hero .lede strong { color: var(--ink); font-weight: 550; }

.tasks { position: relative; z-index: 2; max-width: 1180px; margin: 36px auto 0; display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 210px; gap: 14px; }
.task {
  position: relative; display: grid; grid-template-rows: 1fr auto; overflow: hidden; text-align: left; padding: 0; border-radius: 22px;
  border: 1px solid var(--line); background: var(--surface); box-shadow: 0 1px 2px rgba(21, 19, 26, 0.03);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), border-color 0.3s;
}
.task:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); border-color: var(--line-2); }
.task:active { transform: translateY(-1px); }
.task-visual { position: relative; overflow: hidden; background: var(--paper-2); }
.task-visual img, .task-visual video { width: 100%; height: 100%; object-fit: cover; }
.task-body { display: grid; gap: 2px; padding: 12px 16px 14px; }
.task-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; font: 400 21px/1.15 var(--font-display); letter-spacing: -0.01em; }
.task-title .icon { width: 16px; height: 16px; color: var(--faint); transition: transform 0.4s var(--ease), color 0.2s; }
.task:hover .task-title .icon { transform: translateX(3px); color: var(--ink); }
.task-blurb { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.task.featured { grid-column: span 2; grid-row: span 2; grid-template-rows: 1fr auto; }
.task.featured .task-title { font-size: 34px; }
.task.featured .task-blurb { font-size: 14px; max-width: 46ch; }
.task.featured .task-body { padding: 18px 22px 20px; gap: 6px; }
.task-meta { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }

/* Little animated scenes inside task cards: the real product photo, moving. */
.tv-scene { position: absolute; inset: 0; display: grid; place-items: center; }
.tv-scene.paper { background: radial-gradient(120% 80% at 70% 20%, #fff 0%, var(--paper-2) 60%, var(--paper-3) 100%); }
.tv-scene.dusk { background: radial-gradient(120% 90% at 30% 10%, #ffe9cf 0%, #f3c9a0 45%, #b88e7a 100%); }
.tv-scene.studio { background: linear-gradient(160deg, #f5f1ff 0%, #e7e0fb 50%, #d9e9f8 100%); }
.tv-scene.check { background-color: #fff; background-image: linear-gradient(45deg, #ece8e1 25%, transparent 25%), linear-gradient(-45deg, #ece8e1 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #ece8e1 75%), linear-gradient(-45deg, transparent 75%, #ece8e1 75%); background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; }
.tv-scene img.product { height: 82%; width: auto; object-fit: contain; filter: drop-shadow(0 14px 18px rgba(70, 32, 19, 0.28)); }
.tv-scene img.photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tv-scene .halves { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr; }
.tv-scene .halves > div { position: relative; overflow: hidden; display: grid; place-items: center; }
.tv-scene .halves > div + div { border-left: 1px solid rgba(255, 255, 255, 0.9); }
.tv-scene .halves img.product { height: 72%; }
.tv-scene .tv-label { position: absolute; bottom: 8px; padding: 2px 8px; border-radius: 999px; font: 500 9.5px/1.6 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; background: rgba(255, 255, 255, 0.85); color: var(--ink-2); }
.tv-scene .wave { display: flex; align-items: center; gap: 3px; height: 34px; position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); padding: 0 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.86); }
.tv-scene .wave i { width: 3px; border-radius: 3px; background: var(--accent); animation: wave 1.1s ease-in-out infinite; animation-delay: calc(var(--i) * -0.13s); height: 30%; }
@keyframes wave { 50% { height: 90%; } }
.tv-scene .sharpen { position: absolute; inset: 0; backdrop-filter: blur(5px); -webkit-mask-image: linear-gradient(90deg, #000 0 50%, transparent 50%); mask-image: linear-gradient(90deg, #000 0 50%, transparent 50%); animation: sweep 4.5s var(--ease) infinite; }
@keyframes sweep { 0%, 100% { -webkit-mask-position: 0 0; mask-position: 0 0; } 50% { -webkit-mask-position: 100% 0; mask-position: 100% 0; } }
.tv-scene .type-line { position: absolute; left: 16px; right: 16px; bottom: 14px; padding: 9px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.92); font-size: 12px; color: var(--ink-2); box-shadow: var(--shadow-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-scene .type-line::after { content: ""; display: inline-block; width: 1px; height: 13px; margin-left: 2px; vertical-align: -2px; background: var(--accent); animation: pulse 1s steps(1) infinite; }

/* The featured ad card's phone */
.tv-phone { position: relative; height: 88%; aspect-ratio: 9 / 18.5; border-radius: 26px; padding: 7px; background: var(--ink); box-shadow: 0 30px 50px -22px rgba(21, 19, 26, 0.55); transform: rotate(-4deg); transition: transform 0.7s var(--ease); }
.task:hover .tv-phone { transform: rotate(0deg) scale(1.02); }
.tv-phone .screen { position: relative; width: 100%; height: 100%; border-radius: 20px; overflow: hidden; background: #f4ece2; }
.tv-phone .screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tv-phone .cap { position: absolute; left: 8%; right: 22%; bottom: 20%; padding: 4px 6px; border-radius: 8px; background: rgba(21, 19, 26, 0.78); color: #fff; font-size: 10px; font-weight: 600; text-align: center; line-height: 1.3; opacity: 0; animation: caption 9s infinite; animation-delay: calc(var(--i) * 3s); }
@keyframes caption { 0%, 2% { opacity: 0; transform: translateY(6px); } 5%, 30% { opacity: 1; transform: none; } 33%, 100% { opacity: 0; } }
.tv-phone .ui { position: absolute; right: 7px; bottom: 34%; display: grid; gap: 9px; }
.tv-phone .ui i { width: 16px; height: 16px; border-radius: 50%; background: rgba(255, 255, 255, 0.85); }
.tv-scene.dusk .tv-phone { translate: 58% 0; }
.tv-ad-side { position: absolute; left: 7%; top: 12%; display: grid; gap: 10px; width: 40%; }
.tv-ad-side .line { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.85); box-shadow: var(--shadow-soft); font-size: 12px; color: var(--ink-2); animation: rise 0.8s var(--ease) both; animation-delay: var(--d); }
.tv-ad-side .line .icon { width: 14px; height: 14px; color: var(--accent); }
.tv-ad-side .line.ok .icon { color: var(--ok); }

.recent { max-width: 1180px; margin: 0 auto; padding: 28px 24px 70px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { font: 400 28px/1.1 var(--font-display); letter-spacing: -0.01em; }
.recent-strip { display: grid; grid-auto-flow: column; grid-auto-columns: 180px; gap: 12px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.recent-item { position: relative; scroll-snap-align: start; aspect-ratio: 4 / 5; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--paper-2); padding: 0; transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease); }
.recent-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.recent-item img, .recent-item video { width: 100%; height: 100%; object-fit: cover; }
.recent-item .ri-meta { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; justify-content: space-between; gap: 6px; }
.recent-item .pill { background: rgba(255, 255, 255, 0.9); color: var(--ink-2); }
.empty-note { padding: 26px; border-radius: 18px; border: 1px dashed var(--line-2); text-align: center; color: var(--muted); }
.advanced-hint { margin-top: 26px; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: 13px; }

/* ------------------------------------------------------------ guided flow (simple) */
.flow { max-width: 1240px; margin: 0 auto; padding: 22px 24px 40px; }
.flow-head { display: grid; gap: 8px; margin-bottom: 22px; }
.back { display: inline-flex; align-items: center; gap: 6px; width: fit-content; font-size: 13px; color: var(--muted); transition: color 0.2s, gap 0.3s var(--ease); }
.back:hover { color: var(--ink); gap: 9px; }
.back .icon { width: 15px; height: 15px; }
.flow-head h1 { font-size: clamp(36px, 4.6vw, 56px); }
.flow-head p { color: var(--muted); max-width: 60ch; font-size: 15.5px; }
.flow-grid { display: grid; grid-template-columns: minmax(340px, 440px) 1fr; gap: 28px; align-items: start; }

.steps { display: grid; gap: 10px; align-content: start; }
.step { position: relative; display: grid; gap: 12px; padding: 18px 18px 18px 58px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); transition: border-color 0.3s, box-shadow 0.4s var(--ease), opacity 0.3s; animation: rise 0.6s var(--ease) both; animation-delay: var(--d, 0s); }
.step.active { border-color: var(--accent-line); box-shadow: 0 0 0 4px rgba(99, 69, 229, 0.06), var(--shadow-soft); }
.step.locked { opacity: 0.55; }
.step-num { position: absolute; left: 18px; top: 18px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font: 500 12px/1 var(--font-mono); color: var(--muted); border: 1px solid var(--line-2); background: var(--surface); transition: 0.3s; }
.step.active .step-num { background: var(--accent); color: #fff; border-color: var(--accent); }
.step.done .step-num { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.step.done .step-num .icon { width: 13px; height: 13px; stroke-width: 2.4; }
.step-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.step-title { font-weight: 600; font-size: 15px; }
.step-hint { font-size: 12.5px; color: var(--muted); line-height: 1.45; margin-top: -6px; }
.step-optional { font: 500 10px/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }

.picks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pick { position: relative; aspect-ratio: 1; padding: 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--paper); transition: transform 0.3s var(--ease), border-color 0.2s, box-shadow 0.2s; }
.pick:hover { transform: translateY(-2px); border-color: var(--line-3); }
.pick img, .pick video { width: 100%; height: 100%; object-fit: cover; }
.pick.contain img { object-fit: contain; padding: 6px; }
.pick.selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99, 69, 229, 0.18); }
.pick.selected::after { content: ""; position: absolute; top: 6px; right: 6px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 11px no-repeat; }
.pick.upload { display: grid; place-content: center; justify-items: center; gap: 4px; border-style: dashed; border-color: var(--line-2); color: var(--muted); font-size: 11.5px; font-weight: 500; }
.pick.upload .icon { width: 20px; height: 20px; }
.pick.upload:hover { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.pick .pick-label { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 5px; font-size: 10.5px; font-weight: 600; color: #fff; background: linear-gradient(transparent, rgba(21, 19, 26, 0.65)); text-align: left; }
.pick .uploading { position: absolute; inset: auto 0 0 0; height: 3px; background: var(--accent); transition: width 0.2s; }
.picks-more { margin-top: 2px; }

.prompt-box { position: relative; }
.prompt-box textarea { width: 100%; min-height: 92px; padding: 12px 44px 12px 14px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); resize: none; line-height: 1.5; font-size: 15px; transition: border-color 0.2s, box-shadow 0.2s; }
.prompt-box textarea:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 4px rgba(99, 69, 229, 0.1); }
.prompt-box textarea::placeholder { color: var(--faint); }
.prompt-box .enhance { position: absolute; right: 7px; top: 7px; color: var(--accent); }
.enhance.busy .icon { animation: spin 0.9s linear infinite; opacity: 1; }
.enhance.busy::after { display: none; }
.ideas { display: flex; flex-wrap: wrap; gap: 6px; }
.idea { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--ink-2); font-size: 12.5px; text-align: left; transition: border-color 0.2s, background 0.2s, transform 0.2s; }
.idea:hover { border-color: var(--accent-line); background: var(--accent-soft); transform: translateY(-1px); }
.idea .icon { color: var(--accent); width: 13px; height: 13px; }
.idea .swatch { width: 12px; height: 12px; border-radius: 4px; }

.options { display: grid; gap: 8px; }
.options.two { grid-template-columns: 1fr 1fr; }
.option { position: relative; display: grid; gap: 3px; text-align: left; padding: 13px 14px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); transition: border-color 0.2s, background 0.2s, box-shadow 0.2s; }
.option:hover { border-color: var(--line-3); }
.option.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.option strong { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 7px; }
.option small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.option .tag { position: absolute; top: 10px; right: 10px; }

.formats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.format { display: grid; justify-items: center; align-content: end; gap: 6px; height: 92px; padding: 10px 6px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); color: var(--muted); transition: 0.2s; }
.format:hover { border-color: var(--line-3); color: var(--ink); }
.format.selected { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-deep); box-shadow: 0 0 0 1px var(--accent) inset; }
.format .frame { border: 1.8px solid currentColor; border-radius: 4px; }
.format strong { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.format small { font: 500 9.5px/1 var(--font-mono); letter-spacing: 0.06em; color: var(--faint); }

.moves { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.move { position: relative; display: grid; gap: 5px; padding: 4px 4px 6px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); text-align: center; transition: border-color 0.2s, transform 0.3s var(--ease); }
.move:hover { transform: translateY(-2px); border-color: var(--line-3); }
.move.selected { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(99, 69, 229, 0.2); }
.move .cam-thumb { aspect-ratio: 1; border-radius: 10px; }
.move span { font-size: 11px; font-weight: 550; color: var(--ink-2); }

.slider-row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.slider-row .val { font: 400 22px/1 var(--font-display); min-width: 3ch; text-align: right; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.switch { position: relative; width: 44px; height: 26px; border-radius: 999px; border: 0; background: rgba(21, 19, 26, 0.14); padding: 0; flex: none; transition: background 0.3s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(21, 19, 26, 0.3); transition: transform 0.35s var(--ease); }
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(18px); }

.flow-cta { position: sticky; bottom: 14px; z-index: 5; display: grid; gap: 8px; padding: 14px; border-radius: 22px; background: rgba(255, 255, 255, 0.95); border: 1px solid var(--line); backdrop-filter: blur(14px); box-shadow: 0 -10px 30px -18px rgba(21, 19, 26, 0.25), var(--shadow-soft); }
.make-btn {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; height: 54px; width: 100%; border: 0; border-radius: 999px;
  background: var(--ink); color: var(--paper); font-weight: 600; font-size: 15.5px; overflow: hidden; isolation: isolate; transition: transform 0.2s, box-shadow 0.3s var(--ease);
}
.make-btn::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--accent-grad); opacity: 0; transition: opacity 0.4s var(--ease); }
.make-btn:hover:not(:disabled)::before { opacity: 1; }
.make-btn:hover:not(:disabled) { box-shadow: 0 16px 36px -14px rgba(99, 69, 229, 0.65); }
.make-btn:active:not(:disabled) { transform: translateY(1px); }
.make-btn .icon { width: 18px; height: 18px; stroke-width: 2; }
.make-btn small { font: 500 11px/1 var(--font-mono); letter-spacing: 0.06em; opacity: 0.75; }
.make-btn.dim { background: #c9c5cf; color: #fff; }
.make-btn.busy .icon { animation: spin 0.8s linear infinite; }
.cta-note { margin: 0; font-size: 12px; line-height: 1.5; color: var(--muted); text-align: center; text-wrap: balance; }
.cta-note .icon { display: inline-block; width: 13px; height: 13px; margin-right: 5px; vertical-align: -2px; }
.shake { animation: shake 0.35s; }

.stage-col { position: sticky; top: calc(var(--top) + 16px); display: grid; gap: 14px; }
.stage { position: relative; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; min-height: 520px; height: calc(100dvh - var(--top) - 160px); max-height: 760px; border-radius: 28px; overflow: hidden; background: var(--paper-2); border: 1px solid var(--line); isolation: isolate; }
.stage::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(70% 60% at 50% 40%, rgba(255, 255, 255, 0.9), transparent 70%); }
.stage .orb { opacity: 0.8; }
.stage-frame { position: relative; z-index: 2; max-width: 86%; max-height: 86%; border-radius: 18px; overflow: hidden; background: var(--surface); box-shadow: 0 30px 70px -30px rgba(21, 19, 26, 0.45), 0 0 0 1px rgba(21, 19, 26, 0.06); transition: aspect-ratio 0.5s var(--ease), width 0.5s var(--ease), height 0.5s var(--ease); }
.stage-frame > img, .stage-frame > video, .stage-frame .cam-thumb, .stage-frame .cam-thumb img { width: 100%; height: 100%; object-fit: cover; }
.stage-frame.contain > img { object-fit: contain; background: var(--surface); }
.stage-frame.checker { background-color: #fff; background-image: linear-gradient(45deg, #ece8e1 25%, transparent 25%), linear-gradient(-45deg, #ece8e1 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #ece8e1 75%), linear-gradient(-45deg, transparent 75%, #ece8e1 75%); background-size: 18px 18px; background-position: 0 0, 0 9px, 9px -9px, -9px 0; }
.stage-frame .cam-thumb { border-radius: 0; background: var(--paper-2); }
.stage-empty { position: relative; z-index: 2; display: grid; justify-items: center; gap: 12px; padding: 30px; text-align: center; color: var(--muted); max-width: 420px; }
.stage-empty .display-sm { font: 400 30px/1.15 var(--font-display); color: var(--ink); letter-spacing: -0.01em; }
.stage-empty .display-sm em { color: var(--accent); }
.stage-empty .ghost-frame { display: grid; place-items: center; border: 1.5px dashed var(--line-3); border-radius: 16px; color: var(--faint); }
.stage-empty .ghost-frame .icon { width: 28px; height: 28px; }
.stage-quote { position: absolute; left: 50%; bottom: 22px; z-index: 3; transform: translateX(-50%); width: min(80%, 520px); padding: 10px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.92); box-shadow: var(--shadow-soft); font: italic 400 17px/1.35 var(--font-display); color: var(--ink-2); text-align: center; animation: rise 0.4s var(--ease) both; }
.stage-tag { position: absolute; top: 16px; left: 16px; z-index: 3; display: flex; gap: 6px; }
.stage-tag .pill { background: rgba(255, 255, 255, 0.92); color: var(--ink-2); box-shadow: 0 0 0 1px var(--line); }

.stage-progress { position: absolute; inset: 0; z-index: 4; display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center; background: rgba(250, 248, 244, 0.55); backdrop-filter: blur(3px); animation: fade 0.3s var(--ease); }
.stage-progress::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(105deg, transparent 30%, rgba(99, 69, 229, 0.1) 45%, rgba(13, 162, 231, 0.12) 55%, transparent 70%); background-size: 260% 100%; animation: shimmer 2.4s linear infinite; }
.stage-progress .ring { width: 64px; height: 64px; }
/* Over a live preview: a badge at the foot of the stage, so the picture stays in view. */
.stage-progress.over-preview { inset: auto 50% 22px auto; transform: translateX(50%); display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 12px; border-radius: 999px; background: rgba(250, 248, 244, 0.86); backdrop-filter: blur(12px); box-shadow: var(--shadow-pop); white-space: nowrap; animation: none; }
.stage-progress.over-preview::before { display: none; }
.stage-progress.over-preview .ring { width: 28px; height: 28px; }
.stage-progress.over-preview .big { font: 600 13px/1 var(--font-sans); letter-spacing: 0; }
.stage-frame.live > img { transition: filter 0.4s; filter: saturate(1.05); }
.stage-progress .big { font: 400 30px/1.1 var(--font-display); letter-spacing: -0.01em; }
.stage-progress .meta { font: 500 11px/1 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

.stage-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.stage-actions .spacer { flex: 1; }
.next-steps { display: grid; gap: 8px; padding: 14px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); animation: rise 0.5s var(--ease) both; }
.next-steps h3 { font: 500 11px/1 var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.next-row { display: flex; flex-wrap: wrap; gap: 8px; }
.next { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px 0 6px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-size: 13px; font-weight: 550; transition: border-color 0.2s, transform 0.3s var(--ease), box-shadow 0.3s; }
.next:hover { border-color: var(--accent-line); transform: translateY(-1px); box-shadow: var(--shadow-soft); }
.next .ico { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.next .ico .icon { width: 14px; height: 14px; }
.variants { display: flex; gap: 8px; }
.variant { width: 64px; height: 64px; padding: 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--paper); transition: border-color 0.2s, transform 0.2s; }
.variant:hover { transform: translateY(-2px); }
.variant.selected { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(99, 69, 229, 0.2); }
.variant img, .variant video { width: 100%; height: 100%; object-fit: cover; }
.variant.pending { display: grid; place-items: center; }
.variant.pending .ring { width: 26px; height: 26px; }

.compare { position: relative; width: 100%; height: 100%; overflow: hidden; touch-action: none; cursor: ew-resize; user-select: none; }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.compare.contain img { object-fit: contain; }
.compare .after { clip-path: inset(0 0 0 var(--cut, 50%)); }
.compare .handle { position: absolute; top: 0; bottom: 0; left: var(--cut, 50%); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(21, 19, 26, 0.15); }
.compare .handle::after { content: "⟷"; position: absolute; top: 50%; left: 50%; display: grid; place-items: center; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-soft); font-size: 15px; color: var(--ink-2); }
.compare .lbl { position: absolute; top: 12px; padding: 3px 9px; border-radius: 999px; background: rgba(21, 19, 26, 0.6); color: #fff; font: 500 10px/1.6 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; }
.compare .lbl.l { left: 12px; }
.compare .lbl.r { right: 12px; }

.task-history { margin-top: 34px; }
.task-history:empty { display: none; }
.task-history .recent-strip { grid-auto-columns: 128px; }
.task-history .recent-item { aspect-ratio: 1; border-radius: 12px; }

/* ------------------------------------------------------------ simple ads */
.brand-picks { display: grid; gap: 8px; }
.brand-pick { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--surface); text-align: left; transition: 0.2s; }
.brand-pick:hover { border-color: var(--line-3); }
.brand-pick.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.brand-pick img, .brand-pick .brand-ph { width: 54px; height: 54px; border-radius: 12px; object-fit: cover; flex: none; background: var(--paper-2); }
.brand-pick strong { display: block; font-size: 14px; }
.brand-pick small { color: var(--muted); font-size: 12px; }
.platform-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.platform-card { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; align-items: center; text-align: left; padding: 12px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); transition: 0.2s; }
.platform-card .aspect-glyph { grid-row: 1 / 3; color: var(--muted); }
.platform-card strong { font-size: 13px; font-weight: 600; line-height: 1.25; }
.platform-card small { font: 500 10px/1 var(--font-mono); letter-spacing: 0.06em; color: var(--faint); }
.platform-card:hover { border-color: var(--line-3); }
.platform-card.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.platform-card.selected .aspect-glyph { color: var(--accent); }
.platform-tip { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: flex-start; }
.platform-tip .icon { width: 14px; height: 14px; margin-top: 2px; color: var(--accent); }
.idea-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.idea-card { display: grid; gap: 3px; text-align: left; padding: 12px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); transition: 0.2s; }
.idea-card strong { font-size: 13.5px; font-weight: 600; }
.idea-card small { font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.idea-card:hover { border-color: var(--line-3); }
.idea-card.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }

.phone { position: relative; z-index: 2; height: min(88%, 640px); aspect-ratio: 9 / 18.6; border-radius: 40px; padding: 10px; background: var(--ink); box-shadow: 0 40px 80px -36px rgba(21, 19, 26, 0.6); transition: aspect-ratio 0.5s var(--ease); }
.phone.feed { aspect-ratio: 4 / 6.1; border-radius: 30px; }
.phone.square { aspect-ratio: 1 / 1.5; border-radius: 30px; }
.phone-screen { position: relative; width: 100%; height: 100%; border-radius: 31px; overflow: hidden; background: #efe7dd; }
.phone.feed .phone-screen, .phone.square .phone-screen { border-radius: 22px; }
.phone-screen video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.phone-notch { position: absolute; top: 9px; left: 50%; z-index: 5; transform: translateX(-50%); width: 34%; height: 20px; border-radius: 999px; background: var(--ink); }
.phone .frame-media { position: absolute; inset: 0; }
.sb-shot { position: absolute; inset: 0; opacity: 0; transition: opacity 0.6s var(--ease); }
.sb-shot.on { opacity: 1; }
.sb-shot .cam-thumb { width: 100%; height: 100%; border-radius: 0; background: #efe7dd; }
.sb-shot .cam-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sb-shot.scene .cam-thumb img { filter: saturate(0.9); }
.sb-hook { position: absolute; left: 14px; right: 14px; top: 34%; z-index: 1; color: #fff; font-weight: 700; font-size: 21px; line-height: 1.25; text-align: center; text-wrap: balance; text-shadow: 0 2px 14px rgba(21, 19, 26, 0.55); opacity: 0; transform: translateY(10px); transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }
.sb-shot.on .sb-hook { opacity: 1; transform: none; }
.sb-shot.on .sb-caption.later { transition-delay: 1.1s; }
.stage-note { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 0 6px; font-size: 13px; color: var(--muted); }
.stage-note .icon { flex: none; width: 15px; height: 15px; margin-top: 2px; color: var(--accent); }
details.post-text { border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; background: var(--surface); }
details.post-text summary { cursor: pointer; font: 500 11px/1.6 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
details.post-text p { margin: 8px 0 2px; white-space: pre-wrap; font-size: 13.5px; }
.sb-visual { position: absolute; left: 16px; right: 16px; top: 17%; z-index: 1; font: italic 400 19px/1.18 var(--font-display); color: var(--ink); text-align: center; text-wrap: balance; }
.sb-caption { position: absolute; left: 9%; right: 9%; bottom: 24%; padding: 8px 10px; border-radius: 10px; background: rgba(21, 19, 26, 0.78); color: #fff; font-weight: 650; font-size: 14px; line-height: 1.3; text-align: center; transform: translateY(6px); opacity: 0; transition: 0.45s var(--ease); }
.sb-shot.on .sb-caption { opacity: 1; transform: none; }
.sb-endcard { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 18px; text-align: center; background: #fbf4e8; opacity: 0; transition: opacity 0.6s; }
.sb-endcard.on { opacity: 1; }
.sb-endcard img { height: 44%; object-fit: contain; filter: drop-shadow(0 12px 14px rgba(70, 32, 19, 0.25)); }
.sb-endcard strong { font-size: 15px; line-height: 1.3; }
.sb-endcard span { font-size: 12.5px; color: #7f351e; font-weight: 600; }
.sb-endcard em { font-style: normal; font-size: 11px; padding: 4px 10px; border-radius: 6px; background: #7f351e; color: #fff; }
.sb-dots { position: absolute; top: 34px; left: 12px; right: 12px; z-index: 4; display: flex; gap: 3px; }
.sb-dots i { flex: 1; height: 2.5px; border-radius: 2px; background: rgba(255, 255, 255, 0.45); overflow: hidden; }
.sb-dots i.past { background: #fff; }
.sb-dots i.now::after { content: ""; display: block; height: 100%; width: 100%; background: #fff; transform-origin: left; animation: fill var(--dur, 3s) linear both; }
@keyframes fill { from { transform: scaleX(0); } }
.safe-shade { position: absolute; inset: 0; z-index: 4; pointer-events: none; opacity: 0; transition: opacity 0.3s; }
.phone.show-safe .safe-shade { opacity: 1; }
.safe-shade i { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(135deg, rgba(207, 62, 62, 0.3) 0 6px, rgba(207, 62, 62, 0.12) 6px 12px); }

.verdict { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 16px; font-size: 13px; line-height: 1.45; animation: rise 0.4s var(--ease) both; }
.verdict .icon { width: 18px; height: 18px; margin-top: 1px; }
.verdict strong { display: block; font-size: 13.5px; }
.verdict.ok { background: var(--ok-soft); color: #0d5f3f; }
.verdict.ok .icon { color: var(--ok); }
.verdict.warn { background: var(--warn-soft); color: #7a4b07; }
.verdict.warn .icon { color: var(--warn); }
.verdict.bad { background: var(--bad-soft); color: #8f2626; }
.verdict.bad .icon { color: var(--bad); }
.verdict ul { margin: 6px 0 0; padding-left: 18px; }
.script { display: grid; gap: 6px; }
.script-line { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--paper); font-size: 13px; }
.script-line .n { font: 500 11px/1 var(--font-mono); color: var(--faint); }
.script-line input { width: 100%; border: 0; background: transparent; padding: 3px 0; font-size: 13.5px; font-weight: 550; }
.script-line input:focus { outline: none; }
.script-line:focus-within { box-shadow: 0 0 0 2px var(--accent-line); background: var(--surface); }
.script-line .src { font: 500 9.5px/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.making { display: grid; gap: 10px; }
.making-shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 6px; }
.making-shots .shot-cell { aspect-ratio: 9 / 16; }

/* ------------------------------------------------------------ studio (advanced create) */
.create { position: relative; height: 100%; display: flex; flex-direction: column; }
.create-head { padding: 16px 24px 0; display: grid; gap: 12px; }
.tool-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.tool-tabs::-webkit-scrollbar { display: none; }
.tool-tab {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 15px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--muted); font-weight: 500; white-space: nowrap; transition: 0.2s;
}
.tool-tab:hover { color: var(--ink); border-color: var(--line-2); }
.tool-tab.active { color: var(--ink); background: var(--surface); border-color: var(--line-2); box-shadow: var(--shadow-soft); }
.tool-tab.active .icon { color: var(--accent); }
.app-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; min-height: 22px; }
.app-choices { display: flex; gap: 6px; flex-wrap: wrap; }
.app-choice {
  display: grid; grid-template-columns: auto auto; column-gap: 10px; align-items: baseline; text-align: left; padding: 7px 12px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); transition: 0.2s;
}
.app-choice:hover { border-color: var(--line-2); color: var(--ink); }
.app-choice.active { border-color: var(--accent-line); background: var(--accent-soft); color: var(--ink); }
.app-name { font-weight: 600; font-size: 13px; }
.app-meta { font: 500 10.5px/1 var(--font-mono); color: var(--faint); justify-self: end; }
.app-model { grid-column: 1 / -1; font: 500 10.5px/1.5 var(--font-mono); color: var(--faint); }
.free { display: inline-flex; align-items: center; gap: 3px; color: var(--ok); }
.free .icon { width: 12px; height: 12px; }
.app-blurb { color: var(--muted); font-size: 12.5px; flex: 1; min-width: 200px; }

.banner-slot { padding: 0 24px; }
.banner { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 10px 10px 10px 14px; border-radius: 16px; border: 1px solid rgba(201, 138, 12, 0.25); background: var(--warn-soft); font-size: 13px; color: #6b4507; }
.banner > .icon { color: var(--warn); }
.banner span { flex: 1; }

.feed { flex: 1; overflow-y: auto; padding: 16px 24px 220px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); grid-auto-rows: 6px; gap: 12px; }
.page .grid { margin-top: 16px; }

.tile { position: relative; border-radius: 16px; overflow: hidden; background: var(--paper-2); cursor: zoom-in; isolation: isolate; outline-offset: 3px; animation: rise 0.5s var(--ease) both; --rise: 8px; box-shadow: 0 0 0 1px var(--line); }
.tile-media, .tile-media img, .tile-media video { width: 100%; height: 100%; object-fit: cover; }
.tile-media .audio-tile { height: 100%; display: grid; place-content: center; justify-items: center; gap: 8px; color: var(--muted); background: linear-gradient(135deg, #f1edff, #e6f4fb); }
.tile-media .audio-tile .icon { width: 30px; height: 30px; color: var(--accent); }
.tile-chip { position: absolute; top: 8px; display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.88); color: var(--ink-2); backdrop-filter: blur(8px); font: 500 10.5px/1 var(--font-mono); letter-spacing: 0.04em; z-index: 2; }
.tile-chip .icon { width: 10px; height: 10px; }
.tile-chip.left { left: 8px; }
.tile-chip.right { right: 8px; }
.tile-chip.demo { color: var(--warn); }
.tile-fav { position: absolute; left: 8px; bottom: 8px; color: #e0445f; z-index: 2; }
.tile-overlay {
  position: absolute; inset: auto 0 0 0; z-index: 3; display: grid; gap: 8px; padding: 40px 10px 10px;
  background: linear-gradient(to top, rgba(21, 19, 26, 0.82), rgba(21, 19, 26, 0.45) 55%, transparent); opacity: 0; transform: translateY(6px); transition: 0.25s var(--ease);
}
.tile:hover .tile-overlay, .tile:focus-visible .tile-overlay, .tile:focus-within .tile-overlay { opacity: 1; transform: none; }
.tile-prompt { font-size: 12.5px; line-height: 1.4; color: #f2f0ec; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tile-actions { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.tile-actions .chip { background: rgba(255, 255, 255, 0.16); border-color: transparent; color: #fff; backdrop-filter: blur(8px); }
.tile-actions .chip .icon { color: #fff; }
.tile-actions .chip:hover { background: rgba(255, 255, 255, 0.28); }
.tile-actions .chip span { display: none; }
.tile-actions .chip:first-child span { display: inline; }
.tile-actions .icon-btn { background: rgba(255, 255, 255, 0.16); border-color: transparent; color: #fff; }

.tile.job { cursor: default; background: var(--surface); }
.job-shimmer { position: absolute; inset: 0; background: linear-gradient(110deg, transparent 20%, rgba(99, 69, 229, 0.07) 40%, rgba(13, 162, 231, 0.09) 50%, transparent 70%); background-size: 250% 100%; animation: shimmer 2.2s linear infinite; }
.job-body { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; padding: 14px; text-align: center; }
.job-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile.job.has-preview .job-body { inset: auto 8px 8px; padding: 8px 10px; gap: 2px; border-radius: 12px; background: rgba(250, 248, 244, 0.86); backdrop-filter: blur(10px); }
.tile.job.has-preview .job-body .ring, .tile.job.has-preview .job-prompt { display: none; }
.job-title { font-weight: 600; font-size: 13.5px; }
.job-meta { font: 500 10.5px/1.4 var(--font-mono); color: var(--muted); letter-spacing: 0.04em; }
.job-prompt { font-size: 12px; color: var(--faint); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 90%; }
.job-error { font-size: 12px; color: var(--bad); max-width: 95%; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.job-icon .icon { width: 26px; height: 26px; color: var(--bad); }
.tile.job.canceled .job-icon .icon { color: var(--muted); }
.ring { width: 46px; height: 46px; transform: rotate(-90deg); }
.ring.spin { animation: spin 1.1s linear infinite; }
.ring-track { fill: none; stroke: rgba(21, 19, 26, 0.08); stroke-width: 3.5; }
.ring-bar { fill: none; stroke: var(--accent); stroke-width: 3.5; stroke-linecap: round; transition: stroke-dashoffset 0.5s var(--ease); }

.empty-hero { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 9vh 16px 16px; }
.empty-hero h1 { font-size: clamp(34px, 4.6vw, 54px); }
.empty-hero.small { padding: 40px 16px; }
.empty-hero .ideas { justify-content: center; max-width: 860px; margin-top: 12px; }
.empty-hero .idea { padding: 10px 14px; font-size: 13px; border-radius: 14px; background: var(--surface); }

.composer {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(980px, calc(100% - 32px)); z-index: 20;
  display: grid; gap: 10px; padding: 12px; border-radius: 26px; background: rgba(255, 255, 255, 0.88); border: 1px solid var(--line);
  box-shadow: 0 30px 70px -30px rgba(21, 19, 26, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.6) inset; backdrop-filter: blur(22px) saturate(1.3);
}
.composer.shake { animation: shake-c 0.35s; }
@keyframes shake-c { 25% { transform: translateX(calc(-50% - 6px)); } 75% { transform: translateX(calc(-50% + 6px)); } }
.composer-main { display: flex; gap: 10px; align-items: stretch; }
.refs { display: flex; gap: 8px; }
.ref {
  position: relative; width: 64px; height: 64px; flex: none; border-radius: 14px; overflow: hidden; display: grid; place-items: center; align-content: center; gap: 2px;
  border: 1px dashed var(--line-3); background: var(--paper); color: var(--muted); padding: 0; transition: 0.2s;
}
.ref.empty:hover { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }
.ref.empty.required { border-color: var(--accent-line); }
.ref .icon { width: 20px; height: 20px; }
.ref img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ref.filled { border-style: solid; border-color: var(--line); }
.ref-label { position: relative; font-size: 9.5px; font-weight: 600; line-height: 1.1; text-align: center; padding: 0 3px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ref.filled .ref-label { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 3px 3px; background: linear-gradient(transparent, rgba(21, 19, 26, 0.7)); color: #fff; }
.ref-x { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(21, 19, 26, 0.6); color: #fff; opacity: 0; transition: 0.15s; }
.ref:hover .ref-x, .ref-x:focus-visible { opacity: 1; }
.ref-x .icon { width: 12px; height: 12px; }
.ref-audio { display: grid; place-items: center; width: 100%; height: 100%; background: linear-gradient(135deg, #f1edff, #e6f4fb); }
.ref-audio .icon { color: var(--accent); }
.ref.uploading { border-style: solid; }
.ref-progress { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent); transition: width 0.2s; }
.ref-menu { display: grid; gap: 10px; width: 300px; }
.ref-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 6px; }
.ref-pick { aspect-ratio: 1; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--paper); }
.ref-pick:hover { border-color: var(--accent); }
.ref-pick img { width: 100%; height: 100%; object-fit: cover; }
.ref-pick .ref-audio small { font-size: 9px; color: var(--muted); }

.prompt-wrap { position: relative; flex: 1; min-width: 0; display: flex; border-radius: 18px; background: var(--paper); border: 1px solid var(--line); transition: border-color 0.2s, box-shadow 0.2s; }
.prompt-wrap:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 4px rgba(99, 69, 229, 0.08); background: var(--surface); }
.prompt-wrap.static { align-items: center; padding: 0 16px; color: var(--muted); font-size: 13px; }
.prompt { flex: 1; min-height: 64px; max-height: 200px; resize: none; border: 0; background: transparent; padding: 12px 44px 12px 14px; font-size: 15px; line-height: 1.5; }
.prompt:focus { outline: none; }
.prompt::placeholder { color: var(--faint); }
.prompt-wrap .enhance { position: absolute; right: 6px; top: 6px; color: var(--accent) !important; }
.go { display: flex; }
.generate {
  position: relative; display: grid; align-content: center; justify-items: center; gap: 3px; min-width: 140px; padding: 0 18px; border: 0; border-radius: 18px;
  background: var(--ink); color: var(--paper); overflow: hidden; isolation: isolate; transition: transform 0.15s, box-shadow 0.3s var(--ease);
}
.generate::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--accent-grad); opacity: 0; transition: opacity 0.4s var(--ease); }
.generate:hover::before { opacity: 1; }
.generate:hover { box-shadow: 0 14px 32px -14px rgba(99, 69, 229, 0.7); }
.generate:active { transform: translateY(1px); }
.generate.dim { background: #c9c5cf; }
.gen-label { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 15px; }
.gen-label .icon { width: 17px; height: 17px; stroke-width: 2; }
.gen-meta { font: 500 10.5px/1 var(--font-mono); letter-spacing: 0.05em; opacity: 0.75; }
.generate.busy .gen-label .icon { animation: spin 0.8s linear infinite; }
.composer-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.cam-chip { padding-left: 4px; }
.advanced { display: grid; gap: 14px; width: 300px; padding: 4px; }

.drop-overlay { position: absolute; inset: 12px; z-index: 40; display: none; place-items: center; border: 2px dashed var(--accent-line); border-radius: 26px; background: rgba(250, 248, 244, 0.9); backdrop-filter: blur(4px); pointer-events: none; }
.drop-overlay div { display: grid; justify-items: center; gap: 8px; font: 400 28px/1.1 var(--font-display); }
.drop-overlay .icon { width: 36px; height: 36px; color: var(--accent); }
.dragging .drop-overlay { display: grid; }

/* camera previews */
.cam-sheet { display: grid; gap: 14px; }
.cam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.cam-card { position: relative; display: grid; gap: 8px; padding: 6px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); text-align: left; transition: 0.25s var(--ease); }
.cam-card:hover { border-color: var(--line-3); transform: translateY(-2px); }
.cam-card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.cam-thumb { overflow: hidden; border-radius: 12px; background: var(--paper-2); }
.cam-thumb.card { aspect-ratio: 4 / 5; }
.cam-thumb img { width: 100%; height: 100%; object-fit: cover; transform-origin: center; will-change: transform; }
.cam-thumb.mini { width: 26px; height: 26px; border-radius: 50%; }
.cam-label { font-weight: 550; font-size: 13px; padding: 0 4px 2px; }
.cam-check { position: absolute; top: 12px; right: 12px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; }
.cam-check .icon { width: 14px; height: 14px; stroke-width: 2.6; }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 60; display: grid; grid-template-columns: 1fr 380px; background: rgba(243, 239, 231, 0.96); backdrop-filter: blur(12px); animation: fade 0.2s var(--ease); }
.lb-stage { display: grid; place-items: center; padding: 40px 64px; min-width: 0; min-height: 0; }
.lb-stage img, .lb-stage video { max-width: 100%; max-height: calc(100dvh - 80px); border-radius: 14px; box-shadow: var(--shadow-lift); object-fit: contain; background: #fff; }
.lb-stage .audio-tile { display: grid; gap: 12px; justify-items: center; padding: 40px; border-radius: 22px; background: var(--surface); }
.lb-side { overflow-y: auto; padding: 60px 24px 24px; background: var(--surface); border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 18px; }
.lb-head { display: flex; gap: 6px; flex-wrap: wrap; }
.lb-prompt { display: grid; gap: 8px; }
.lb-prompt p { font: 400 20px/1.35 var(--font-display); white-space: pre-wrap; }
.lb-prompt .chip { justify-self: start; }
.lb-name { font: 400 22px/1.3 var(--font-display); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; margin: 0; font-size: 13px; }
.facts dt { font: 500 10.5px/1.9 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.facts dd { margin: 0; text-align: right; overflow: hidden; text-overflow: ellipsis; }
.lb-lineage h4 { font: 500 10.5px/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.lineage-thumb { width: 64px; height: 64px; padding: 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-2); background: var(--paper); }
.lineage-thumb img, .lineage-thumb video { width: 100%; height: 100%; object-fit: cover; }
.lb-actions { display: grid; gap: 8px; margin-top: auto; }
.lb-actions .btn.block { justify-content: flex-start; border-radius: 14px; }
.lb-close { position: absolute; top: 14px; right: 14px; z-index: 2; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; }
.lb-nav.prev { left: 14px; }
.lb-nav.next { right: 394px; }

/* ------------------------------------------------------------ pages */
.page { max-width: 1240px; margin: 0 auto; padding: 28px 24px 70px; display: grid; gap: 18px; align-content: start; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-bottom: 6px; }
.page-head p { margin-top: 8px; color: var(--muted); max-width: 60ch; }
.search { width: 280px; border-radius: 999px; padding-left: 16px; }
.section-title { font: 400 26px/1.15 var(--font-display); letter-spacing: -0.01em; margin-top: 14px; }
.status-line { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; }
.status-line span:nth-child(2) { flex: 1; }
.status-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.status-inline.ok { color: var(--ok); }
.status-inline.bad { color: var(--bad); }
.status-inline.warn { color: var(--warn); }

/* apps */
.app-cards { display: grid; gap: 22px; }
.app-group { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.app-group h3 { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font: 500 11px/1 var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.app-group h3 .icon { width: 15px; height: 15px; }
.app-card { display: grid; gap: 8px; align-content: start; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); transition: box-shadow 0.3s var(--ease), border-color 0.2s; }
.app-card:hover { box-shadow: var(--shadow-soft); border-color: var(--line-2); }
.app-card-head { display: flex; align-items: center; gap: 8px; }
.app-card-head strong { font: 400 21px/1.15 var(--font-display); }
.app-card p:not(.muted) { font-size: 13px; color: var(--ink-2); }
.app-card p.muted { font-family: var(--font-mono); font-size: 11px; }
.meta { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font: 500 11px/1 var(--font-mono); }
.meta .icon { width: 13px; height: 13px; }
.meta.ok { color: var(--ok); }
.meta.bad { color: var(--bad); }
.import { display: grid; gap: 14px; }
.import h2 { font: 400 26px/1.15 var(--font-display); }
.import-row { display: grid; grid-template-columns: 260px 1fr; gap: 12px; align-items: stretch; }
.dropzone { display: grid; justify-items: center; gap: 4px; padding: 20px; border-radius: 18px; border: 1.5px dashed var(--line-3); background: var(--paper); text-align: center; transition: 0.2s; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone .icon { width: 24px; height: 24px; color: var(--accent); }
.import-ok { display: grid; gap: 8px; justify-items: start; padding: 14px; border-radius: 14px; background: var(--ok-soft); border: 1px solid rgba(19, 138, 91, 0.2); }
.import-ok p { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.import-ok .icon { color: var(--ok); }
.import-ok .warn .icon { color: var(--warn); }
.code { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--ink); color: #ece9f3; border: 1px solid var(--line); font-family: var(--font-mono); font-size: 12.5px; margin: 10px 0 14px; }
.code .icon-btn { background: transparent; border-color: rgba(255, 255, 255, 0.18); color: #ece9f3; }
.code code { flex: 1; overflow-x: auto; }
.models-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.models-table th { text-align: left; font: 500 10.5px/1 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding: 10px 8px; border-bottom: 1px solid var(--line-2); }
.models-table td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; word-break: break-all; }

/* settings */
.settings { max-width: 900px; }
.settings .card { display: grid; gap: 12px; }
.settings .card h2 { font: 400 26px/1.15 var(--font-display); letter-spacing: -0.01em; }
.backends { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 6px; }
.backend { display: grid; gap: 6px; align-content: start; justify-items: start; text-align: left; padding: 16px; border-radius: 18px; border: 1px solid var(--line-2); background: var(--surface); transition: 0.2s; }
.backend:hover { border-color: var(--line-3); }
.backend.active { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.backend .icon { color: var(--accent); width: 22px; height: 22px; }
.backend strong { font-size: 14.5px; }
.backend small { color: var(--muted); font-size: 12px; line-height: 1.45; }
.engine { display: grid; gap: 12px; padding: 16px; border-radius: 18px; background: var(--paper); border: 1px solid var(--line); }
.engine-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.engine-head strong { font-size: 14.5px; }
.engine-progress { display: grid; gap: 6px; }
.engine-progress .bar { height: 6px; border-radius: 6px; background: rgba(21, 19, 26, 0.08); overflow: hidden; }
.engine-progress .bar i { display: block; height: 100%; border-radius: 6px; background: var(--accent-grad); transition: width 0.3s var(--ease); }
.engine-progress small { font-size: 11px; color: var(--muted); }
.engine-error { color: var(--bad); white-space: pre-wrap; font-size: 12px; }
.packs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.pack { display: grid; gap: 7px; align-content: start; padding: 14px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--surface); }
.pack.ready { border-color: rgba(19, 138, 91, 0.35); box-shadow: 0 0 0 1px rgba(19, 138, 91, 0.12) inset; }
.pack-head { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; flex-wrap: wrap; }
.pack-head small { font-size: 10.5px; }
.pack p { margin: 0; color: var(--ink-2); }
.pack-meta { display: flex; gap: 12px; font-size: 11px; color: var(--muted); }
.pack-meta .ok { color: var(--ok); }
.pack-meta .warn { color: var(--warn); }
.engine-advanced summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.engine-advanced[open] summary { margin-bottom: 12px; }

/* ------------------------------------------------------------ recipes */
.chip.active { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-deep); }
.recipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.recipe-card { display: grid; grid-template-rows: auto 1fr; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); overflow: hidden; box-shadow: 0 1px 2px rgba(21, 19, 26, 0.03); transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.2s; }
.recipe-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: var(--line-2); }
.recipe-frames { display: flex; align-items: flex-end; justify-content: center; gap: 8px; height: 132px; padding: 22px 18px 18px; background: radial-gradient(120% 90% at 20% 0%, rgba(99, 69, 229, 0.14), transparent 60%), radial-gradient(90% 80% at 100% 100%, rgba(13, 162, 231, 0.12), transparent 60%), var(--paper-2); overflow: hidden; }
.recipe-frames .frame { height: 100%; max-width: 30%; display: grid; place-items: center; border-radius: 8px; background: linear-gradient(160deg, #ffffff, #ece6dc); box-shadow: 0 10px 24px -14px rgba(21, 19, 26, 0.5), 0 0 0 1px rgba(21, 19, 26, 0.06); color: var(--accent); transition: transform 0.4s var(--ease); }
.recipe-frames .frame:nth-child(even) { height: 82%; }
.recipe-frames .frame .icon { width: 16px; height: 16px; }
.recipe-card:hover .frame { transform: translateY(-4px); }
.recipe-card:hover .frame:nth-child(even) { transform: translateY(-7px); }
.recipe-body { display: grid; gap: 6px; align-content: start; padding: 16px 18px 18px; }
.recipe-body h2 { font: 400 25px/1.1 var(--font-display); letter-spacing: -0.01em; }
.recipe-blurb { color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.recipe-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.recipe-page .back { display: inline-flex; align-items: center; gap: 6px; width: fit-content; font-size: 13px; }
.recipe-head { display: grid; gap: 8px; }
.recipe-head .lede { max-width: 62ch; font-size: 15.5px; }
.recipe-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.recipe-form { display: grid; gap: 18px; }
.recipe-input { display: grid; gap: 6px; }
.recipe-label { font-weight: 600; font-size: 14px; }
.recipe-input .picks { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); }
.recipe-text { display: grid; gap: 8px; }
.recipe-text textarea { resize: vertical; min-height: 64px; }
.recipe-text .chip { white-space: normal; height: auto; min-height: 28px; padding: 5px 10px; text-align: left; line-height: 1.35; }
.recipe-blocker { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border-radius: 14px; background: var(--warn-soft); color: #6b4507; font-size: 13px; }
.recipe-blocker .icon { color: var(--warn); }
.recipe-blocker span { flex: 1; }
.recipe-form .btn.large small { font-weight: 450; opacity: 0.8; }
.recipe-steps { display: grid; gap: 12px; }
.recipe-plan { margin: 0; padding: 0 0 0 20px; display: grid; gap: 10px; }
.recipe-plan li::marker { font: 500 11px var(--font-mono); color: var(--muted); }
.recipe-plan li > div { font-size: 14px; }
.recipe-tools { padding-top: 10px; border-top: 1px solid var(--line); }
.recipe-editor { display: grid; gap: 12px; }
.input.code { font: 12px/1.5 var(--font-mono); white-space: pre; tab-size: 2; min-height: 420px; resize: vertical; }
.runs { display: grid; gap: 12px; }
.run-card { display: grid; gap: 12px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.run-head { display: flex; align-items: center; gap: 10px; }
.run-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.run-steps li { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px 0 5px; border-radius: 999px; background: rgba(21, 19, 26, 0.04); font-size: 12.5px; color: var(--muted); }
.run-steps .mark { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); font: 500 10px/1 var(--font-mono); box-shadow: 0 0 0 1px var(--line-2); }
.run-steps .mark .icon { width: 12px; height: 12px; }
.run-steps li.running { background: var(--accent-soft); color: var(--accent-deep); }
.run-steps li.running .mark { box-shadow: 0 0 0 1px var(--accent-line); animation: pulse 1.4s infinite; }
.run-steps li.done { color: var(--ink-2); }
.run-steps li.done .mark { background: var(--ok-soft); color: var(--ok); box-shadow: none; }
.run-steps li.failed { background: var(--bad-soft); color: var(--bad); }
.run-steps li.skipped, .run-steps li.canceled { opacity: 0.6; text-decoration: line-through; }
.run-results { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.run-results:empty { display: none; }
.run-result { flex: none; height: 200px; margin: 0; display: grid; grid-template-rows: 1fr auto; gap: 6px; }
.run-result .tile { height: 100%; animation: none; }
.run-result figcaption { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
@media (max-width: 860px) {
  .recipe-layout { grid-template-columns: 1fr; }
  .run-result { height: 160px; }
}

.set-frames { display: flex; align-items: flex-end; gap: 9px; height: 64%; }
.set-frames span { height: 100%; border-radius: 10px; overflow: hidden; background: #fff; box-shadow: 0 14px 26px -14px rgba(21, 19, 26, 0.45), 0 0 0 1px rgba(21, 19, 26, 0.06); }
.set-frames span:first-child { height: 58%; }
.set-frames span:nth-child(2) { height: 78%; }
.set-frames img { width: 100%; height: 100%; object-fit: cover; }

/* ------------------------------------------------------------ posts */
.posts-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; }
.post-sections { display: grid; gap: 22px; }
.post-section { display: grid; gap: 10px; }
.post-list { display: grid; gap: 8px; }
.post-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); cursor: pointer; transition: border-color 0.2s, box-shadow 0.25s var(--ease); }
.post-card:hover { border-color: var(--line-2); box-shadow: var(--shadow-soft); }
.post-thumbs { display: flex; gap: 4px; align-items: center; }
.post-thumb { position: relative; width: 56px; height: 56px; border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: var(--paper-2); color: var(--muted); flex: none; }
.post-thumb img, .post-thumb video { width: 100%; height: 100%; object-fit: cover; }
.post-thumb > .icon { position: absolute; width: 16px; height: 16px; color: #fff; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5)); }
.post-thumb.gone { background: var(--bad-soft); color: var(--bad); }
.post-thumb.gone > .icon, .post-thumb.empty > .icon { position: static; color: currentColor; filter: none; }
.post-more { font: 500 11px var(--font-mono); color: var(--muted); padding: 0 4px; }
.post-main { display: grid; gap: 3px; min-width: 0; }
.post-top { display: flex; align-items: center; gap: 8px; }
.post-title { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-words { font-size: 12.5px; color: var(--muted); white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-platforms { gap: 4px; margin-top: 2px; }
.post-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.post-editor { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 22px; }
.post-editor-media, .post-editor-words { display: grid; gap: 10px; align-content: start; }
.post-media { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.post-media-item { position: relative; }
.post-media-item .post-thumb { width: 100%; height: auto; aspect-ratio: 1; }
.post-media-item .icon-btn { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; background: rgba(250, 248, 244, 0.9); }
.post-add { aspect-ratio: 1; display: grid; place-content: center; justify-items: center; gap: 4px; border-radius: 10px; border: 1px dashed var(--line-3); background: transparent; color: var(--muted); font-size: 12px; }
.post-add:hover { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.post-counts { display: flex; flex-wrap: wrap; gap: 10px; font-size: 11px; color: var(--muted); }
.post-counts .over { color: var(--bad); font-weight: 600; }
.post-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.post-pick { display: grid; grid-template-columns: repeat(4, 72px); gap: 6px; max-height: 320px; overflow-y: auto; padding: 4px; }
@media (max-width: 860px) {
  .post-card { grid-template-columns: auto minmax(0, 1fr); }
  .post-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .post-editor { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------ first run */
.welcome { position: relative; overflow: hidden; min-height: calc(100dvh - var(--top)); padding: 64px 24px 80px; }
.welcome-inner { position: relative; z-index: 2; max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 48px; align-items: start; }
.welcome-intro { padding-top: 8px; }
.welcome-intro .display { margin-top: 18px; font: 400 clamp(42px, 5.8vw, 76px)/0.98 var(--font-display); letter-spacing: -0.025em; }
.welcome-intro .lede { margin-top: 18px; max-width: 42ch; font-size: 16.5px; line-height: 1.6; color: var(--muted); }
.machine { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.machine .pill { height: 30px; padding: 0 12px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-weight: 500; }
.welcome-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 16px; max-width: 46ch; font-size: 13px; color: var(--muted); }
.welcome-note .icon { width: 16px; height: 16px; margin-top: 2px; }
.welcome-note.warn { color: #6b4507; }
.welcome-note.warn .icon { color: var(--warn); }
.welcome-card { display: grid; gap: 14px; padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lift); }
.welcome-card h2 { font-size: 15px; }
.pack-picks { display: grid; gap: 8px; }
.pack-pick { display: grid; grid-template-columns: auto 1fr auto; gap: 3px 12px; align-items: baseline; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line-2); cursor: pointer; transition: border-color 0.2s, background 0.2s; }
.pack-pick:hover { border-color: var(--line-3); }
.pack-pick.on { border-color: var(--accent-line); background: var(--accent-soft); }
.pack-pick.off { cursor: default; border-color: rgba(19, 138, 91, 0.3); background: var(--ok-soft); }
.pack-pick input { align-self: center; }
.pack-pick strong { font-size: 14px; }
.pack-pick small { grid-column: 2 / -1; color: var(--muted); font-size: 12.5px; }
.pack-pick small .warn { color: var(--warn); }
.pack-pick .size { font: 500 11.5px/1.4 var(--font-mono); color: var(--muted); white-space: nowrap; }
.welcome-total { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); padding: 0 2px; }
.welcome-actions { display: grid; gap: 6px; }
.welcome-actions .row { justify-content: center; }
.engine-progress.overall .bar { height: 8px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.steps li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; }
.steps li > div { display: grid; gap: 6px; padding-top: 4px; min-width: 0; }
.steps .mark { position: relative; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-2); background: var(--paper); font: 500 11px/1 var(--font-mono); color: var(--muted); }
.steps .mark .icon { width: 15px; height: 15px; }
.steps li.done .mark { background: var(--ok-soft); border-color: rgba(19, 138, 91, 0.3); color: var(--ok); }
.steps li.now .mark { border-color: var(--accent-line); color: var(--accent); }
.steps li.now .mark::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--accent); border-right-color: transparent; border-bottom-color: transparent; animation: spin 1.1s linear infinite; }
.welcome-done { display: grid; justify-items: center; gap: 12px; padding: 18px 8px 8px; text-align: center; }
.welcome-done h2 { font-size: 34px; font-weight: 400; letter-spacing: -0.02em; }
.welcome-done p { max-width: 40ch; }
.welcome-done .btn { margin-top: 6px; }
.big-check { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); animation: pop 0.5s var(--ease) both; }
.big-check .icon { width: 28px; height: 28px; stroke-width: 2.2; }
@media (max-width: 860px) {
  .welcome { padding: 32px 16px 96px; }
  .welcome-inner { grid-template-columns: 1fr; gap: 26px; }
}
.readiness { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 6px; font-size: 13px; }
.readiness li { display: flex; gap: 8px; align-items: flex-start; }
.readiness li.ok .icon { color: var(--ok); }
.readiness li.bad .icon { color: var(--bad); }

/* ads (advanced) */
.ads-page { max-width: 1320px; }
.ads-layout { display: grid; grid-template-columns: 370px 1fr; gap: 22px; align-items: start; }
.ad-form { position: sticky; top: calc(var(--top) + 16px); display: grid; gap: 16px; }
.ad-form h2 { font: 400 26px/1.15 var(--font-display); }
.brand-card { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 16px; background: var(--paper); border: 1px solid var(--line); }
.brand-edit { display: grid; gap: 14px; }
.brand-edit .field input + input { margin-top: 2px; }
.brand-card img, .brand-ph { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: var(--paper-2); display: grid; place-items: center; flex: none; }
.platforms { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.platform { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-align: left; padding: 10px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); color: var(--muted); transition: 0.2s; }
.platform .aspect-glyph { grid-row: 1 / 3; }
.platform span { font-size: 12.5px; font-weight: 600; color: var(--ink); line-height: 1.25; }
.platform small { font: 500 10px/1 var(--font-mono); }
.platform.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.engines { display: grid; gap: 8px; }
.engine { display: grid; gap: 3px; text-align: left; padding: 12px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); transition: 0.2s; }
.engine small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.engine.active { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.ads-main { display: grid; gap: 16px; min-width: 0; }
.drafts { display: grid; gap: 16px; }
.draft { display: grid; gap: 16px; }
.brief { display: grid; gap: 14px; }
.brief-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.brief-head h3 { font: 400 24px/1.15 var(--font-display); }
.brief-notes { font-size: 13px; color: var(--muted); padding: 10px 12px; border-radius: 12px; background: var(--paper); border-left: 3px solid var(--accent); }
.shots { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.shot { display: grid; gap: 8px; align-content: start; padding: 12px; border-radius: 16px; background: var(--paper); border: 1px solid var(--line); }
.shot-top { display: flex; align-items: center; gap: 8px; }
.shot-index { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--paper); font: 500 11px/1 var(--font-mono); }
.secs { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; }
.secs input { width: 62px; }
.shot details summary, .postcopy summary { cursor: pointer; color: var(--muted); font-size: 12.5px; font-weight: 550; }
.shot details textarea { margin-top: 6px; font-size: 12.5px; }
.endcard-edit { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.endcard-edit h4 { grid-column: 1 / -1; font: 500 10.5px/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.postcopy { display: grid; gap: 10px; }
.issues { list-style: none; margin: 0; padding: 12px; border-radius: 14px; background: var(--paper); display: grid; gap: 8px; font-size: 13px; }
.issues li { display: flex; gap: 8px; align-items: flex-start; }
.issues li.bad .icon { color: var(--bad); }
.issues li.warn .icon { color: var(--warn); }
.ad-list { display: grid; gap: 14px; }
.ad-card { display: grid; grid-template-columns: 260px 1fr; gap: 18px; align-items: start; }
.ad-info { display: grid; gap: 10px; min-width: 0; }
.ad-info h3 { font: 400 24px/1.15 var(--font-display); }
.ad-hook { font-size: 15px; font-weight: 600; }
.player { position: relative; width: 100%; max-height: 540px; border-radius: 16px; overflow: hidden; background: #000; }
.player video { width: 100%; height: 100%; object-fit: contain; }
.safe-overlay { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.2s; }
.player.show-safe .safe-overlay { opacity: 1; }
.safe { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(135deg, rgba(207, 62, 62, 0.3) 0 6px, rgba(207, 62, 62, 0.12) 6px 12px); }
.safe.top { top: 0; }
.safe.bottom { bottom: 0; }
.safe.right { left: auto; right: 0; }
.safe-toggle { position: absolute; top: 8px; right: 8px; background: rgba(255, 255, 255, 0.88); backdrop-filter: blur(8px); }
.safe-toggle.on { color: var(--bad); }
.shots-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 6px; border-radius: 16px; background: var(--paper); border: 1px solid var(--line); }
.shot-cell { position: relative; aspect-ratio: 9 / 16; border-radius: 10px; overflow: hidden; background: var(--paper-2); display: grid; place-items: center; }
.shot-cell img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.shot-cell .chip { position: relative; z-index: 2; }
.shot-cell.failed { box-shadow: inset 0 0 0 1.5px var(--bad); }
.shot-n { position: absolute; top: 5px; left: 5px; z-index: 2; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.9); color: var(--ink-2); font: 500 10px/1 var(--font-mono); }
.shot-cell.done .shot-n { background: var(--ok); color: #fff; }
.shot-progress { position: absolute; left: 8px; right: 8px; bottom: 8px; height: 3px; border-radius: 3px; background: rgba(21, 19, 26, 0.1); overflow: hidden; }
.shot-progress i { display: block; height: 100%; background: var(--accent); transition: width 0.3s; }
.other-cuts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* activity tray */
.activity { display: grid; gap: 10px; width: 340px; padding: 4px; }
.activity h3 { font: 500 10.5px/1 var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); padding: 2px 4px; }
.act-item { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 6px; border-radius: 14px; }
.act-item:hover { background: var(--paper); }
.act-thumb { width: 44px; height: 44px; border-radius: 10px; overflow: hidden; background: var(--paper-2); display: grid; place-items: center; }
.act-thumb img, .act-thumb video { width: 100%; height: 100%; object-fit: cover; }
.act-thumb .icon { width: 18px; height: 18px; color: var(--muted); }
.act-title { font-size: 13px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-meta { font: 500 10.5px/1.4 var(--font-mono); color: var(--muted); }
.act-bar { height: 3px; border-radius: 3px; background: rgba(21, 19, 26, 0.08); overflow: hidden; margin-top: 5px; }
.act-bar i { display: block; height: 100%; background: var(--accent-grad); transition: width 0.4s var(--ease); }
.act-empty { padding: 18px; text-align: center; color: var(--muted); font-size: 13px; }

/* login */
.login { grid-row: 1 / -1; display: grid; justify-items: center; align-content: center; gap: 12px; width: min(340px, calc(100% - 32px)); margin: 0 auto; text-align: center; min-height: 100dvh; }
.login h1 { font-size: 44px; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1080px) {
  .tasks { grid-template-columns: repeat(3, 1fr); }
  .task.featured { grid-column: span 3; grid-row: span 2; }
  .flow-grid { grid-template-columns: 1fr; }
  .stage-col { position: relative; top: 0; order: -1; }
  .stage { height: auto; min-height: 0; aspect-ratio: 4 / 3.4; max-height: 70dvh; }
}

@media (max-width: 960px) {
  .ads-layout { grid-template-columns: 1fr; }
  .ad-form { position: static; }
  .lightbox { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .lb-side { max-height: 45dvh; padding-top: 18px; border-left: 0; border-top: 1px solid var(--line); }
  .lb-nav.next { right: 14px; }
  .lb-stage { padding: 56px 16px 12px; }
  .lb-stage img, .lb-stage video { max-height: 50dvh; }
  .backends { grid-template-columns: 1fr; }
  .packs { grid-template-columns: 1fr; }
  .import-row { grid-template-columns: 1fr; }
  .topbar { grid-template-columns: auto 1fr auto; }
  .topbar .nav { display: none; }
  .bottom-nav { position: sticky; bottom: 0; z-index: 50; display: flex; justify-content: space-around; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: rgba(250, 248, 244, 0.94); backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
  .bottom-nav a { display: grid; justify-items: center; gap: 3px; flex: 1; min-width: 0; padding: 6px 2px; border-radius: 12px; font-size: 10.5px; font-weight: 550; color: var(--muted); }
  .bottom-nav a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bottom-nav a .icon { width: 21px; height: 21px; }
  .bottom-nav a.active { color: var(--ink); }
  .bottom-nav a.active .icon { color: var(--accent); }
  #app { grid-template-rows: var(--top) 1fr auto; }
  .view[data-view="studio"] { height: calc(100dvh - var(--top) - 64px); }
  /* Keep the Make button above the bottom navigation. */
  .flow-cta { bottom: calc(72px + env(safe-area-inset-bottom)); }
}

@media (max-width: 720px) {
  :root { --top: 58px; }
  body { font-size: 14px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .brand-word small, .status-pill .status-text, .activity-btn .act-text { display: none; }
  .status-pill { padding: 0 10px; }
  .hero { padding: 36px 16px 24px; }
  .hero .display { font-size: clamp(40px, 12vw, 56px); }
  .hero .lede { font-size: 15.5px; }
  .tasks { grid-template-columns: 1fr 1fr; grid-auto-rows: 180px; gap: 10px; margin-top: 26px; }
  .task.featured { grid-column: span 2; grid-row: span 2; }
  .task.featured .task-title { font-size: 28px; }
  .task-title { font-size: 18px; }
  .task-blurb { display: none; }
  .task.featured .task-blurb { display: block; }
  .tv-ad-side { display: none; }
  .tv-scene.dusk .tv-phone { translate: none; }
  .recent { padding: 22px 16px 50px; }
  .flow { padding: 16px 16px 30px; }
  .step { padding: 16px 14px 16px 50px; }
  .step-num { left: 14px; top: 16px; }
  .picks, .moves { grid-template-columns: repeat(3, 1fr); }
  .formats { grid-template-columns: repeat(2, 1fr); }
  .idea-cards, .platform-cards, .options.two { grid-template-columns: 1fr; }
  /* A shorter stage so the first step shows without scrolling. */
  .stage { aspect-ratio: auto; height: clamp(300px, 50dvh, 440px); border-radius: 22px; }
  .create-head { padding: 12px 16px 0; }
  .app-blurb { display: none; }
  .banner-slot { padding: 0 16px; }
  .feed { padding: 12px 16px 250px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .composer { bottom: 10px; width: calc(100% - 20px); padding: 10px; border-radius: 22px; }
  .composer-main { flex-wrap: wrap; }
  .refs { order: 1; }
  .prompt-wrap { order: 2; flex-basis: 100%; }
  .go { order: 3; flex: 1; }
  .generate { width: 100%; min-height: 50px; }
  .composer-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .composer-chips::-webkit-scrollbar { display: none; }
  .page { padding: 18px 16px 40px; }
  .search { width: 100%; }
  .ad-card { grid-template-columns: 1fr; }
  .endcard-edit { grid-template-columns: 1fr; }
  .style-grid { width: min(420px, calc(100vw - 40px)); grid-template-columns: repeat(3, 1fr); }
  .aspect-grid { width: min(330px, calc(100vw - 40px)); }
  .tile-overlay { opacity: 1; transform: none; padding-top: 24px; }
  .tile-prompt { display: none; }
  .grain::after { display: none; }
  .orb { filter: blur(50px); animation: none; }
  .toasts { left: 50%; right: auto; transform: translateX(-50%); bottom: 84px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .word > span { animation: none; }
}
.sb-caption[hidden] { display: none; }

/* Voice recorder */
.recorder { display: grid; justify-items: center; gap: 14px; padding: 10px 0 6px; text-align: center; }
.recorder > p { margin: 0; max-width: 40ch; }
.rec-btn { position: relative; width: 96px; height: 96px; border: 0; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--ink); box-shadow: 0 18px 40px -18px rgba(21, 19, 26, 0.6); transition: transform 0.3s var(--ease), background 0.3s var(--ease); }
.rec-btn:hover { transform: scale(1.04); }
.rec-btn .icon { width: 30px; height: 30px; }
.rec-btn.on { background: var(--bad); }
.rec-btn.on::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 2px solid var(--bad); animation: rec-ring 1.4s var(--ease) infinite; }
.rec-btn .stop { width: 26px; height: 26px; border-radius: 6px; background: #fff; }
@keyframes rec-ring { from { transform: scale(0.92); opacity: 0.6; } to { transform: scale(1.25); opacity: 0; } }
.rec-time { font: 500 12.5px/1.4 var(--font-mono); letter-spacing: 0.08em; color: var(--muted); }
.rec-meter { display: flex; align-items: center; gap: 3px; height: 44px; }
.rec-meter i { width: 4px; height: 8%; border-radius: 3px; background: var(--accent); transition: height 0.08s linear; }
.recorder audio { width: 100%; }
.recorder .row { justify-content: center; }
.rec-problem { display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--warn) 10%, var(--surface)); color: var(--ink-2); }
.rec-problem .icon { flex: none; color: var(--warn); margin-top: 2px; }
.rec-problem p { margin: 0; }

/* Recent results: open on tap, next steps on hover or keyboard focus */
.recent-item .ri-open { position: absolute; inset: 0; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: pointer; }
.recent-item .ri-meta, .recent-item .ri-actions { pointer-events: none; }
.recent-item .ri-actions { position: absolute; left: 8px; right: 8px; bottom: 8px; display: grid; gap: 5px; opacity: 0; transform: translateY(6px); transition: opacity 0.25s var(--ease), transform 0.25s var(--ease); }
.ri-act { pointer-events: auto; display: flex; align-items: center; gap: 6px; padding: 6px 9px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, 0.94); box-shadow: var(--shadow-soft); font-size: 12px; font-weight: 500; color: var(--ink); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ri-act:hover { background: #fff; color: var(--accent); }
.ri-act .icon { flex: none; width: 13px; height: 13px; color: var(--accent); }
@media (hover: hover) {
  .recent-item:hover .ri-actions, .recent-item:focus-within .ri-actions { opacity: 1; transform: none; }
  .recent-item:hover .ri-meta, .recent-item:focus-within .ri-meta { opacity: 0; }
}
.recent-item .ri-meta { transition: opacity 0.2s var(--ease); }

/* Failure details */
details.err-details { max-width: 44ch; font-size: 12px; color: var(--muted); text-align: left; }
details.err-details summary { cursor: pointer; text-align: center; font: 500 10.5px/1.6 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; }
details.err-details p { margin: 6px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--paper-2); white-space: pre-wrap; word-break: break-word; }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
