/* DerteVideos — AI Cinema Studio design system (mobile first, Apple HIG inspired). */
:root {
  --bg: #09090B;
  --surface: #18181D;
  --elevated: #222229;
  --hairline: rgba(255, 255, 255, .08);
  --hairline-2: rgba(255, 255, 255, .14);
  --text: #F5F5F7;
  --text-2: #9898A3;
  --text-3: #6E6E78;
  --orange: #FF5935;
  --orange-2: #FF8A5C;
  --lilac: #A78BFA;
  --green: #30D158;
  --yellow: #FFD60A;
  --red: #FF453A;
  --blue: #64A8FF;
  --grad-create: linear-gradient(135deg, #FF5935 0%, #FF7A45 45%, #C084FC 130%);
  --grad-ai: linear-gradient(135deg, #A78BFA, #7C6CF6);
  --glass: rgba(24, 24, 29, .72);
  --glass-strong: rgba(18, 18, 22, .86);
  --blur: saturate(180%) blur(22px);
  --r-sm: 12px; --r: 16px; --r-lg: 20px; --r-xl: 24px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .5);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, "JetBrains Mono", monospace;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --tabbar-h: 64px;
  --sidebar-w: 248px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --t-fast: 160ms; --t: 240ms;
  /* legacy aliases (advanced editor views) */
  --panel: var(--surface); --panel-2: var(--elevated); --line: var(--hairline); --line-2: var(--hairline-2);
  --muted: var(--text-2); --dim: var(--text-3); --accent: var(--orange); --accent-2: var(--orange-2);
  --ok: var(--green); --warn: #FF9F0A; --err: var(--red); --video: var(--blue); --audio: #32D2C9; --music: var(--lilac); --sub: var(--yellow);
  --radius: var(--r);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text); font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-x: hidden; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--orange-2); text-decoration: none; }
img, video { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; }
:focus-visible { outline: 2px solid var(--lilac); outline-offset: 2px; border-radius: 8px; }
.boot { min-height: 100dvh; display: grid; place-items: center; }
.boot-mark { width: 54px; height: 54px; border-radius: 16px; background: var(--grad-create); box-shadow: 0 0 60px rgba(255, 89, 53, .35); animation: breathe 1.6s var(--ease) infinite; }
@keyframes breathe { 50% { transform: scale(.92); opacity: .7; } }
.ic { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic.sm { width: 18px; height: 18px; } .ic.lg { width: 28px; height: 28px; }

/* ---------- app shell ---------- */
.app { min-height: 100dvh; }
.main { min-width: 0; padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 24px); }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px;
  padding: calc(var(--safe-top) + 8px) calc(16px + var(--safe-right)) 8px calc(16px + var(--safe-left));
  background: rgba(9, 9, 11, .78); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-bottom: 1px solid var(--hairline); min-height: 56px; }
.topbar h1 { font-size: 17px; font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.content { padding: 12px calc(16px + var(--safe-right)) 24px calc(16px + var(--safe-left)); max-width: 1180px; margin: 0 auto; }
.content.wide { max-width: 1440px; }
.large-title { font-size: 32px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; margin: 6px 0 4px; }
.subtitle { color: var(--text-2); font-size: 15px; }
.section { margin-top: 28px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { font-size: 20px; font-weight: 650; }
.section-head a, .link { font-size: 15px; color: var(--orange-2); background: none; border: 0; padding: 8px 0; min-height: 44px; display: inline-flex; align-items: center; }

.tabbar { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  height: calc(var(--tabbar-h) + var(--safe-bottom)); padding: 0 calc(6px + var(--safe-right)) var(--safe-bottom) calc(6px + var(--safe-left));
  background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-top: 1px solid var(--hairline); }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 48px; min-width: 44px;
  color: var(--text-3); font-size: 10.5px; font-weight: 500; transition: color var(--t-fast); }
.tab.active { color: var(--text); }
.tab.active .ic { stroke: var(--orange); }
.tab-create { justify-self: center; width: 56px; height: 56px; margin-top: -22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--grad-create); color: #fff; box-shadow: 0 10px 28px rgba(255, 89, 53, .45), 0 0 0 5px var(--bg); transition: transform var(--t-fast) var(--ease); }
.tab-create:active { transform: scale(.94); }
.tab-create .ic { width: 26px; height: 26px; stroke-width: 2.2; }

.sidebar { display: none; }
@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .tabbar { display: none; }
  .main { padding-bottom: 32px; }
  .sidebar { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100dvh; padding: calc(var(--safe-top) + 20px) 14px 18px calc(14px + var(--safe-left));
    background: rgba(16, 16, 20, .7); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-right: 1px solid var(--hairline); overflow-y: auto; }
  .side-link { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 8px 12px; border-radius: 10px; color: var(--text-2); font-size: 14.5px; font-weight: 500; transition: background var(--t-fast), color var(--t-fast); }
  .side-link:hover { background: rgba(255, 255, 255, .05); color: var(--text); }
  .side-link.active { background: rgba(255, 255, 255, .08); color: var(--text); }
  .side-link.active .ic { stroke: var(--orange); }
  .side-label { color: var(--text-3); font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; padding: 18px 12px 6px; }
  .side-create { margin: 6px 0 14px; }
  .side-foot { margin-top: auto; padding: 12px; border-top: 1px solid var(--hairline); font-size: 12.5px; color: var(--text-3); }
  .side-foot kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--hairline-2); border-radius: 5px; padding: 0 5px; color: var(--text-2); }
  .topbar { padding-top: calc(var(--safe-top) + 14px); padding-bottom: 12px; }
  .content { padding: 16px 32px 40px; }
  .large-title { font-size: 34px; }
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; letter-spacing: -.02em; padding: 4px 12px 14px; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: #121216 url("/static/icons/icon-192.png") center/cover; box-shadow: 0 4px 14px rgba(255, 89, 53, .25); flex: none; }
.brand small { display: block; font-size: 11px; font-weight: 500; color: var(--text-2); }

/* ---------- surfaces & lists ---------- */
.surface, .card { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); padding: 16px; }
.list { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); overflow: hidden; }
.list-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 16px; color: var(--text); background: none; border: 0; width: 100%; text-align: left; }
.list-row + .list-row { border-top: 1px solid var(--hairline); }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .t { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .s { color: var(--text-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .val { color: var(--text-2); font-size: 14.5px; text-align: right; }
.list-row .chev { color: var(--text-3); }
.list-row .lic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; background: rgba(255, 255, 255, .06); }
button.list-row:active, a.list-row:active { background: rgba(255, 255, 255, .04); }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 14px;
  background: var(--elevated); border: 1px solid var(--hairline-2); color: var(--text); font-weight: 600; font-size: 15px; white-space: nowrap;
  transition: transform var(--t-fast) var(--ease), background var(--t-fast), opacity var(--t-fast); }
.btn:hover { background: #2a2a32; }
.btn:active { transform: scale(.97); }
.btn:disabled, .btn[aria-busy="true"] { opacity: .55; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--grad-create); border: 0; color: #fff; box-shadow: 0 8px 24px rgba(255, 89, 53, .3); }
.btn.ai { background: var(--grad-ai); border: 0; color: #fff; box-shadow: 0 8px 24px rgba(167, 139, 250, .25); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: rgba(255, 255, 255, .06); color: var(--text); }
.btn.danger { color: var(--red); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 11px; }
.btn.block { width: 100%; }
.btn.xl { min-height: 56px; font-size: 17px; border-radius: 18px; }
.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .06); border: 0; color: var(--text); position: relative; flex: none; transition: background var(--t-fast); }
.icon-btn:hover { background: rgba(255, 255, 255, .1); }
.icon-btn .dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 2px var(--bg); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; min-height: 44px; padding: 11px 14px; font-size: 16px; color: var(--text); background: var(--elevated);
  border: 1px solid var(--hairline-2); border-radius: 12px; outline: none; transition: border-color var(--t-fast), box-shadow var(--t-fast); -webkit-appearance: none; appearance: none; }
select { background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
input:focus, select:focus, textarea:focus { border-color: rgba(167, 139, 250, .7); box-shadow: 0 0 0 4px rgba(167, 139, 250, .16); }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--orange); }
input[type=file] { font-size: 14px; color: var(--text-2); max-width: 100%; }
label { display: block; color: var(--text-2); font-size: 13px; margin: 0 0 6px; }
.field { margin-bottom: 14px; }
.search { position: relative; }
.search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search input { padding-left: 40px; border-radius: 14px; background: var(--surface); }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding: 2px 0; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 999px; background: var(--surface);
  border: 1px solid var(--hairline-2); color: var(--text-2); font-size: 14px; font-weight: 500; transition: all var(--t-fast); }
.chip:hover { color: var(--text); }
.chip.on { background: rgba(255, 89, 53, .14); border-color: rgba(255, 89, 53, .55); color: var(--text); }
.chip.ai.on { background: rgba(167, 139, 250, .16); border-color: rgba(167, 139, 250, .6); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { min-height: 38px; border: 0; background: none; border-radius: 9px; color: var(--text-2); font-weight: 550; font-size: 14px; transition: all var(--t-fast); padding: 0 6px; }
.seg button.on { background: var(--elevated); color: var(--text); box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
.toggle { position: relative; width: 51px; height: 31px; flex: none; }
.toggle input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; width: 100%; height: 100%; z-index: 1; }
.toggle span { position: absolute; inset: 0; border-radius: 99px; background: #39393f; transition: background var(--t); }
.toggle span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); transition: transform var(--t) var(--ease); }
.toggle input:checked + span { background: var(--green); }
.toggle input:checked + span::after { transform: translateX(20px); }
.toggle input:focus-visible + span { outline: 2px solid var(--lilac); outline-offset: 2px; }

.pill, .badge { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: rgba(255, 255, 255, .07); color: var(--text-2); white-space: nowrap; border: 0; }
.pill .d { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok, .badge.ok { color: var(--green); background: rgba(48, 209, 88, .12); }
.pill.warn, .badge.warn { color: var(--warn); background: rgba(255, 159, 10, .13); }
.pill.err, .badge.err { color: var(--red); background: rgba(255, 69, 58, .13); }
.pill.info, .badge.info { color: var(--blue); background: rgba(100, 168, 255, .13); }
.pill.ai-c { color: var(--lilac); background: rgba(167, 139, 250, .14); }
.badge.plan { background: transparent; border: 1px dashed var(--hairline-2); }
.muted { color: var(--text-2); } .dim { color: var(--text-3); } .mono { font-family: var(--mono); font-size: 12.5px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.spacer { flex: 1; }
.grid { display: grid; gap: 14px; }
.g2, .g3 { grid-template-columns: 1fr; }
@media (min-width: 640px) { .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.progress { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: inherit; background: var(--grad-create); transition: width .6s var(--ease); }
.progress.indet > i { width: 35% !important; animation: indet 1.4s var(--ease) infinite; }
@keyframes indet { 0% { transform: translateX(-110%); } 100% { transform: translateX(320%); } }
.bar { height: 4px; background: var(--hairline); border-radius: 4px; overflow: hidden; flex: 1; }
.bar > i { display: block; height: 100%; background: var(--orange); width: 0; transition: width .3s; }
.ring { --p: 0; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 11px; font-weight: 700;
  background: conic-gradient(var(--orange) calc(var(--p) * 1%), rgba(255, 255, 255, .08) 0); }
.ring::before { content: attr(data-l); width: 36px; height: 36px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; }
.ring.indet { background: conic-gradient(var(--lilac) 25%, rgba(255, 255, 255, .08) 0); animation: spin 1.2s linear infinite; }
.ring.indet::before { animation: spin 1.2s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }

.sk { background: linear-gradient(90deg, #17171c 0%, #202027 50%, #17171c 100%); background-size: 200% 100%; animation: sk 1.3s linear infinite; border-radius: var(--r); }
@keyframes sk { to { background-position: -200% 0; } }
.empty { text-align: center; padding: 36px 20px; color: var(--text-2); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--hairline); }
.empty .em-ic { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 18px; display: grid; place-items: center; background: rgba(255, 255, 255, .05); color: var(--text); }
.empty h3 { color: var(--text); font-size: 17px; margin-bottom: 6px; }
.empty p { margin: 0 auto 16px; max-width: 340px; font-size: 14px; }

/* ---------- home ---------- */
.hero { position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 22px 20px; border: 1px solid var(--hairline);
  background: radial-gradient(120% 140% at 100% 0%, rgba(167, 139, 250, .28), transparent 55%), radial-gradient(90% 120% at 0% 100%, rgba(255, 89, 53, .2), transparent 60%), var(--surface); }
.hero .eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.hero h2 { font-size: 30px; line-height: 1.08; margin: 10px 0 8px; font-weight: 750; letter-spacing: -.035em; }
.hero h2 em { font-style: normal; background: linear-gradient(90deg, var(--orange), var(--lilac)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--text-2); margin: 0 0 18px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.status-dot.ok { background: var(--green); box-shadow: 0 0 0 4px rgba(48, 209, 88, .15); }
.status-dot.warn { background: var(--warn); box-shadow: 0 0 0 4px rgba(255, 159, 10, .15); }
.status-dot.err { background: var(--red); }
.quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 720px) { .quick { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--hairline); color: var(--text); min-height: 96px; }
.tile .k { color: var(--text-2); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.tile .v { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.tile .v small { font-size: 13px; font-weight: 500; color: var(--text-2); }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 78%); gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 4px; scroll-padding: 16px; }
.rail::-webkit-scrollbar { display: none; }
@media (min-width: 900px) { .rail { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); grid-auto-columns: auto; overflow: visible; margin: 0; padding: 0; } }
.poster { position: relative; display: block; border-radius: var(--r-lg); overflow: hidden; background: var(--elevated); aspect-ratio: 16/9; scroll-snap-align: start; color: var(--text); border: 1px solid var(--hairline); }
.poster img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.poster:hover img { transform: scale(1.03); }
.poster .shade { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, rgba(0, 0, 0, .82)); }
.poster .meta { position: absolute; left: 12px; right: 12px; bottom: 10px; }
.poster .meta b { display: block; font-size: 15px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.poster .meta span { font-size: 12px; color: rgba(255, 255, 255, .75); }
.poster .dur { position: absolute; top: 10px; right: 10px; font-size: 11.5px; font-weight: 650; padding: 3px 8px; border-radius: 8px; background: rgba(0, 0, 0, .55); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.ph-art { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255, 255, 255, .35); background: radial-gradient(80% 80% at 30% 20%, rgba(255, 89, 53, .25), transparent), radial-gradient(80% 80% at 80% 90%, rgba(167, 139, 250, .25), transparent), #141418; }
.active-card { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--hairline); color: var(--text); }
.active-card + .active-card { margin-top: 10px; }
.active-card .grow { flex: 1; min-width: 0; }
.active-card .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.active-card .s { font-size: 13px; color: var(--text-2); margin: 2px 0 8px; }
.meter { display: flex; flex-direction: column; gap: 10px; }
.meter .nums { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.meter .big { font-size: 26px; font-weight: 750; letter-spacing: -.03em; }
.meter .big small { font-size: 14px; color: var(--text-2); font-weight: 500; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; font-size: 14px; }
.kv span { color: var(--text-2); } .kv b { font-weight: 600; text-align: right; }

/* ---------- create ---------- */
.create { max-width: 760px; margin: 0 auto; }
.create-head { text-align: center; padding: 14px 0 6px; }
.create-head .orb { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 22px; background: var(--grad-create); display: grid; place-items: center; color: #fff; box-shadow: 0 16px 50px rgba(255, 89, 53, .35); }
.create-head h1 { font-size: 30px; font-weight: 750; letter-spacing: -.035em; }
.create-head p { color: var(--text-2); margin: 6px 0 0; font-size: 16px; }
.prompt-box { margin-top: 20px; border-radius: var(--r-xl); padding: 1.5px; background: linear-gradient(135deg, rgba(255, 89, 53, .6), rgba(167, 139, 250, .6)); box-shadow: var(--shadow); }
.prompt-box .in { border-radius: 23px; background: var(--surface); padding: 14px 14px 10px; }
.prompt-box textarea { border: 0; background: transparent; padding: 4px; min-height: 120px; resize: none; font-size: 17px; line-height: 1.5; box-shadow: none; }
.prompt-box textarea:focus { box-shadow: none; }
.prompt-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 6px; color: var(--text-3); font-size: 12.5px; }
.suggest { margin-top: 14px; }
.suggest .chip { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt-group { margin-top: 22px; }
.opt-group > .lbl { font-size: 13px; color: var(--text-2); margin-bottom: 8px; font-weight: 550; }
.estimate { margin-top: 18px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--hairline); }
.estimate .total { font-size: 24px; font-weight: 750; letter-spacing: -.03em; }
.estimate .lines { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--text-2); font-size: 13px; margin-top: 6px; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; font-size: 14px; background: rgba(255, 159, 10, .1); color: #FFD08A; margin-top: 10px; }
.notice.err { background: rgba(255, 69, 58, .1); color: #FFA39E; }
.notice.info { background: rgba(167, 139, 250, .1); color: #D7CCFF; }
.notice.ok { background: rgba(48, 209, 88, .1); color: #9EF0B4; }
.sticky-cta { position: sticky; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 10px); z-index: 5; margin-top: 18px; }
@media (min-width: 900px) { .sticky-cta { bottom: 16px; } }
details.adv { margin-top: 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--hairline); }
details.adv summary { list-style: none; cursor: pointer; min-height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; font-weight: 550; }
details.adv summary::-webkit-details-marker { display: none; }
details.adv[open] summary .ic { transform: rotate(90deg); }
details.adv summary .ic { transition: transform var(--t-fast); color: var(--text-3); }
details.adv .body { padding: 0 16px 16px; }

/* ---------- production / studio ---------- */
.prod-hero { position: relative; overflow: hidden; border-radius: var(--r-xl); border: 1px solid var(--hairline); background: var(--surface); }
.prod-hero .art { aspect-ratio: 21/9; background: #121216 center/cover; position: relative; }
.prod-hero .art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(9, 9, 11, .05), rgba(24, 24, 29, 1)); }
.prod-hero .art.gen { background: radial-gradient(90% 120% at 15% 10%, rgba(255, 89, 53, .35), transparent 60%), radial-gradient(90% 120% at 90% 90%, rgba(167, 139, 250, .35), transparent 60%), #141418; }
.prod-hero .body { position: relative; padding: 0 16px 16px; margin-top: -36px; }
.prod-hero h2 { font-size: 24px; font-weight: 750; letter-spacing: -.03em; line-height: 1.15; }
.prod-hero .cmd { color: var(--text-2); font-size: 14px; margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat2 { padding: 12px; border-radius: 14px; background: var(--elevated); min-width: 0; }
.stat2 .k { font-size: 12px; color: var(--text-2); }
.stat2 .v { font-size: 18px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phase { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 14px; flex-wrap: wrap; }
.prod-layout { display: grid; gap: 16px; margin-top: 16px; }
@media (min-width: 1200px) { .prod-layout { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } .prod-layout .ctx { position: sticky; top: 84px; } }
.agents { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .agents { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .prod-layout .agents { grid-template-columns: 1fr 1fr; } }
.agent { display: flex; flex-direction: column; gap: 8px; text-align: left; padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--hairline); color: var(--text); min-height: 88px; transition: border-color var(--t), transform var(--t-fast) var(--ease); }
.agent:active { transform: scale(.98); }
.agent .top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.agent .av { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: rgba(255, 255, 255, .06); color: var(--text-2); flex: none; position: relative; }
.agent .nm { font-size: 13.5px; font-weight: 600; line-height: 1.2; min-width: 0; }
.agent .st { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agent.working { border-color: rgba(167, 139, 250, .45); background: linear-gradient(180deg, rgba(167, 139, 250, .08), var(--surface) 70%); }
.agent.working .av { color: var(--lilac); background: rgba(167, 139, 250, .14); }
.agent.working .av::after { content: ""; position: absolute; inset: -3px; border-radius: 13px; border: 1.5px solid rgba(167, 139, 250, .6); animation: pulse-ring 1.8s var(--ease) infinite; }
.agent.done .av { color: var(--green); background: rgba(48, 209, 88, .12); }
.agent.blocked { border-color: rgba(255, 159, 10, .45); } .agent.blocked .av { color: var(--warn); background: rgba(255, 159, 10, .12); }
.agent.error { border-color: rgba(255, 69, 58, .45); } .agent.error .av { color: var(--red); background: rgba(255, 69, 58, .12); }
@keyframes pulse-ring { 0% { opacity: .9; transform: scale(.92); } 100% { opacity: 0; transform: scale(1.25); } }
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: flex; gap: 10px; padding: 10px 0; font-size: 14px; align-items: flex-start; }
.activity li + li { border-top: 1px solid var(--hairline); }
.activity .when { color: var(--text-3); font-size: 12px; white-space: nowrap; margin-left: auto; padding-left: 8px; }
.live-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; color: var(--text-3); }
.live-dot i { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.live-dot.on { color: var(--green); } .live-dot.on i { background: var(--green); animation: breathe 1.6s infinite; }

/* Live Production Studio */
.studio { display: grid; gap: 14px; }
@media (min-width: 1100px) { .studio { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; } }
.monitor { position: relative; border-radius: var(--r-xl); overflow: hidden; background: #000; border: 1px solid var(--hairline); aspect-ratio: 16/9; }
.monitor video, .monitor img { width: 100%; height: 100%; object-fit: contain; background: #000; }
.monitor .state { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px; color: var(--text-2); font-size: 14px;
  background: radial-gradient(80% 80% at 30% 20%, rgba(167, 139, 250, .18), transparent), #0c0c0f; }
.monitor .hud { position: absolute; left: 10px; top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.monitor .hud .pill { background: rgba(0, 0, 0, .55); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: #fff; }
.transport { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.transport .tc { font-family: var(--mono); font-size: 13px; color: var(--text-2); margin-left: auto; }
.scrub { width: 100%; accent-color: var(--orange); height: 28px; }
.filmstrip { display: grid; grid-auto-flow: column; grid-auto-columns: 132px; gap: 8px; overflow-x: auto; padding: 4px 0 8px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.frame { position: relative; display: block; border: 0; padding: 0; text-align: left; border-radius: 12px; overflow: hidden; background: var(--elevated); aspect-ratio: 16/9; color: var(--text); scroll-snap-align: start; outline: 2px solid transparent; transition: outline-color var(--t-fast); }
.frame.sel { outline-color: var(--orange); }
.frame img { width: 100%; height: 100%; object-fit: cover; }
.frame .n { position: absolute; left: 6px; top: 5px; font-size: 11px; font-weight: 700; text-shadow: 0 1px 3px #000; }
.frame .stt { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 6px 4px; font-size: 10.5px; background: linear-gradient(transparent, rgba(0, 0, 0, .8)); display: flex; align-items: center; gap: 4px; }
.frame .stt i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); flex: none; }
.frame.s-done .stt i { background: var(--green); } .frame.s-run .stt i { background: var(--lilac); animation: breathe 1.4s infinite; } .frame.s-err .stt i { background: var(--red); }
.frame .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-3); font-size: 11px; }
.mtl { display: none; }
@media (min-width: 900px) {
  .mtl { display: block; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); padding: 10px 12px; overflow-x: auto; }
  .mtl .lane { position: relative; height: 30px; margin-top: 4px; display: flex; align-items: center; }
  .mtl .lane .nm { position: sticky; left: 0; width: 92px; flex: none; font-size: 11.5px; color: var(--text-2); z-index: 1; background: var(--surface); height: 100%; display: flex; align-items: center; }
  .mtl .lane .trk { position: relative; flex: 1; height: 24px; background: #101014; border-radius: 6px; min-width: 600px; }
  .mtl .blk { position: absolute; top: 2px; bottom: 2px; border-radius: 5px; font-size: 10.5px; padding: 3px 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: rgba(255, 255, 255, .9); border: 1px solid rgba(255, 255, 255, .12); cursor: pointer; }
  .mtl .blk.v { background: rgba(100, 168, 255, .28); } .mtl .blk.a { background: rgba(167, 139, 250, .28); } .mtl .blk.n { background: rgba(50, 210, 201, .25); }
  .mtl .blk.m { background: rgba(255, 89, 53, .22); } .mtl .blk.f { background: rgba(255, 214, 10, .2); } .mtl .blk.s { background: rgba(255, 255, 255, .1); } .mtl .blk.t { background: rgba(48, 209, 88, .22); }
  .mtl .blk.pending { background: repeating-linear-gradient(45deg, rgba(255, 255, 255, .04) 0 6px, transparent 6px 12px); color: var(--text-3); border-style: dashed; }
  .mtl .blk.run { box-shadow: inset 0 0 0 1.5px var(--lilac); }
  .mtl .blk.sel { outline: 2px solid var(--orange); }
}
.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 11.5px; color: var(--text-3); margin-top: 8px; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }

/* Art direction */
.ad-grid { display: grid; gap: 14px; }
@media (min-width: 1000px) { .ad-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.proposal { border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--hairline); overflow: hidden; display: flex; flex-direction: column; transition: border-color var(--t), box-shadow var(--t); }
.proposal.picked { border-color: rgba(167, 139, 250, .7); box-shadow: 0 0 0 3px rgba(167, 139, 250, .2); }
.proposal .shots { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; aspect-ratio: 16/10; background: #0c0c0f; }
.proposal .shots > * { position: relative; overflow: hidden; background: #141418; }
.proposal .shots > :first-child { grid-row: 1 / 3; }
.proposal .shots img { width: 100%; height: 100%; object-fit: cover; }
.proposal .shots .wait { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; color: var(--text-3); text-align: center; padding: 6px; }
.proposal .pb { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.proposal h3 { font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.proposal .num { font-size: 12px; font-weight: 700; color: var(--lilac); letter-spacing: .06em; text-transform: uppercase; }
.palette { display: flex; gap: 6px; }
.palette i { width: 24px; height: 24px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .15); }
.proposal .desc2 { color: var(--text-2); font-size: 14px; line-height: 1.5; }
.proposal .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.feedback { position: sticky; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 10px); z-index: 6; margin-top: 16px; padding: 12px; border-radius: var(--r-xl); }
@media (min-width: 900px) { .feedback { bottom: 16px; } }
.feedback textarea { min-height: 52px; resize: none; background: rgba(0, 0, 0, .25); }

/* ---------- watch ---------- */
.watch-hero { position: relative; margin: -12px -16px 0; overflow: hidden; }
@media (min-width: 900px) { .watch-hero { margin: 0; border-radius: var(--r-xl); } }
.watch-hero .player { position: relative; aspect-ratio: 16/9; background: #000; }
.watch-hero video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.watch-body { position: relative; padding-top: 18px; }
.watch-body h1 { font-size: 26px; font-weight: 750; letter-spacing: -.03em; line-height: 1.15; }
.watch-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; color: var(--text-2); font-size: 14px; margin: 8px 0 14px; align-items: center; }
.watch-meta .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); }
.desc { white-space: pre-wrap; color: var(--text-2); font-size: 14.5px; line-height: 1.55; }
.dl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 720px) { .dl-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.dl { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; padding: 12px; min-height: 76px; border-radius: 14px; background: var(--surface); border: 1px solid var(--hairline); color: var(--text); font-size: 13.5px; font-weight: 600; }
.dl .ic { color: var(--orange-2); }
.dl.off { opacity: .45; pointer-events: none; }

/* ---------- gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.gitem { position: relative; display: block; width: 100%; padding: 0; border: 0; text-align: left; border-radius: 16px; overflow: hidden; background: var(--surface); aspect-ratio: 4/3; color: var(--text); }
.gitem img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity var(--t); }
.gitem img.ld { opacity: 1; }
.gitem .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-3); }
.gitem .ov { position: absolute; inset: auto 0 0 0; padding: 22px 10px 8px; background: linear-gradient(transparent, rgba(0, 0, 0, .78)); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.gitem .ov .t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.gitem .kind { position: absolute; top: 8px; left: 8px; background: rgba(0, 0, 0, .55); color: #fff; }

/* ---------- sheets / toast ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .45); opacity: 0; transition: opacity var(--t); }
.sheet-backdrop.on { opacity: 1; }
.sheet { position: fixed; z-index: 91; left: 0; right: 0; bottom: 0; max-height: calc(100dvh - var(--safe-top) - 24px); display: flex; flex-direction: column;
  background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--hairline-2); border-bottom: 0;
  border-radius: 24px 24px 0 0; box-shadow: var(--shadow-lg); transform: translateY(100%); transition: transform 300ms var(--ease); padding-bottom: var(--safe-bottom); }
.sheet.on { transform: none; }
@media (min-width: 720px) { .sheet { left: 50%; right: auto; width: min(580px, 92vw); bottom: auto; top: 50%; border-radius: 24px; border-bottom: 1px solid var(--hairline-2);
  transform: translate(-50%, -46%) scale(.98); opacity: 0; transition: transform var(--t) var(--ease), opacity var(--t); max-height: 86dvh; padding-bottom: 0; }
  .sheet.on { transform: translate(-50%, -50%); opacity: 1; } }
.sheet .grab { width: 36px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .25); margin: 8px auto 0; flex: none; }
@media (min-width: 720px) { .sheet .grab { display: none; } }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px 6px; flex: none; }
.sheet-head h3 { flex: 1; font-size: 18px; font-weight: 650; }
.sheet-body { overflow-y: auto; padding: 6px 16px 20px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
#toast { position: fixed; z-index: 100; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 14px); display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
@media (min-width: 900px) { #toast { bottom: 24px; left: auto; right: 24px; transform: none; } }
#toast .t { pointer-events: auto; padding: 12px 16px; border-radius: 16px; font-size: 14.5px; background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--hairline-2); box-shadow: var(--shadow-lg); animation: toast-in var(--t) var(--ease); display: flex; align-items: center; gap: 10px; }
#toast .t.err { border-color: rgba(255, 69, 58, .5); } #toast .t.ok { border-color: rgba(48, 209, 88, .45); }
#toast .t button { margin-left: auto; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ---------- auth ---------- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: calc(var(--safe-top) + 24px) 20px calc(var(--safe-bottom) + 24px);
  background: radial-gradient(70% 50% at 80% 0%, rgba(167, 139, 250, .22), transparent 70%), radial-gradient(60% 50% at 10% 100%, rgba(255, 89, 53, .18), transparent 70%), var(--bg); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .logo { width: 72px; height: 72px; border-radius: 20px; margin: 0 auto 18px; background: url("/static/icons/icon-512.png") center/cover; box-shadow: 0 18px 50px rgba(255, 89, 53, .3); }
.auth-card h1 { text-align: center; font-size: 28px; font-weight: 750; letter-spacing: -.03em; }
.auth-card p.lead { text-align: center; color: var(--text-2); margin: 6px 0 24px; }
.auth-card .seg { margin-bottom: 16px; }

/* ---------- advanced editor (legacy views) ---------- */
.card h2 { font-size: 16px; margin: 0 0 12px; font-weight: 650; }
.card h3 { font-size: 13px; margin: 14px 0 8px; color: var(--text-2); font-weight: 600; }
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-bottom: 16px; }
.tabs a, .tabs button { flex: none; min-height: 36px; padding: 0 14px; display: inline-flex; align-items: center; border-radius: 999px; background: var(--surface); border: 1px solid var(--hairline); color: var(--text-2); font-size: 14px; }
.tabs .active { color: var(--text); background: var(--elevated); border-color: var(--hairline-2); }
.drop { display: block; border: 1.5px dashed var(--hairline-2); border-radius: var(--r-lg); padding: 26px; text-align: center; color: var(--text-2); cursor: pointer; transition: .15s; }
.drop.over { border-color: var(--orange); background: rgba(255, 89, 53, .05); color: var(--text); }
.assets { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-top: 16px; }
.asset { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r); overflow: hidden; }
.asset .thumb { aspect-ratio: 16/10; background: #07090b center/cover no-repeat; display: grid; place-items: center; color: var(--text-3); font-size: 12px; position: relative; }
.asset .thumb .kind { position: absolute; left: 8px; top: 8px; }
.asset .meta { padding: 10px 12px; font-size: 12.5px; }
.asset .meta .fn { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.uploads .up { display: flex; gap: 10px; align-items: center; font-size: 12.5px; margin-top: 8px; }
.editor { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 1100px) { .editor { grid-template-columns: minmax(0, 1fr) 320px; } }
.viewer { background: #000; border: 1px solid var(--hairline); border-radius: var(--r-lg); aspect-ratio: 16/9; display: grid; place-items: center; overflow: hidden; }
.viewer video, .viewer img { max-width: 100%; max-height: 100%; }
.timeline { margin-top: 16px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); padding: 10px 12px 14px; overflow-x: auto; }
.ruler { position: relative; height: 22px; margin-left: 92px; border-bottom: 1px solid var(--hairline); font-family: var(--mono); font-size: 10.5px; color: var(--text-3); }
.ruler span { position: absolute; top: 3px; transform: translateX(-50%); }
.track { display: flex; align-items: stretch; height: 46px; margin-top: 6px; }
.track .tname { width: 92px; flex: none; font-size: 11.5px; color: var(--text-2); display: flex; flex-direction: column; justify-content: center; gap: 2px; padding-right: 8px; }
.track .tname .tools { display: flex; gap: 4px; }
.track .tname .tools button { background: none; border: 1px solid var(--hairline); border-radius: 4px; font-size: 10px; padding: 0 4px; color: var(--text-3); }
.track .tname .tools button.on { color: var(--warn); border-color: var(--warn); }
.track .lane { position: relative; flex: 1; background: #101014; border-radius: 6px; }
.clip { position: absolute; top: 3px; bottom: 3px; border-radius: 6px; padding: 4px 7px; font-size: 11px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer;
  background: rgba(100, 168, 255, .22); border: 1px solid rgba(100, 168, 255, .6); color: #d6e7ff; }
.clip.audio { background: rgba(50, 210, 201, .18); border-color: rgba(50, 210, 201, .6); color: #c9f4f1; }
.clip.music { background: rgba(167, 139, 250, .2); border-color: rgba(167, 139, 250, .6); color: #ece5ff; }
.clip.cue { background: rgba(255, 214, 10, .14); border-color: rgba(255, 214, 10, .5); color: #fff1b0; }
.clip.sel { outline: 2px solid var(--orange); outline-offset: 1px; }
.inspector .kv { grid-template-columns: 90px 1fr; align-items: center; font-size: 13px; }
.history { max-height: 220px; overflow: auto; font-size: 12.5px; }
.history div { padding: 6px 0; border-bottom: 1px solid var(--hairline); }
.job { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--hairline); font-size: 13px; }
.job:last-child { border-bottom: 0; }
@media (min-width: 720px) { .job { grid-template-columns: 120px 1fr 110px 100px; } }
.render { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 720px) { .render { grid-template-columns: 240px 1fr; } }
.render video { width: 100%; max-height: 360px; background: #000; border-radius: 12px; }
.findings { padding-left: 18px; } .findings li { margin-bottom: 4px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--hairline); }
th { color: var(--text-3); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.bp-sections { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 720px) { .bp-sections { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.bp-sec { border: 1px solid var(--hairline); border-radius: 12px; padding: 10px 12px; background: #131317; min-width: 0; }
.bp-sec .head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-weight: 600; font-size: 13px; }
.bp-sec .body { color: var(--text-2); font-size: 13px; overflow-wrap: anywhere; max-height: 160px; overflow: auto; }
.bp-sec.full { grid-column: 1 / -1; }
.pipeline { display: flex; overflow-x: auto; padding: 4px 0 8px; }
.stage { flex: 1 0 90px; position: relative; padding: 10px 6px 0; text-align: center; font-size: 11.5px; color: var(--text-3); }
.stage::before { content: ""; position: absolute; top: 15px; left: 0; right: 0; height: 2px; background: var(--hairline); }
.stage .dot { position: relative; width: 12px; height: 12px; border-radius: 50%; margin: 0 auto 8px; background: var(--elevated); border: 2px solid var(--hairline-2); }
.stage.done { color: var(--text-2); } .stage.done .dot { background: var(--green); border-color: var(--green); }
.stage.active { color: var(--text); } .stage.active .dot { background: var(--orange); border-color: var(--orange); }
.stage.planned .dot { border-style: dashed; }
.command textarea { min-height: 110px; }
.command .actions { display: flex; gap: 10px; justify-content: space-between; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.examples { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.stat { display: flex; flex-direction: column; gap: 2px; } .stat b { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.project { cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- utilities added with the JS rewrite ---------- */
.sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.editor-dash { grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 1000px) { .editor-dash { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } }
.legacy .card + .card { margin-top: 16px; }
.auth-card .field label { color: var(--text-2); }
@media (min-width: 1100px) { .studio .ctx .agents { grid-template-columns: 1fr 1fr; } }
.agent .nm { overflow-wrap: anywhere; }

/* ---------- Derte Intelligence ---------- */
.orb.ai { width: 64px; height: 64px; border-radius: 22px; display: grid; place-items: center; color: #fff; margin: 0 auto 14px;
  background: linear-gradient(135deg, #7C5CF0, var(--lilac)); box-shadow: 0 16px 50px rgba(167, 139, 250, .35); }
.orb.ai.sm { width: 48px; height: 48px; border-radius: 16px; margin: 0; flex: none; }
.intel-wait { text-align: center; padding: 40px 12px; max-width: 520px; margin: 0 auto; }
.intel-wait h2 { font-size: 24px; font-weight: 750; margin: 6px 0 8px; letter-spacing: -.02em; }
.intel-intro { display: flex; gap: 14px; align-items: center; }
.intel-intro h2 { font-size: 20px; font-weight: 700; }
.intel-intro p { margin: 4px 0 0; font-size: 14px; }
.intel-hero { display: flex; gap: 18px; align-items: center; margin-bottom: 16px; }
.intel-hero h2 { font-size: 24px; font-weight: 750; letter-spacing: -.02em; margin-top: 4px; }
@media (max-width: 420px) { .intel-hero { flex-direction: column; align-items: flex-start; } }
.intel-grid { display: grid; gap: 14px; }
@media (min-width: 1000px) { .intel-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; } }
.dscore { --p: 0; flex: none; border-radius: 50%; display: grid; place-items: center; position: relative;
  background: conic-gradient(var(--lilac) calc(var(--p) * 1%), var(--orange) calc(var(--p) * 1%), rgba(255, 255, 255, .08) calc(var(--p) * 1%)); }
.dscore::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--bg); }
.dscore > div { position: relative; text-align: center; line-height: 1; }
.dscore b { font-size: 34px; font-weight: 800; letter-spacing: -.03em; display: block; }
.dscore span { font-size: 10.5px; color: var(--text-2); letter-spacing: .04em; text-transform: uppercase; }
.dmini { --p: 0; width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 13px; font-weight: 750;
  background: radial-gradient(closest-side, var(--surface) 76%, transparent 78% 100%), conic-gradient(var(--lilac) calc(var(--p) * 1%), rgba(255, 255, 255, .08) 0); }
.chart { margin: 4px 0 0; position: relative; }
.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.chart .legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.chart .legend i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.seg.sm { display: inline-grid; } .seg.sm button { min-height: 30px; font-size: 12.5px; padding: 0 10px; }
.chart svg { width: 100%; height: auto; display: block; touch-action: pan-y; }
.chart .grid { stroke: rgba(255, 255, 255, .06); }
.chart .ax { fill: var(--text-3); font-size: 11px; font-family: var(--font); }
.chart .band { fill: rgba(167, 139, 250, .12); }
.chart .act { fill: var(--green); stroke: var(--bg); stroke-width: 2; }
.chart .cursor { stroke: rgba(255, 255, 255, .35); stroke-dasharray: 3 3; }
.chart .tip { position: absolute; top: 40px; width: 150px; padding: 8px 10px; border-radius: 12px; background: var(--glass-strong);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--hairline-2); font-size: 12px; pointer-events: none; box-shadow: var(--shadow-lg); }
.chart .tip span { display: flex; justify-content: space-between; color: var(--text-2); } .chart .tip > b { display: block; margin-bottom: 4px; }
.chart figcaption { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.htable { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.htable > div { background: var(--elevated); border-radius: 12px; padding: 8px 6px; text-align: center; min-width: 0; }
.htable span { display: block; font-size: 11px; color: var(--text-3); } .htable b { display: block; font-size: 15px; margin: 2px 0; }
.htable small { display: block; font-size: 10.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reasons { margin: 10px 0 0; padding-left: 18px; color: var(--text-2); font-size: 13px; line-height: 1.5; }
.reasons.big { font-size: 14.5px; color: var(--text); }
.comp-list { display: grid; gap: 6px; }
@media (min-width: 900px) { .comp-list { grid-template-columns: 1fr 1fr; } }
.comp { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 30px; gap: 10px; align-items: center; text-align: left; min-height: 52px;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 14px; padding: 8px 12px; color: var(--text); font-size: 14px; }
.comp .nm small { display: block; color: var(--text-3); font-size: 11.5px; }
.comp .bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.comp .bar i { display: block; height: 100%; background: var(--orange); border-radius: 3px; } .comp .bar i.ai { background: var(--lilac); }
.comp b { text-align: right; font-variant-numeric: tabular-nums; }
.wrow { display: grid; grid-template-columns: minmax(0, 1fr) 110px 30px; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--hairline); }
.wrow small { display: block; color: var(--text-3); font-size: 11.5px; font-weight: 400; }
.wrow output { text-align: right; font-variant-numeric: tabular-nums; }
.sh { font-size: 15px; margin: 18px 0 8px; }
pre.method { white-space: pre-wrap; font-family: var(--font); font-size: 13px; color: var(--text-2); line-height: 1.55; margin: 0 0 12px; }
.glass { background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--hairline-2); box-shadow: var(--shadow-lg); }
.feedback textarea { min-height: 44px; }
.htable { grid-template-columns: repeat(5, minmax(66px, 1fr)); overflow-x: auto; scrollbar-width: none; }
.htable b { font-size: 14px; }
@media (max-width: 899px) { .feedback { position: static; margin-bottom: 8px; } }
.intel-grid > * { min-width: 0; } .surface { min-width: 0; }
