/* Фабрика крео — интерфейс. Тёмная рабочая тема, акцент «сигнальный коралл». */
:root {
  --bg: #0d0e10;
  --bg-2: #131417;
  --panel: #17191c;
  --raised: #1e2024;
  --hover: #24272c;
  --line: #2a2d33;
  --line-2: #363a41;
  --text: #ecedef;
  --text-2: #b4b8bf;
  --muted: #7d828a;
  --accent: #ff6a3d;
  --accent-2: #ff8a63;
  --accent-bg: rgba(255, 106, 61, .12);
  --ok: #3ccf8e;
  --ok-bg: rgba(60, 207, 142, .12);
  --warn: #f5b437;
  --warn-bg: rgba(245, 180, 55, .12);
  --err: #ff5468;
  --err-bg: rgba(255, 84, 104, .12);
  --info: #5aa9ff;
  --info-bg: rgba(90, 169, 255, .12);
  --r: 10px;
  --r-sm: 7px;
  --sidebar: 248px;
  --top: 56px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --shadow: 0 12px 40px rgba(0, 0, 0, .45), 0 2px 8px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased; overflow: hidden;
}
[x-cloak] { display: none !important; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent); color: #000; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2c2f35; border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--muted); }
.dim { color: var(--text-2); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 8px; }
.between { justify-content: space-between; }
.gap-4 { gap: 4px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; }
.hr { height: 1px; background: var(--line); margin: 12px 0; }

/* ── каркас ── */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; height: 100vh; }
.sidebar {
  background: var(--bg-2); border-right: 1px solid var(--line); display: flex; flex-direction: column;
  min-height: 0;
}
.brand { height: var(--top); display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: #140700;
  display: grid; place-items: center; font-weight: 800; font-size: 13px; letter-spacing: -.5px;
}
.brand-name { font-weight: 700; letter-spacing: -.2px; }
.brand-name small { display: block; font-weight: 500; color: var(--muted); font-size: 11px; letter-spacing: 0; }
.nav { padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--text-2); text-decoration: none; font-weight: 500; position: relative;
}
.nav a:hover { background: var(--hover); color: var(--text); }
.nav a.on { background: var(--raised); color: var(--text); }
.nav a.on::before { content: ""; position: absolute; left: -8px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--accent); }
.nav .count { margin-left: auto; font-size: 11px; color: var(--muted); font-family: var(--mono); }
.nav .count.hot { color: var(--accent); }
.ico { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.side-section { padding: 6px 16px 4px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.tree { overflow: auto; flex: 1; padding: 0 8px 12px; }
.tree-offer { margin-top: 2px; }
.tree-row {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--r-sm); cursor: pointer;
  color: var(--text-2); user-select: none; position: relative;
}
.tree-row:hover { background: var(--hover); color: var(--text); }
.tree-row.on { background: var(--accent-bg); color: var(--text); }
.tree-row.drop { outline: 2px dashed var(--accent); outline-offset: -2px; background: var(--accent-bg); }
.tree-row .dot { width: 8px; height: 8px; border-radius: 3px; flex: none; }
.tree-row .count { margin-left: auto; font-size: 11px; color: var(--muted); font-family: var(--mono); }
.tree-row .act { opacity: 0; margin-left: 4px; }
.tree-row:hover .act { opacity: 1; }
.tree-proj { padding-left: 26px; }
.chev { width: 12px; height: 12px; transition: transform .15s; flex: none; }
.chev.open { transform: rotate(90deg); }
.side-foot { border-top: 1px solid var(--line); padding: 10px 12px; display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px;
  background: var(--raised); color: var(--text-2); border: 1px solid var(--line-2); flex: none;
}
.avatar.sm { width: 22px; height: 22px; font-size: 10px; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar {
  height: var(--top); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px;
  padding: 0 20px; background: var(--bg); flex: none;
}
.topbar h1 { font-size: 16px; margin: 0; font-weight: 650; letter-spacing: -.2px; white-space: nowrap; }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--muted); min-width: 0; }
.crumbs b { color: var(--text); font-weight: 650; }
.content { flex: 1; overflow: auto; position: relative; }
.page { padding: 20px 24px 120px; }

/* ── элементы ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 14px;
  border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--raised); color: var(--text);
  cursor: pointer; font-weight: 550; white-space: nowrap; transition: background .12s, border-color .12s, transform .05s;
  text-decoration: none; user-select: none;
}
.btn:hover { background: var(--hover); border-color: #444952; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #170800; }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.danger { color: var(--err); }
.btn.danger:hover { background: var(--err-bg); border-color: var(--err); }
.btn.ok { color: var(--ok); }
.btn.ok:hover { background: var(--ok-bg); border-color: var(--ok); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn.xs { height: 24px; padding: 0 8px; font-size: 12px; border-radius: 6px; }
.btn.icon { width: 34px; padding: 0; }
.btn.icon.sm { width: 28px; }
.btn .kbd { margin-left: 4px; }
.kbd { font-family: var(--mono); font-size: 10.5px; padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line-2); color: var(--muted); background: var(--bg-2); }

.input, .select, .textarea {
  height: 34px; padding: 0 10px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--bg-2);
  color: var(--text); outline: none; width: 100%; transition: border-color .12s, box-shadow .12s;
}
.textarea { height: auto; min-height: 80px; padding: 8px 10px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.input.sm, .select.sm { height: 28px; font-size: 13px; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%237d828a' fill='none' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }
.label { font-size: 12px; color: var(--muted); font-weight: 550; margin-bottom: 5px; display: block; }
.field { display: flex; flex-direction: column; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

.search { position: relative; width: 340px; max-width: 34vw; }
.search .input { padding-left: 34px; height: 34px; background: var(--panel); }
.search .ico { position: absolute; left: 11px; top: 9px; color: var(--muted); }
.search .kbd { position: absolute; right: 8px; top: 8px; }

.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 2px; gap: 2px; }
.seg button { border: 0; background: transparent; height: 28px; padding: 0 10px; border-radius: 5px; color: var(--text-2); cursor: pointer; font-weight: 550; font-size: 13px; white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--raised); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.4); }
.seg.sm button { height: 22px; padding: 0 8px; font-size: 12px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--panel); color: var(--text-2); cursor: pointer; font-size: 13px; font-weight: 550;
  white-space: nowrap; user-select: none;
}
.chip:hover { color: var(--text); border-color: #464b54; }
.chip.on { background: var(--accent-bg); border-color: var(--accent); color: var(--text); }
.chip .x { opacity: .6; }
.badge { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 5px; font-size: 11px; font-weight: 650; background: var(--raised); color: var(--text-2); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.err { background: var(--err-bg); color: var(--err); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.accent { background: var(--accent-bg); color: var(--accent); }
.tag { display: inline-flex; height: 20px; align-items: center; padding: 0 7px; border-radius: 5px; background: var(--raised); color: var(--text-2); font-size: 11.5px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.card.pad { padding: 16px; }
.card h3 { margin: 0 0 4px; font-size: 14px; }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; margin: 0 0 10px; }

.empty { text-align: center; padding: 64px 20px; color: var(--muted); }
.empty .big { font-size: 17px; color: var(--text); font-weight: 650; margin-bottom: 6px; }
.empty .art { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 18px; background: var(--raised); display: grid; place-items: center; color: var(--accent); }
.empty .art .ico { width: 28px; height: 28px; }

/* ── тулбар страницы ── */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }

/* ── сетка ассетов ── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--tile, 190px), 1fr)); gap: 14px; }
.tile {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; cursor: pointer;
  position: relative; transition: border-color .12s, transform .12s, box-shadow .12s; user-select: none;
}
.tile:hover { border-color: #3b3f47; }
.tile.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.tile.dragging { opacity: .5; }
.tile .media {
  aspect-ratio: 1; position: relative; overflow: hidden;
  background: #0a0b0c repeating-conic-gradient(#121316 0 25%, #0e0f11 0 50%) 0 0 / 16px 16px;
  display: grid; place-items: center;
}
.tile .media img, .tile .media video { width: 100%; height: 100%; object-fit: contain; display: block; }
.tile .meta { padding: 8px 10px 10px; }
.tile .name { font-weight: 600; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .sub { color: var(--muted); font-size: 11.5px; display: flex; gap: 6px; align-items: center; margin-top: 2px; }
.tile .check {
  position: absolute; top: 8px; left: 8px; width: 22px; height: 22px; border-radius: 6px; background: rgba(0,0,0,.55);
  border: 1.5px solid rgba(255,255,255,.55); display: grid; place-items: center; opacity: 0; transition: opacity .1s; z-index: 2;
}
.tile:hover .check, .tile.sel .check, .grid.selecting .tile .check { opacity: 1; }
.tile.sel .check { background: var(--accent); border-color: var(--accent); color: #170800; }
.tile .corner { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; z-index: 2; }
.tile .bottom-badges { position: absolute; bottom: 8px; left: 8px; right: 8px; display: flex; gap: 4px; z-index: 2; justify-content: space-between; }
.ov-badge { background: rgba(0,0,0,.66); backdrop-filter: blur(6px); color: #fff; font-size: 11px; font-weight: 650; border-radius: 5px; padding: 2px 6px; font-family: var(--mono); }
.fav { color: var(--warn); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.st-draft { background: var(--muted); } .st-review { background: var(--info); } .st-approved { background: var(--ok); } .st-rework { background: var(--err); }
.processing { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.55); color: var(--text-2); font-size: 12px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.2); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* панель массовых действий */
.bulkbar {
  position: fixed; left: calc(var(--sidebar) + 50%); transform: translateX(calc(-50% - var(--sidebar) / 2)); bottom: 22px; z-index: 40;
  background: #22252a; border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 14px;
}
.bulkbar .n { font-weight: 700; margin-right: 6px; }

/* ── выезжающая панель ── */
.drawer-back { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(920px, 92vw); background: var(--bg-2); border-left: 1px solid var(--line);
  z-index: 51; display: flex; flex-direction: column; box-shadow: var(--shadow);
}
.drawer.narrow { width: min(560px, 92vw); }
.drawer-head { height: var(--top); display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); flex: none; }
.drawer-body { flex: 1; overflow: auto; }
.split { display: grid; grid-template-columns: 1.25fr 1fr; min-height: 100%; }
.split > .left { background: #0a0b0c; display: flex; align-items: center; justify-content: center; padding: 20px; border-right: 1px solid var(--line); min-height: 420px; position: relative; }
.split > .left img, .split > .left video { max-width: 100%; max-height: calc(100vh - 120px); border-radius: 6px; }
.split > .right { padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* ── модалка ── */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 60; display: grid; place-items: center; padding: 20px; }
.modal { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 14px; width: min(520px, 100%); box-shadow: var(--shadow); max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.modal.wide { width: min(760px, 100%); }
.modal-head { padding: 16px 18px 6px; display: flex; align-items: center; justify-content: space-between; }
.modal-head h2 { margin: 0; font-size: 16px; }
.modal-body { padding: 10px 18px 16px; overflow: auto; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; align-items: center; }

/* ── студия экспорта ── */
.studio { position: fixed; inset: 0; z-index: 55; background: var(--bg); display: grid; grid-template-rows: var(--top) 1fr auto; }
.studio-head { border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 16px; }
.studio-main { display: grid; grid-template-columns: 290px 1fr; min-height: 0; }
.studio-side { border-right: 1px solid var(--line); overflow: auto; padding: 16px; background: var(--bg-2); }
.studio-canvas { overflow: auto; padding: 20px 24px 40px; }
.studio-foot { border-top: 1px solid var(--line); padding: 12px 20px; display: flex; align-items: center; gap: 12px; background: var(--bg-2); }
.fmt-list { display: flex; flex-direction: column; gap: 2px; }
.fmt-item { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: var(--r-sm); cursor: pointer; }
.fmt-item:hover { background: var(--hover); }
.fmt-item .box { border: 1.5px solid var(--muted); border-radius: 2px; flex: none; }
.fmt-item.on .box { border-color: var(--accent); background: var(--accent-bg); }
.cbx { width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--line-2); display: grid; place-items: center; flex: none; background: var(--bg); }
.cbx.on { background: var(--accent); border-color: var(--accent); color: #170800; }
.cbx .ico { width: 11px; height: 11px; stroke-width: 3; }
.pvgrid { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-start; }
.pv { display: flex; flex-direction: column; gap: 8px; }
.pv-frame {
  position: relative; overflow: hidden; border-radius: 6px; background: #000; cursor: crosshair; outline: 1px solid var(--line-2);
}
.pv-frame.active { outline: 2px solid var(--accent); }
.pv-frame .bgblur { position: absolute; inset: -10%; background-size: cover; background-position: center; filter: blur(18px) brightness(.8) saturate(.9); }
.pv-frame .bgcolor { position: absolute; inset: 0; }
.pv-frame .img { position: absolute; background-repeat: no-repeat; }
.pv-frame .safe { position: absolute; inset: 0; pointer-events: none; }
.pv-frame .safe .zone { position: absolute; background: repeating-linear-gradient(45deg, rgba(255,84,104,.42) 0 5px, rgba(255,84,104,.2) 5px 10px); }
.pv-frame .boxes .b { position: absolute; border: 1.5px solid; border-radius: 3px; pointer-events: none; }
.pv-frame .boxes .b.face { border-color: var(--ok); }
.pv-frame .boxes .b.text { border-color: var(--info); }
.pv-frame .focus { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 2px rgba(0,0,0,.5); pointer-events: none; }
.pv-cap { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.pv-cap b { font-weight: 650; }
.pv-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.range { -webkit-appearance: none; appearance: none; height: 4px; background: var(--line-2); border-radius: 4px; outline: none; width: 100%; }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--text); border: 2px solid var(--accent); cursor: pointer; }
.asset-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.asset-strip .st { width: 54px; height: 54px; border-radius: 7px; overflow: hidden; border: 2px solid transparent; flex: none; cursor: pointer; background: #000; }
.asset-strip .st.on { border-color: var(--accent); }
.asset-strip .st img { width: 100%; height: 100%; object-fit: cover; }

/* ── задачи (очередь) ── */
.pop { position: absolute; top: calc(var(--top) - 6px); right: 16px; width: 420px; max-height: 70vh; overflow: auto; z-index: 45; background: #1b1d21; border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); }
.job { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.job:last-child { border-bottom: 0; }
.bar { height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width .4s; }
.bar.ok > i { background: var(--ok); }
.bar.err > i { background: var(--err); }
.queue-btn { position: relative; }
.queue-btn .pulse { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,106,61,.6); } 70% { box-shadow: 0 0 0 8px rgba(255,106,61,0); } 100% { box-shadow: 0 0 0 0 rgba(255,106,61,0); } }

/* ── таблицы ── */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:hover td { background: rgba(255,255,255,.015); }
.table .num { text-align: right; font-family: var(--mono); font-size: 12.5px; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.kpi .v { font-size: 24px; font-weight: 700; letter-spacing: -.5px; font-family: var(--mono); }
.kpi .l { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* ── референсы ── */
.paste-zone {
  border: 1.5px dashed var(--line-2); border-radius: 14px; padding: 18px; display: flex; gap: 14px; align-items: center;
  background: var(--panel); margin-bottom: 18px; transition: border-color .12s, background .12s;
}
.paste-zone.over { border-color: var(--accent); background: var(--accent-bg); }
.paste-zone .input { background: var(--bg); height: 40px; font-size: 14px; }
.masonry { columns: var(--cols, 5) 220px; column-gap: 14px; }
.masonry > * { break-inside: avoid; margin-bottom: 14px; }
.ref { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; cursor: pointer; position: relative; transition: border-color .12s; }
.ref:hover { border-color: #3b3f47; }
.ref.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.ref .media { position: relative; background: #0a0b0c; min-height: 90px; }
.ref .media img, .ref .media video { width: 100%; display: block; }
.ref .linkonly { padding: 26px 14px; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); text-align: center; }
.ref .body { padding: 9px 11px 11px; display: flex; flex-direction: column; gap: 6px; }
.ref .title { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.flames { color: var(--accent); letter-spacing: -1px; }
.src-badge { position: absolute; top: 8px; left: 8px; z-index: 2; }

/* ── брифы (канбан) ── */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(200px, 1fr)); gap: 12px; align-items: start; min-width: 1060px; }
.kcol { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; max-height: calc(100vh - 160px); }
.kcol.over { border-color: var(--accent); background: rgba(255,106,61,.04); }
.kcol-head { padding: 12px 14px 8px; display: flex; align-items: center; gap: 8px; font-weight: 650; }
.kcol-head .count { color: var(--muted); font-family: var(--mono); font-size: 12px; font-weight: 500; }
.kcol-body { padding: 4px 10px 10px; display: flex; flex-direction: column; gap: 10px; overflow: auto; min-height: 60px; }
.bcard { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 8px; }
.bcard:hover { border-color: #3b3f47; }
.bcard .t { font-weight: 650; line-height: 1.3; }
.bcard .thumbs { display: flex; gap: 4px; }
.bcard .thumbs img { width: 38px; height: 38px; object-fit: cover; border-radius: 5px; background: #000; }
.deadline.over { color: var(--err); }
.deadline.soon { color: var(--warn); }

/* ── toasts ── */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { background: #24272c; border: 1px solid var(--line-2); border-left: 3px solid var(--accent); border-radius: 10px; padding: 10px 14px; box-shadow: var(--shadow); max-width: 420px; font-size: 13px; display: flex; gap: 10px; align-items: flex-start; animation: tin .18s ease-out; }
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--err); }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }

/* ── загрузка файлов: оверлей ── */
.dropover { position: fixed; inset: 0; z-index: 90; background: rgba(13,14,16,.86); display: grid; place-items: center; pointer-events: none; }
.dropover .box { border: 2px dashed var(--accent); border-radius: 20px; padding: 48px 64px; text-align: center; background: var(--accent-bg); }
.dropover .box .big { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.uploads { position: fixed; left: calc(var(--sidebar) + 20px); bottom: 20px; z-index: 80; width: 340px; background: #1b1d21; border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); padding: 12px 14px; }

/* ── комментарии ── */
.comments { display: flex; flex-direction: column; gap: 10px; }
.cmt { display: flex; gap: 10px; }
.cmt .bubble { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; flex: 1; }
.cmt.approve .bubble { border-color: rgba(60,207,142,.4); }
.cmt.rework .bubble { border-color: rgba(255,84,104,.45); }

/* ── настройки ── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 12px; color: var(--text-2); text-decoration: none; font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; cursor: pointer; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--text); border-bottom-color: var(--accent); }
.prov { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
.steps { counter-reset: s; display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.steps li { counter-increment: s; display: flex; gap: 12px; }
.steps li::before { content: counter(s); width: 24px; height: 24px; border-radius: 50%; background: var(--raised); color: var(--text-2); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.steps li.done::before { content: "✓"; background: var(--ok-bg); color: var(--ok); }
.copy { cursor: copy; }
.notice { border-radius: 10px; padding: 10px 12px; font-size: 13px; display: flex; gap: 10px; align-items: flex-start; }
.notice.warn { background: var(--warn-bg); color: #f8d38b; }
.notice.info { background: var(--info-bg); color: #b5d6ff; }
.notice.err { background: var(--err-bg); color: #ffb3bd; }
.notice.ok { background: var(--ok-bg); color: #a6ebcb; }

/* ── вход ── */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: radial-gradient(1200px 600px at 20% 10%, rgba(255,106,61,.18), transparent 60%), var(--bg-2); border-right: 1px solid var(--line); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; position: relative; }
.login-art .tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; transform: rotate(-8deg) translateY(10px); opacity: .9; }
.login-art .tiles div { border-radius: 8px; background: var(--raised); border: 1px solid var(--line-2); }
.login-form { display: grid; place-items: center; padding: 40px; }
.login-form form { width: 340px; display: flex; flex-direction: column; gap: 14px; }

@media (max-width: 1100px) {
  :root { --sidebar: 210px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { display: none; }
}

/* видео-превью под плашками */
.tile .media video, .ref .media video { z-index: 1; }
.src-badge, .tile .corner, .tile .bottom-badges, .tile .check, .processing { z-index: 3 !important; }
.login-art .tiles { grid-template-columns: repeat(5, 96px); }
