:root, html[data-theme="dark"] {
  --bg: #07080b;
  --bg2: #0d0f14;
  --panel: #12151c;
  --panel2: #171b24;
  --panel-hot: #181d14;
  --line: #252a35;
  --text: #f4f5f7;
  --muted: #8b919c;
  --lime: #e8ff47;
  --lime-dim: #c6dc3a;
  --violet: #8b7cff;
  --danger: #ff6b6b;
  --ok: #3ddc97;
  --warn: #f5c542;
  --chip-on-bg: #1c1f14;
  --cost-bg: #12160c;
  --cost-line: #2e3518;
  --cost-note: #b7bd9a;
  --notice-bg: #16140c;
  --notice-line: #3a3418;
  --notice-text: #e6d48a;
  --drop-line: #343b49;
  --phone-line: #2a2f3a;
  --step-line: #2a2f3a;
  --shadow: 0 30px 80px rgba(0,0,0,.45);
  --grad-1: rgba(139,124,255,.28);
  --grad-2: rgba(232,255,71,.14);
  --grad-3: rgba(80,160,255,.14);
  --radius: 14px;
  --font: "IBM Plex Sans", system-ui, sans-serif;
  --display: "Syne", "IBM Plex Sans", sans-serif;
}
html[data-theme="light"] {
  --bg: #e6e3db;
  --bg2: #f3f1eb;
  --panel: #efece5;
  --panel2: #f7f5f0;
  --panel-hot: #e8e6de;
  --line: #d0cbc0;
  --text: #2b2925;
  --muted: #7a766c;
  --lime: #5d664c;
  --lime-dim: #4a5240;
  --violet: #5c5874;
  --danger: #9a4f4f;
  --ok: #3f7358;
  --warn: #8e7540;
  --chip-on-bg: #e2e3d8;
  --cost-bg: #ece9e1;
  --cost-line: #d4d0c6;
  --cost-note: #6d6a61;
  --notice-bg: #ece8df;
  --notice-line: #d8d2c6;
  --notice-text: #5b574e;
  --drop-line: #c9c4b8;
  --phone-line: #cdc8bc;
  --step-line: #cdc8bc;
  --shadow: 0 18px 40px rgba(48,44,36,.08);
  --grad-1: rgba(92,88,116,.11);
  --grad-2: rgba(93,102,76,.12);
  --grad-3: rgba(70,82,96,.07);
}
* { box-sizing: border-box; }
html, body, #root { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  letter-spacing: -0.01em;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img, video { max-width: 100%; display: block; }

.app { min-height: 100%; display: flex; flex-direction: column; background:
  radial-gradient(980px 520px at 100% -8%, var(--grad-1), transparent 52%),
  radial-gradient(820px 460px at -10% 108%, var(--grad-2), transparent 50%),
  radial-gradient(640px 380px at 62% 92%, var(--grad-3), transparent 48%),
  linear-gradient(180deg, color-mix(in srgb, var(--bg2) 70%, transparent) 0%, transparent 28%, color-mix(in srgb, var(--bg) 88%, black) 100%),
  var(--bg);
}
html[data-theme="light"] .app {
  background:
    radial-gradient(900px 460px at 96% -12%, var(--grad-1), transparent 56%),
    radial-gradient(760px 420px at -8% 108%, var(--grad-2), transparent 52%),
    linear-gradient(180deg, #f2f0e9 0%, var(--bg) 42%, #ddd9d0 100%);
}

.top {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 55%, transparent), transparent);
  backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand img { width: 32px; height: 32px; border-radius: 9px; object-fit: cover; }
.brand b { font-family: var(--display); font-weight: 700; letter-spacing: -0.04em; font-size: 16px; }
.brand span { color: var(--muted); font-size: 12px; margin-left: 2px; }
.modes { display: flex; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 3px; margin-left: 12px; }
.modes button {
  border: 0; background: transparent; color: var(--muted);
  padding: 6px 14px; border-radius: 999px; font-size: 12px; font-weight: 600;
}
.modes button.on {
  background: linear-gradient(180deg, color-mix(in srgb, var(--lime) 88%, white), var(--lime));
  color: #111;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--lime) 28%, transparent);
}
html[data-theme="light"] .modes button.on {
  color: #f4f2eb;
  background: linear-gradient(180deg, #6c755c, var(--lime));
  box-shadow: none;
}
.top-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.ghost {
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  border-radius: 999px; padding: 7px 12px; font-size: 12px;
}
.ghost, .chip, .create, .modes button, .tl-clip, .drop, .ready-card, .job {
  transition: transform .16s ease, box-shadow .2s ease, border-color .16s ease, background .16s ease, color .16s ease, filter .16s ease, opacity .16s ease;
}
.ghost:hover { color: var(--text); border-color: color-mix(in srgb, var(--line) 40%, var(--text)); transform: translateY(-1px); }
.chip:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--lime) 35%, var(--line)); }
.chip.on { box-shadow: 0 0 16px color-mix(in srgb, var(--lime) 22%, transparent); }
.theme-btn { min-width: 40px; }

.workspace {
  flex: 1;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr) 292px;
  min-height: 0;
}
.col { border-right: 1px solid var(--line); min-height: 0; overflow: auto; }
.col:last-child { border-right: 0; }
.pad { padding: 18px; }
.h-label {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 10px; font-weight: 600;
}

.drop {
  border: 1px dashed var(--drop-line);
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel2) 70%, transparent), var(--panel));
  border-radius: var(--radius);
  min-height: 168px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; text-align: center; padding: 16px; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.drop.compact { min-height: 88px; padding: 10px; }
.drop:hover, .drop.hot { border-color: var(--lime); background: var(--panel-hot); }
.drop strong { font-size: 14px; }
.drop p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.thumb {
  width: 100%; border-radius: 12px; overflow: hidden; background: #000;
  border: 1px solid var(--line); position: relative;
}
.thumb video, .thumb img { width: 100%; height: 210px; object-fit: cover; }
.thumb.slim video, .thumb.slim img { height: 112px; }
.thumb .tag {
  position: absolute; left: 8px; bottom: 8px;
  background: rgba(0,0,0,.7); padding: 4px 8px; border-radius: 999px; font-size: 11px;
}

.product-card {
  display: flex; gap: 10px; align-items: center;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 8px; cursor: pointer;
}
.product-card.on { border-color: var(--lime); }
.product-card img, .ph {
  width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: #1c212b;
}
.ph { display: grid; place-items: center; color: var(--muted); font-size: 11px; }
.product-card .meta { min-width: 0; }
.product-card .meta b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-card .meta small { color: var(--muted); }
.prod-del { flex: 1; font-size: 12px; }
.cat-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.cat-bar .chip { cursor: pointer; }
.cat-block { margin-top: 22px; }
.cat-block h3 { margin: 0 0 10px; font-size: 15px; font-family: var(--display); letter-spacing: -0.03em; }
.cat-block h3 small { color: var(--muted); font-weight: 500; font-size: 12px; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
#p-cat-hint { margin: 0; }
.lib-detail { max-width: 1100px; margin: 0 auto; }
.lib-detail h3 { margin: 22px 0 6px; font-size: 15px; }
.lib-head { display: flex; gap: 16px; align-items: center; margin: 16px 0 8px; }
.lib-head img, .lib-head .ph { width: 88px; height: 88px; border-radius: 12px; object-fit: cover; background: #1c212b; }
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.asset-cell { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.asset-cell img, .asset-cell video { width: 100%; height: 160px; object-fit: cover; border-radius: 8px; background: #000; }
.asset-cell small { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-add { align-items: center; justify-content: center; min-height: 160px; cursor: pointer; color: var(--muted); border-style: dashed; }
.muted { color: var(--muted); }

.stage {
  display: flex; flex-direction: column; min-height: 0;
}
.stage-preview {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 18px 18px 8px; min-height: 280px;
}
.stage.has-tl .stage-preview { flex: 0 0 auto; min-height: 220px; padding-bottom: 4px; }
.phone {
  width: min(320px, 100%);
  aspect-ratio: 9/16;
  background: #000;
  border-radius: 28px;
  border: 1px solid var(--phone-line);
  box-shadow: var(--shadow), 0 0 0 1px color-mix(in srgb, var(--violet) 18%, transparent), 0 24px 60px color-mix(in srgb, var(--violet) 12%, transparent);
  overflow: hidden;
  position: relative;
}
.phone.wide { width: min(640px, 100%); aspect-ratio: 16/9; border-radius: 18px; }
.phone.square { width: min(420px, 90%); aspect-ratio: 1/1; border-radius: 18px; }
.phone.original {
  width: auto;
  max-width: min(420px, 100%);
  height: min(520px, 68vh);
  aspect-ratio: unset;
  border-radius: 18px;
}
.phone.original video, .phone.original img { width: auto; height: 100%; max-width: 100%; object-fit: contain; margin: 0 auto; }
.phone video, .phone img { width: 100%; height: 100%; object-fit: cover; }
.phone .empty {
  height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--muted); padding: 24px; text-align: center; gap: 8px;
}
.phone .empty b { color: var(--text); font-family: var(--display); font-size: 22px; letter-spacing: -.04em; }

.stepper {
  display: flex; gap: 0; padding: 0 24px 8px; overflow-x: auto;
}
.step {
  flex: 1; min-width: 88px; text-align: center; font-size: 10px;
  color: var(--muted); text-transform: uppercase; letter-spacing: .08em;
  position: relative; padding-top: 14px;
}
.step:before {
  content: ""; position: absolute; left: 0; right: 0; top: 4px; height: 2px; background: var(--step-line);
}
.step:first-child:before { left: 50%; }
.step:last-child:before { right: 50%; }
.step i {
  position: absolute; left: 50%; top: 0; transform: translateX(-50%);
  width: 9px; height: 9px; border-radius: 50%; background: var(--step-line);
}
.step.on { color: var(--lime); }
.step.on i { background: var(--lime); box-shadow: 0 0 0 4px rgba(232,255,71,.15); }
.step.done { color: var(--ok); }
.step.done i { background: var(--ok); }
.step.err { color: var(--danger); }
.step.err i { background: var(--danger); }
.bar { height: 4px; background: var(--step-line); border-radius: 99px; margin: 10px 24px 0; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--lime); width: 0; transition: width .45s ease; }
.caption { text-align: center; font-size: 12px; color: var(--muted); padding: 8px 24px 4px; min-height: 1.6em; }
.cap {
  background: var(--notice-bg);
  border: 1px solid var(--notice-line);
  color: var(--notice-text);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.45;
  margin-top: 12px;
}
.cap b {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.cap ul { margin: 0 0 8px; padding-left: 18px; }
.cap li { margin: 0 0 4px; }
.preview {
  margin: 0 24px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}
.preview b { display: block; color: var(--text); margin-bottom: 6px; }
.preview p { margin: 0 0 4px; }
.preview .bad { color: var(--danger); }
.preview .warn { color: var(--warn); }
.warn { color: var(--warn); }
.timeline {
  margin: 0 16px 12px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--violet) 8%, transparent), transparent 42%),
    color-mix(in srgb, var(--panel) 90%, transparent);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 color-mix(in srgb, white 6%, transparent);
}
.tl-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.tl-title { display: flex; align-items: baseline; gap: 8px; flex: 0 0 auto; }
.tl-head b, .tl-title b { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.tl-head small, .tl-title small { color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.tl-search {
  flex: 1 1 220px;
  display: flex; align-items: center; gap: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--muted);
  min-width: 200px;
}
.tl-search:focus-within { border-color: var(--violet); color: var(--text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--violet) 22%, transparent); }
.tl-search.on { border-color: var(--violet); }
.tl-search input {
  border: 0; background: transparent; outline: none; width: 100%;
  padding: 0; font-size: 13px; color: var(--text);
}
.tl-search small { min-width: 1.2em; text-align: right; color: var(--violet); font-weight: 600; }
.tl-tools { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; }
.tl-clock {
  margin-left: auto; font-variant-numeric: tabular-nums;
  font-size: 12px; color: var(--lime); letter-spacing: .04em;
}
.tl-scroll {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 0 10px;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--violet) 55%, var(--line)) color-mix(in srgb, var(--panel) 70%, transparent);
}
.tl-scroll::-webkit-scrollbar { height: 7px; }
.tl-scroll::-webkit-scrollbar-track {
  background: color-mix(in srgb, var(--panel) 80%, transparent);
  border-radius: 99px;
  margin: 0 6px;
}
.tl-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, color-mix(in srgb, var(--violet) 55%, var(--line)), color-mix(in srgb, var(--lime) 40%, var(--line)));
  border-radius: 99px;
}
.tl-scroll::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(90deg, var(--violet), var(--lime-dim));
}
.tl-track {
  position: relative;
  display: flex;
  height: 96px;
  min-width: 100%;
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg) 70%, #000);
  box-shadow: inset 0 0 0 1px var(--line);
}
.tl-clip, .tl-scene {
  position: relative;
  height: 100%;
  min-width: 36px;
  border: 0;
  border-right: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  background: #0a0b0e;
  padding: 0; overflow: hidden; text-align: left; color: inherit;
  cursor: pointer;
}
.tl-clip:last-of-type { border-right: 0; border-radius: 0 12px 12px 0; }
.tl-clip:first-of-type { border-radius: 12px 0 0 12px; }
.tl-handle {
  position: absolute; left: -5px; top: 0; width: 10px; height: 100%;
  z-index: 4; cursor: ew-resize;
}
.tl-handle:before {
  content: ""; position: absolute; left: 4px; top: 14%; bottom: 14%;
  width: 2px; border-radius: 2px;
  background: var(--lime);
  box-shadow: 0 0 8px color-mix(in srgb, var(--lime) 70%, transparent);
  opacity: .55;
}
.tl-handle:hover:before, .tl-handle:active:before { opacity: 1; }
.tl-playhead {
  position: absolute; top: -6px; bottom: -6px; width: 2px;
  background: var(--lime); z-index: 6; pointer-events: none;
  box-shadow: 0 0 12px color-mix(in srgb, var(--lime) 80%, transparent);
  transform: translateX(-1px);
}
.tl-playhead i {
  pointer-events: auto; cursor: ew-resize;
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 11px; height: 11px;
  background: var(--lime); border-radius: 2px 2px 7px 7px;
  box-shadow: 0 0 10px var(--lime);
}
.tl-film { display: none; }
.tl-scene img { width: 100%; height: 88px; object-fit: cover; display: block; filter: saturate(1.05); }
.tl-scene:after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 42%;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.62));
  pointer-events: none;
}
.tl-scene .badge {
  position: absolute; top: 6px; left: 6px; z-index: 1;
  background: rgba(8,9,12,.72); color: #fff;
  font-size: 10px; font-weight: 600; font-style: normal;
  letter-spacing: .02em; padding: 2px 7px; border-radius: 999px;
  backdrop-filter: blur(8px);
}
.tl-scene .mark {
  position: absolute; top: 6px; right: 6px; z-index: 1;
  width: 16px; height: 16px; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.78);
  background: rgba(0,0,0,.25);
  padding: 0; display: block;
}
.tl-scene small {
  display: block; font-size: 10px; color: rgba(255,255,255,.82);
  position: absolute; left: 6px; bottom: 6px; z-index: 1;
  text-shadow: 0 1px 2px rgba(0,0,0,.7);
  padding: 0;
}
.tl-scene.on, .tl-clip.on { box-shadow: inset 0 0 0 1.5px var(--lime); }
.tl-scene.on .mark, .tl-clip.on .mark { background: var(--lime); border-color: var(--lime); }
.tl-scene.foc, .tl-clip.foc { outline: 2px solid var(--violet); outline-offset: -2px; z-index: 2; }
.tl-scene.hit, .tl-clip.hit { box-shadow: inset 0 0 0 1.5px var(--violet); }
.tl-scene.dim, .tl-clip.dim { opacity: .38; filter: grayscale(.25); }
.tl-scene.dim:hover, .tl-clip.dim:hover { opacity: .75; }
.tl-clip.now { box-shadow: inset 0 -2px 0 var(--lime); }
.tl-ruler {
  display: flex; justify-content: space-between;
  font-size: 10px; color: var(--muted); padding: 0 2px 2px;
  font-variant-numeric: tabular-nums;
}
.tl-hint { margin: 8px 2px 0; font-size: 12px; color: var(--muted); }
.ready-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 16px; }
.ready-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; cursor: pointer; }
.ready-card video { width: 100%; height: 140px; object-fit: cover; background: #000; }
.ready-card b, .ready-card small { display: block; padding: 6px 10px; font-size: 12px; }
.ready-card small { color: var(--muted); padding-top: 0; padding-bottom: 8px; }
.ready-card .ready-dl { display: inline-block; margin: 0 10px 12px; padding: 6px 12px; font-size: 12px; cursor: pointer; }
.tl-see {
  margin-top: 8px; background: var(--bg);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; font-size: 12.5px; color: var(--muted); line-height: 1.45;
}
.tl-see b { color: var(--text); }
.tl-see p { margin: 0 0 6px; }
.tl-see-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.tl-see-head b { font-size: 13px; }
.tl-see-tags { margin-left: auto; font-size: 11px; color: var(--muted); }
.tl-dl { display: flex; gap: 6px; flex: 0 0 auto; }
.tl-dl .ghost, .tl-line .ghost { padding: 5px 10px; font-size: 11px; }
.tl-line { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.tl-line span { min-width: 0; }
.tl-line .ghost { flex: 0 0 auto; }
.tl-see mark, .timeline mark {
  background: color-mix(in srgb, var(--lime) 35%, transparent);
  color: var(--text); border-radius: 3px; padding: 0 2px;
}
.tags { color: var(--muted); font-size: 12px; }
.ep-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.ep-row.edit b { color: var(--lime); width: 100%; }
.ep-row.edit span { color: var(--muted); width: 100%; }
.ep-row.keep span { color: var(--muted); }
.empty-tl {
  color: var(--muted); font-size: 12px; padding: 16px 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; min-height: 108px; text-align: center;
}
.empty-tl p { margin: 0; }
.tl-skel { display: flex; gap: 6px; width: 100%; max-width: 420px; }
.tl-skel i {
  flex: 1; height: 54px; border-radius: 8px;
  background: linear-gradient(90deg, var(--panel2), color-mix(in srgb, var(--violet) 18%, var(--panel)), var(--panel2));
  background-size: 200% 100%;
  animation: skel 1.4s ease-in-out infinite;
}
@keyframes skel {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.composer {
  border-top: 1px solid var(--line);
  padding: 16px 18px 18px;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--bg) 55%, transparent));
}
.tl-search input::placeholder { color: var(--muted); opacity: 1; }
.composer textarea {
  width: 100%; min-height: 72px; resize: vertical;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; outline: none;
}
.composer textarea:focus { border-color: #4a4558; }
.composer.hot { outline: 2px dashed var(--lime); outline-offset: 4px; border-radius: 12px; }
.prompt-files {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px;
}
.prompt-file {
  position: relative; width: 72px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; padding: 4px;
  display: flex; flex-direction: column; gap: 4px;
}
.prompt-file img, .prompt-file video {
  width: 100%; height: 56px; object-fit: cover; border-radius: 6px; background: #000;
}
.prompt-file small {
  color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.prompt-file.add {
  align-items: center; justify-content: center; min-height: 72px;
  cursor: pointer; color: var(--muted); border-style: dashed; font-size: 11px; text-align: center;
}
.prompt-x {
  position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; padding: 0; line-height: 1;
}
.q-prod {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 0;
}
.q-prod b { color: var(--muted); font-size: 12px; width: 16px; }
.q-prod span { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-prod .ghost { padding: 2px 7px; font-size: 12px; }
.q-st { color: var(--muted); font-size: 11px; white-space: nowrap; }
.q-st.ok { color: var(--ok); }
.q-st.err { color: #e07070; }
.q-st.run { color: var(--lime); }
.row { display: flex; gap: 10px; align-items: center; margin-top: 12px; }
.create {
  margin-left: auto;
  background: linear-gradient(180deg, color-mix(in srgb, var(--lime) 82%, white), var(--lime));
  color: #111; border: 0;
  font-family: var(--display); font-weight: 800; letter-spacing: .04em;
  padding: 12px 22px; border-radius: 12px; font-size: 14px;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--lime) 22%, transparent);
}
html[data-theme="light"] .create {
  color: #f6f4ee;
  background: linear-gradient(180deg, #717a62, var(--lime));
  box-shadow: 0 8px 18px rgba(48,44,36,.12);
}
.create:disabled { opacity: .4; cursor: default; }
.create:not(:disabled):hover { filter: brightness(1.05); transform: translateY(-1px); }
.cost {
  background: var(--cost-bg);
  border: 1px solid var(--cost-line);
  border-radius: 12px;
  padding: 8px 12px;
  min-width: 180px;
}
.cost b { color: var(--lime); font-size: 16px; font-family: var(--display); letter-spacing: -.03em; }
.cost span { color: var(--muted); font-size: 12px; margin-left: 6px; }
.cost p { margin: 4px 0 0; color: var(--cost-note); font-size: 11px; line-height: 1.4; }
#sel-language { min-height: 0; height: auto; }
.lang-pick { display: flex; flex-direction: column; gap: 6px; }
.ghost-block { width: 100%; margin-top: 8px; }
.field.tight { margin-bottom: 8px; gap: 5px; }
.ok-cap { color: var(--ok); }
.compact-report { margin: 0 16px 10px; padding: 8px 12px; }
.inspector .block { margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.inspector .block:last-child { border-bottom: 0; margin-bottom: 0; }
.seg {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.chip {
  border: 1px solid var(--line); background: var(--panel);
  color: var(--muted); border-radius: 999px; padding: 6px 10px; font-size: 12px;
}
.chip.on {
  background: linear-gradient(180deg, color-mix(in srgb, var(--chip-on-bg) 70%, var(--lime)), var(--chip-on-bg));
  border-color: var(--lime); color: var(--lime);
}
html[data-theme="light"] .chip.on { color: var(--lime-dim); }
.dub-sort { margin-top: 2px; }
.dub-sort .chip { cursor: pointer; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.field span { font-size: 12px; color: var(--muted); }
select, .input {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 10px; outline: none; width: 100%;
}

.jobs { display: flex; flex-direction: column; gap: 8px; }
.job {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; cursor: pointer;
}
.job b { font-size: 12px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job small { color: var(--muted); }
.job.dub-file {
  display: flex; align-items: center; gap: 10px; cursor: grab;
}
.job.dub-file.dragging { opacity: 0.45; }
.job.dub-file.drag-over { border-color: var(--lime); }
.job.dub-file.done {
  border-color: color-mix(in srgb, var(--ok) 55%, var(--line));
  background: color-mix(in srgb, var(--ok) 14%, var(--panel));
}
.job.dub-file.done b { color: var(--ok); }
.job.dub-file.run {
  border-color: color-mix(in srgb, var(--warn) 55%, var(--line));
}
.job.dub-file.queued {
  border-color: color-mix(in srgb, var(--violet) 45%, var(--line));
}
.job.dub-file.err {
  border-color: color-mix(in srgb, var(--danger) 55%, var(--line));
}
.job.dub-file.err .dub-meta small { white-space: normal; }
.dub-err {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 4px;
}
.dub-err-msg {
  display: block;
  flex: 1;
  min-width: 0;
  color: var(--danger);
  font-size: 11px;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
  user-select: text;
  -webkit-user-select: text;
  cursor: text;
}
.errbox.copyable {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  user-select: text;
  -webkit-user-select: text;
}
.errbox.copyable .dub-err-msg { color: inherit; }
.dub-handle { color: var(--muted); letter-spacing: -2px; font-size: 13px; user-select: none; }
.dub-mark {
  width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex: 0 0 auto;
  background: var(--panel2); color: var(--muted); border: 1px solid var(--line);
}
.job.dub-file.done .dub-mark { background: var(--ok); color: #062014; border-color: var(--ok); }
.job.dub-file.run .dub-mark { background: var(--warn); color: #2a2208; border-color: var(--warn); }
.job.dub-file.queued .dub-mark { background: var(--violet); color: #fff; border-color: var(--violet); }
.job.dub-file.err .dub-mark { background: var(--danger); color: #fff; border-color: var(--danger); }
html[data-theme="light"] .job.dub-file.done .dub-mark { color: #fff; }
.dub-meta { flex: 1; min-width: 0; }
.dub-actions { display: flex; flex: 0 0 auto; gap: 6px; align-items: center; flex-wrap: nowrap; }
.job.dub-file .ghost { flex: 0 0 auto; padding: 5px 10px; font-size: 12px; line-height: 1.2; }
.job.dub-file .ghost.icon-btn,
.icon-btn {
  width: 30px; min-width: 30px; height: 30px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; line-height: 1;
}
.icon-btn svg { display: block; }
.icon-btn.on { border-color: var(--lime); color: var(--lime); background: var(--chip-on-bg); }
.dub-gender { display: inline-flex; gap: 4px; align-items: center; }
.job.dub-file.err .dub-gender .icon-btn { border-color: color-mix(in srgb, var(--warn) 70%, var(--line)); }
.dub-sex-hint { display: block; margin-top: 2px; font-size: 11px; color: var(--warn); }
.row #dub-dl-all { margin-left: auto; }
.row #dub-dl-all + .create { margin-left: 0; }

#studio-chat { position: fixed; right: 18px; bottom: 18px; z-index: 60; }
.gchat-fab {
  height: 42px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  font-family: var(--display); font-size: 13px; font-weight: 700; letter-spacing: -.02em;
  box-shadow: var(--shadow);
}
.gchat-fab:hover { border-color: var(--lime); color: var(--lime); }
.gchat-panel {
  width: min(380px, calc(100vw - 28px));
  max-height: min(70vh, 560px);
  display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow); overflow: hidden;
}
.gchat-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-bottom: 1px solid var(--line);
  font-family: var(--display); font-weight: 700; font-size: 14px;
}
.gchat-head-btns { display: flex; gap: 4px; }
.gchat-log {
  flex: 1; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px;
  min-height: 180px; max-height: 380px;
}
.gchat-empty { color: var(--muted); font-size: 13px; line-height: 1.45; }
.gchat-msg {
  max-width: 92%; padding: 8px 10px; border-radius: 12px; font-size: 13px; line-height: 1.45;
  white-space: pre-wrap; word-break: break-word;
}
.gchat-msg.me { align-self: flex-end; background: var(--chip-on-bg); border: 1px solid var(--line); }
.gchat-msg.ai { align-self: flex-start; background: var(--panel2); border: 1px solid var(--line); }
.gchat-msg.dim { color: var(--muted); }
.gchat-tools { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.vf-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.stock-strip { margin: 10px 0 4px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 12px; background: var(--panel2); }
.stock-strip.hot { border-color: var(--lime); }
.stock-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.stock-head small { color: var(--muted); }
.stock-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.stock-clip { flex: 0 0 110px; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); overflow: hidden; text-align: left; }
.stock-clip video { display: block; width: 100%; height: 64px; object-fit: cover; background: #111; }
.stock-clip span { display: block; padding: 4px 6px; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stock-clip.on { border-color: var(--lime); }
.stock-add { font-size: 12px; cursor: pointer; color: var(--muted); }
.tl-clip.stock { outline: 1px solid var(--lime); }
.tl-clip.inhand { outline: 1px solid #7ec8ff; }
.tl-clip.swap { outline: 1px solid #ffb347; }
.mode-tag { position: absolute; left: 4px; bottom: 16px; font-size: 9px; background: #000c; color: #fff; padding: 1px 4px; border-radius: 4px; z-index: 3; }
.ctx-menu { position: fixed; z-index: 80; min-width: 220px; max-width: 280px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px; box-shadow: var(--shadow); }
.ctx-menu[hidden] { display: none; }
.ctx-menu button { display: block; width: 100%; text-align: left; background: none; border: 0; color: var(--text); padding: 8px 10px; border-radius: 8px; cursor: pointer; font: inherit; font-size: 13px; }
.ctx-menu button:hover, .ctx-menu button.on { background: var(--panel2); }
.ctx-menu .ctx-sub { max-height: 180px; overflow: auto; margin-top: 4px; border-top: 1px solid var(--line); padding-top: 4px; }
.ctx-menu .ctx-sub button { font-size: 12px; color: var(--muted); }
.var-slider { display: flex; align-items: center; gap: 10px; flex: 1; }
.var-slider input[type="range"] { flex: 1; accent-color: var(--lime); }
.var-slider b { min-width: 1.4em; text-align: right; font-variant-numeric: tabular-nums; }
.var-watch { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 0; }
.var-watch span { color: var(--muted); font-size: 12px; margin-right: 4px; }
.var-mini { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.gchat-err { padding: 6px 12px; color: var(--danger); font-size: 12px; }
.gchat-form {
  display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); align-items: flex-end;
}
.gchat-form textarea {
  flex: 1; resize: none; min-height: 40px; max-height: 90px;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px;
}
.gchat-form .create { height: 40px; min-width: 40px; padding: 0 12px; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.dot.run { background: var(--warn); }
.dot.ok { background: var(--ok); }
.dot.err { background: var(--danger); }

.modal-back {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center; z-index: 20; padding: 20px;
}
.modal {
  width: min(560px, 100%); background: var(--bg2); border: 1px solid var(--line);
  border-radius: 18px; padding: 20px; max-height: 90vh; overflow: auto;
}
.modal h2 { font-family: var(--display); margin: 0 0 12px; letter-spacing: -.04em; }
.add-drops {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}
.add-drops .drop.compact { min-height: 72px; padding: 10px 8px; }
.add-drops .drop strong { font-size: 13px; }
.add-drops .drop p { font-size: 11px; }
.assets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.assets .cell {
  aspect-ratio: 1; background: var(--panel); border: 1px dashed var(--drop-line); border-radius: 10px;
  overflow: hidden; cursor: pointer; display: grid; place-items: center; color: var(--muted); font-size: 11px;
}
.assets .cell img, .assets .cell video { width: 100%; height: 100%; object-fit: cover; }

.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; font-size: 13px; }
.kv i { color: var(--muted); font-style: normal; }

.notice {
  background: var(--notice-bg); border: 1px solid var(--notice-line); color: var(--notice-text);
  border-radius: 10px; padding: 10px 12px; font-size: 12px; line-height: 1.4; margin-bottom: 12px;
}
.errbox { color: var(--danger); font-size: 13px; }

@media (max-width: 1100px) {
  .workspace { grid-template-columns: 1fr; }
  .col { border-right: 0; border-bottom: 1px solid var(--line); }
  .phone { width: min(260px, 70vw); }
}
