/* Дизайн-система «Ночная студия» (14.10.2026): тёмный чернильный фон с мягким сиянием, стеклянные панели,
   сине-фиолетовый градиент с розовым краем, заголовки Unbounded, текст Onest. Шрифты лежат у нас (static/fonts):
   так они быстрее грузятся и не передают адреса посетителей сторонним сервисам. Лицензия шрифтов — SIL OFL 1.1. */
@font-face { font-family: "Onest"; font-style: normal; font-weight: 300 800; font-display: swap; src: url(/static/fonts/onest-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 300 800; font-display: swap; src: url(/static/fonts/onest-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 400 800; font-display: swap; src: url(/static/fonts/unbounded-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 400 800; font-display: swap; src: url(/static/fonts/unbounded-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --font: "Onest", "Segoe UI", Roboto, system-ui, sans-serif;
  --font-display: "Unbounded", "Onest", "Segoe UI", sans-serif;
  --bg: #05070f;
  --side: rgba(9, 12, 30, .78);
  --panel: #0d1230;
  --panel-2: #141a3d;
  --panel-3: #1b224d;
  --glass: linear-gradient(180deg, rgba(24, 30, 66, .72), rgba(12, 16, 40, .72));
  --line: rgba(132, 146, 255, .14);
  --line-2: rgba(132, 146, 255, .3);
  --text: #eef0ff;
  --muted: #9ba2cf;
  --faint: #8a91c0;
  --accent: #6366f1;
  --accent-2: #a855f7;
  --accent-ink: #ffffff;
  --cyan: #22d3ee;
  /* белый текст на всех точках градиента — контраст не ниже 4,7:1 (норма 4,5) */
  --grad: linear-gradient(120deg, #4f46e5 0%, #7c3aed 58%, #c026d3 100%);
  --grad-soft: linear-gradient(120deg, rgba(79, 70, 229, .22), rgba(124, 58, 237, .16) 58%, rgba(192, 38, 211, .14));
  --grad-text: linear-gradient(95deg, #a5b4fc 0%, #c4b5fd 45%, #f0abfc 100%);
  --glow: 0 10px 30px -10px rgba(124, 58, 237, .7);
  --ring: 0 0 0 3px rgba(129, 140, 248, .38);
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #fb7185;
  --blue: #93a5ff;
  --radius: 16px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; }
html { scrollbar-color: rgba(129, 140, 248, .3) transparent; scrollbar-width: thin; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14.5px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
::selection { background: rgba(168, 85, 247, .45); color: #fff; }
a { color: var(--blue); text-decoration-color: rgba(147, 165, 255, .4); text-underline-offset: 3px; }
h1, h2 { font-family: var(--font-display); letter-spacing: -.02em; }
h3 { margin: 20px 0 10px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); }
h2 { margin: 0 0 12px; font-size: 19px; font-weight: 600; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.grad-text { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
/* только svg: у зон загрузки фото есть свой span.ico — его не трогаем */
svg.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn svg.ico { width: 16px; height: 16px; vertical-align: -3px; margin-right: 7px; }
:focus-visible { outline: none; box-shadow: var(--ring); }

/* ---------- фон: мягкое сияние и лёгкое зерно ---------- */
body::before { content: ""; position: fixed; inset: -20vmax; z-index: -2; pointer-events: none;
  background:
    radial-gradient(38vmax 30vmax at 78% 8%, rgba(99, 102, 241, .28), transparent 62%),
    radial-gradient(34vmax 28vmax at 12% 42%, rgba(168, 85, 247, .18), transparent 64%),
    radial-gradient(30vmax 24vmax at 70% 96%, rgba(34, 211, 238, .12), transparent 62%);
  animation: aurora 38s ease-in-out infinite alternate; }
body::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .055; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
@keyframes aurora { 0% { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(-3vmax, 2vmax, 0) scale(1.06); } 100% { transform: translate3d(2vmax, -2vmax, 0) scale(1.02); } }

/* ---------- каркас: меню слева, справа шапка и содержимое ---------- */
body { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 20px;
  padding: 20px 14px 16px; background: var(--side); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-right: 1px solid var(--line); z-index: 40; }
.brand { display: flex; gap: 11px; align-items: center; padding: 2px 6px 4px; }
.logo-mark { position: relative; width: 40px; height: 40px; border-radius: 12px; background: var(--grad); display: grid; place-items: center;
  box-shadow: var(--glow), inset 0 1px 0 rgba(255, 255, 255, .25); flex: none; overflow: hidden; }
.logo-mark::after { content: ""; position: absolute; inset: -40%; background: conic-gradient(from 0deg, transparent 0 70%, rgba(255, 255, 255, .35) 80%, transparent 90%);
  animation: spin 6s linear infinite; }
.logo-mark svg { position: relative; z-index: 1; width: 17px; height: 17px; fill: #fff; margin-left: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.brand-title { font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.brand-sub { color: var(--muted); font-size: 11.5px; line-height: 1.3; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav button { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 12px; border: 0; background: none;
  color: var(--muted); font: inherit; font-weight: 600; font-size: 14px; text-align: left; cursor: pointer; transition: background .2s, color .2s, transform .2s var(--ease); }
.nav button:hover { background: rgba(129, 140, 248, .09); color: var(--text); }
.nav button:hover svg.ico { transform: scale(1.08); }
.nav button svg.ico { transition: transform .2s var(--ease); }
.nav button.active { background: var(--grad); color: #fff; box-shadow: var(--glow), inset 0 1px 0 rgba(255, 255, 255, .22); }
/* «Для профи» сворачивается: обычному человеку эти шесть пунктов не нужны */
.nav button.nav-group { margin-top: 14px; padding: 8px 12px; justify-content: space-between; font-size: 11px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--faint); }
.nav button.nav-group svg.ico { width: 15px; height: 15px; transition: transform .25s var(--ease); }
.nav button.nav-group[aria-expanded="true"] svg.ico { transform: rotate(180deg); }
.nav-pro { display: none; flex-direction: column; gap: 3px; }
.nav-pro.open { display: flex; animation: rise .3s var(--ease) both; }
.side-card { position: relative; margin-top: auto; padding: 18px 16px 16px; border-radius: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 12.5px;
  color: var(--muted); background: var(--grad-soft); border: 1px solid var(--line-2); overflow: hidden; }
.side-card::before { content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, rgba(192, 38, 211, .45), transparent 70%); pointer-events: none; }
.side-card b { position: relative; color: var(--text); font-family: var(--font-display); font-size: 13.5px; font-weight: 600; line-height: 1.35; }
.side-card .spark { width: 22px; height: 22px; color: #e9d5ff; }
.side-card .btn { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; }
.side-card .btn .ico { width: 14px; height: 14px; margin: 0; }
.side-backdrop { display: none; }
.shell { min-width: 0; }

.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 14px 28px;
  background: rgba(5, 7, 15, .66); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
.search { flex: 1; max-width: 540px; position: relative; display: flex; align-items: center; margin: 0; }
.search .ico { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.search input { padding: 11px 44px 11px 42px; border-radius: 14px; background: rgba(20, 26, 61, .6); font-size: 14px; }
.search kbd { position: absolute; right: 10px; padding: 2px 8px; border-radius: 7px; border: 1px solid var(--line-2); color: var(--muted);
  font: 600 12px/1.4 var(--font); background: rgba(255, 255, 255, .04); pointer-events: none; }
.search input:focus + kbd, .search input:not(:placeholder-shown) + kbd { display: none; }
.top-right { display: flex; gap: 10px; align-items: center; margin-left: auto; }
.icon-btn { position: relative; width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; cursor: pointer;
  background: rgba(20, 26, 61, .6); border: 1px solid var(--line); color: var(--text); transition: border-color .2s, transform .2s var(--ease); }
.icon-btn:hover { border-color: var(--line-2); transform: translateY(-1px); }
.bell b { position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: linear-gradient(135deg, #f472b6, #c026d3);
  color: #fff; font-size: 11px; display: grid; place-items: center; border: 2px solid var(--bg); animation: pop .35s var(--ease); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.menu-btn { display: none; }
.badge { display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 999px; font-weight: 700; font-size: 11.5px; letter-spacing: .04em; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 currentColor; animation: beacon 2.4s ease-out infinite; }
@keyframes beacon { 0% { box-shadow: 0 0 0 0 currentColor; } 70%, 100% { box-shadow: 0 0 0 6px transparent; } }
.badge.test { background: rgba(251, 191, 36, .1); color: var(--warn); border: 1px solid rgba(251, 191, 36, .32); }
.badge.live { background: rgba(52, 211, 153, .1); color: var(--ok); border: 1px solid rgba(52, 211, 153, .32); }
.pill { padding: 5px 10px; border-radius: 999px; background: rgba(129, 140, 248, .14); color: var(--blue); font-size: 12px; font-weight: 600; }
.banner { margin: 16px 28px 0; padding: 11px 15px; border-radius: 14px; background: rgba(251, 191, 36, .07); border: 1px solid rgba(251, 191, 36, .26); color: #fde68a; font-size: 13px; }

main { padding: 26px 28px 56px; }
.tab { display: none; }
.tab.active { display: block; animation: rise .35s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.layout-2 { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
.panel { background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--line); border-radius: 20px;
  padding: 8px 18px 18px; position: sticky; top: 96px; max-height: calc(100vh - 112px); overflow: auto; }
.content { min-width: 0; }
.empty { color: var(--muted); padding: 56px 24px; text-align: center; border: 1px dashed var(--line-2); border-radius: 20px; background: rgba(13, 18, 48, .35); }

input, select, textarea { width: 100%; background: rgba(9, 12, 32, .55); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px;
  font: inherit; transition: border-color .2s, box-shadow .2s, background .2s; }
input::placeholder, textarea::placeholder { color: #7880ad; }
input:hover, select:hover, textarea:hover { border-color: var(--line-2); }
input:focus, select:focus, textarea:focus { outline: none; border-color: rgba(129, 140, 248, .7); box-shadow: var(--ring); background: rgba(12, 16, 42, .8); }
select { appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ba2cf' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
select option { background: #10152e; color: var(--text); }
input[type=checkbox], input[type=radio] { accent-color: #7c3aed; }
textarea { resize: vertical; }
label { display: block; font-size: 12.5px; color: var(--muted); margin: 8px 0; }
label > input, label > select, label > textarea, label > .seg { margin-top: 5px; }
label.inline { display: flex; gap: 8px; align-items: center; color: var(--text); }
label.inline input { width: auto; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row-form { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.row-form input { grid-column: 1 / 2; }
.row-form .btn { grid-column: 2 / 3; }
.checks { display: flex; gap: 12px; flex-wrap: wrap; margin: 6px 0; }
.checks label { display: flex; gap: 6px; align-items: center; color: var(--text); margin: 0; }
.checks input { width: auto; }

.btn { position: relative; background: rgba(255, 255, 255, .04); color: var(--text); border: 1px solid var(--line-2); border-radius: 12px; padding: 9px 15px;
  font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .2s, border-color .2s, transform .2s var(--ease), box-shadow .2s, filter .2s; }
.btn:hover { background: rgba(255, 255, 255, .08); border-color: rgba(165, 180, 252, .45); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn.primary { background: var(--grad); color: #fff; border: 0; overflow: hidden; box-shadow: var(--glow), inset 0 1px 0 rgba(255, 255, 255, .22); }
/* блик, пробегающий по главной кнопке при наведении */
.btn.primary::after { content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .28), transparent); transform: skewX(-18deg); transition: left .6s var(--ease); }
.btn.primary:hover { filter: brightness(1.08) saturate(1.08); box-shadow: 0 14px 34px -10px rgba(168, 85, 247, .8), inset 0 1px 0 rgba(255, 255, 255, .25); }
.btn.primary:hover::after { left: 120%; }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.small { padding: 6px 11px; font-size: 12.5px; border-radius: 10px; }
.btn.wide { width: 100%; margin-top: 10px; }
.btn.danger { color: var(--err); }

.seg { display: flex; background: rgba(9, 12, 32, .55); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.seg button { flex: 1; background: none; border: 0; color: var(--muted); padding: 7px; border-radius: 9px; font: inherit; font-weight: 700; cursor: pointer; transition: color .2s, background .2s; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--grad); color: #fff; box-shadow: var(--glow); }

.sources { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.source { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 11px; background: rgba(20, 26, 61, .55); border: 1px solid var(--line); font-size: 13px; }
.source.off { opacity: .45; }
.source .v { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 15px; }
.plat { font-size: 10.5px; font-weight: 800; padding: 2px 6px; border-radius: 6px; letter-spacing: .03em; }
.plat.instagram { background: #3b1d3d; color: #ff8ad8; }
.plat.tiktok { background: #14323a; color: #5ef0ff; }
.plat.youtube { background: #3d1b1b; color: #ff7676; }

.estimate { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--grad-soft); border: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.estimate b { color: var(--text); }
.job-inline { margin-top: 10px; }
.progress { height: 8px; border-radius: 999px; background: rgba(129, 140, 248, .12); overflow: hidden; }
/* полоса «дышит»: по ней бежит блик, пока задача идёт */
.progress > div { position: relative; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #4f46e5, #7c3aed, #c026d3, #22d3ee);
  background-size: 300% 100%; animation: flow 3s linear infinite; transition: width .6s var(--ease); box-shadow: 0 0 16px rgba(168, 85, 247, .55); }
@keyframes flow { to { background-position: -300% 0; } }

.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar select { width: 210px; }
.toolbar input { max-width: 320px; }
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.vcard { background: var(--glass); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; transition: transform .25s var(--ease), border-color .25s; }
.vcard:hover { transform: translateY(-3px); border-color: var(--line-2); }
.vthumb { position: relative; aspect-ratio: 9 / 13; background: #000 center/cover no-repeat; }
.vthumb .plat { position: absolute; left: 8px; top: 8px; }
.vthumb .demo { position: absolute; right: 8px; top: 8px; background: rgba(0,0,0,.65); color: var(--warn); font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 6px; }
.vthumb .views { position: absolute; left: 8px; bottom: 8px; background: rgba(0,0,0,.65); padding: 3px 8px; border-radius: 8px; font-weight: 800; }
.vthumb .score { position: absolute; right: 8px; bottom: 8px; background: var(--grad); color: #fff; padding: 3px 8px; border-radius: 8px; font-weight: 800; font-size: 12px; }
.vbody { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.vauthor { font-weight: 700; }
.vcap { color: var(--muted); font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vstats { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--muted); }
.vstats b { color: var(--text); }
.vactions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }

.list { display: flex; flex-direction: column; gap: 6px; }
.item { padding: 10px 12px; border-radius: 12px; background: rgba(20, 26, 61, .5); cursor: pointer; border: 1px solid var(--line); transition: border-color .2s, background .2s; }
.item:hover { border-color: var(--line-2); background: rgba(27, 34, 77, .6); }
.item.sel { border-color: rgba(168, 85, 247, .7); box-shadow: 0 0 0 1px rgba(168, 85, 247, .35); }
.item .t { font-weight: 600; font-size: 13.5px; }
.item .s { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; margin-top: 2px; }
.st { font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 6px; }
.st.done { background: rgba(60,207,145,.15); color: var(--ok); }
.st.running, .st.queued { background: rgba(91,140,255,.15); color: var(--blue); }
.st.error { background: rgba(255,91,107,.15); color: var(--err); }
.st.pending { background: var(--panel); color: var(--muted); }
.chip { display: inline-flex; gap: 8px; align-items: center; padding: 6px 10px; border-radius: 10px; background: rgba(107,108,255,.12); border: 1px solid rgba(122,138,255,.4); font-size: 12.5px; margin: 4px 0; }
.chip button { background: none; border: 0; color: var(--muted); cursor: pointer; }

.card { background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--line); border-radius: 20px; padding: 18px; margin-bottom: 14px; }
.card-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; }
.meta b { color: var(--text); }
.scene { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.scene:first-child { border-top: 0; }
.scene .n { width: 28px; height: 28px; border-radius: 8px; background: var(--panel-2); display: grid; place-items: center; font-weight: 800; color: #a9a6ff; }
.scene textarea { font-size: 14.5px; }
.scene details { margin-top: 6px; }
.scene summary { color: var(--muted); font-size: 12px; cursor: pointer; }
.scene .wc { font-size: 11.5px; color: var(--muted); margin-top: 3px; display: flex; justify-content: space-between; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cost { font-size: 13px; }
.cost b { color: #a9a6ff; }
.big-cost { font-size: 22px; font-weight: 800; color: #a9a6ff; }

.steps { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.stepbox { padding: 8px 12px; border-radius: 12px; background: rgba(20, 26, 61, .5); font-size: 12.5px; border: 1px solid var(--line); }
.stepbox.done { border-color: rgba(60,207,145,.5); }
.stepbox.running { border-color: var(--blue); }
.stepbox.error { border-color: var(--err); }
.stepbox small { display: block; color: var(--muted); }
.studio { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 16px; align-items: start; }
.player video { width: 100%; aspect-ratio: 9 / 16; background: #000; border-radius: var(--radius); }
.player .ph { aspect-ratio: 9 / 16; border-radius: var(--radius); background: var(--panel-2); display: grid; place-items: center; color: var(--muted); text-align: center; padding: 20px; }
.scene-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.sc { background: var(--panel-2); border-radius: 12px; overflow: hidden; font-size: 12px; }
.sc .media { aspect-ratio: 9 / 16; background: #000 center/cover no-repeat; position: relative; }
.sc .media video { width: 100%; height: 100%; object-fit: cover; }
.sc .media .tag { position: absolute; left: 6px; top: 6px; background: rgba(0,0,0,.7); padding: 1px 6px; border-radius: 6px; font-weight: 800; }
.sc .txt { padding: 6px 8px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sc .acts { display: flex; gap: 4px; padding: 0 6px 6px; }
.sc .acts button { flex: 1; font-size: 11px; padding: 4px; }
.log { max-height: 220px; overflow: auto; font: 12px/1.5 Consolas, monospace; background: #0b0d12; border-radius: 10px; padding: 8px 10px; color: #b9bfd3; }
.log .warn { color: var(--warn); }
.log .error { color: var(--err); }
table.costs { width: 100%; border-collapse: collapse; font-size: 13px; }
table.costs td { padding: 4px 0; border-bottom: 1px solid var(--line); }
table.costs td:last-child { text-align: right; }

.settings { max-width: 980px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.settings .card { margin: 0; }
.settings .full { grid-column: 1 / -1; }
.keyrow { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line); }
.ok { color: var(--ok); font-weight: 700; }
.no { color: var(--err); font-weight: 700; }
code { background: rgba(129, 140, 248, .12); padding: 1px 6px; border-radius: 6px; font-size: 12.5px; }

.modal { position: fixed; inset: 0; background: rgba(3, 5, 14, .66); backdrop-filter: blur(6px); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal-box { position: relative; background: linear-gradient(180deg, #151b3f, #0d1230); border: 1px solid var(--line-2); border-radius: 22px; padding: 24px; width: min(760px, 100%);
  max-height: 88vh; overflow: auto; box-shadow: 0 30px 80px rgba(0, 0, 0, .55); animation: rise .3s var(--ease) both; }
.modal-close { position: absolute; right: 12px; top: 8px; background: none; border: 0; color: var(--muted); font-size: 26px; cursor: pointer; }
.idea { padding: 10px 12px; border-radius: 12px; background: var(--panel-2); margin: 8px 0; display: flex; gap: 12px; justify-content: space-between; align-items: center; }
.idea .t { font-weight: 700; }
.idea .d { color: var(--muted); font-size: 12.5px; }
ul.clean { margin: 4px 0 10px; padding-left: 18px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; max-width: min(520px, calc(100vw - 28px));
  background: rgba(22, 28, 64, .92); backdrop-filter: blur(14px); border: 1px solid var(--line-2); padding: 11px 18px; border-radius: 14px; z-index: 60;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .5); animation: toastIn .35s var(--ease) both; font-weight: 500; }
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.toast.err { background: rgba(60, 18, 34, .94); border-color: rgba(251, 113, 133, .45); }
.toast.err::before { background: var(--err); box-shadow: 0 0 10px var(--err); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } }

/* ---------- автопилот ---------- */
.btn.big { padding: 13px 16px; font-size: 15px; }
.pipeline { position: relative; }
.stage { display: grid; grid-template-columns: 40px 1fr; gap: 12px; position: relative; padding-bottom: 14px; }
.stage::before { content: ""; position: absolute; left: 19px; top: 36px; bottom: 0; width: 2px; background: var(--line); }
.stage:last-child::before { display: none; }
.stage .dot { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 800;
  background: var(--panel-2); border: 2px solid var(--line); color: var(--muted); z-index: 1; }
.stage.done .dot { border-color: var(--ok); color: var(--ok); }
.stage.running .dot { border-color: var(--blue); color: var(--blue); animation: pulse 1.4s infinite; }
.stage.error .dot { border-color: var(--err); color: var(--err); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(91,140,255,.5); } 50% { box-shadow: 0 0 0 8px rgba(91,140,255,0); } }
.stage .body { background: var(--glass); border: 1px solid var(--line); border-radius: 16px; padding: 13px 15px; min-width: 0; }
.stage.pending .body { opacity: .55; }
.stage-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stage-head b { font-size: 15px; }
.stage-art { margin-top: 10px; font-size: 13px; }
.stage-art:empty { display: none; }
.mini { display: grid; grid-template-columns: 90px 1fr; gap: 12px; }
.mini .th { aspect-ratio: 9 / 13; border-radius: 10px; background: #000 center/cover no-repeat; position: relative; }
.mini .th .plat { position: absolute; left: 5px; top: 5px; }
pre.prompt { white-space: pre-wrap; word-break: break-word; background: #0b0d12; border-radius: 10px; padding: 8px 10px;
  font: 12px/1.5 Consolas, monospace; color: #c8cde0; margin: 6px 0; max-height: 220px; overflow: auto; }
ol.lines { margin: 4px 0; padding-left: 20px; }
ol.lines li { margin: 3px 0; }
.vid-small video { width: 220px; aspect-ratio: 9 / 16; border-radius: 12px; background: #000; }
.pub { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--panel-2); margin: 6px 0; }

/* ---------- клиенты и заказы ---------- */
.money-mini { display: grid; gap: 4px; }
.money-mini div { display: flex; justify-content: space-between; gap: 8px; padding: 8px 12px; border-radius: 12px; background: rgba(20, 26, 61, .5); border: 1px solid var(--line); font-size: 13px; }
.money-mini span { color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px; }
.stat { background: var(--grad-soft); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.stat span { color: var(--muted); font-size: 12px; display: block; }
.stat b { font-family: var(--font-display); font-weight: 600; font-size: 22px; display: block; margin: 4px 0; }
.stat small { color: var(--muted); font-size: 11.5px; }
.funnel { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.funnel div { background: rgba(20, 26, 61, .5); border: 1px solid var(--line); border-radius: 14px; padding: 10px 8px; text-align: center; }
.funnel b { display: block; font-family: var(--font-display); font-weight: 600; font-size: 18px; }
.funnel span { color: var(--muted); font-size: 11.5px; }
.table-wrap { overflow-x: auto; }
table.orders { width: 100%; border-collapse: collapse; font-size: 13px; }
table.orders th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 4px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.orders td { padding: 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.orders input.num { width: 84px; }
table.orders input.oTitle { min-width: 150px; }
table.orders select { min-width: 150px; }
table.orders input[type=checkbox] { width: auto; }
.nowrap { white-space: nowrap; }
.order-form { display: grid; grid-template-columns: 1fr 90px 120px 180px auto; gap: 6px; margin: 12px 0 6px; }
.span-2 { grid-column: 1 / -1; }
.grid-3 { display: grid; grid-template-columns: 1fr 150px 1.5fr; gap: 10px; margin-top: 4px; }
.uploads { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.upload { display: grid; grid-template-columns: 110px 1fr; gap: 12px; align-items: center; }
.up-prev { aspect-ratio: 1; border-radius: 12px; background: var(--panel-2) center / contain no-repeat; display: grid; place-items: center;
  color: var(--muted); font-size: 12px; border: 1px dashed var(--line); }
.up-prev.logo { background-color: #3a3f52; }
.upload label.btn { display: inline-block; margin: 0; color: var(--text); font-size: 12.5px; }
.cl-logo { width: 18px; height: 18px; object-fit: contain; vertical-align: -4px; margin-right: 6px; border-radius: 4px; }
.cl-videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.cl-vid { background: var(--panel-2); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.cl-vid .th video, .cl-vid .th .ph { width: 100%; aspect-ratio: 9 / 16; border-radius: 10px; background: #000; display: block; }
.cl-vid .th .ph { display: grid; place-items: center; color: var(--muted); background: var(--panel); }
.cl-vid .t { font-weight: 600; font-size: 13px; }
.cl-vid .s { color: var(--muted); font-size: 12px; }

@media (max-width: 900px) {
  body { display: block; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; transform: translateX(-100%); transition: transform .22s ease; }
  body.side-open .side { transform: none; box-shadow: 20px 0 60px rgba(0, 0, 0, .5); }
  body.side-open .side-backdrop { display: block; position: fixed; inset: 0; background: rgba(3, 6, 20, .6); z-index: 35; }
  .menu-btn { display: grid; }
  .topbar { gap: 10px; padding: 10px 14px; }
  .search input { font-size: 16px; padding-right: 14px; }
  .search kbd { display: none; }
  .badge { padding: 6px 10px; font-size: 0; }
  .badge::after { content: attr(data-short); font-size: 11.5px; }
  .icon-btn { width: 38px; height: 38px; }
  main { padding: 18px 14px 40px; }
  .topbar { background: rgba(5, 7, 15, .82); }
  .banner { margin: 12px 14px 0; }
  .layout-2, .studio, .settings { grid-template-columns: 1fr; }
  .panel { position: static; max-height: none; }
  .stats, .funnel { grid-template-columns: 1fr 1fr; }
  .order-form, .grid-3, .uploads { grid-template-columns: 1fr; }
}

/* ---------- окно на сайте партнёра (/embed/<ключ>, embed.js ставит html.embed) ----------
   «Для профи», лента, режим завода и рекламная карточка посетителю не нужны; до входа интерфейс скрыт целиком
   (html.embed-locked) — карточка входа поверх. Правила синхронные: админ-меню не мелькает до ACC.init. */
html.embed #proGroup, html.embed #navPro, html.embed #tabs [data-tab="feed"], html.embed #modeBadge,
html.embed #modeBanner, html.embed .side-card { display: none !important; }
html.embed-locked .side, html.embed-locked .shell, html.embed-locked .side-backdrop { visibility: hidden; }
/* ещё до embed.js (он в конце страницы): метатег окна уже есть — интерфейс не показываем. Отдельным правилом:
   браузер без :has() пропустит только его */
html:has(meta[name="zavod-embed"]):not(.embed) .side, html:has(meta[name="zavod-embed"]):not(.embed) .shell { visibility: hidden; }
html.embed .banner.embed-note { background: rgba(99, 102, 241, .1); border-color: var(--line-2); color: var(--text); }
html.embed .icon-btn.embed-expand svg.ico { width: 17px; height: 17px; }
.modal.embed-ask { z-index: 70; }
.modal.embed-ask .modal-box { width: min(460px, 100%); }
.modal.embed-ask .embed-ask-q { margin: 0 0 14px; font-size: 15px; }
.modal.embed-ask input { margin-bottom: 14px; }
.acc-site { width: auto; min-width: 170px; }

/* меньше движения — для тех, кому оно мешает (настройка системы) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
