/* Герои региона — живые фото. Оформление: тёмная тема с оранжевым акцентом (см. example_design). */

:root {
  /* поверхности */
  --bg:#0E0E11; --bg-2:#0B0B0E; --surface:#15151A; --surface-2:#101014;
  --card-a:#16161B; --card-b:#101014; --header-bg:rgba(14,14,17,.72);
  /* текст */
  --text:#F4F3F1; --muted:#A6A6AF; --muted-2:#9A9AA3; --faint:#74747D; --faint-2:#5F5F68;
  /* линии */
  --line:rgba(255,255,255,.08); --line-2:rgba(255,255,255,.14); --hair:rgba(255,255,255,.06);
  --chip:rgba(255,255,255,.04); --chip-hover:rgba(255,255,255,.08);
  /* акцент */
  --accent:#FF6A1A; --accent-2:#FF8A3D; --accent-deep:#C2470A;
  --accent-soft:rgba(255,106,26,.12); --accent-glow:rgba(255,106,26,.28); --on-accent:#0B0B0D;
  /* состояния */
  --ok:#27D07F; --ok-soft:rgba(39,208,127,.12);
  --warn:#F5C542; --warn-soft:rgba(245,197,66,.12);
  --err:#FF5C5C; --err-soft:rgba(255,92,92,.12);
  /* форма */
  --r-xs:8px; --r-sm:10px; --r-md:14px; --r-lg:20px; --r-pill:100px;
  --s1:4px; --s2:8px; --s3:12px; --s4:16px; --s5:22px; --s6:32px;
  --header-h:64px; --maxw:1640px;
  --shadow-1:0 8px 24px rgba(0,0,0,.35); --shadow-2:0 24px 60px rgba(0,0,0,.45);
  --glow:0 10px 28px var(--accent-glow);
  --font-display:'Unbounded',system-ui,sans-serif; --font:'Manrope',system-ui,-apple-system,sans-serif;
  --font-mono:'JetBrains Mono',Consolas,ui-monospace,monospace;
  --dur:.18s; --ease:cubic-bezier(.2,.7,.3,1);
}
:root[data-theme="light"] {
  --bg:#F3F3F1; --bg-2:#EAEAE6; --surface:#FFFFFF; --surface-2:#F7F7F4;
  --card-a:#FFFFFF; --card-b:#F6F6F3; --header-bg:rgba(243,243,241,.82);
  --text:#19191C; --muted:#55555E; --muted-2:#5E5E68; --faint:#86868F; --faint-2:#9A9AA2;
  --line:rgba(0,0,0,.10); --line-2:rgba(0,0,0,.16); --hair:rgba(0,0,0,.07);
  --chip:rgba(0,0,0,.035); --chip-hover:rgba(0,0,0,.06);
  --accent-soft:rgba(255,106,26,.14); --on-accent:#FFFFFF;
  --shadow-1:0 8px 24px rgba(20,20,25,.08); --shadow-2:0 24px 60px rgba(20,20,25,.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.55;
       -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; }
::selection { background: rgba(255,106,26,.32); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------------------------------------------------------------- типографика */
.t-display { font-family: var(--font-display); font-weight: 700; font-size: clamp(22px,2.4vw,28px); line-height: 1.1; letter-spacing: -.02em; }
.t-h1 { font-family: var(--font-display); font-weight: 700; font-size: 21px; line-height: 1.2; letter-spacing: -.015em; }
.t-h2 { font-weight: 800; font-size: 17px; letter-spacing: -.01em; }
.t-label { font-family: var(--font-mono); font-weight: 600; font-size: 10.5px; letter-spacing: .2em;
           text-transform: uppercase; color: var(--faint); }
.t-num, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.t-sm { font-size: 13px; color: var(--muted-2); }

/* ---------------------------------------------------------------- кнопки */
.btn { --h:40px; height: var(--h); display: inline-flex; align-items: center; justify-content: center; gap: 8px;
       padding: 0 16px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--chip);
       color: var(--text); font: 600 14px/1 var(--font); cursor: pointer; white-space: nowrap;
       transition: background var(--dur) var(--ease), border-color var(--dur), transform var(--dur); }
.btn:hover { background: var(--chip-hover); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; box-shadow: var(--glow); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); transform: translateY(-1px); }
.btn.ghost { background: transparent; }
.btn.quiet { background: transparent; border-color: transparent; color: var(--muted); }
.btn.quiet:hover { background: var(--chip); color: var(--text); }
.btn.danger { background: transparent; border-color: rgba(255,92,92,.34); color: #FF9B9B; }
.btn.danger:hover { background: var(--err-soft); border-color: var(--err); }
.btn.big { --h:50px; padding: 0 26px; font-size: 15.5px; border-radius: var(--r-md); }
.btn.small { --h:32px; padding: 0 11px; font-size: 13px; border-radius: var(--r-xs); }
.btn.icon { --h:38px; width: 38px; padding: 0; }
.btn.block { width: 100%; }
.spin { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.3); border-top-color: currentColor;
        border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: -2px; }

/* ---------------------------------------------------------------- поля */
.field { display: block; margin-bottom: var(--s4); }
.field > span, .field__label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.hint { margin-top: 6px; font-size: 12.5px; color: var(--faint); line-height: 1.45; }
input, select, textarea { width: 100%; height: 42px; padding: 0 13px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text);
  font: 500 14.5px/1.4 var(--font); transition: border-color var(--dur), box-shadow var(--dur); }
textarea { height: auto; min-height: 84px; padding: 11px 13px; resize: vertical; line-height: 1.5; }
textarea.code { font-family: var(--font-mono); font-size: 12.5px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder, textarea::placeholder { color: var(--faint-2); }
input[type=checkbox] { width: auto; height: auto; }
select { appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23A6A6AF' stroke-width='2'><path d='M2 4.5 6 8.5 10 4.5'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center; }
input[type=range] { width: 100%; height: 4px; padding: 0; appearance: none; background: var(--line-2);
  border: none; border-radius: var(--r-pill); margin: 14px 0 6px; }
input[type=range]::-webkit-slider-thumb { appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--bg); box-shadow: 0 0 0 1px var(--accent); cursor: pointer; }
.switch { display: flex; align-items: flex-start; gap: 11px; cursor: pointer; padding: 7px 0; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch i { flex: none; width: 40px; height: 23px; border-radius: var(--r-pill); background: var(--chip);
  border: 1px solid var(--line-2); position: relative; transition: all var(--dur) var(--ease); margin-top: 1px; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%;
  background: var(--muted); transition: all var(--dur) var(--ease); }
.switch input:checked + i { background: var(--accent); border-color: var(--accent); }
.switch input:checked + i::after { left: 19px; background: #fff; }
.switch input:focus-visible + i { box-shadow: 0 0 0 3px var(--accent-soft); }
.switch b { display: block; font-size: 14px; font-weight: 600; }
.switch small { display: block; font-size: 12.5px; color: var(--faint); line-height: 1.4; margin-top: 2px; }
.seg { display: inline-flex; padding: 3px; gap: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); }
.seg button { height: auto; padding: 7px 13px; border-radius: 7px; border: none; background: transparent; color: var(--muted);
  font: 600 13px/1 var(--font); cursor: pointer; transition: all var(--dur) var(--ease); }
.seg button:hover { color: var(--text); background: var(--chip); }
.seg button.on { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

/* ---------------------------------------------------------------- шапка */
.appbar { position: sticky; top: 0; z-index: 60; height: var(--header-h); background: var(--header-bg);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--hair); }
.appbar > div { height: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 120%, var(--accent-deep), #161318); border: 1px solid rgba(255,255,255,.12); }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-text b { font-family: var(--font-display); font-weight: 700; font-size: 14px; letter-spacing: -.01em; }
.brand-text i { font-family: var(--font-mono); font-size: 9px; font-weight: 600; letter-spacing: .3em;
  color: var(--accent); margin-top: 4px; font-style: normal; text-transform: uppercase; }
.nav { display: flex; gap: 4px; margin-left: 10px; }
.navpill { height: 34px; padding: 0 15px; border-radius: var(--r-pill); border: 1px solid transparent; background: transparent;
  color: var(--muted); font: 600 13.5px/1 var(--font); cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.navpill:hover { background: var(--chip); color: var(--text); }
.navpill.on { background: var(--accent-soft); border-color: rgba(255,106,26,.3); color: var(--accent); }
.spacer { flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: var(--r-pill);
  background: var(--chip); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--muted); }
.chip.btn-like { cursor: pointer; } .chip.btn-like:hover { background: var(--chip-hover); color: var(--text); }
.chip.ok { color: var(--ok); background: var(--ok-soft); border-color: rgba(39,208,127,.28); }
.chip.err { color: #FF9B9B; background: var(--err-soft); border-color: rgba(255,92,92,.3); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 9px var(--ok); }
.dot.warn { background: var(--warn); box-shadow: 0 0 9px var(--warn); }
.dot.err { background: var(--err); box-shadow: 0 0 9px var(--err); }
.dot.live { background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: blink 2.2s ease-in-out infinite; }
.usermenu { position: relative; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font: 700 12px/1 var(--font-mono); border: 1px solid rgba(255,106,26,.3); }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: var(--surface);
  border: 1px solid var(--line-2); border-radius: var(--r-md); box-shadow: var(--shadow-2); padding: 6px; display: none; z-index: 70; }
.menu.open { display: block; }
.menu b { display: block; padding: 9px 12px 3px; font-size: 14px; }
.menu .role { padding: 0 12px 9px; font-size: 12px; color: var(--faint); border-bottom: 1px solid var(--hair); margin-bottom: 6px; }
.menu button { width: 100%; height: 36px; justify-content: flex-start; border: none; background: transparent; color: var(--text);
  font: 500 13.5px/1 var(--font); padding: 0 12px; border-radius: var(--r-xs); cursor: pointer; display: flex; align-items: center; gap: 9px; }
.menu button:hover { background: var(--chip); }

/* ---------------------------------------------------------------- экраны */
.screen { display: none; }
body[data-screen="catalog"] .screen.catalog,
body[data-screen="studio"] .screen.studio,
body[data-screen="jobs"] .screen.jobs,
body[data-screen="users"] .screen.users { display: block; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 22px; }
.pagehead { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: var(--s5); }
.pagehead .t-display { flex: none; }
.empty { color: var(--muted); padding: 48px 20px; text-align: center; border: 1px dashed var(--line-2); border-radius: var(--r-lg); }
.empty b { display: block; font-size: 16px; color: var(--text); margin-bottom: 6px; }

/* каталог */
.catalog-grid { display: grid; grid-template-columns: 300px 1fr; gap: 22px; align-items: start; }
.tree-panel { position: sticky; top: calc(var(--header-h) + 22px); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden; max-height: calc(100vh - var(--header-h) - 44px); display: flex; flex-direction: column; }
.tree-panel .search { padding: 12px; border-bottom: 1px solid var(--hair); }
.tree { overflow: auto; padding: 6px; }
.region > .title { padding: 9px 12px; font-weight: 700; font-size: 13.5px; cursor: pointer; display: flex;
  justify-content: space-between; gap: 8px; border-radius: var(--r-xs); user-select: none; }
.region > .title:hover { background: var(--chip); }
.region > .title .n { font-family: var(--font-mono); font-size: 11px; color: var(--faint); }
.region.collapsed .persons { display: none; }
.person { padding: 7px 12px 7px 20px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px;
  border-radius: var(--r-xs); font-size: 13.5px; }
.person:hover { background: var(--chip); }
.person.active { background: var(--accent-soft); color: var(--accent); box-shadow: inset 2px 0 0 var(--accent); }
.person .n { font-family: var(--font-mono); font-size: 11px; color: var(--faint); white-space: nowrap; }
.person .n b { color: var(--accent); }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.photo { position: relative; border-radius: var(--r-md); overflow: hidden; background: var(--surface);
  border: 1px solid var(--line); cursor: pointer; transition: border-color var(--dur), transform var(--dur), box-shadow var(--dur); }
.photo:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-1); }
.photo img, .photo video { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--surface-2); }
.rail .photo video { aspect-ratio: 4/3; background: #000; }
.photo .cap { padding: 8px 10px; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo .badge { position: absolute; top: 8px; right: 8px; display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px; border-radius: var(--r-pill); background: rgba(11,11,14,.72); backdrop-filter: blur(6px);
  border: 1px solid var(--accent); color: #fff; font-family: var(--font-mono); font-size: 11px; font-weight: 600; }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(190px, 220px); gap: 12px; overflow-x: auto;
  padding-bottom: 6px; scrollbar-width: thin; }

/* студия */
.studio-grid { display: grid; grid-template-columns: minmax(300px, 380px) minmax(420px, 1fr) minmax(320px, 420px); gap: 20px; align-items: start; }
.sticky { position: sticky; top: calc(var(--header-h) + 22px); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5); }
.card + .card { margin-top: 16px; }
.card > h3 { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.step-no { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--accent-soft); color: var(--accent); font: 700 11px/1 var(--font-mono); }
.preview img { width: 100%; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface-2); display: block; }
.preview .meta { margin-top: 10px; font-family: var(--font-mono); font-size: 11px; color: var(--faint); word-break: break-all; line-height: 1.6; }
.filmstrip { display: flex; gap: 8px; overflow-x: auto; margin-top: 12px; padding-bottom: 4px; }
.filmstrip img { width: 62px; height: 62px; object-fit: cover; border-radius: var(--r-xs); border: 1px solid var(--line);
  cursor: pointer; flex: none; opacity: .65; transition: opacity var(--dur), border-color var(--dur); }
.filmstrip img:hover { opacity: 1; }
.filmstrip img.on { opacity: 1; border-color: var(--accent); }
.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.option { position: relative; text-align: left; display: flex; flex-direction: column; gap: 8px; padding: 16px;
  border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); cursor: pointer;
  transition: all var(--dur) var(--ease); color: inherit; font: inherit; height: auto; }
.option:hover { border-color: var(--line-2); transform: translateY(-2px); background: var(--surface-2); }
.option.on { border-color: var(--accent); background: linear-gradient(150deg, var(--accent-soft), transparent 58%);
  box-shadow: 0 14px 34px rgba(255,106,26,.12); }
.option .ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); }
.option .name { font-size: 15px; font-weight: 700; }
.option .desc { font-size: 12.8px; line-height: 1.5; color: var(--muted-2); }
.option .meta { font-family: var(--font-mono); font-size: 10.5px; color: var(--faint); letter-spacing: .04em; }
.option .pick { position: absolute; top: -9px; left: 14px; padding: 3px 10px; border-radius: var(--r-pill);
  background: var(--accent); color: var(--on-accent); font-size: 10px; font-weight: 700; }
.quick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 12px 0 14px;
  padding: 12px 14px; border-radius: var(--r-md); background: linear-gradient(140deg, var(--accent-soft), transparent 70%);
  border: 1px solid rgba(255,106,26,.28); }
.quick .btn { flex: none; }
.quick span { flex: 1; min-width: 180px; }

.advice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md);
  background: var(--accent-soft); border: 1px solid rgba(255,106,26,.25); font-size: 13.5px; margin-bottom: 14px; }
.advice.warn { background: var(--warn-soft); border-color: rgba(245,197,66,.3); }
details.adv { margin-top: 14px; border-top: 1px solid var(--hair); padding-top: 12px; }
details.adv > summary, details > summary { cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 7px; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "▸"; color: var(--faint); transition: transform var(--dur); }
details[open] > summary::before { transform: rotate(90deg); }
details.adv > div, details.adv > .row, details > .inner { margin-top: 12px; }
.row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 12px; }
.row > label { flex: 1; min-width: 150px; margin: 0; }
.row.tight { gap: 8px; align-items: center; }
.grow { flex: 1; min-width: 200px; }
.director-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.director-grid textarea { min-height: 76px; font-size: 13.5px; }
.actionbar { position: sticky; bottom: 0; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding-top: 14px; margin-top: 4px; }
.note { background: var(--ok-soft); border: 1px solid rgba(39,208,127,.28); border-radius: var(--r-md);
  padding: 10px 12px; font-size: 13.5px; margin-bottom: 12px; }
.error { background: var(--err-soft); border: 1px solid rgba(255,92,92,.3); color: #FFB3B3; border-radius: var(--r-md);
  padding: 10px 12px; font-size: 13.5px; margin-bottom: 12px; white-space: pre-wrap; }

/* дубли (задачи) */
.takes { display: flex; flex-direction: column; gap: 14px; }
/* колонка дублей не растягивает страницу: свой скролл */
.takes-col > .card { display: flex; flex-direction: column; max-height: calc(100vh - var(--header-h) - 54px); }
.takes-col .takes { overflow: auto; padding-right: 4px; margin-right: -4px; }
@media (max-width: 1240px) { .takes-col > .card { max-height: none; } .takes-col .takes { overflow: visible; } }
.take { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; animation: rise .22s var(--ease); }
.take.running { border-color: rgba(255,106,26,.34); }
.take.failed { border-color: rgba(255,92,92,.34); }
.take video { display: block; width: 100%; background: #000; }
.take .ph { aspect-ratio: 4/3; display: grid; place-items: center; gap: 10px; background: var(--surface-2);
  color: var(--muted); font-size: 13px; text-align: center; padding: 16px; }
.take .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 9px; }
.take .head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.take .no { font-family: var(--font-display); font-weight: 700; font-size: 14px; }
.take .note-ru { font-size: 13px; color: var(--muted-2); line-height: 1.45; }
.take .tech { font-family: var(--font-mono); font-size: 10.5px; color: var(--faint-2); line-height: 1.6; overflow-wrap: anywhere; }
.take .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--r-pill);
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: .06em;
  background: var(--chip); border: 1px solid var(--line); color: var(--muted); }
.pill.running { color: var(--accent); background: var(--accent-soft); border-color: rgba(255,106,26,.3); }
.pill.done { color: var(--ok); background: var(--ok-soft); border-color: rgba(39,208,127,.28); }
.pill.failed, .pill.cancelled { color: #FF9B9B; background: var(--err-soft); border-color: rgba(255,92,92,.3); }
.bar { height: 6px; background: var(--surface-2); border-radius: var(--r-pill); overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-deep), var(--accent)); width: 0; transition: width .6s var(--ease); }
.stage { font-size: 12.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 10px; }

/* плитки готовых роликов */
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.vgrid.big { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.takes-col .vgrid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 10px; }
.takes-col .vtile .cap b { font-size: 12.5px; }
.vtile { position: relative; border-radius: var(--r-md); overflow: hidden; background: var(--surface);
  border: 1px solid var(--line); cursor: pointer; transition: border-color var(--dur), transform var(--dur), box-shadow var(--dur); }
.vtile:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-1); }
.vtile video { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; background: #000; }
.vtile .play { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 44px; height: 44px;
  border-radius: 50%; display: grid; place-items: center; background: rgba(11,11,14,.6); backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,.25); color: #fff; font-size: 15px; pointer-events: none; transition: opacity var(--dur); }
.vtile:hover .play { opacity: 0; }
.vtile .cap { padding: 9px 11px; display: flex; flex-direction: column; gap: 2px; }
.vtile .cap b { font-size: 13.5px; font-weight: 700; }
.vtile .cap span { font-family: var(--font-mono); font-size: 10.5px; color: var(--faint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* строки задач в работе / с ошибкой */
.jrows { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.jrows.wide { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.jrow { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px;
  display: flex; flex-direction: column; gap: 8px; }
.jrow.running, .jrow.queued { border-color: rgba(255,106,26,.34); }
.jrow.failed, .jrow.cancelled { border-color: rgba(255,92,92,.34); }
.jrow-head { display: flex; align-items: center; gap: 8px; }
.jrow-head b { font-size: 14px; }

/* окно просмотра ролика */
.modal.viewer { width: min(1100px, 96vw); padding: 18px; }
.viewer-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.viewer-media { background: #000; border-radius: var(--r-md); overflow: hidden; display: grid; place-items: center; }
.viewer-media video { display: block; width: 100%; max-height: 62vh; background: #000; }
.modal.viewer .note-ru { margin-top: 12px; font-size: 14px; color: var(--muted-2); }
.modal.viewer .tech { margin-top: 6px; font-family: var(--font-mono); font-size: 11px; color: var(--faint-2); overflow-wrap: anywhere; }

/* таблица пользователей */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font: 600 11px/1 var(--font-mono); letter-spacing: .14em; text-transform: uppercase;
  color: var(--faint); padding: 0 12px 10px; }
.table td { padding: 12px; border-top: 1px solid var(--hair); vertical-align: middle; }
.table tr.off td { opacity: .5; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }

/* модалки и тосты */
.modal-bg { position: fixed; inset: 0; background: rgba(6,6,8,.72); backdrop-filter: blur(4px); display: none;
  align-items: center; justify-content: center; z-index: 80; padding: 20px; }
.modal-bg.open { display: flex; }
.modal { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg); width: min(900px, 96vw);
  max-height: 88vh; overflow: auto; padding: 22px; box-shadow: var(--shadow-2); }
.modal.narrow { width: min(460px, 96vw); }
.modal h2 { font-family: var(--font-display); font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.modal .sub { color: var(--muted); font-size: 13.5px; margin-bottom: 16px; }
.modal-foot { display: flex; gap: 10px; align-items: center; margin-top: 18px; flex-wrap: wrap; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tabs button.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.toast { position: fixed; bottom: 20px; right: 20px; background: var(--surface); border: 1px solid var(--line-2);
  padding: 12px 16px; border-radius: var(--r-md); z-index: 90; display: none; max-width: 420px; box-shadow: var(--shadow-2); font-size: 14px; }
.toast.err { border-color: var(--err); color: #FFB3B3; }
.toast.open { display: block; animation: rise .2s var(--ease); }
pre.log { font-family: var(--font-mono); font-size: 11.5px; white-space: pre-wrap; max-height: 60vh; overflow: auto;
  background: var(--bg-2); padding: 12px; border-radius: var(--r-md); border: 1px solid var(--line); }

/* ---------------------------------------------------------------- вход */
.login-body { min-height: 100vh; display: grid; place-items: center; background: var(--bg); position: relative; overflow: hidden; padding: 20px; }
.login-glow { position: absolute; width: 780px; height: 780px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255,106,26,.18), transparent 62%); filter: blur(30px); }
.login-card { position: relative; width: min(400px, 94vw); background: linear-gradient(150deg, var(--card-a), var(--card-b));
  border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 30px 28px; box-shadow: var(--shadow-2); }
.login-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; }
.login-card h1 { font-family: var(--font-display); font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.login-card .muted { font-size: 13.5px; margin-bottom: 20px; }
.login-card .field { margin-bottom: 14px; }
.login-err { background: var(--err-soft); border: 1px solid rgba(255,92,92,.34); color: #FFB3B3; border-radius: var(--r-sm);
  padding: 9px 12px; font-size: 13px; margin-bottom: 14px; }
.login-note { font-size: 12px; margin-top: 16px; text-align: center; }

/* ---------------------------------------------------------------- адаптив */
@media (max-width: 1500px) { .studio-grid { grid-template-columns: minmax(260px, 330px) 1fr minmax(300px, 380px); } }
@media (max-width: 1240px) {
  .studio-grid { grid-template-columns: minmax(260px, 320px) 1fr; }
  .studio-grid .takes-col { grid-column: 1 / -1; }
}
@media (max-width: 980px) {
  .catalog-grid { grid-template-columns: 1fr; }
  .tree-panel { position: static; max-height: 340px; }
  .studio-grid { grid-template-columns: 1fr; }
  .sticky { position: static; }
  .appbar > div { padding: 0 14px; gap: 10px; }
  .wrap { padding: 16px; }
  .options { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body { font-size: 14.5px; }
  .appbar > div { gap: 8px; }
  .brand-text { display: none; }
  .navpill { padding: 0 11px; font-size: 13px; }
  #chip-system span, #chip-queue span { display: none; }
  #chip-system, #chip-queue { padding: 0 9px; }
  #user-name { display: none; }
  .photos { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .rail { grid-auto-columns: minmax(160px, 70vw); }
  .pagehead { gap: 10px; }
  .modal { padding: 16px; }
  .row > label { min-width: 100%; }
}
