/* SeemsGood Media Corporation — панель студии.
   Тёмная монтажная: светятся только кадры, статусы и квота.
   Слева — «где я», сверху — «кто» (персонажи) и «что показать» (фильтры), справа — «этот ролик».
   Встроенные стили запрещены CSP, поэтому всё — классами; шрифты лежат рядом. */

@font-face { font-family: "Onest"; font-weight: 100 900; 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+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Onest"; font-weight: 100 900; 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: "Unbounded"; font-weight: 200 900; font-display: swap; src: url("/static/fonts/unbounded-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Unbounded"; font-weight: 200 900; 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: "JetBrains Mono"; font-weight: 500; font-display: swap; src: url("/static/fonts/jbmono-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; font-display: swap; src: url("/static/fonts/jbmono-cyrillic.woff2") format("woff2"); unicode-range: U+0400-045F; }

:root {
  --bg: #0a0a0e;
  --panel: #101016;
  --raise: #16161e;
  --hover: #1d1d27;
  --line: rgba(236, 232, 255, .07);
  --line-2: rgba(236, 232, 255, .13);
  --ink: #f3f1fa;
  --ink-2: #aeabbe;
  --mute: #75738c;
  --accent: #8d6bff;
  --accent-2: #b39cff;
  --accent-soft: rgba(141, 107, 255, .14);
  --accent-glow: rgba(141, 107, 255, .38);
  --live: #ff8a4c;
  --live-soft: rgba(255, 138, 76, .14);
  --ok: #43d99b; --ok-soft: rgba(67, 217, 155, .13);
  --warn: #ffbf47; --warn-soft: rgba(255, 191, 71, .13);
  --bad: #ff5f73; --bad-soft: rgba(255, 95, 115, .13);
  --run: #62aaff; --run-soft: rgba(98, 170, 255, .14);
  --scrim: rgba(4, 4, 8, .62);
  --f-ui: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-display: "Unbounded", "Onest", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --side: 240px; --side-mini: 72px; --insp: 440px; --top: 64px;
  --card-min: 196px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--f-ui); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; overflow-x: hidden; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent-glow); }
h1 { font: 700 26px/1.15 var(--f-display); letter-spacing: -.02em; margin: 0 0 14px; text-wrap: balance; }
h2 { font-size: 15px; line-height: 1.3; margin: 0 0 12px; font-weight: 650; }
h3 { font-size: 13px; font-weight: 600; }
p { margin: 0 0 10px; }
code { font: 12.5px/1.4 var(--f-mono); background: var(--raise); padding: 2px 6px; border-radius: 5px; }
kbd { font: 600 10.5px/1 var(--f-mono); color: var(--mute); padding: 3px 6px; border-radius: 5px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03); }
.muted, .mute { color: var(--mute); }
.small { font-size: 12.5px; }
.bad { color: var(--bad); }
.mono { font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .01em; }
.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.spin { animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .25; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* ---------- аватары: 8 цветов по id ---------- */
.ava { position: relative; display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 50%; overflow: hidden; color: #fff; font-weight: 700; font-size: 12px; letter-spacing: .02em; background: linear-gradient(140deg, var(--c1), var(--c2)); }
.ava::after { content: ""; position: absolute; inset: 0; background: radial-gradient(80% 60% at 30% 20%, rgba(255, 255, 255, .35), transparent 60%); }
.ava.xs { width: 22px; height: 22px; font-size: 9px; }
.ava.lg { width: 64px; height: 64px; font-size: 20px; }
.ava.xl { width: 112px; height: 112px; font-size: 38px; }
.ava img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.av-0 { --c1: #ff6a88; --c2: #ff99ac; } .av-1 { --c1: #2193b0; --c2: #6dd5ed; } .av-2 { --c1: #8e2de2; --c2: #c471f5; } .av-3 { --c1: #11998e; --c2: #38ef7d; }
.av-4 { --c1: #f7971e; --c2: #ffd200; } .av-5 { --c1: #ee0979; --c2: #ff6a00; } .av-6 { --c1: #4776e6; --c2: #8e54e9; } .av-7 { --c1: #fc5c7d; --c2: #6a82fb; }
.stack { display: inline-flex; }
.stack .ava { box-shadow: 0 0 0 2px rgba(10, 10, 14, .9); }
.stack .ava + .ava { margin-left: -7px; }

/* ---------- каркас ---------- */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .28s var(--ease); }
.app.mini { grid-template-columns: var(--side-mini) minmax(0, 1fr); }
.side { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 4px; padding: calc(14px + env(safe-area-inset-top, 0px)) 12px calc(12px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); background: var(--panel); border-right: 1px solid var(--line); overflow-y: auto; overflow-x: hidden; z-index: 30; scrollbar-width: none; }
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 6px 16px; white-space: nowrap; color: var(--ink); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand b { display: block; font: 700 15px/1 var(--f-display); letter-spacing: -.01em; }
.brand small { display: block; color: var(--mute); font-size: 11px; margin-top: 4px; }
.logo { width: 36px; height: 36px; border-radius: 11px; flex: none; display: block; }
/* Герой студии: появляется после входа, смеётся при входе и при наведении. */
.logo.face { background: #0b0b10; overflow: hidden; box-shadow: 0 6px 18px rgba(255, 138, 76, .3); }
.logo.face img { width: 100%; height: 100%; object-fit: cover; display: block; transform-origin: 50% 85%; animation: chuckle 8s ease-in-out infinite; }
.brand:hover .logo.face img { animation: laughing .3s ease-in-out infinite; }
body.entering .logo.face img { animation: pop-laugh 1.5s var(--ease) both; }
@keyframes chuckle { 0%, 86%, 100% { transform: none; } 88% { transform: rotate(-7deg) scale(1.08); } 90% { transform: rotate(6deg) scale(1.08); } 92% { transform: rotate(-5deg) scale(1.06); } 94% { transform: rotate(4deg) scale(1.04); } 96% { transform: rotate(-2deg); } }
@keyframes laughing { 0%, 100% { transform: rotate(-7deg) scale(1.1); } 50% { transform: rotate(7deg) translateY(-1px) scale(1.12); } }
@keyframes pop-laugh { 0% { transform: scale(0) rotate(-30deg); } 30% { transform: scale(1.25) rotate(8deg); } 42% { transform: scale(1.1) rotate(-8deg); } 54% { transform: scale(1.15) rotate(7deg); } 66% { transform: scale(1.08) rotate(-6deg); } 78% { transform: scale(1.1) rotate(4deg); } 100% { transform: none; } }
.collapse { position: absolute; right: 10px; top: calc(20px + env(safe-area-inset-top, 0px)); width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: var(--mute); background: none; border: 0; cursor: pointer; }
.collapse:hover { background: var(--hover); color: var(--ink); }
.new-btn { display: flex; align-items: center; justify-content: center; gap: 8px; height: 42px; margin-bottom: 10px; border-radius: 11px; font-weight: 600; color: #fff; white-space: nowrap; text-decoration: none; background: linear-gradient(180deg, #9b7dff, #7a55ff); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 8px 22px var(--accent-glow); transition: transform .12s, box-shadow .2s; }
.new-btn:hover { text-decoration: none; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 10px 30px var(--accent-glow); }
.new-btn:active { transform: translateY(1px); }
.new-btn kbd { color: rgba(255, 255, 255, .75); border-color: rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .08); }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-h { font-size: 10.5px; font-weight: 600; color: var(--mute); text-transform: uppercase; letter-spacing: .09em; padding: 12px 10px 6px; white-space: nowrap; }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 11px; border-radius: 9px; color: var(--ink-2); font-weight: 500; text-decoration: none; white-space: nowrap; transition: background .12s, color .12s; }
.nav a .i { color: var(--mute); transition: color .12s; }
.nav a:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.nav a:hover .i { color: var(--ink); }
.nav a.on { background: var(--accent-soft); color: var(--ink); }
.nav a.on .i { color: var(--accent-2); }
.nav a.on::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.cnt { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 99px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--accent-soft); color: var(--accent-2); }
.cnt.live-cnt { background: var(--live-soft); color: var(--live); }
.side-foot { margin-top: auto; padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.quota { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 12px; background: var(--raise); border: 1px solid var(--line); white-space: nowrap; color: var(--ink); text-decoration: none; }
.quota:hover { border-color: var(--line-2); text-decoration: none; }
.quota-top { display: flex; align-items: baseline; justify-content: space-between; font-size: 12px; color: var(--mute); }
.quota-top b { font: 700 18px/1 var(--f-display); color: var(--ink); letter-spacing: -.02em; }
.me-row { display: flex; align-items: center; gap: 6px; }
.me-row form { margin: 0; }
.me { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 10px; white-space: nowrap; color: var(--ink); text-decoration: none; }
.me:hover { background: var(--hover); text-decoration: none; }
.me > span:last-child { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.me b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.me small { color: var(--mute); font-size: 11.5px; }
.app.mini .brand-t, .app.mini .new-btn span, .app.mini .new-btn kbd, .app.mini .nav-h, .app.mini .nav a span, .app.mini .nav .cnt, .app.mini .quota, .app.mini .me > span:last-child, .app.mini .me-row form { display: none; }
.app.mini .new-btn { width: 44px; margin-inline: auto; }
.app.mini .nav a { justify-content: center; padding: 0; }
.app.mini .collapse { position: static; margin: 0 auto 6px; transform: rotate(180deg); }
.app.mini .me { justify-content: center; }

.main { min-width: 0; display: flex; flex-direction: column; transition: padding-right .3s var(--ease); }
.app.insp-open .main { padding-right: var(--insp); }
.top { position: sticky; top: 0; z-index: 20; height: var(--top); display: flex; align-items: center; gap: 12px; padding: env(safe-area-inset-top, 0px) max(28px, env(safe-area-inset-right, 0px)) 0 28px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.5) blur(16px); -webkit-backdrop-filter: saturate(1.5) blur(16px); border-bottom: 1px solid var(--line); }
.crumbs { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs a { color: var(--mute); font-weight: 500; }
.crumbs .sep { color: var(--mute); opacity: .6; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.menu-toggle { display: none; }
.icon-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 10px; color: var(--ink-2); background: none; border: 0; cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 8px; color: var(--mute); }
.icon-btn.menu-toggle { display: none; }
.live { display: flex; align-items: center; gap: 9px; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--raise); font-weight: 600; font-size: 13px; white-space: nowrap; color: var(--ink); text-decoration: none; }
.live:hover { border-color: var(--line-2); text-decoration: none; }
.ring { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--live-soft); border-top-color: var(--live); animation: spin 1s linear infinite; flex: none; }
.live.idle .ring { animation: none; border-color: var(--ok-soft); border-top-color: var(--ok); }
.counter { display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--raise); color: var(--mute); font-size: 12px; text-decoration: none; white-space: nowrap; }
.counter:hover { border-color: var(--line-2); text-decoration: none; }
.counter .i { color: var(--accent-2); width: 16px; height: 16px; }
.counter span { display: flex; align-items: baseline; gap: 5px; }
.counter span + span { padding-left: 12px; border-left: 1px solid var(--line); }
.counter strong { font-size: 15px; color: var(--ink); font-weight: 700; }
.view { width: 100%; max-width: 1480px; padding: 22px max(28px, env(safe-area-inset-right, 0px)) 80px 28px; }
.solo { min-height: 100vh; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.view-head h1 { margin: 0; }
.view-head p { margin: 6px 0 0; color: var(--mute); max-width: 720px; }
.head-acts { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- кнопки, поля ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; text-decoration: none; background: var(--raise); border: 1px solid var(--line-2); color: var(--ink); transition: background .12s, border-color .12s, transform .08s, box-shadow .2s; }
.btn:hover { background: var(--hover); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn .i { width: 16px; height: 16px; }
.btn.pri, .btn-primary { background: linear-gradient(180deg, #9b7dff, #7a55ff); border-color: transparent; color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 6px 18px var(--accent-glow); }
.btn.pri:hover, .btn-primary:hover { filter: brightness(1.08); background: linear-gradient(180deg, #9b7dff, #7a55ff); }
.btn.pri:disabled, .btn-primary:disabled { opacity: .5; cursor: not-allowed; filter: grayscale(.4); box-shadow: none; }
.btn.ghost { background: none; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--hover); color: var(--ink); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); border-color: rgba(255, 95, 115, .3); }
.btn-big { height: 48px; padding: 0 24px; font-size: 15px; border-radius: 12px; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 9px; }
.link { font: inherit; font-size: 13.5px; font-weight: 500; background: none; border: 0; padding: 0; color: var(--accent-2); cursor: pointer; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.link.danger, .danger { color: var(--bad); }
label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 550; color: var(--ink-2); }
label small { font-weight: 400; color: var(--mute); font-size: 12px; line-height: 1.45; }
input, select, textarea { font: inherit; font-size: 14px; color: var(--ink); background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 12px; min-width: 0; transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: var(--mute); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
select { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, var(--mute) 50%), linear-gradient(135deg, var(--mute) 50%, transparent 50%); background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
textarea { resize: vertical; line-height: 1.55; }
input[type="number"] { width: 110px; }
input[type="file"] { padding: 7px; cursor: pointer; }
input[type="file"]::file-selector-button { font: inherit; font-weight: 600; font-size: 13px; margin-right: 12px; padding: 6px 12px; border-radius: 7px; border: 1px solid var(--line-2); background: var(--raise); color: var(--ink); cursor: pointer; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin: 0; }
.inline-form .grow { flex: 1 1 220px; }
.inline-form.compact { gap: 8px; align-items: center; }
.inline-form.compact select { padding: 5px 30px 5px 9px; font-size: 13px; }
.copy { width: 100%; margin-top: 10px; font: 13px/1.4 var(--f-mono); }

/* ---------- общие блоки (страницы управления) ---------- */
.card:not(a) { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 20px 22px; margin-bottom: 18px; }
.card.narrow { width: min(420px, 100%); }
.narrow-left { max-width: 620px; }
.card-inset { margin-top: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--raise); }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; margin-bottom: 18px; }
.split > .card { margin-bottom: 0; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 32px 0 14px; font-size: 16px; font-weight: 700; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 20px; }
.toolbar form { margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0; }
.actions form { margin: 0; }
.more { margin-top: 26px; text-align: center; }
.notice { padding: 13px 16px; border-radius: 14px; margin-bottom: 16px; border: 1px solid var(--line); font-size: 13.5px; }
.notice p { margin: 6px 0 0; }
.notice-bad { background: var(--bad-soft); border-color: rgba(255, 95, 115, .3); }
.notice-ok { background: var(--ok-soft); border-color: rgba(67, 217, 155, .3); }
.form-error { color: var(--bad); background: var(--bad-soft); padding: 10px 14px; border-radius: 10px; border: 1px solid rgba(255, 95, 115, .25); }
.empty { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 60px 20px; border: 1px dashed var(--line-2); border-radius: 18px; color: var(--mute); text-align: center; }
.empty > .i { width: 30px; height: 30px; opacity: .7; margin-bottom: 4px; }
.empty b { color: var(--ink); font-size: 15px; }
.empty p { margin: 0 0 12px; max-width: 440px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 10px 18px; margin: 0; font-size: 13.5px; }
.facts dt { color: var(--mute); }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.plain { list-style: none; margin: 0; padding: 0; }
.plain li { padding: 4px 0; }
.big-numbers { display: flex; flex-wrap: wrap; gap: 26px; color: var(--mute); align-items: baseline; margin-bottom: 8px; }
.big-numbers strong { font: 700 32px/1 var(--f-display); color: var(--ink); margin-right: 6px; letter-spacing: -.03em; }
.prompt { background: var(--raise); border: 1px solid var(--line); padding: 12px 14px; border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink-2); line-height: 1.6; font-size: 13.5px; margin: 0; }
.rows { list-style: none; margin: 0; padding: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.rows li { display: flex; gap: 14px; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.rows li:hover { background: var(--raise); }
.rows li:last-child { border-bottom: 0; }
.rows li.request { flex-direction: column; align-items: stretch; gap: 12px; }
.row-link { display: flex; flex-direction: column; gap: 3px; color: var(--ink); text-decoration: none; min-width: 0; }
.row-link:hover { text-decoration: none; }
.row-link:hover strong { color: var(--accent-2); }
.row-main { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-sub { color: var(--mute); font-size: 13px; overflow-wrap: anywhere; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; margin-bottom: 20px; font-size: 13.5px; }
.table th { text-align: left; font-weight: 600; color: var(--mute); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; background: rgba(255, 255, 255, .02); }
.table th, .table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover { background: var(--raise); }
.table tr:last-child td { border-bottom: 0; }
.table .row-actions { display: flex; gap: 14px; justify-content: flex-end; align-items: center; }
.table .row-actions form { margin: 0; }
.table tr.is-off td { color: var(--mute); }
.segmented { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); }
.segmented label, .segmented a { flex-direction: row; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 8px; font-size: 13.5px; font-weight: 550; color: var(--ink-2); cursor: pointer; text-decoration: none; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:checked), .segmented a.on { background: var(--hover); color: var(--ink); }
.segmented label.disabled { opacity: .45; cursor: not-allowed; }
.groups li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.groups input { width: 170px; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--hover); color: var(--ink-2); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.p-ok, .pill-completed, .pill-acc-active { background: var(--ok-soft); color: var(--ok); }
.p-run, .p-queue, .pill-queued { background: var(--run-soft); color: var(--run); }
.p-run::before { animation: pulse 1.3s infinite; }
.p-wait, .pill-acc-exhausted { background: var(--warn-soft); color: var(--warn); }
.p-bad, .pill-failed, .pill-acc-error { background: var(--bad-soft); color: var(--bad); }
.p-off, .pill-acc-disabled { background: var(--hover); color: var(--mute); }
.events summary { cursor: pointer; color: var(--ink-2); font-weight: 600; }
.events ol { list-style: none; padding: 0; margin: 12px 0; font-size: 13.5px; }
.events li { padding: 3px 0; }

/* ---------- лента персонажей («кто») ---------- */
.cast-strip { display: flex; gap: 16px; overflow-x: auto; padding: 4px 2px 14px; margin-bottom: 2px; scrollbar-width: none; }
.cast-strip::-webkit-scrollbar { display: none; }
.who { flex: none; width: 72px; display: flex; flex-direction: column; align-items: center; gap: 7px; color: var(--ink-2); font-size: 12.5px; font-weight: 500; text-decoration: none; }
.who:hover { text-decoration: none; color: var(--ink); }
.who .ava { width: 64px; height: 64px; font-size: 20px; transition: transform .2s var(--ease), box-shadow .2s; box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--line-2); }
.who:hover .ava { transform: translateY(-2px); }
.who.on { color: var(--ink); }
.who.on .ava { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent), 0 8px 24px var(--accent-glow); }
.who .n { max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who .c { font-size: 10.5px; color: var(--mute); margin-top: -5px; }
.who.all .ava { background: var(--raise); color: var(--ink-2); }
.who.add .ava { background: none; border: 1.5px dashed var(--line-2); box-shadow: none; color: var(--mute); }

/* ---------- фильтры («что показать») ---------- */
.filters { position: sticky; top: var(--top); z-index: 15; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0; margin-bottom: 12px; background: var(--bg); box-shadow: 0 10px 14px -10px var(--bg); }
.tabs { display: flex; gap: 2px; padding: 3px; border-radius: 11px; background: var(--panel); border: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tab { display: flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 8px; color: var(--ink-2); font-weight: 550; white-space: nowrap; text-decoration: none; transition: background .15s, color .15s; }
.tab:hover { color: var(--ink); text-decoration: none; }
.tab.on { background: var(--hover); color: var(--ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 2px 8px rgba(0, 0, 0, .35); }
.tab b { font-size: 11px; font-weight: 700; color: var(--mute); }
.tab.on b { color: var(--accent-2); }
.tab.err b { color: var(--bad); }
.tab .pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--live); animation: pulse 1.4s ease-in-out infinite; }
.f-right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dd { position: relative; }
.dd > button { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--ink-2); font-weight: 500; white-space: nowrap; cursor: pointer; }
.dd > button:hover, .dd.open > button { border-color: var(--line-2); color: var(--ink); }
.dd > button b { color: var(--ink); font-weight: 600; }
.dd > button .i { width: 15px; height: 15px; color: var(--mute); }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; padding: 6px; border-radius: 12px; background: var(--raise); border: 1px solid var(--line-2); box-shadow: 0 20px 50px rgba(0, 0, 0, .55); z-index: 40; opacity: 0; transform: translateY(-4px) scale(.98); transform-origin: top right; pointer-events: none; transition: opacity .14s, transform .14s var(--ease); }
.dd.open .menu { opacity: 1; transform: none; pointer-events: auto; }
.menu a { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; }
.menu a:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.menu a.on { color: var(--ink); }
.menu a .i { margin-left: auto; color: var(--accent-2); opacity: 0; }
.menu a.on .i { opacity: 1; }
.density { display: flex; padding: 3px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); }
.density button { width: 32px; height: 30px; display: grid; place-items: center; border-radius: 7px; color: var(--mute); background: none; border: 0; cursor: pointer; }
.density button.on { background: var(--hover); color: var(--ink); }
.fchips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; width: 100%; }
.fchips:empty { display: none; }
.fchip { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 6px 0 4px; border-radius: 99px; background: var(--accent-soft); color: var(--ink); font-size: 12.5px; font-weight: 550; }
.fchip.t { padding-left: 10px; }
.fchip a { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); }
.fchip a:hover { background: rgba(255, 255, 255, .1); color: var(--ink); }
.fchip .i { width: 12px; height: 12px; }
.reset { font-size: 12.5px; color: var(--mute); font-weight: 500; }
.result-count { color: var(--mute); font-size: 12.5px; margin: -2px 0 14px; }

/* ---------- кадры 9:16 ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--card-min), 1fr)); gap: 22px 16px; }
.grid.dens-l { --card-min: 240px; } .grid.dens-s { --card-min: 150px; }
a.card { position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0; color: var(--ink); text-decoration: none; animation: rise .45s var(--ease) both; }
a.card:hover { text-decoration: none; }
.shot { position: relative; display: grid; place-items: center; aspect-ratio: 9 / 16; max-width: 100%; border-radius: 14px; overflow: hidden; background: #050508; box-shadow: 0 0 0 1px var(--line); transition: transform .25s var(--ease), box-shadow .25s; }
a.card:hover .shot, a.card:focus-visible .shot { transform: translateY(-4px); box-shadow: 0 0 0 1px var(--line-2), 0 22px 44px rgba(0, 0, 0, .6); }
a.card.sel .shot { box-shadow: 0 0 0 2px var(--accent), 0 22px 44px rgba(0, 0, 0, .6); }
.shot .poster, .shot video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.shot video { opacity: 0; transition: opacity .25s; }
.shot.playing video { opacity: 1; }
.shot::after { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(0, 0, 0, .35) 0%, transparent 22%, transparent 55%, rgba(0, 0, 0, .72) 100%); pointer-events: none; }
a.card.failed .shot .poster { filter: saturate(.35) brightness(.7); }
a.card.just-done .shot { animation: flash 1.3s var(--ease); }
@keyframes flash { 0% { box-shadow: 0 0 0 3px var(--ok), 0 0 40px rgba(67, 217, 155, .6); } 100% { box-shadow: 0 0 0 1px var(--line); } }
.badge { position: absolute; z-index: 2; display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: rgba(8, 8, 12, .62); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: #fff; white-space: nowrap; max-width: calc(100% - 18px); overflow: hidden; text-overflow: ellipsis; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge.plain::before { display: none; }
.b-tl { left: 9px; top: 9px; } .b-tr { right: 9px; top: 9px; }
.st-run { color: #9ccaff; } .st-run::before { animation: pulse 1.3s infinite; }
.st-queue { color: #c9c6da; } .st-wait { color: #ffd27a; } .st-bad { color: #ff97a5; } .st-off { color: #a3a1b4; } .st-ok { color: #7ff0bd; }
.shot-foot { position: absolute; z-index: 2; left: 10px; right: 10px; bottom: 10px; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; color: #fff; }
.shot-foot .mono { opacity: .8; }
.scrub { position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .15); opacity: 0; transition: opacity .2s; }
.shot.playing .scrub { opacity: 1; }
.scrub i { display: block; height: 100%; width: 0; background: var(--accent-2); }
.develop { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; background: radial-gradient(120% 70% at 50% 110%, rgba(141, 107, 255, .35), transparent 65%), #07070b; }
.shot.running .develop::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 0 40%, rgba(179, 156, 255, .18) 50%, transparent 60% 100%); background-size: 100% 260%; animation: develop 2.6s linear infinite; }
.develop.calm { background: #07070b; }
@keyframes develop { from { background-position: 0 100%; } to { background-position: 0 -160%; } }
.prog { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; color: #d7d4ea; font-size: 12.5px; text-align: center; padding: 0 12px; }
.prog .i { width: 30px; height: 30px; opacity: .85; }
.prog b { font-weight: 600; }
.prog small { color: var(--mute); font-size: 11.5px; }
.meta { display: flex; flex-direction: column; gap: 2px; padding: 0 2px; min-width: 0; }
.meta strong { font-weight: 600; font-size: 14px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.meta span { color: var(--mute); font-size: 12.5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.meta .why { color: var(--bad); }

/* ---------- правая панель ролика ---------- */
.insp { position: fixed; z-index: 35; top: 0; right: 0; bottom: 0; width: var(--insp); display: flex; flex-direction: column; background: var(--panel); border-left: 1px solid var(--line); transform: translateX(100%); transition: transform .3s var(--ease), visibility .3s; padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) 0; visibility: hidden; }
.insp.open { transform: none; visibility: visible; box-shadow: -30px 0 60px rgba(0, 0, 0, .4); }
.insp-head { display: flex; align-items: center; gap: 4px; height: 56px; padding: 0 10px 0 16px; border-bottom: 1px solid var(--line); flex: none; }
.insp-t { flex: 1; display: flex; align-items: center; gap: 8px; color: var(--mute); min-width: 0; }
.insp-t .i { width: 15px; height: 15px; }
.insp-body { flex: 1; overflow-y: auto; padding: 16px; scrollbar-width: thin; transition: opacity .15s; }
.insp-body.loading { opacity: .45; }
.scrim { position: fixed; inset: 0; z-index: 34; background: var(--scrim); opacity: 0; pointer-events: none; transition: opacity .25s; }
.scrim.show { opacity: 1; pointer-events: auto; }
#side-scrim { z-index: 44; }

.jp-media { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.player { position: relative; width: min(100%, 300px); margin: 0 auto; aspect-ratio: 9 / 16; border-radius: 16px; overflow: hidden; background: #050508; box-shadow: 0 0 0 1px var(--line-2), 0 24px 50px rgba(0, 0, 0, .55); }
.player video, .player .poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.player .develop { z-index: 0; }
.player.gone .poster { opacity: .3; filter: grayscale(1); }
.player-note { color: var(--mute); font-size: 12.5px; text-align: center; margin: 0; }
.jp-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.jp-title h2 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.jp-sub { color: var(--mute); font-size: 12.5px; margin-bottom: 14px; }
.jp-cast { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.cast-pill { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px 0 4px; border-radius: 99px; background: var(--raise); border: 1px solid var(--line); color: var(--ink); font-weight: 550; font-size: 13px; text-decoration: none; }
.cast-pill:hover { border-color: var(--accent); text-decoration: none; }
.cast-pill small { color: var(--mute); font-weight: 400; }
.cast-pill .order { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font: 700 11px/1 var(--f-mono); }
.acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 18px; }
.acts form { margin: 0; display: contents; }
.acts .btn { min-width: 0; overflow: hidden; text-overflow: ellipsis; padding: 0 10px; width: 100%; }
.acts .wide { grid-column: 1 / -1; }
.jp-tabs { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); margin-bottom: 14px; }
.jp-tabs button { flex: 1; height: 30px; border-radius: 7px; color: var(--ink-2); font-weight: 550; font-size: 13px; background: none; border: 0; cursor: pointer; }
.jp-tabs button.on { background: var(--hover); color: var(--ink); }
.jp-sec { margin-bottom: 18px; }
.jp-sec > h3 { font-size: 11px; font-weight: 600; color: var(--mute); text-transform: uppercase; letter-spacing: .08em; margin: 0 0 10px; }
.box { background: var(--raise); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.cap-form textarea { width: 100%; background: transparent; border: 0; padding: 0; box-shadow: none; min-height: 110px; }
.cap-form .tags-in { width: 100%; background: transparent; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 10px 0 0; margin-top: 8px; color: var(--accent-2); box-shadow: none; }
.cap-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--mute); }
.cap-foot .grow { flex: 1; display: flex; align-items: center; gap: 6px; min-width: 140px; }
.cap-foot .i { width: 14px; height: 14px; }
.cap-foot .grow .i { color: var(--accent-2); }
.timeline { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.timeline li { position: relative; padding: 0 0 14px 24px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.timeline li::after { content: ""; position: absolute; left: 7.5px; top: 18px; bottom: 0; width: 1px; background: var(--line-2); }
.timeline li:last-child::after { display: none; }
.timeline .mono { color: var(--mute); display: block; }
/* Страница задания: те же блоки в две колонки. */
.job-page .jp { display: grid; grid-template-columns: minmax(260px, 380px) minmax(0, 1fr); gap: 32px; align-items: start; }
.job-page .jp-media { position: sticky; top: calc(var(--top) + 24px); }
.job-page .player { width: 100%; }
.job-page .jp-info { max-width: 820px; }

/* ---------- создание ---------- */
.create { display: grid; grid-template-columns: 210px minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.steps { position: sticky; top: calc(var(--top) + 20px); display: flex; flex-direction: column; gap: 4px; }
.stp { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px; color: var(--mute); font-weight: 550; text-decoration: none; }
.stp:hover { background: var(--hover); color: var(--ink-2); text-decoration: none; }
.stp .n { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--raise); border: 1px solid var(--line-2); font: 700 12px/1 var(--f-mono); flex: none; color: var(--ink); }
.stp small { display: block; font-weight: 400; font-size: 11.5px; color: var(--mute); max-width: 140px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.stp.on { color: var(--ink); background: var(--accent-soft); }
.stp.on .n { background: var(--accent); border-color: var(--accent); color: #fff; }
.stp.done .n { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.stp.done .n .i { width: 14px; height: 14px; stroke-width: 2.6; }
.step { padding: 22px 24px; margin-bottom: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; scroll-margin-top: calc(var(--top) + 16px); }
.step > h2 { display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 700; margin: 0 0 4px; letter-spacing: -.01em; }
.step > .hint { color: var(--mute); margin: 0 0 18px; font-size: 13.5px; }
.step h3 { font-size: 11px; font-weight: 600; margin: 18px 0 10px; color: var(--mute); text-transform: uppercase; letter-spacing: .08em; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 14px; }
.pick-grid.video { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
.pick { position: relative; display: flex; flex-direction: column; gap: 7px; color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 550; cursor: pointer; min-width: 0; }
.pick:hover { text-decoration: none; }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick .ph { position: relative; display: grid; place-items: center; aspect-ratio: 3 / 4; max-width: 100%; border-radius: 14px; overflow: hidden; background: linear-gradient(150deg, var(--c1, #1d1d27), var(--c2, #101016)); color: #fff; font: 700 30px/1 var(--f-display); box-shadow: 0 0 0 1px var(--line); transition: transform .2s var(--ease), box-shadow .2s; }
.pick-grid.video .ph { aspect-ratio: 9 / 16; }
.pick .ph img, .pick .ph video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pick:hover .ph { transform: translateY(-3px); }
.pick.on .ph, .pick:has(input:checked) .ph { box-shadow: 0 0 0 2px var(--accent), 0 0 0 6px var(--accent-soft); }
.pick:has(input:focus-visible) .ph { box-shadow: 0 0 0 2px var(--accent), 0 0 0 6px var(--accent-soft); }
.pick .ord { position: absolute; z-index: 2; top: 8px; left: 8px; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 99px; display: grid; place-items: center; background: var(--accent); color: #fff; font: 700 12px/1 var(--f-mono); box-shadow: 0 0 0 2px var(--panel); }
.pick-sub { color: var(--mute); font-weight: 400; font-size: 12px; margin-top: -4px; }
.upload-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; aspect-ratio: 9 / 16; border-radius: 14px; border: 1.5px dashed var(--line-2); color: var(--mute); font-size: 12.5px; text-align: center; padding: 10px; text-decoration: none; }
.upload-tile:hover { border-color: var(--accent); color: var(--ink); text-decoration: none; }
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.mode { position: relative; flex-direction: column; align-items: stretch; gap: 0; text-align: left; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--raise); cursor: pointer; color: var(--ink); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.mode:hover { text-decoration: none; }
.mode input { position: absolute; opacity: 0; pointer-events: none; }
.mode b { font-size: 15px; }
.mode span { display: block; color: var(--mute); font-size: 12.5px; margin-top: 4px; font-weight: 400; }
.mode.on, .mode:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.mode.disabled { opacity: .45; cursor: not-allowed; }
.chipset { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; flex-direction: row; align-items: center; height: 34px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--raise); color: var(--ink-2); font-size: 13px; font-weight: 500; cursor: pointer; transition: all .12s; }
.chip:hover { color: var(--ink); border-color: rgba(179, 156, 255, .4); }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); }
.chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.per { padding: 16px; border-radius: 14px; background: var(--raise); border: 1px solid var(--line); margin-bottom: 12px; }
.per-h { display: flex; align-items: center; gap: 10px; font-weight: 600; margin-bottom: 4px; }
.per textarea, .step textarea { width: 100%; }
.auto-note { display: flex; align-items: center; gap: 6px; color: var(--mute); font-size: 12px; margin-top: 8px; }
.auto-note .i { width: 13px; height: 13px; color: var(--accent-2); }
.summary { position: sticky; top: calc(var(--top) + 20px); display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); }
.summary h4 { margin: 0; font-size: 11px; color: var(--mute); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.sum-row { display: flex; align-items: center; gap: 10px; min-height: 30px; font-size: 13px; }
.sum-row .k { color: var(--mute); width: 70px; flex: none; }
.sum-row .v { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cost { padding: 14px; border-radius: 14px; background: var(--raise); border: 1px solid var(--line); }
.cost-n { font: 700 26px/1 var(--f-display); letter-spacing: -.02em; }
.cost p { margin: 6px 0 0; color: var(--mute); font-size: 12.5px; }
.summary select { width: 100%; }
.go { width: 100%; height: 50px; font-size: 15px; border-radius: 12px; }
.next-hint { animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 50% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 6px 26px rgba(141, 107, 255, .7); } }

/* ---------- персонажи ---------- */
.chars { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
.char-card { display: block; border-radius: 18px; overflow: hidden; background: var(--panel); border: 1px solid var(--line); color: var(--ink); text-decoration: none; transition: transform .2s var(--ease), border-color .2s, box-shadow .2s; animation: rise .45s var(--ease) both; }
.char-card:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: 0 20px 40px rgba(0, 0, 0, .45); text-decoration: none; }
.char-card .ph { position: relative; aspect-ratio: 4 / 5; display: grid; place-items: center; font: 700 56px/1 var(--f-display); color: #fff; background: linear-gradient(150deg, var(--c1), var(--c2)); }
.char-card .ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.char-card .ph::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 55%, rgba(0, 0, 0, .55)); }
.char-body { padding: 14px 16px 16px; }
.char-body b { font-size: 16px; }
.char-body .h { color: var(--accent-2); font-size: 12.5px; display: block; }
.char-stats { display: flex; gap: 14px; margin-top: 8px; color: var(--mute); font-size: 12px; }
.char-stats strong { color: var(--ink); font-weight: 600; }
.channel-cover { position: relative; height: 170px; border-radius: 22px; overflow: hidden; background: linear-gradient(120deg, var(--c1), var(--c2)); }
.channel-cover::after { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 90% at 80% 0%, rgba(255, 255, 255, .25), transparent 60%), linear-gradient(transparent 30%, rgba(10, 10, 14, .85)); }
.channel-head { position: relative; z-index: 1; display: flex; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin: -56px 0 22px; padding: 0 24px; }
.channel-head .ava.xl { box-shadow: 0 0 0 5px var(--bg), 0 18px 40px rgba(0, 0, 0, .5); }
.channel-head .who-t { flex: 1; min-width: 200px; padding-bottom: 6px; }
.channel-head h1 { margin: 0; font-size: 30px; }
.channel-head .stats { display: flex; gap: 18px; color: var(--mute); font-size: 13px; margin-top: 8px; flex-wrap: wrap; }
.channel-head .stats b { color: var(--ink); }
.channel-head .cta { display: flex; gap: 10px; padding-bottom: 6px; flex-wrap: wrap; }
.channel-head .cta form { margin: 0; }
.subtabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.subtabs a { height: 42px; display: flex; align-items: center; color: var(--mute); font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none; }
.subtabs a.on, .subtabs a:hover { color: var(--ink); text-decoration: none; }
.subtabs a.on { border-color: var(--accent); }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.photos figure { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.photos img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block; background: #050508; }
.photos form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 10px; }
.photos select { padding: 5px 30px 5px 9px; font-size: 12.5px; flex: 1; }

/* ---------- очередь ---------- */
.qlist { display: flex; flex-direction: column; gap: 10px; }
.qrow { display: grid; grid-template-columns: 54px minmax(0, 1fr) 200px auto; gap: 16px; align-items: center; padding: 10px 14px 10px 10px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); color: var(--ink); text-decoration: none; transition: border-color .15s, background .15s; animation: rise .4s var(--ease) both; }
.qrow:hover { border-color: var(--line-2); background: var(--raise); text-decoration: none; }
.qrow .thumb { position: relative; width: 54px; aspect-ratio: 9 / 16; border-radius: 9px; background: #07070b; overflow: hidden; }
.qrow .thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.qrow .thumb.run::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, rgba(179, 156, 255, .35) 50%, transparent 70%); background-size: 100% 260%; animation: develop 2.2s linear infinite; }
.qrow strong { display: block; font-weight: 600; }
.qrow small { color: var(--mute); }
.qrow .qa form { margin: 0; }

/* ---------- вход ---------- */
.login { position: relative; min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; overflow: hidden; padding: env(safe-area-inset-top, 0px) max(16px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(16px, env(safe-area-inset-left, 0px)); background: radial-gradient(50% 45% at 20% 25%, rgba(255, 95, 158, .18), transparent 70%), radial-gradient(45% 45% at 80% 75%, rgba(141, 107, 255, .22), transparent 70%), radial-gradient(40% 40% at 70% 20%, rgba(255, 138, 76, .12), transparent 70%), var(--bg); }
.login::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(closest-side, transparent 55%, rgba(10, 10, 14, .55)); }
.soc-field { position: absolute; inset: 0; overflow: hidden; }
.soc { position: absolute; left: 0; top: 0; width: 56px; height: 56px; border-radius: 28%; display: grid; place-items: center; box-shadow: 0 16px 34px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .25); will-change: transform; user-select: none; }
.soc.s1 { width: 44px; height: 44px; } .soc.s2 { width: 56px; height: 56px; } .soc.s3 { width: 70px; height: 70px; } .soc.s4 { width: 84px; height: 84px; }
.soc svg { width: 56%; height: 56%; }
.s-ig { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.s-tt { background: #111; } .s-tt svg { filter: drop-shadow(-2px -1px 0 #25f4ee) drop-shadow(2px 1px 0 #fe2c55); }
.s-yt { background: #ff0033; } .s-tw { background: #1d9bf0; } .s-fb { background: #1877f2; } .s-sc { background: #fffc00; } .s-pin { background: #e60023; }
.s-th { background: #101010; border: 1px solid rgba(255, 255, 255, .15); } .s-li { background: #0a66c2; }
.login-card { position: relative; z-index: 2; width: min(410px, 100%); padding: 34px 28px 26px; border-radius: 26px; text-align: center; background: rgba(16, 16, 22, .74); backdrop-filter: blur(20px) saturate(1.3); -webkit-backdrop-filter: blur(20px) saturate(1.3); border: 1px solid var(--line-2); box-shadow: 0 40px 100px rgba(0, 0, 0, .6); animation: card-in .7s var(--ease) both; transition: opacity .45s, transform .45s var(--ease); }
.login.leaving .login-card { opacity: 0; transform: scale(.96); }
@keyframes card-in { from { opacity: 0; transform: translateY(18px) scale(.97); } }
.lc-title { margin: 0; font: 700 clamp(30px, 8vw, 40px)/1.02 var(--f-display); letter-spacing: -.035em; }
.lc-title span { background: linear-gradient(90deg, #ff8a4c, #ff5f9e, #8d6bff, #ff8a4c); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 6s linear infinite; }
@keyframes shimmer { to { background-position: 300% 0; } }
.lc-sub { margin: 12px 0 26px; font: 600 11.5px/1 var(--f-ui); letter-spacing: .34em; text-transform: uppercase; color: var(--ink-2); }
.login-card h1 { font: 650 17px/1.3 var(--f-ui); margin: 0 0 16px; letter-spacing: 0; }
.login-card .lead { color: var(--mute); font-size: 13.5px; margin: -8px 0 18px; }
.login-card form { text-align: left; display: flex; flex-direction: column; gap: 14px; }
.login-card input { height: 46px; border-radius: 12px; background: rgba(10, 10, 14, .7); font-size: 15px; }
.login-card .btn.pri { height: 50px; font-size: 15px; border-radius: 13px; margin-top: 4px; width: 100%; }
.login-card .form-error { margin: 0 0 4px; text-align: left; }
.lc-foot { margin: 18px 0 0; color: var(--mute); font-size: 12.5px; }
.btn .spinner { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .8s linear infinite; }
.btn.loading .lbl { display: none; } .btn.loading .spinner { display: block; }

/* ---------- тосты ---------- */
.toasts { position: fixed; z-index: 80; left: calc(var(--side) + 24px); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 10px; align-items: flex-start; pointer-events: none; }
body.out .toasts { left: 50%; transform: translateX(-50%); align-items: center; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; min-width: 280px; max-width: 420px; padding: 10px 8px 10px 12px; border-radius: 14px; background: var(--raise); border: 1px solid var(--line-2); box-shadow: 0 20px 50px rgba(0, 0, 0, .55); animation: toast-in .35s var(--ease); font-size: 13.5px; }
.toast.out-anim { animation: toast-out .25s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.97); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(-20px); } }
.toast .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--ok-soft); color: var(--ok); }
.toast.error .ic { background: var(--bad-soft); color: var(--bad); }
.toast .tx { flex: 1; min-width: 0; }
.tabbar { display: none; }

/* ---------- узкие экраны ---------- */
@media (max-width: 1280px) {
  .create { grid-template-columns: minmax(0, 1fr) 280px; }
  .create .steps { display: none; }
}
@media (max-width: 1180px) {
  .app.insp-open .main { padding-right: 0; }
  .job-page .jp { grid-template-columns: minmax(0, 1fr); }
  .job-page .jp-media { position: static; max-width: 380px; width: 100%; margin: 0 auto 18px; }
}
@media (max-width: 960px) {
  .create { grid-template-columns: minmax(0, 1fr); }
  .summary { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); top: auto; z-index: 5; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px 14px; background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 -10px 40px rgba(0, 0, 0, .5); }
  .summary h4, .summary .sum-row { display: none; }
  .summary .cost { flex: 1; padding: 0; background: none; border: 0; }
  .summary .cost-n { font-size: 19px; }
  .summary label { flex-basis: 100%; }
  .summary .go { width: auto; flex: 1 1 200px; height: 46px; }
}
@media (max-width: 860px) {
  :root { --top: 56px; }
  .app, .app.mini { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 45; transform: translateX(-100%); transition: transform .25s var(--ease); }
  .side.open { transform: none; box-shadow: 0 0 60px rgba(0, 0, 0, .6); }
  .app.mini .brand-t, .app.mini .nav-h, .app.mini .nav a span, .app.mini .quota, .app.mini .me > span:last-child, .app.mini .me-row form, .app.mini .new-btn span { display: revert; }
  .collapse { display: none; }
  .icon-btn.menu-toggle { display: inline-grid; }
  .top { padding: env(safe-area-inset-top, 0px) max(12px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); gap: 6px; }
  .live .live-t, .counter span + span { display: none; }
  .live { padding: 0 11px; }
  .view { padding: 16px max(16px, env(safe-area-inset-right, 0px)) 110px max(16px, env(safe-area-inset-left, 0px)); }
  .f-right { margin-left: 0; width: 100%; }
  .density { display: none; }
  .grid, .grid.dens-l, .grid.dens-s { --card-min: 150px; gap: 18px 12px; }
  .insp { width: 100%; }
  .dd.open::before { content: ""; position: fixed; inset: 0; z-index: 44; background: var(--scrim); }
  .menu { position: fixed; z-index: 45; left: max(10px, env(safe-area-inset-left, 0px)); right: max(10px, env(safe-area-inset-right, 0px)); top: auto; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); min-width: 0; padding: 8px; border-radius: 18px; transform: translateY(24px); transform-origin: bottom center; }
  .dd.open .menu { transform: none; }
  .menu a { height: 50px; font-size: 16px; padding: 0 14px; border-radius: 12px; }
  .menu::before { content: attr(data-title); display: block; padding: 8px 14px 10px; font-size: 12px; font-weight: 600; color: var(--mute); text-transform: uppercase; letter-spacing: .08em; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); background: color-mix(in srgb, var(--panel) 90%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
  .tabbar a, .tabbar button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; color: var(--mute); font-size: 10.5px; font-weight: 550; text-decoration: none; background: none; border: 0; cursor: pointer; }
  .tabbar .on { color: var(--ink); }
  .tabbar .on .i { color: var(--accent-2); }
  .tabbar .plus { width: 46px; height: 46px; margin: -10px auto 0; border-radius: 15px; display: grid; place-items: center; color: #fff; background: linear-gradient(180deg, #9b7dff, #7a55ff); box-shadow: 0 8px 22px var(--accent-glow); }
  .tabbar .cnt { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 16px; height: 16px; padding: 0 4px; margin: 0; background: var(--live); color: #fff; font-size: 9.5px; }
  .table { display: block; overflow-x: auto; white-space: nowrap; }
  .qrow { grid-template-columns: 46px minmax(0, 1fr); }
  .qrow .qp, .qrow .qa { grid-column: 2; }
  .channel-head { padding: 0 8px; }
  .channel-cover { height: 120px; }
  .channel-head .ava.xl { width: 88px; height: 88px; font-size: 30px; }
  .toasts { left: max(16px, env(safe-area-inset-left, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(84px + env(safe-area-inset-bottom, 0px)); align-items: stretch; }
  body.out .toasts { transform: none; left: 16px; bottom: 20px; }
  .toast { max-width: none; min-width: 0; }
  .step { padding: 18px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
