/* FORGE platform — base, layout and components */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 14px/1.5 var(--font-ui); color: var(--text); background: var(--bg); background-image: var(--bg-grad); background-attachment: fixed;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-feature-settings: "ss01", "cv11";
}
::selection { background: var(--accent-soft); color: var(--text); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img, video, canvas { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: var(--r-sm); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; } }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--rail) 1fr; min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-5) var(--s-3);
  border-right: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(18px) saturate(1.4);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-grad); color: var(--accent-ink); box-shadow: var(--glow); }
.brand-name { font-weight: 650; letter-spacing: .14em; font-size: 13px; }
.brand-sub { font-size: 11px; color: var(--text-3); letter-spacing: .02em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); padding: 14px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: var(--r-sm); color: var(--text-2); font-weight: 500;
  transition: background var(--t-fast), color var(--t-fast);
}
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a[aria-current="page"] { background: var(--surface-3); color: var(--text); box-shadow: var(--shadow-1); }
.nav a[aria-current="page"] svg { color: var(--accent); opacity: 1; }
.nav .count { margin-left: auto; font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: var(--s-3); }
.wallet { padding: 12px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.wallet-row { display: flex; justify-content: space-between; align-items: baseline; }
.wallet-value { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.meter { height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; margin-top: 8px; }
.meter > i { display: block; height: 100%; background: var(--accent-grad); border-radius: inherit; transition: width var(--t-slow) var(--ease); }
.rail-tools { display: flex; gap: 6px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: var(--s-4); padding: 14px var(--s-8); min-height: 64px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(16px); }
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 13px; min-width: 0; }
.crumbs b { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }
.page { padding: var(--s-8); max-width: 1480px; width: 100%; margin: 0 auto; animation: page-in var(--t-slow) var(--ease); }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } }

/* ---------- typography ---------- */
.display { font-family: var(--font-display); font-weight: 800; letter-spacing: -.04em; line-height: 1.02; margin: 0; }
.display em { font-style: normal; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .06em; }
h1.display { font-size: clamp(32px, 3.8vw, 52px); }
h2.display { font-size: 30px; }
.h2 { font-family: var(--font-display); font-size: 20px; font-weight: 750; letter-spacing: -.025em; margin: 0; }
.h3 { font-family: var(--font-display); font-size: 15px; font-weight: 700; letter-spacing: -.015em; margin: 0; }
.niche-cover b, .prod-cover .ph, .plan .price, .player-empty b, .title-edit { font-weight: 800; letter-spacing: -.035em; }
.kpi b, .wallet-value, .quote-total b { font-family: var(--font-display); font-weight: 800; letter-spacing: -.03em; }
.eyebrow { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); font-weight: 600; }
.muted { color: var(--text-2); } .faint { color: var(--text-3); }
.mono { font-family: var(--font-mono); font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
p { margin: 0; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.card-pad { padding: var(--s-6); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--line); }
.card-body { padding: var(--s-5); }
.panel { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); }
.divider { height: 1px; background: var(--line); margin: var(--s-4) 0; }
.stack { display: flex; flex-direction: column; gap: var(--s-4); } .stack-sm { display: flex; flex-direction: column; gap: var(--s-2); } .stack-lg { display: flex; flex-direction: column; gap: var(--s-8); }
.row { display: flex; align-items: center; gap: var(--s-3); } .row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.between { justify-content: space-between; } .grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: var(--s-4); }
.grid-auto { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* ---------- buttons ---------- */
.btn {
  --b-bg: var(--surface-2); --b-fg: var(--text); --b-line: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: var(--r-sm);
  border: 1px solid var(--b-line); background: var(--b-bg); color: var(--b-fg); font-weight: 550; cursor: pointer; white-space: nowrap; user-select: none;
  transition: transform var(--t-fast) var(--ease), background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), opacity var(--t-fast);
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:hover { border-color: var(--text-3); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { --b-fg: var(--accent-ink); --b-line: transparent; position: relative; overflow: hidden; background: var(--accent-grad); background-size: 160% 100%; box-shadow: var(--glow), inset 0 1px 0 rgba(255, 255, 255, .28); transition: background-position var(--t-slow) var(--ease), transform var(--t-fast) var(--ease), box-shadow var(--t); }
.btn-primary::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .38) 50%, transparent 70%); transform: translateX(-120%); transition: transform 700ms var(--ease); pointer-events: none; }
.btn-primary:hover { background-position: 100% 0; border-color: transparent; transform: translateY(-1px); }
.btn-primary:hover::after { transform: translateX(120%); }
.btn-primary[disabled]::after { display: none; }
.btn-ghost { --b-bg: transparent; --b-line: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: transparent; }
.btn-danger { --b-fg: var(--bad); }
.btn-lg { height: 46px; padding: 0 22px; font-size: 15px; border-radius: var(--r-md); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-icon { width: 36px; padding: 0; } .btn-icon.btn-sm { width: 30px; }
.btn .spin { animation: spin 900ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- inputs ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.hint { font-size: 12px; color: var(--text-3); }
.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface);
  transition: border-color var(--t-fast), box-shadow var(--t-fast); outline: none;
}
.textarea { height: auto; min-height: 120px; padding: 12px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: calc(100% - 17px) 16px, calc(100% - 12px) 16px; background-size: 5px 5px; background-repeat: no-repeat; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
input[type="color"] { width: 38px; height: 38px; padding: 3px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); cursor: pointer; }

.seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg button { flex: none; }
.seg { display: inline-flex; padding: 3px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); gap: 2px; }
.seg button { display: inline-flex; align-items: center; gap: 7px; border: 0; background: transparent; height: 32px; padding: 0 14px; border-radius: 9px; color: var(--text-2); font-weight: 550; cursor: pointer; transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast); }
.seg button svg { width: 15px; height: 15px; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-2); }
.seg.full { display: flex; } .seg.full button { flex: 1; justify-content: center; }

.switch { position: relative; width: 36px; height: 20px; border-radius: 20px; background: var(--surface-3); border: 1px solid var(--line-2); cursor: pointer; flex: none; transition: background var(--t); }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-2); transition: transform var(--t) var(--ease-spring), background var(--t); }
.switch[aria-checked="true"] { background: var(--accent); border-color: transparent; } .switch[aria-checked="true"]::after { transform: translateX(16px); background: white; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: var(--r-pill); font-size: 11.5px; font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge.plain::before { display: none; }
.badge.ok { background: var(--ok-soft); color: var(--ok); } .badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); } .badge.info { background: var(--info-soft); color: var(--info); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.badge.live::before { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--r-pill); border: 1px solid var(--line-2); font-size: 12px; color: var(--text-2); }
.chip svg { width: 13px; height: 13px; }
.kbd { font-family: var(--font-mono); font-size: 11px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line-2); color: var(--text-3); }

/* ---------- studio ---------- */
.studio { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--s-6); align-items: start; }
.studio-hero { padding: var(--s-10) var(--s-8) var(--s-8); position: relative; overflow: hidden; }
.studio-hero { isolation: isolate; background-image: linear-gradient(100deg, var(--surface) 38%, color-mix(in srgb, var(--surface) 55%, transparent) 70%, transparent), url('/assets/styles/hero.webp'); background-size: cover; background-position: right center; }
.studio-hero::before, .studio-hero::after { content: ""; position: absolute; z-index: -1; pointer-events: none; border-radius: 50%; filter: blur(60px); opacity: .55; }
.studio-hero::before { width: 420px; height: 260px; top: -120px; left: -60px; background: radial-gradient(circle, rgba(85, 71, 218, .55), transparent 70%); animation: aurora-a 14s ease-in-out infinite alternate; }
.studio-hero::after { width: 380px; height: 240px; top: -90px; right: -40px; background: radial-gradient(circle, rgba(20, 200, 189, .45), transparent 70%); animation: aurora-b 17s ease-in-out infinite alternate; }
@keyframes aurora-a { to { transform: translate(140px, 40px) scale(1.15); } }
@keyframes aurora-b { to { transform: translate(-160px, 30px) scale(.9); } }
.prompt { position: relative; margin-top: var(--s-6); border-radius: var(--r-lg); border: 1px solid var(--line-2); background: var(--surface); box-shadow: var(--shadow-2); transition: box-shadow var(--t), border-color var(--t); }
.prompt::before { content: ""; position: absolute; inset: -1.5px; border-radius: inherit; padding: 1.5px; background: var(--accent-grad); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity var(--t); pointer-events: none; }
.prompt:focus-within { border-color: transparent; box-shadow: 0 0 0 5px var(--accent-soft), var(--shadow-2); }
.prompt:focus-within::before { opacity: 1; }
.prompt textarea { display: block; width: 100%; min-height: 128px; padding: 20px 22px 8px; border: 0; background: transparent; resize: none; outline: none; font-size: 18px; line-height: 1.55; letter-spacing: -.005em; }
.prompt textarea::placeholder { color: var(--text-3); }
.prompt-bar { display: flex; align-items: center; gap: var(--s-2); padding: 10px 12px 12px; flex-wrap: wrap; }
/* live production stage in the player */
.stage { position: relative; width: 100%; aspect-ratio: 9 / 16; max-height: 72vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 28px 22px; text-align: center; color: #f4f1ff; overflow: hidden;
  background: radial-gradient(90% 70% at 20% 0%, #3b2a8a 0%, transparent 60%), radial-gradient(80% 70% at 100% 100%, #0f5f73 0%, transparent 60%), #0c0a18; }
.player.horizontal .stage { aspect-ratio: 16 / 9; }
.player:has(.stage) { width: 100%; }
.player.vertical:has(.stage) { width: min(100%, calc(72vh * 9 / 16)); }
.stage-bg { position: absolute; inset: -30px; background-size: cover; background-position: center; filter: blur(26px) saturate(1.2) brightness(.45); opacity: 0; transform: scale(1.08); transition: opacity .8s, background-image .8s; }
.stage.has-thumb .stage-bg { opacity: 1; }
.stage-glow { position: absolute; width: 140%; aspect-ratio: 1; border-radius: 50%; background: conic-gradient(from 0deg, transparent, rgba(124, 92, 255, .35), rgba(54, 195, 224, .3), transparent 70%); filter: blur(40px); opacity: .7; }
@media (prefers-reduced-motion: no-preference) { .stage-glow { animation: stage-spin 9s linear infinite; } .stage-phases span[data-state="active"] i { animation: stage-pulse 1.4s ease-in-out infinite; } }
@keyframes stage-spin { to { transform: rotate(360deg); } }
@keyframes stage-pulse { 50% { transform: scale(1.5); box-shadow: 0 0 0 6px rgba(124, 92, 255, .25); } }
.stage > :not(.stage-bg):not(.stage-glow) { position: relative; z-index: 1; }
.stage-ring { position: relative; width: 104px; height: 104px; display: grid; place-items: center; }
.stage-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.stage-ring circle { fill: none; stroke-width: 6; }
.stage-ring .track { stroke: rgba(255, 255, 255, .12); }
.stage-ring .bar { stroke: #8f7bff; stroke-linecap: round; transition: stroke-dasharray .9s ease; filter: drop-shadow(0 0 6px rgba(143, 123, 255, .7)); }
.stage-ring b { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.stage-title { font-size: 19px; font-weight: 800; letter-spacing: -0.01em; max-width: 90%; }
.stage-line { font-size: 14px; line-height: 1.45; color: rgba(244, 241, 255, .82); max-width: 92%; font-style: italic; min-height: 1em; }
.stage-line:empty, .stage-detail:empty { display: none; }
.stage-detail { font-size: 11.5px; color: rgba(244, 241, 255, .55); max-width: 92%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-phases { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 6px; font-size: 11px; color: rgba(244, 241, 255, .5); }
.stage-phases span { display: inline-flex; align-items: center; gap: 5px; }
.stage-phases i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .25); transition: background .4s; }
.stage-phases span[data-state="done"] { color: rgba(244, 241, 255, .8); } .stage-phases span[data-state="done"] i { background: #36e0c8; }
.stage-phases span[data-state="active"] { color: #fff; font-weight: 700; } .stage-phases span[data-state="active"] i { background: #8f7bff; }
.stage-time { font-size: 12px; color: rgba(244, 241, 255, .6); }

/* sign-in */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--bg); }
@media (max-width: 880px) { .auth-shell { grid-template-columns: 1fr; } .auth-hero { display: none; } }
.auth-hero { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(28px, 4vw, 56px); color: #f6f3ff;
  background: radial-gradient(120% 90% at 0% 0%, #5b3df5 0%, transparent 55%), radial-gradient(90% 80% at 100% 100%, #13b8c9 0%, transparent 55%), linear-gradient(160deg, #191233, #0d1424); }
.auth-hero .brand { color: inherit; } .auth-hero .brand-sub { color: rgba(246, 243, 255, .7); }
.auth-pitch { position: relative; z-index: 1; max-width: 520px; }
.auth-pitch h2 { font-family: var(--font-display, inherit); font-size: clamp(32px, 4vw, 52px); line-height: 1.02; letter-spacing: -0.03em; font-weight: 800; margin: 0 0 22px; }
.auth-pitch h2 em { font-style: normal; background: linear-gradient(90deg, #b9a8ff, #6fe6e0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-pitch ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; font-size: 15px; color: rgba(246, 243, 255, .86); }
.auth-pitch li { display: flex; gap: 10px; align-items: center; }
.auth-pitch li svg { width: 18px; height: 18px; color: #6fe6e0; flex: none; }
.auth-glow { position: absolute; width: 520px; height: 520px; right: -160px; top: 18%; border-radius: 50%; background: conic-gradient(from 120deg, #7c5cff, #36c3e0, #ff6aa8, #7c5cff); filter: blur(90px); opacity: .35; }
@media (prefers-reduced-motion: no-preference) { .auth-glow { animation: auth-spin 18s linear infinite; } }
@keyframes auth-spin { to { transform: rotate(360deg); } }
.auth-main { display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: min(420px, 100%); display: grid; gap: 14px; }
.auth-card h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; margin: 0; }
.auth-card .muted { margin: -6px 0 6px; }
.auth-field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; }
.auth-field .input { height: 46px; font-size: 15px; }
.auth-submit { width: 100%; justify-content: center; margin-top: 4px; }
.auth-forgot { justify-self: end; font-size: 13px; margin-top: -6px; }
.auth-alt { text-align: center; font-size: 14px; color: var(--text-2); margin: 4px 0 0; }
.auth-legal { text-align: center; font-size: 12px; margin: 0; }
.auth-error:empty { display: none; }
.auth-error { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; color: var(--bad, #c0392b); background: color-mix(in srgb, var(--bad, #c0392b) 9%, transparent); }
.auth-error svg { width: 16px; height: 16px; flex: none; }
.account { display: flex; align-items: center; gap: 10px; padding: 8px 6px 8px 10px; border-radius: 12px; border: 1px solid var(--line); margin-top: 10px; }
.account-avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #fff; background: linear-gradient(135deg, var(--accent), #36c3e0); flex: none; }
.account-meta { display: grid; min-width: 0; flex: 1; font-size: 12.5px; }
.account-meta b, .account-meta span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-meta span { color: var(--text-3, var(--text-2)); font-size: 11.5px; }

/* clip studio */
.clip-hero { padding: clamp(20px, 3vw, 34px); position: relative; overflow: hidden; background: radial-gradient(110% 140% at 100% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 58%), radial-gradient(80% 120% at 0% 100%, color-mix(in srgb, #36e0c8 12%, transparent), transparent 55%), var(--surface); }
.clip-steps { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.clip-steps span { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; padding: 5px 11px 5px 5px; border-radius: 99px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 80%, transparent); }
.clip-steps b { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; color: #fff; background: linear-gradient(135deg, var(--accent), #36c3e0); }
.clip-drop { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 34px 18px; border-radius: 16px; border: 1.5px dashed color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--surface) 70%, transparent); cursor: pointer; transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast); }
.clip-drop:hover, .clip-drop.over, .clip-drop:focus-visible { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); transform: translateY(-1px); }
.clip-drop b { font-size: 16px; }
.clip-drop-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--accent), #36c3e0); box-shadow: 0 12px 30px -14px var(--accent); }
.clip-drop-icon svg { width: 24px; height: 24px; }
.clip-projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.clip-project { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: inherit; text-decoration: none; transition: border-color var(--t-fast), transform var(--t-fast); }
.clip-project:hover { border-color: var(--accent); transform: translateY(-1px); }
.clip-project .thumb { width: 64px; height: 84px; border-radius: 9px; overflow: hidden; display: grid; place-items: center; background: var(--surface-2, #f1eee8); color: var(--text-3, var(--text-2)); }
.clip-project .thumb img { width: 100%; height: 100%; object-fit: cover; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.clip-source-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent); flex: none; }
.range-bar { position: relative; height: 14px; border-radius: 99px; background: color-mix(in srgb, var(--text) 8%, transparent); cursor: pointer; overflow: hidden; }
.range-bar i { position: absolute; top: 0; bottom: 0; border-radius: 99px; background: linear-gradient(90deg, var(--accent), #36c3e0); box-shadow: 0 0 0 2px color-mix(in srgb, var(--surface) 70%, transparent) inset; transition: left .15s, width .15s; }
.clip-quote { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: end; padding-top: 14px; border-top: 1px solid var(--line); }
@media (max-width: 700px) { .clip-quote { grid-template-columns: 1fr; } }
.clip-phases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.clip-phases .phase { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); font-size: 13px; }
.clip-phases .phase.run { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.clip-phases .phase.done { color: var(--ok, #1f9d6b); }
.clip-phases .phase svg { width: 15px; height: 15px; }
.clip-phases .phase .faint { margin-left: auto; }
.clip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.clip-card { display: grid; gap: 10px; padding: 10px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast); }
.clip-card:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); box-shadow: 0 18px 40px -28px var(--accent); transform: translateY(-2px); }
.clip-card.stale { border-style: dashed; }
.clip-frame { position: relative; aspect-ratio: 9 / 16; border-radius: 12px; overflow: hidden; background: #0d0b14; border: 0; padding: 0; cursor: pointer; }
.clip-frame video { width: 100%; height: 100%; object-fit: cover; display: block; }
.clip-frame .play { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(transparent 55%, rgba(10, 6, 20, .55)); transition: opacity var(--t-fast); }
.clip-frame .play svg { width: 46px; height: 46px; padding: 12px; border-radius: 50%; color: #fff; background: rgba(255, 255, 255, .2); backdrop-filter: blur(8px); }
.clip-frame.playing .play { opacity: 0; }
.clip-frame .dur, .clip-frame .top { position: absolute; top: 8px; font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 99px; backdrop-filter: blur(8px); }
.clip-frame .dur { right: 8px; color: #fff; background: rgba(10, 6, 20, .55); }
.clip-frame .top { left: 8px; color: #141414; background: #ffd43b; }
.clip-meta { display: grid; gap: 9px; padding: 0 2px 2px; }
.clip-title { font-size: 14px; line-height: 1.3; font-weight: 720; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clip-hook { display: block; margin-top: 3px; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--accent); }
.score-ring { position: relative; flex: none; display: grid; place-items: center; }
.score-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.score-ring circle { fill: none; stroke-width: 4; }
.score-ring .track { stroke: color-mix(in srgb, var(--text) 10%, transparent); }
.score-ring .bar { stroke-linecap: round; stroke: #8a8f9c; }
.score-ring.good .bar { stroke: #36c3a0; } .score-ring.hot .bar { stroke: #ff7a3d; }
.score-ring b { font-size: 14px; font-weight: 800; }
.score-bars { display: grid; gap: 6px; }
.score-bar { display: grid; grid-template-columns: 110px minmax(0, 1fr) 30px; gap: 10px; align-items: center; font-size: 12.5px; }
.score-bar .progress { height: 6px; }

/* voice library */
.voice-hero { background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%), radial-gradient(90% 120% at 0% 100%, color-mix(in srgb, #36e0c8 12%, transparent), transparent 55%), var(--surface); }
.tier-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
@media (max-width: 760px) { .tier-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tier-chip { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; border: 1px dashed var(--line-2, var(--line)); font-size: 12.5px; color: var(--text-2); }
.tier-chip b { font-size: 14px; color: var(--text); }
.tier-chip.on { border-style: solid; border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.tier-state { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; margin-top: 2px; }
.tier-state svg { width: 12px; height: 12px; }
.voice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.voice-card { display: grid; gap: 12px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast); }
.voice-card:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); box-shadow: 0 12px 30px -22px var(--accent); transform: translateY(-1px); }
.voice-card.tier-flagship { background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 8%, var(--surface)), color-mix(in srgb, #36e0c8 6%, var(--surface))); }
.voice-card.locked { border-style: dashed; }
.voice-card.preset { border-color: color-mix(in srgb, #36e0c8 45%, var(--line)); }
.voice-avatar { width: 42px; height: 42px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 17px; color: #fff; background: linear-gradient(135deg, #7c5cff, #3d7bff); box-shadow: inset 0 -6px 12px rgba(0,0,0,.15); }
.voice-avatar.female { background: linear-gradient(135deg, #ff6aa8, #8a5cff); }
.voice-avatar.male { background: linear-gradient(135deg, #3d7bff, #20c3b4); }

/* idea pool under the prompt: trending long-form | short ideas */
.pool { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: var(--s-4); position: relative; }
@media (max-width: 860px) { .pool { grid-template-columns: 1fr; } }
.pool-col { display: grid; gap: 5px; align-content: start; min-width: 0; }
.pool-head { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; margin-bottom: 1px; }
.pool-head .faint { font-size: 11.5px; }
/* one compact row per idea; expands on click */
.pool-idea { border-radius: 10px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(6px); transition: border-color var(--t-fast), box-shadow var(--t-fast); min-width: 0; }
.pool-idea:hover, .pool-idea[open] { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.pool-idea[open] { box-shadow: 0 10px 26px -20px var(--accent); }
.pool-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok, #1f9d6b); margin: 0 2px; }
.pool-idea summary { list-style: none; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 7px; padding: 7px 9px; cursor: pointer; font-size: 13px; }
.pool-idea summary::-webkit-details-marker { display: none; }
.pool-idea summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 10px; }
.pool-idea summary > svg { width: 14px; height: 14px; color: var(--text-3, var(--text-2)); transition: transform var(--t-fast); }
.pool-idea[open] summary > svg { transform: rotate(180deg); }
.pool-title { font-weight: 650; font-size: 12.5px; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pool-title.blurred { white-space: nowrap; display: block; text-overflow: clip; filter: blur(4px); opacity: .5; user-select: none; letter-spacing: .5px; }
.pool-tag { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: color-mix(in srgb, var(--ok, #1f9d6b) 13%, transparent); color: var(--ok, #1f9d6b); white-space: nowrap; }
.pool-tag.hot { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.pool-tag svg { width: 11px; height: 11px; }
.pool-len { font-size: 11.5px; color: var(--text-3, var(--text-2)); white-space: nowrap; }
.pool-price { font-size: 12px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.pool-price.free { color: var(--ok, #1f9d6b); }
.pool-idea.premium { border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 7%, var(--surface)), color-mix(in srgb, #36e0c8 5%, var(--surface))); }
.pool-body { display: grid; gap: 8px; padding: 0 10px 10px; }
.pool-hook { font-size: 12.5px; color: var(--text-2); margin: 0; }
.pool-meta { font-size: 11.5px; color: var(--text-3, var(--text-2)); }
.pool-includes { display: flex; flex-wrap: wrap; gap: 3px 10px; font-size: 11.5px; color: var(--text-2); }
.pool-includes span { display: inline-flex; align-items: center; gap: 3px; }
.pool-includes svg { width: 12px; height: 12px; color: var(--accent); }
.pool-skeleton { height: 34px; border-radius: 10px; background: linear-gradient(100deg, var(--surface-2, #f4f1ec) 30%, var(--surface) 50%, var(--surface-2, #f4f1ec) 70%); background-size: 300% 100%; animation: idea-shimmer 1.2s linear infinite; }
@media (prefers-reduced-motion: reduce) { .pool-skeleton { animation: none; } }

/* thumbnail preview */
.thumb-preview { width: 100%; border-radius: 10px; border: 1px solid var(--line); display: block; object-fit: cover; }
.thumb-preview.vertical { max-width: 220px; aspect-ratio: 9 / 16; margin: 0 auto; }
.thumb-preview.horizontal { aspect-ratio: 16 / 9; }

/* idea generator */
.idea-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.idea-grid:empty { display: none; }
.idea-card { display: flex; flex-direction: column; gap: 8px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-lg, 14px); background: var(--surface); transition: border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast); }
.idea-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 10px 28px -18px var(--accent); }
.idea-card h3 { font-size: 15px; font-weight: 750; line-height: 1.3; letter-spacing: -0.01em; }
.idea-card .idea-hook { font-size: 13.5px; color: var(--text); font-weight: 560; }
.idea-card p { font-size: 13px; margin: 0; }
.idea-card .btn { margin-top: auto; align-self: flex-start; }
.idea-card.skeleton { min-height: 170px; background: linear-gradient(100deg, var(--surface-2, #f4f1ec) 30%, var(--surface) 50%, var(--surface-2, #f4f1ec) 70%); background-size: 300% 100%; animation: idea-shimmer 1.2s linear infinite; }
@keyframes idea-shimmer { to { background-position: -150% 0; } }
@media (prefers-reduced-motion: reduce) { .idea-card.skeleton { animation: none; } }
.suggestions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: var(--s-4); }
.suggestion { border: 1px dashed var(--line-2); background: transparent; color: var(--text-2); padding: 6px 12px; border-radius: var(--r-pill); cursor: pointer; font-size: 12.5px; transition: all var(--t-fast); }
.suggestion:hover { border-style: solid; color: var(--text); background: var(--surface-2); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); margin: 0 0 var(--s-3); }
.config-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--s-5); }

.style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: var(--s-4); }
.style-card { position: relative; text-align: left; padding: 0; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); cursor: pointer; overflow: hidden; transition: transform var(--t) var(--ease), border-color var(--t), box-shadow var(--t); }
.style-card:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: var(--shadow-2); }
.style-card[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.style-art { height: 92px; position: relative; overflow: hidden; }
.style-art .sa-line { position: absolute; left: 12px; height: 7px; border-radius: 4px; background: rgba(255, 255, 255, .85); }
.style-art .sa-bar { position: absolute; left: 12px; width: 22px; height: 3px; border-radius: 2px; }
.style-art .sa-frame { position: absolute; inset: 14px 14px 14px 56%; border-radius: 6px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .15); animation: kb 6s ease-in-out infinite alternate; }
@keyframes kb { to { transform: scale(1.08) translateX(-4px); } }
.style-art.cover { height: 132px; background: var(--canvas); }
.style-art.cover img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.02); transition: transform 6s cubic-bezier(.2, .7, .2, 1), filter var(--t-slow); filter: saturate(1.05); }
.style-art.cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 8, 25, .05) 40%, rgba(10, 8, 25, .55)); pointer-events: none; }
.style-art .sheen { position: absolute; inset: -40% -60%; background: linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, .28) 50%, transparent 58%); transform: translateX(-60%); transition: transform 1.1s var(--ease); pointer-events: none; z-index: 1; }
.style-card:hover .style-art.cover img { transform: scale(1.14); filter: saturate(1.2); }
.style-card:hover .style-art .sheen { transform: translateX(60%); }
.style-card[aria-pressed="true"] .style-art.cover img { transform: scale(1.1); }
.style-card .badge { z-index: 2; }
.style-card.locked .style-art.cover img { filter: saturate(.55) brightness(.85); }
.style-card .badge svg { width: 11px; height: 11px; }
.style-meta { padding: 10px 12px 12px; }
.style-meta b { display: block; font-size: 13px; font-weight: 600; }
.style-meta span { display: block; font-size: 11.5px; color: var(--text-3); line-height: 1.4; margin-top: 2px; }
.style-card .badge { position: absolute; top: 8px; right: 8px; height: 20px; font-size: 10.5px; backdrop-filter: blur(6px); }
.style-card[data-availability="engine"], .style-card[data-availability="provider"] { opacity: .78; }
.style-card[data-availability="soon"] { opacity: .6; filter: saturate(.55); cursor: default; }
.style-card[data-availability="soon"]:hover { transform: none; }

.niche-strip { display: flex; gap: var(--s-3); overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.niche-pill { scroll-snap-align: start; flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); cursor: pointer; transition: border-color var(--t-fast), background var(--t-fast); }
.niche-pill:hover { border-color: var(--line-2); }
.niche-pill[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.niche-dot { width: 28px; height: 28px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15); }
.niche-pill b { font-size: 13px; font-weight: 600; white-space: nowrap; } .niche-pill span { font-size: 11px; color: var(--text-3); display: block; }

.summary { position: sticky; top: 88px; }
.summary-row { display: flex; justify-content: space-between; gap: var(--s-3); padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.summary-row:last-child { border-bottom: 0; }
.summary-row span:first-child { color: var(--text-3); }
.summary-row span:last-child { font-weight: 550; text-align: right; }
.quote { margin-top: var(--s-4); padding: var(--s-4); border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.quote-total { display: flex; align-items: baseline; justify-content: space-between; }
.quote-total b { font-size: 26px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

.script-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: var(--s-4); overflow-x: auto; scrollbar-width: none; }
.script-tabs .tab { flex: none; }
.tab { border: 0; background: none; padding: 10px 14px; color: var(--text-2); font-weight: 550; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 8px; align-items: center; }
.tab svg { width: 15px; height: 15px; }
.tab:hover { color: var(--text); } .tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }

/* ---------- productions ---------- */
.prod-grid { display: grid; gap: var(--s-5); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.prod-card { display: flex; flex-direction: column; border-radius: var(--r-lg); overflow: hidden; background: var(--surface); border: 1px solid var(--line); transition: transform var(--t) var(--ease), box-shadow var(--t), border-color var(--t); }
.prod-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--line-2); }
.prod-cover { position: relative; aspect-ratio: 16 / 10; background: var(--canvas); overflow: hidden; display: grid; place-items: center; }
.prod-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-slow) var(--ease); }
.prod-card:hover .prod-cover img { transform: scale(1.04); }
.prod-cover .ph { font-family: var(--font-display); font-size: 22px; color: rgba(255, 255, 255, .8); padding: 0 24px; text-align: center; line-height: 1.15; }
.prod-cover .badge { position: absolute; top: 10px; left: 10px; backdrop-filter: blur(8px); }
.prod-cover .dur { position: absolute; bottom: 10px; right: 10px; font-size: 11px; padding: 2px 7px; border-radius: 6px; background: rgba(0, 0, 0, .6); color: #fff; font-variant-numeric: tabular-nums; }
.prod-info { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.prod-info b { font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prod-info .meta { display: flex; gap: 10px; font-size: 12px; color: var(--text-3); flex-wrap: wrap; }

/* ---------- production workspace ---------- */
.ws { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: var(--s-6); align-items: start; }
.ws-head { display: flex; align-items: flex-start; gap: var(--s-4); margin-bottom: var(--s-6); flex-wrap: wrap; }
.title-edit { font-family: var(--font-display); font-size: 34px; line-height: 1.1; border: 1px solid transparent; background: transparent; border-radius: var(--r-sm); padding: 2px 6px; margin-left: -7px; width: 100%; outline: none; }
.title-edit:hover { border-color: var(--line); } .title-edit:focus { border-color: var(--accent); background: var(--surface); }
.pipeline { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: var(--s-6); }
.pstep { position: relative; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); display: flex; gap: 10px; align-items: center; min-width: 0; }
.pstep .pi { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--text-3); }
.pstep .pi svg { width: 15px; height: 15px; }
.pstep b { display: block; font-size: 13px; font-weight: 600; } .pstep span { display: block; font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pstep[data-state="done"] .pi { background: var(--ok-soft); color: var(--ok); }
.pstep[data-state="active"] { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.pstep[data-state="active"] .pi { background: var(--accent-soft); color: var(--accent); }
.pstep[data-state="blocked"] .pi { background: var(--warn-soft); color: var(--warn); }

.player { position: relative; border-radius: var(--r-lg); overflow: hidden; background: var(--canvas); border: 1px solid var(--line); display: grid; place-items: center; }
.player video { width: 100%; max-height: 70vh; background: #000; }
.player.vertical { aspect-ratio: 9 / 16; max-height: 72vh; margin: 0 auto; }
.player.horizontal { aspect-ratio: 16 / 9; }
.player.vertical video { height: 100%; object-fit: contain; }
.player-empty { text-align: center; color: rgba(255, 255, 255, .65); padding: var(--s-8); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.player-empty svg { width: 34px; height: 34px; opacity: .6; }
.player-empty b { font-family: var(--font-display); font-weight: 400; font-size: 22px; color: #fff; }

.progress { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent-grad); transition: width var(--t-slow) var(--ease); position: relative; }
.progress.live > i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent); animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.steps { display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow: auto; margin-top: var(--s-3); }
.step { display: flex; align-items: center; gap: 10px; font-size: 12.5px; padding: 5px 2px; color: var(--text-2); }
.step svg { width: 14px; height: 14px; flex: none; }
.step[data-status="done"] svg { color: var(--ok); } .step[data-status="running"] { color: var(--text); } .step[data-status="running"] svg { color: var(--accent); }
.step[data-status="failed"] { color: var(--bad); } .step[data-status="pending"] { color: var(--text-3); }
.step .detail { margin-left: auto; color: var(--text-3); font-size: 11.5px; white-space: nowrap; }

.notice { display: flex; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm); font-size: 12.5px; line-height: 1.45; background: var(--surface-2); border: 1px solid var(--line); }
.notice svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.notice.warn { background: var(--warn-soft); border-color: transparent; } .notice.warn svg { color: var(--warn); }
.notice.bad { background: var(--bad-soft); border-color: transparent; } .notice.bad svg { color: var(--bad); }
.notice.ok { background: var(--ok-soft); border-color: transparent; } .notice.ok svg { color: var(--ok); }
.notice.info { background: var(--info-soft); border-color: transparent; } .notice.info svg { color: var(--info); }

.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--s-4); }
.chapter-head { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; margin-top: var(--s-2); }
.chapter-head::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.scene { display: flex; flex-direction: column; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); overflow: hidden; transition: border-color var(--t), box-shadow var(--t), transform var(--t) var(--ease); }
.scene:hover { border-color: var(--line-2); box-shadow: var(--shadow-2); }
.scene.selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.scene-media { position: relative; aspect-ratio: 16 / 9; background: var(--canvas); overflow: hidden; cursor: pointer; }
.scene-media.vertical { aspect-ratio: 1 / 1; }
.scene-media img, .scene-media video { width: 100%; height: 100%; object-fit: cover; }
.scene-media .idx { position: absolute; top: 8px; left: 8px; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: rgba(0, 0, 0, .55); color: #fff; font-variant-numeric: tabular-nums; }
.scene-media .src { position: absolute; bottom: 8px; left: 8px; }
.scene-media .swap { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .45); color: #fff; opacity: 0; transition: opacity var(--t-fast); font-weight: 600; gap: 6px; }
.scene-media:hover .swap { opacity: 1; }
.scene-media .swap { grid-auto-flow: column; place-content: center; font-size: 13px; }
.scene-media .swap svg { width: 18px; height: 18px; }
.motion-thumb { width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: center; padding: 14px 16px; gap: 6px; }
.motion-thumb i { width: 22px; height: 3px; border-radius: 2px; }
.motion-thumb b { color: #fff; font-size: 15px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.scene-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.scene-text { font-size: 13px; line-height: 1.5; color: var(--text); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.scene-foot { display: flex; align-items: center; gap: 6px; margin-top: auto; font-size: 11.5px; color: var(--text-3); }

/* ---------- editor timeline ---------- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--s-4); }
.timeline { border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.ws.editing { grid-template-columns: minmax(0, 1fr); }
.ws.editing > aside { display: none; }
.tl-toolbar .mono { white-space: nowrap; }
.tl-toolbar { display: flex; align-items: center; gap: var(--s-2); padding: 8px 12px; border-bottom: 1px solid var(--line); }
.tl-scroll { overflow-x: auto; position: relative; }
.tl-inner { position: relative; min-width: 100%; }
.tl-ruler { height: 24px; position: relative; border-bottom: 1px solid var(--line); font-size: 10px; color: var(--text-3); font-family: var(--font-mono); }
.tl-ruler span { position: absolute; top: 5px; transform: translateX(-50%); }
.tl-ruler span::after { content: ""; position: absolute; left: 50%; top: 14px; width: 1px; height: 5px; background: var(--line-2); }
.tl-track { display: flex; align-items: stretch; height: 52px; position: relative; border-bottom: 1px solid var(--line); }
.tl-track.small { height: 34px; }
.tl-label { position: sticky; left: 0; z-index: 2; width: 92px; flex: none; display: flex; align-items: center; gap: 6px; padding: 0 10px; font-size: 11px; font-weight: 600; color: var(--text-3); background: var(--surface); border-right: 1px solid var(--line); }
.tl-label svg { width: 13px; height: 13px; }
.tl-lane { position: relative; flex: 1; }
.tl-clip { position: absolute; top: 5px; bottom: 5px; border-radius: 6px; overflow: hidden; cursor: pointer; border: 1px solid rgba(255, 255, 255, .08); background: var(--surface-3); display: flex; align-items: center; transition: box-shadow var(--t-fast), filter var(--t-fast); }
.tl-clip:hover { filter: brightness(1.12); }
.tl-clip.selected { box-shadow: 0 0 0 2px var(--accent); z-index: 1; }
.tl-clip img { height: 100%; width: auto; flex: none; opacity: .9; }
.tl-clip span { font-size: 11px; padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.tl-clip.motion { background: linear-gradient(120deg, var(--c0, #1d2b4a), var(--c1, #0b1220)); } .tl-clip.motion span { color: #fff; }
.tl-cap { position: absolute; top: 6px; bottom: 6px; border-radius: 4px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); font-size: 10px; padding: 0 4px; overflow: hidden; white-space: nowrap; color: var(--text-2); display: flex; align-items: center; }
.tl-wave { position: absolute; inset: 4px 0; }
.tl-playhead { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); z-index: 3; pointer-events: none; box-shadow: 0 0 10px var(--accent); }
.tl-playhead::before { content: ""; position: absolute; top: 0; left: -5px; border: 6px solid transparent; border-top-color: var(--accent); }
.inspector { position: sticky; top: 88px; }

/* ---------- library ---------- */
.drop { border: 1.5px dashed var(--line-2); border-radius: var(--r-lg); padding: var(--s-8); text-align: center; background: var(--surface); transition: border-color var(--t), background var(--t); cursor: pointer; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop svg { width: 28px; height: 28px; color: var(--text-3); margin: 0 auto 10px; }
.asset-grid { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.asset { position: relative; border-radius: var(--r-md); overflow: hidden; background: var(--surface); border: 1px solid var(--line); cursor: pointer; text-align: left; padding: 0; transition: transform var(--t) var(--ease), border-color var(--t), box-shadow var(--t); }
.asset:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: var(--shadow-2); }
.asset[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.asset-thumb { aspect-ratio: 4 / 3; background: var(--canvas); display: grid; place-items: center; overflow: hidden; color: var(--text-3); }
.asset-thumb img { width: 100%; height: 100%; object-fit: cover; }
.asset-thumb svg { width: 26px; height: 26px; }
.asset-info { padding: 8px 10px 10px; }
.asset-info b { display: block; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset-info span { font-size: 11px; color: var(--text-3); }
.asset .badge { position: absolute; top: 8px; right: 8px; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- tables, kpis ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--s-3); }
.kpi { padding: 16px 18px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.kpi .eyebrow { display: flex; align-items: center; gap: 6px; } .kpi .eyebrow svg { width: 13px; height: 13px; }
.kpi b { display: block; font-size: 26px; font-weight: 600; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 12px; color: var(--text-3); }
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: var(--surface-2); }
.pos { color: var(--ok); } .neg { color: var(--text); }

.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--s-4); }
.plan { padding: var(--s-5); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.plan.current { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.plan .price { font-family: var(--font-display); font-size: 34px; }
.plan ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); }
.plan li { display: flex; gap: 8px; align-items: center; } .plan li svg { width: 14px; height: 14px; color: var(--ok); }

/* ---------- niche ---------- */
.niche-grid { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.niche-card { text-align: left; padding: 0; border-radius: var(--r-lg); overflow: hidden; background: var(--surface); border: 1px solid var(--line); cursor: pointer; transition: transform var(--t) var(--ease), box-shadow var(--t), border-color var(--t); }
.niche-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--line-2); }
.niche-cover { height: 120px; position: relative; padding: 16px; display: flex; flex-direction: column; justify-content: flex-end; }
.niche-cover .badge { position: absolute; top: 12px; left: 12px; }
.niche-cover b { font-family: var(--font-display); font-size: 26px; font-weight: 400; color: #fff; line-height: 1.05; }
.niche-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }

/* ---------- overlays ---------- */
.scrim { position: fixed; inset: 0; z-index: 60; background: var(--scrim); backdrop-filter: blur(4px); display: grid; place-items: center; padding: var(--s-6); animation: fade-in var(--t) var(--ease); }
@keyframes fade-in { from { opacity: 0; } }
.modal { width: min(560px, 100%); max-height: calc(100vh - 48px); overflow: auto; background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-3); animation: pop-in var(--t-slow) var(--ease-spring); }
.modal.wide { width: min(920px, 100%); }
@keyframes pop-in { from { opacity: 0; transform: translateY(10px) scale(.97); } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-4); padding: var(--s-6) var(--s-6) 0; }
.modal-body { padding: var(--s-5) var(--s-6); }
.modal-foot { display: flex; justify-content: flex-end; gap: var(--s-2); padding: 0 var(--s-6) var(--s-6); }
.drawer-scrim { place-items: stretch end; padding: 0; }
.drawer { width: min(520px, 100vw); height: 100vh; overflow: auto; background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-3); animation: slide-in var(--t-slow) var(--ease); }
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } }
.toasts { position: fixed; z-index: 80; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; gap: 10px; align-items: flex-start; min-width: 260px; max-width: 420px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-inv); color: var(--text-inv); box-shadow: var(--shadow-3); animation: pop-in var(--t-slow) var(--ease-spring); font-size: 13px; }
.toast svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.toast.bad svg { color: var(--bad); } .toast.ok svg { color: var(--ok); }

.empty { text-align: center; padding: var(--s-12) var(--s-6); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty .ico { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-3); }
.empty .ico svg { width: 24px; height: 24px; }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: sk 1.4s ease-in-out infinite; border-radius: var(--r-md); }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- responsive ---------- */
.studio > *, .ws > *, .editor > *, .main, .page { min-width: 0; }
@media (max-width: 1180px) {
  .studio, .ws { grid-template-columns: minmax(0, 1fr); }
  .summary, .inspector { position: static; }
  .editor { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: fixed; z-index: 40; bottom: 0; top: auto; left: 0; right: 0; height: auto; flex-direction: row; padding: 6px; border-right: 0; border-top: 1px solid var(--line); }
  .rail .brand, .rail .nav-label, .rail-foot, .nav .count { display: none; }
  .nav { flex-direction: row; justify-content: space-around; width: 100%; }
  .nav a { flex-direction: column; gap: 2px; font-size: 10px; padding: 6px 4px; flex: 1; text-align: center; }
  .page { padding: var(--s-4) var(--s-4) 96px; }
  .topbar { padding: 10px var(--s-4); }
  .studio-hero { padding: var(--s-6) var(--s-4); }
  .pipeline { grid-template-columns: repeat(5, minmax(120px, 1fr)); overflow-x: auto; }
  .title-edit { font-size: 26px; }
  .tl-toolbar .faint { display: none; }
  .crumbs b { max-width: 40vw; }
}
