:root {
  --bg: #0e0f11;
  --panel: #16181b;
  --panel-2: #1d2024;
  --line: #2a2e33;
  --text: #e9eaec;
  --muted: #8b9199;
  --accent: #d4ff5c;
  --accent-ink: #151a05;
  --danger: #ff6b6b;
  --ok: #5cd68a;
  --warn: #ffc15c;
  --radius: 12px;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.45; }
.hidden { display: none !important; }
a { color: var(--accent); }
h1, h2, h3, h4 { margin: 0 0 .6em; line-height: 1.2; }
h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 15px; } h4 { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
p { margin: 0 0 .6em; }

/* top bar */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 24px; padding: 10px 20px;
  background: rgba(14,15,17,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.brand.big { font-size: 20px; justify-content: center; margin-bottom: 12px; }
.logo { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--accent); color: var(--accent-ink); font-size: 12px; }
nav { display: flex; gap: 4px; overflow-x: auto; flex: 1; }
nav button { background: none; border: 0; color: var(--muted); padding: 8px 12px; border-radius: 8px; cursor: pointer; font: inherit; white-space: nowrap; }
nav button:hover { color: var(--text); background: var(--panel); }
nav button.active { color: var(--text); background: var(--panel-2); }
.me { display: flex; align-items: center; gap: 10px; color: var(--muted); white-space: nowrap; }
main { padding: 20px; max-width: 1400px; margin: 0 auto; }
.warn { background: #2b2410; color: var(--warn); padding: 8px 20px; border-bottom: 1px solid #4a3d14; }

/* elements */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  padding: 8px 14px; border-radius: 9px; cursor: pointer; font: inherit; font-weight: 500; text-decoration: none; }
.btn:hover { border-color: #3a3f46; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.danger { color: var(--danger); }
.btn.ghost { background: none; }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: progress; }
input, textarea, select { width: 100%; background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 9px; padding: 9px 11px; font: inherit; }
input[type=checkbox] { width: auto; accent-color: var(--accent); }
input[type=file] { padding: 7px; }
textarea { min-height: 90px; resize: vertical; }
textarea.prompt { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; min-height: 120px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
label { display: block; color: var(--muted); font-size: 12.5px; margin-bottom: 10px; }
label > input, label > textarea, label > select { margin-top: 4px; color: var(--text); font-size: 14px; }
label.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 13.5px; }
.hint { color: var(--muted); font-size: 12.5px; }
.err { color: var(--danger); min-height: 1em; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.panel + .panel { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid4 { display: grid; grid-template-columns: 1.6fr 1fr 0.8fr 1fr; gap: 12px; }
.split { display: grid; grid-template-columns: minmax(320px, 420px) 1fr; gap: 16px; align-items: start; }
.split.wide { grid-template-columns: minmax(320px, 520px) 1fr; }
.sticky { position: sticky; top: 76px; }
.stack > * + * { margin-top: 12px; }
.muted { color: var(--muted); }
.pill { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); }
.pill.ok { color: var(--ok); border-color: #1f4d31; }
.pill.run { color: var(--warn); border-color: #4a3d14; }
.pill.fail { color: var(--danger); border-color: #5a2323; }
.pill.acc { color: var(--accent); border-color: #4b5a1d; }

/* cards & galleries */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: border-color .15s; }
.card:hover { border-color: #444a52; }
.card .cover { aspect-ratio: 3/4; background: var(--panel-2) center/cover no-repeat; display: grid; place-items: center; color: var(--muted); font-size: 38px; }
.card .body { padding: 10px 12px; }
.card .title { font-weight: 600; margin-bottom: 2px; }
.card.new { display: grid; place-items: center; min-height: 240px; border-style: dashed; color: var(--muted); font-size: 15px; }

.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.thumb { position: relative; border-radius: 10px; overflow: hidden; border: 2px solid transparent; background: var(--panel-2); }
.thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.thumb.primary { border-color: var(--accent); }
.thumb .acts { position: absolute; inset: auto 0 0 0; display: flex; gap: 4px; padding: 6px; background: linear-gradient(transparent, rgba(0,0,0,.8)); opacity: 0; transition: opacity .15s; }
.thumb:hover .acts { opacity: 1; }
.thumb .acts button { flex: 1; font-size: 11px; padding: 4px; border-radius: 6px; border: 0; background: rgba(255,255,255,.14); color: #fff; cursor: pointer; }
.thumb .badge { position: absolute; top: 6px; left: 6px; background: var(--accent); color: var(--accent-ink); font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 6px; }

.jobs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.job { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.job .media { position: relative; overflow: hidden; background: #000; aspect-ratio: 9/16; max-height: 420px; display: grid; place-items: center; color: var(--muted); }
.job .media video { position: absolute; inset: 0; }
.job .media.land { aspect-ratio: 16/9; }
.job video, .job img { width: 100%; height: 100%; object-fit: contain; display: block; }
.job .imgs { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: #000; }
.job .imgs img { aspect-ratio: 1; object-fit: cover; cursor: zoom-in; }
.job .body { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.job .prompt-short { color: var(--muted); font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.job audio { width: 100%; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* chips for characters */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; user-select: none; }
.chip .av { width: 28px; height: 28px; border-radius: 50%; background: var(--line) center/cover; }
.chip.on { border-color: var(--accent); background: #1f2610; }
.chip .v { font-size: 11px; color: var(--muted); }

/* analysis */
.an-head { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start; }
.an-head video { width: 100%; max-height: 560px; border-radius: 10px; background: #000; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
ul.clean { margin: 0; padding-left: 18px; }
.scene { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.scene + .scene { margin-top: 14px; }
.scene > div { padding: 14px; }
.scene .orig { border-right: 1px solid var(--line); }
.scene .adapted { background: #151a0c; }
.scene .tc { font-family: ui-monospace, monospace; color: var(--accent); cursor: pointer; }
.scene dl { display: grid; grid-template-columns: 90px 1fr; gap: 4px 10px; margin: 8px 0; font-size: 13px; }
.scene dt { color: var(--muted); }
.scene dd { margin: 0; }
.speech { background: var(--panel-2); border-left: 3px solid var(--accent); padding: 6px 10px; border-radius: 6px; font-style: italic; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); cursor: pointer; }
.list-item:hover { border-color: #444a52; }
.list-item + .list-item { margin-top: 8px; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 500; font-size: 12.5px; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 340px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 24px; }
.login-card .btn { width: 100%; justify-content: center; margin-top: 6px; }

/* modal & toast */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.7); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px; width: 100%; max-width: 560px; max-height: 90vh; overflow: auto; }
.modal-card.img { max-width: 1000px; padding: 8px; background: #000; }
.modal-card.img img { width: 100%; display: block; border-radius: 10px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--panel-2); border: 1px solid var(--line); padding: 10px 16px; border-radius: 10px; z-index: 60; max-width: 90vw; }
.toast.error { border-color: var(--danger); color: #ffc9c9; }

@media (max-width: 900px) {
  .split, .split.wide, .an-head, .scene, .grid2, .grid3, .grid4 { grid-template-columns: 1fr; }
  .scene .orig { border-right: 0; border-bottom: 1px solid var(--line); }
  .top { flex-wrap: wrap; gap: 8px; padding: 10px 16px; }
  nav { order: 3; flex: 1 1 100%; }
  .me { margin-left: auto; }
  main { padding: 16px; }
  .sticky { position: static; }
}

/* ---------- Фото · Flow ---------- */
.flow { padding-bottom: 190px; }
.flow-feed { columns: 4 240px; column-gap: 12px; }
.ftile { position: relative; break-inside: avoid; margin-bottom: 12px; border-radius: 14px; overflow: hidden; background: var(--panel-2); cursor: zoom-in; }
.ftile img { width: 100%; display: block; }
.ftile.pending { aspect-ratio: 3/4; display: grid; place-items: center; cursor: default; background: linear-gradient(110deg, var(--panel) 30%, var(--panel-2) 50%, var(--panel) 70%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.fover { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding: 10px;
  background: linear-gradient(transparent 40%, rgba(0,0,0,.85)); opacity: 0; transition: opacity .15s; }
.ftile:hover .fover, .ftile:focus-within .fover { opacity: 1; }
.fprompt { font-size: 12px; color: #ddd; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.facts { display: flex; gap: 6px; flex-wrap: wrap; }
.facts button, .facts a { border: 0; border-radius: 8px; padding: 5px 9px; font: inherit; font-size: 12px; background: rgba(255,255,255,.16); color: #fff; cursor: pointer; text-decoration: none; }
.facts button:hover, .facts a:hover { background: var(--accent); color: var(--accent-ink); }
.fover select { font-size: 12px; padding: 5px 8px; background: rgba(0,0,0,.6); }
.flow-bar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(880px, calc(100vw - 32px)); z-index: 20;
  background: rgba(22,24,27,.96); backdrop-filter: blur(12px); border: 1px solid var(--line); border-radius: 20px; padding: 10px 12px; box-shadow: 0 16px 50px rgba(0,0,0,.5); }
.ingr { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.ing { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 3px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel-2); font-size: 12.5px; color: var(--text); }
.ing .av { width: 24px; height: 24px; border-radius: 50%; background: var(--line) center/cover; }
.ing .av.sq { border-radius: 6px; }
.ing button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 14px; padding: 0 2px; }
.ing.add { padding: 4px 10px; cursor: pointer; color: var(--muted); border-style: dashed; font: inherit; font-size: 12.5px; }
.ing.add:hover { color: var(--text); border-color: var(--accent); }
.flow-input { display: flex; gap: 8px; align-items: flex-end; }
.flow-input textarea { min-height: 48px; border: 0; background: transparent; padding: 8px 4px; font-size: 15px; }
.flow-input textarea:focus { border: 0; }
.go { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); font-size: 18px; cursor: pointer; }
.go:disabled { opacity: .5; cursor: progress; }
.flow-opts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.flow-opts select { width: auto; padding: 5px 8px; font-size: 12.5px; border-radius: 99px; background: var(--panel-2); }
.thumb.pickable { cursor: pointer; }
@media (max-width: 900px) { .flow-feed { columns: 2 150px; } .fover { opacity: 1; background: linear-gradient(transparent 55%, rgba(0,0,0,.85)); } .fprompt { display: none; } }

/* ---------- общие элементы v3 ---------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.spinner.sm { width: 14px; height: 14px; border-width: 2px; display: inline-block; vertical-align: -2px; }
.back { display: inline-block; color: var(--muted); text-decoration: none; margin-bottom: 10px; font-size: 13px; }
.back:hover { color: var(--text); }
.btn.danger-solid { background: var(--danger); border-color: var(--danger); color: #1a0505; }
.linkbtn { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; padding: 0 4px; }
.modal-card { position: relative; }
.modal-card.wide { max-width: 820px; }
.modal-card video { width: 100%; max-height: 80vh; display: block; border-radius: 10px; background: #000; }
.modal-x { position: absolute; top: 10px; right: 12px; border: 0; background: none; color: var(--muted); font-size: 22px; cursor: pointer; line-height: 1; z-index: 2; }
.modal-card.img .modal-x { color: #fff; text-shadow: 0 1px 3px #000; }
.modal-x:hover { color: var(--text); }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.big-x { font-size: 34px; color: var(--danger); }
.job .imgs.one { grid-template-columns: 1fr; }
.job .imgs.one img { aspect-ratio: auto; max-height: 420px; object-fit: contain; }
.warn-t { color: var(--warn) !important; }
.table-wrap { overflow-x: auto; }
.empty { border: 1px dashed var(--line); border-radius: var(--radius); padding: 28px; text-align: center; color: var(--muted); max-width: 640px; margin: 24px auto; }
.empty h3 { color: var(--text); }
.empty-adapt { display: grid; place-items: center; text-align: center; }
.scene .tc { background: none; border: 0; font: 12.5px ui-monospace, monospace; color: var(--accent); cursor: pointer; padding: 0; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: -2px 0 8px; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.drop { border: 1px dashed #3a3f46; border-radius: 10px; padding: 18px; text-align: center; cursor: pointer; color: var(--muted); transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--accent); background: #1a1f0e; color: var(--text); }
.drop.loading { opacity: .6; pointer-events: none; }
.drop .hint { display: block; margin-top: 6px; color: var(--ok); }

/* сегментные переключатели */
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; margin-bottom: 14px; }
.seg button { border: 0; background: none; color: var(--muted); padding: 6px 12px; border-radius: 7px; cursor: pointer; font: inherit; white-space: nowrap; }
.seg button.on { background: var(--panel-2); color: var(--text); }
.seg.sm button { padding: 4px 10px; font-size: 12.5px; }
.card .cover.wide { aspect-ratio: 16/10; }
.card .cover { font-size: 38px; }

/* ---------- проект (как во Flow) ---------- */
body.in-project main { max-width: none; padding-bottom: 260px; }
.proj-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.proj-top h1 { margin: 0; cursor: text; border-bottom: 1px dashed transparent; }
.proj-top h1:hover { border-bottom-color: var(--muted); }
.proj-top .seg { margin: 0; }
.proj-top #pFilter { margin-left: auto; }
.ftile.video { cursor: pointer; }
.ftile.video video { width: 100%; display: block; background: #000; }
.ftile.pending.video, .ftile.failed { aspect-ratio: 9/16; }
.wait-box, .fail-box { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 14px; text-align: center; }
.fail-box { background: #1e1212; color: #ffc9c9; font-size: 12.5px; }
.fail-box b { color: var(--danger); }
.vbadge, .scene-badge { position: absolute; top: 8px; font-size: 11px; background: rgba(0,0,0,.65); color: #fff; padding: 2px 7px; border-radius: 6px; pointer-events: none; }
.vbadge { left: 8px; }
.scene-badge { right: 8px; }
.ftile .fover { pointer-events: none; }
.ftile .fover .facts, .ftile .fover select { pointer-events: auto; }
.facts button.danger { color: #ffb3b3; }

.composer { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); width: min(980px, calc(100vw - 32px)); z-index: 20;
  background: rgba(22,24,27,.97); backdrop-filter: blur(12px); border: 1px solid var(--line); border-radius: 20px; padding: 10px 14px 12px;
  box-shadow: 0 18px 60px rgba(0,0,0,.55); display: flex; flex-direction: column; gap: 8px; max-height: 70vh; overflow-y: auto; }
.composer.over { border-color: var(--accent); }
.modes { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.modes button { border: 1px solid transparent; background: none; color: var(--muted); padding: 5px 11px; border-radius: 99px; cursor: pointer; font: inherit; font-size: 13px; }
.modes button:hover { color: var(--text); }
.modes button.on { background: var(--panel-2); border-color: var(--line); color: var(--text); }
.mode-hint { margin-left: auto; font-size: 12px; }
.slots { display: flex; align-items: center; gap: 10px; }
.slot { width: 96px; height: 96px; border-radius: 12px; border: 1px dashed #3a3f46; display: grid; place-items: center; text-align: center; font-size: 12px; color: var(--muted); cursor: pointer; position: relative; overflow: hidden; background: var(--bg); }
.slot:hover { border-color: var(--accent); color: var(--text); }
.slot.filled { border-style: solid; }
.slot img { width: 100%; height: 100%; object-fit: cover; }
.slot button { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.7); color: #fff; cursor: pointer; }
.slot.disabled { opacity: .4; cursor: not-allowed; }
.slot small { color: var(--muted); }
.slots .arrow { color: var(--muted); font-size: 18px; }
.flow-opts { align-items: center; }
.pillbtn { border: 1px solid var(--line); background: var(--panel-2); color: var(--text); border-radius: 99px; padding: 5px 11px; font: inherit; font-size: 12.5px; cursor: pointer; list-style: none; }
.pillbtn:hover { border-color: #3a3f46; }
.tog { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: var(--text); font-size: 12.5px; }
.menu-wrap { position: relative; }
.menu { position: absolute; bottom: calc(100% + 6px); left: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 6px; z-index: 30;
  display: grid; grid-template-columns: repeat(3, max-content); gap: 4px; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.menu button { border: 0; background: var(--panel-2); color: var(--text); padding: 6px 10px; border-radius: 8px; cursor: pointer; font: inherit; font-size: 12.5px; text-align: left; }
.menu button:hover { background: var(--accent); color: var(--accent-ink); }
details.more { position: relative; }
details.more summary::-webkit-details-marker { display: none; }
details.more .menu { grid-template-columns: 1fr; min-width: 240px; right: 0; left: auto; padding: 10px; }
details.more label { margin: 0 0 6px; }

body.in-project .toast { bottom: auto; top: 70px; }

/* сцена */
.timeline { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.clip { flex: none; width: 180px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; cursor: grab; }
.clip-media { aspect-ratio: 9/16; background: #000; position: relative; }
.clip-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.clip-bar { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 8px; }
.clip-bar .btn { padding: 3px 7px; }

@media (max-width: 900px) {
  .composer { bottom: 8px; width: calc(100vw - 16px); border-radius: 16px; padding: 8px 10px; }
  .mode-hint { display: none; }
  .modes button { padding: 4px 8px; font-size: 12px; }
  .proj-top #pFilter { margin-left: 0; }
  .menu { grid-template-columns: repeat(2, max-content); }
  .slot { width: 76px; height: 76px; }
  .facts { gap: 4px; }
  .facts button, .facts a { padding: 3px 6px; font-size: 11px; }
  body.in-project main { padding-bottom: 320px; }
}

/* ---------- просмотр на весь экран ---------- */
.viewer { position: fixed; inset: 0; z-index: 80; background: #000; }
.viewer-bar { position: absolute; top: 0; left: 0; right: 0; z-index: 1; display: flex; gap: 8px; align-items: center; padding: 10px 14px 18px; background: linear-gradient(rgba(0,0,0,.8), rgba(0,0,0,0)); color: #ddd; }
.viewer-info { margin-right: auto; font-size: 13px; opacity: .85; }
.viewer-bar button, .viewer-bar a { background: rgba(255,255,255,.14); color: #fff; border: 0; border-radius: 8px; padding: 7px 12px; font: inherit; font-size: 14px; cursor: pointer; text-decoration: none; }
.viewer-bar button:hover, .viewer-bar a:hover { background: rgba(255,255,255,.26); }
.viewer-stage { position: absolute; inset: 0; display: flex; overflow: auto; }
.viewer.fit .viewer-stage { overflow: hidden; }
.viewer-stage > * { margin: auto; display: block; }
/* по размеру экрана: целиком, без прокрутки (единицы экрана — одинаково в Safari и Chrome) */
.viewer-stage video, .viewer.fit .viewer-stage img { width: 100vw; height: 100vh; height: 100dvh; max-width: none; object-fit: contain; }
.viewer.fit .viewer-stage img { cursor: zoom-in; }
/* 100%: пиксель в пиксель, можно прокручивать */
.viewer:not(.fit) .viewer-stage { padding-top: 56px; }
.viewer:not(.fit) .viewer-stage img { width: auto; height: auto; max-width: none; cursor: zoom-out; }
.job .media .expand { position: absolute; top: 8px; right: 8px; z-index: 2; border: 0; border-radius: 8px; background: rgba(0,0,0,.55); color: #fff; font-size: 16px; padding: 4px 8px; cursor: pointer; }
.job .media .expand:hover { background: rgba(0,0,0,.8); }
img[data-zoom] { cursor: zoom-in; }
