/* Macadamia — стиль в духе Are.na: белый/чёрный фон, серые подписи, плоские блоки. */
/* Шрифт Inter (SIL OFL 1.1, см. /fonts/OFL-Inter.txt), переменный 100–900, свой хостинг: латиница + кириллица. */
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/fonts/inter-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/fonts/inter-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/fonts/inter-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/fonts/inter-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  --bg: #ffffff;
  --surface: #f7f7f7;
  --surface2: #ececec;
  --line: #e5e5e5;
  --line2: #d4d4d4;
  --ink: #000000;
  --text: #333333;
  --text2: #696969;
  --text3: #b2b2b2;
  --primary: #00075f;
  --primary-ink: #ffffff;
  --accent: #17ac10;
  --accent-soft: rgba(23, 172, 16, .10);
  --we: rgba(70, 110, 210, .09);
  --sel: var(--accent);
  --sel-soft: var(--accent-soft);
  --dot: #e9e9e9;
  --card: #f4f4f4;
  --red: #d33a2c;
  --green: #1f9d55;
  --overlay: rgba(255, 255, 255, .78);
  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 8px 24px rgba(0, 0, 0, .10);
  --font: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, Menlo, Consolas, monospace;
  --r: 3px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #1a1a1a;
    --surface2: #262626;
    --line: #2a2a2a;
    --line2: #3a3a3a;
    --ink: #ffffff;
    --text: #e5e5e5;
    --text2: #b2b2b2;
    --text3: #696969;
    --primary: #e2dfe9;
    --primary-ink: #000000;
    --accent: #4cd146;
    --accent-soft: rgba(76, 209, 70, .13);
    --we: rgba(120, 150, 255, .10);
    --sel: var(--accent);
    --sel-soft: var(--accent-soft);
    --dot: #1d1d1d;
    --card: #1a1a1a;
    --red: #f06a5d;
    --green: #4cc483;
    --overlay: rgba(0, 0, 0, .72);
    --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 10px 30px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font: 14px/1.4 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font: inherit; color: inherit; }
a { color: inherit; }
.mono { font-variant-numeric: tabular-nums; }
.muted { color: var(--text2); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.pad { padding: 24px; }
.muted-p { color: var(--text2); margin: 0; line-height: 1.5; }
.ic { display: inline-flex; flex-shrink: 0; }
::selection { background: var(--sel-soft); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 10px; border: 3px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

#app { height: 100dvh; display: flex; flex-direction: column; }
#main { flex: 1; min-height: 0; position: relative; }
#main.view-page { overflow: auto; }
#main.view-table { display: flex; flex-direction: column; }
#main.view-board { overflow: hidden; }

/* ───── Логотип ───── */
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 16px; color: var(--ink); }
.logo-mark {
  width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0; position: relative;
  background: radial-gradient(circle at 35% 30%, #fbe6bf 0 18%, #e9bf7f 45%, #b9813f 100%);
}
.logo-mark::after { content: ''; position: absolute; width: 22%; height: 22%; border-radius: 50%; background: #6b3f17; right: 18%; bottom: 20%; opacity: .75; }
.logo-mark.big { width: 26px; height: 26px; }

/* ───── Шапка ───── */
#topbar {
  height: 56px; flex-shrink: 0; display: flex; align-items: center; gap: 16px;
  padding: 0 16px; background: var(--bg); position: relative; z-index: 30;
}
.crumbs { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; font-size: 16px; font-weight: 700; }
.crumbs .logo { color: var(--text2); }
.crumbs .logo:hover { color: var(--ink); }
.crumb-sep { color: var(--text3); font-weight: 400; }
.crumb-project { display: flex; align-items: center; gap: 8px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-mid { display: flex; justify-content: center; }
.top-right { display: flex; align-items: center; gap: 8px; flex: 1; justify-content: flex-end; }
.seg { display: inline-flex; gap: 4px; }
.seg a {
  display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: var(--r);
  color: var(--text2); text-decoration: none; font-weight: 700; font-size: 12.5px;
}
.seg a:hover { color: var(--ink); }
.seg a.on { background: var(--surface); color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
.presence { display: flex; }
.presence .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--green); }
.presence .avatar:first-child { margin-left: 0; }
.presence-more { font-size: 12.5px; color: var(--text2); margin-left: 6px; }
.me-btn { background: none; border: 0; padding: 0; border-radius: 50%; cursor: pointer; display: flex; }
.me-btn:focus-visible { outline: 2px solid var(--sel); outline-offset: 2px; }

/* ───── Кнопки и поля ───── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; padding: 0 10px;
  border-radius: var(--r); border: 1px solid transparent; background: var(--surface); color: var(--text);
  font-weight: 700; font-size: 12.5px; cursor: pointer; white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--surface2); color: var(--ink); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { background: var(--primary); opacity: .88; }
.btn.danger { background: transparent; border-color: var(--line); color: var(--red); }
.btn.danger:hover { background: var(--surface); }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.ghost:hover { background: var(--surface); }
.btn.small { height: 26px; padding: 0 8px; }
.btn.big { height: 38px; width: 100%; font-size: 14px; margin-top: 4px; }
.icon-btn {
  width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r);
  border: 0; background: transparent; color: var(--text2); cursor: pointer; flex-shrink: 0;
}
.icon-btn:hover { background: var(--surface); color: var(--ink); }
.icon-btn:disabled { opacity: .3; cursor: default; background: transparent; }
.icon-btn.small { width: 26px; height: 26px; }
.danger-hover:hover { color: var(--red) !important; }

input, select, textarea {
  font: inherit; font-size: 14px; color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r); padding: 7px 10px; outline: none; width: 100%; min-width: 0;
}
input::placeholder, textarea::placeholder { color: var(--text3); }
textarea { resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input[readonly], textarea[readonly] { background: transparent; }
select { cursor: pointer; }
input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; flex-shrink: 0; }
input[type=number] { -moz-appearance: textfield; }
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 12.5px; color: var(--text2); }
.field-hint { font-size: 12px; color: var(--text3); }
.field-hint.top { margin-top: -4px; }
.form-grid { display: flex; flex-direction: column; gap: 16px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; }
.row-name { display: grid; grid-template-columns: 3fr 1fr; gap: 12px; }
.inline { display: flex; gap: 8px; align-items: center; }
.inline.wrap { flex-wrap: wrap; gap: 6px; }
.steps { gap: 20px; }
.step { display: flex; gap: 14px; }
.step-num { width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 12.5px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.step-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.step-body .field, .step-body .inline { width: 100%; }
.step-title { font-weight: 700; color: var(--text); padding-top: 3px; }
.link-row { display: flex; align-items: center; gap: 6px; }
.file-chip {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 6px; border-radius: var(--r);
  background: var(--surface); text-decoration: none; color: var(--text2);
}
.file-chip:hover { background: var(--surface2); color: var(--ink); }
.file-chip-ic { width: 30px; height: 30px; border-radius: var(--r); display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); flex-shrink: 0; }
.file-chip-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.file-chip-name { font-size: 13px; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip-host { font-size: 11.5px; color: var(--text2); }
.path-prefix { font-size: 12.5px; color: var(--text2); white-space: nowrap; }

/* ───── Модалки, меню, тосты ───── */
.modal-back {
  position: fixed; inset: 0; background: var(--overlay);
  display: flex; align-items: center; justify-content: center; z-index: 270; padding: 12px; animation: fade .1s;
}
.modal {
  width: min(460px, 100%); max-height: 92dvh; display: flex; flex-direction: column;
  background: var(--bg); border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--shadow); animation: pop .12s;
}
.modal.wide { width: min(640px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 14px 4px 22px; }
.modal-head h2 { margin: 0; font-size: 20px; font-weight: 700; color: var(--text); }
.modal-body { padding: 12px 22px; overflow: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: 6px; padding: 12px 22px 20px; flex-wrap: wrap; }
.modal-actions .left { margin-right: auto; }
.modal-actions .btn { height: 32px; padding: 0 12px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(4px); } }

.menu {
  position: fixed; z-index: 290; min-width: 180px; max-height: 70vh; overflow: auto; padding: 4px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); animation: pop .08s;
}
.menu-item {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 6px 10px; border: 0; background: none;
  border-radius: 2px; text-align: left; cursor: pointer; font-size: 13px; white-space: nowrap; color: var(--text);
}
.menu-item:hover { background: var(--surface); color: var(--ink); }
.menu-item.active { font-weight: 700; color: var(--ink); background: var(--accent-soft); }
.menu-item.danger { color: var(--red); }
.menu-hint { margin-left: auto; padding-left: 14px; color: var(--text3); font-size: 12px; font-weight: 400; }
.menu-sep { height: 1px; background: var(--line); margin: 4px 2px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block; }

#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 6px; z-index: 300; align-items: flex-end; pointer-events: none; }
.toast {
  background: var(--ink); color: var(--bg); padding: 9px 13px; border-radius: var(--r);
  font-size: 13px; font-weight: 700; box-shadow: var(--shadow); max-width: 380px; animation: pop .12s; transition: opacity .2s; pointer-events: auto;
}
.toast.error { background: var(--red); color: #fff; }
.toast.out { opacity: 0; }

.lightbox { position: fixed; inset: 0; z-index: 285; background: var(--overlay); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; animation: fade .1s; }
.lightbox img, .lightbox video { max-width: 94vw; max-height: 90vh; box-shadow: var(--shadow); }
.lb-close { position: absolute; top: 14px; right: 14px; }

/* ───── Аватар, статусы, бейджи ───── */
.avatar {
  display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #111;
  font-weight: 700; flex-shrink: 0; user-select: none;
}
.avatar.empty { background: transparent; border: 1px dashed var(--line2); }
.av-stack { display: flex; }
.av-stack .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--bg); }
.av-stack .avatar:first-child { margin-left: 0; }
.code-badge { font-weight: 700; color: var(--text2); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px 0 8px; border-radius: var(--r);
  font-size: 12.5px; font-weight: 700; white-space: nowrap; border: 0;
  background: color-mix(in srgb, var(--c) 13%, transparent); color: var(--text);
}
.pill .dot { width: 7px; height: 7px; background: var(--c); }
.pill.empty { background: transparent; color: var(--text3); font-weight: 400; }
.pill.empty .dot { background: transparent; border: 1px solid var(--text3); }
button.pill { cursor: pointer; }
button.pill:hover { box-shadow: inset 0 0 0 1px var(--line2); }
.pill.small { padding: 0 8px; }

/* ───── Вход ───── */
.auth { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--bg); }
.auth-card { width: min(360px, 100%); padding: 8px 0; }
.auth-logo { display: flex; align-items: center; gap: 12px; font-size: 28px; font-weight: 700; margin-bottom: 26px; color: var(--text); }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-sub { margin: 0; color: var(--text2); font-size: 14px; }
.auth-foot { margin: 4px 0 0; color: var(--text3); font-size: 12.5px; text-align: center; }
.auth-lang { display: flex; justify-content: center; gap: 14px; margin-top: 18px; }
.auth-lang .link-btn { border: 0; background: none; padding: 0; font: inherit; font-size: 12.5px; color: var(--text3); cursor: pointer; }
.auth-lang .link-btn.on { color: var(--text); font-weight: 700; }
.auth-lang .link-btn:hover { color: var(--accent); }
.auth-err { display: none; color: var(--red); font-size: 13px; }

/* ───── Страницы ───── */
.page { max-width: 1240px; margin: 0 auto; padding: 32px 50px 80px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 40px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 28px; line-height: 35px; font-weight: 700; color: var(--text); }
.page-sub { margin: 8px 0 0; color: var(--text2); font-size: 12.5px; max-width: 640px; line-height: 1.5; }
.card { border-top: 1px solid var(--line); overflow-x: auto; }
.empty-state { text-align: center; padding: 80px 20px; color: var(--text2); }
.empty-state h3 { color: var(--text); margin: 0 0 8px; font-size: 16px; }
.empty-state p { margin: 0 auto 18px; max-width: 420px; font-size: 13px; line-height: 1.5; }
.empty-art { display: none; }
.empty-actions { display: flex; gap: 6px; justify-content: center; }

.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 40px 24px; }
.proj-card { text-decoration: none; display: flex; flex-direction: column; gap: 14px; }
.proj-cover { aspect-ratio: 1 / 1; background: var(--surface); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.proj-card:hover .proj-cover { outline: 2px solid var(--accent); outline-offset: 3px; }
.cover-media { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-ph { font-size: 28px; font-weight: 700; color: var(--text3); }
.proj-info { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 0 8px; }
.proj-title { display: flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; font-size: 13px; }
.proj-name { font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj-meta { display: flex; align-items: center; gap: 6px; color: var(--text2); font-size: 12.5px; }
.sep-dot { width: 2px; height: 2px; border-radius: 50%; background: var(--text3); }
.bar { height: 2px; background: var(--line); overflow: hidden; width: 100%; max-width: 160px; }
.bar span { display: block; height: 100%; background: var(--accent); }
.proj-foot { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 26px; }
.proj-foot { position: relative; width: 100%; }
.proj-foot .icon-btn { opacity: 0; position: absolute; right: 0; top: 0; }
.proj-card:hover .proj-foot .icon-btn { opacity: 1; }

.simple-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.simple-table th { text-align: left; font-size: 12.5px; color: var(--text2); font-weight: 400; padding: 10px 12px 8px; }
.simple-table td { padding: 8px 12px; border-top: 1px solid var(--line); vertical-align: middle; color: var(--text); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.user-cell { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.member-list { display: flex; flex-direction: column; max-height: 230px; overflow: auto; border-top: 1px solid var(--line); }
.member-row { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 13px; color: var(--text); }
.member-row:hover { background: var(--surface); }
.m-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-tag { font-size: 12px; color: var(--text2); }
.role-tag.admin { color: var(--text); font-weight: 700; }
.stages-edit { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.stage-row { display: flex; align-items: center; gap: 2px; width: 100%; }
.stage-num { width: 20px; color: var(--text3); font-size: 12.5px; text-align: right; margin-right: 6px; }
.creds { font-family: var(--mono); font-size: 13px; background: var(--surface); padding: 14px; border-radius: var(--r); margin: 0; user-select: all; white-space: pre-wrap; }
.keys-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.keys-table td { padding: 6px 4px; vertical-align: top; border-top: 1px solid var(--line); color: var(--text); }
.keys-table td:first-child { width: 48%; }
kbd { font-family: var(--font); font-size: 12px; font-weight: 700; background: var(--surface); border-radius: var(--r); padding: 2px 6px; }

/* ───── Таблица шотов ───── */
.toolbar { display: flex; align-items: center; gap: 6px; padding: 8px 16px 12px; flex-wrap: wrap; flex-shrink: 0; }
.search { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 8px; border-radius: var(--r); color: var(--text2); background: var(--surface); }
.search:focus-within { box-shadow: inset 0 0 0 1px var(--line2); }
.search-input { border: 0; background: transparent; padding: 0; width: 220px; font-size: 13px; }
.search-input:focus { border: 0; }
.tool-select { width: auto; height: 30px; padding: 0 8px; font-size: 12.5px; font-weight: 700; color: var(--text); background: var(--surface); border-color: transparent; }
.tb-spacer { flex: 1; }
.tb-summary { color: var(--text2); font-size: 12.5px; margin-right: 6px; white-space: nowrap; }
.table-wrap { flex: 1; overflow: auto; min-height: 0; }
.shots-table { border-collapse: separate; border-spacing: 0; min-width: 100%; font-size: 13px; }
.shots-table th {
  position: sticky; top: 0; z-index: 2; background: var(--bg); text-align: left; font-size: 12.5px; font-weight: 400;
  color: var(--text2); padding: 10px 8px 8px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.shots-table th.sortable { cursor: pointer; user-select: none; }
.shots-table th.sortable:hover, .shots-table th.on { color: var(--ink); }
.sort-arrow { margin-left: 4px; color: var(--accent); }
.stage-prog { color: var(--text3); font-size: 11.5px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.shots-table td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--text); }
.shots-table tbody tr:hover td { background: var(--surface); }
.shots-table tbody tr.hl td { background: var(--sel-soft); }
.shots-table th:first-child, .shots-table td:first-child { padding-left: 16px; }
.c-thumb { width: 130px; }
.c-code { width: 120px; }
.c-code .cell-input { width: 104px; }
.c-frames { width: 190px; }
.c-stage { min-width: 112px; }
.c-who { min-width: 150px; }
.c-upd { white-space: nowrap; }
.c-open { width: 44px; }
.thumb {
  width: 112px; height: 63px; overflow: hidden; background: var(--surface); cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: var(--text3);
}
.thumb:hover { outline: 1px solid var(--line2); color: var(--text2); }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.drop-on { outline: 2px dashed var(--sel) !important; outline-offset: 2px; }
.cell-input { background: transparent; border: 1px solid transparent; padding: 5px 7px; font-size: 13px; color: var(--text); }
.cell-input:hover:not([readonly]) { border-color: var(--line); }
.cell-input:focus { background: var(--bg); border-color: var(--accent); }
.cell-input.strong { font-weight: 700; color: var(--ink); }
.cell-input.num { width: 58px; text-align: center; padding: 5px 4px; font-variant-numeric: tabular-nums; }
.cell-select { width: auto; background: transparent; border-color: transparent; font-size: 13px; }
.cell-select:hover { border-color: var(--line); }
.frames-cell { display: flex; align-items: center; gap: 2px; }
.dur { margin-left: 6px; font-size: 12px; color: var(--text2); min-width: 30px; font-variant-numeric: tabular-nums; }
.who-btn { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 3px 8px 3px 3px; border-radius: var(--r); max-width: 180px; font-size: 13px; color: var(--text); }
button.who-btn { cursor: pointer; }
button.who-btn:hover { background: var(--surface2); }
.who-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ───── Панель шота ───── */
.shot-panel {
  position: fixed; top: 56px; right: 0; bottom: 0; width: 400px; max-width: 100vw; z-index: 40;
  background: var(--bg); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; transform: translateX(102%); transition: transform .16s ease;
}
.shot-panel.open { transform: none; }
.sp-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 8px 16px; }
.sp-code { flex: 1; font-size: 28px; line-height: 35px; font-weight: 700; color: var(--text); background: transparent; border-color: transparent; padding: 0 6px; margin-left: -6px; }
.sp-code:hover:not([readonly]) { border-color: var(--line); }
.sp-nav { display: flex; }
.sp-body { flex: 1; overflow: auto; padding: 8px 16px 20px; display: flex; flex-direction: column; gap: 22px; }
.sp-body section h4 { margin: 0 0 6px; padding-bottom: 4px; font-size: 12.5px; color: var(--text2); font-weight: 400; border-bottom: 1px solid var(--line); }
.sp-preview { aspect-ratio: 16 / 9; background: var(--surface); overflow: hidden; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sp-preview.empty { cursor: pointer; }
.sp-preview.empty:hover { outline: 1px solid var(--line2); }
.sp-preview img, .sp-preview video { width: 100%; height: 100%; object-fit: contain; display: block; }
.sp-preview img { cursor: zoom-in; }
.drop-hint { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--text2); text-align: center; padding: 12px; font-size: 13px; }
.sp-prev-actions { display: flex; gap: 6px; margin-top: -12px; flex-wrap: wrap; }
.sp-stages { display: flex; flex-direction: column; }
.sp-stage { display: flex; align-items: center; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--text); }
.sp-stage:last-child { border-bottom: 0; }
.sp-stage-name { font-weight: 700; }
.sp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.frames { display: flex; align-items: center; gap: 6px; }
.frames input { text-align: center; padding: 7px 4px; font-variant-numeric: tabular-nums; }
.sp-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }

/* ───── Доска ───── */
.board-canvas {
  position: absolute; inset: 0; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none;
  background-color: var(--bg); background-image: radial-gradient(circle, var(--dot) 1px, transparent 1.3px);
}
.board-canvas.space, .board-canvas.tool-hand { cursor: grab; }
.board-canvas.panning { cursor: grabbing; }
.board-canvas.tool-text { cursor: text; }
.board-canvas.dropping::after { content: ''; position: absolute; inset: 8px; border: 1px dashed var(--sel); pointer-events: none; background: var(--sel-soft); }
.world { position: absolute; left: 0; top: 0; transform-origin: 0 0; --iz: 1; }
.bi { position: absolute; left: 0; top: 0; }
.bi.sel { outline: calc(1.5px * var(--iz)) solid var(--sel); outline-offset: calc(4px * var(--iz)); }
.bi.hl { outline: calc(2px * var(--iz)) solid var(--sel); outline-offset: calc(4px * var(--iz)); }
.rz {
  display: none; position: absolute; right: calc(-10px * var(--iz)); bottom: calc(-10px * var(--iz));
  width: calc(11px * var(--iz)); height: calc(11px * var(--iz)); background: var(--bg);
  border: calc(1.5px * var(--iz)) solid var(--sel); cursor: nwse-resize; z-index: 2;
}
.bi.single .rz { display: block; }
.space .rz, .tool-hand .rz { cursor: inherit; }

.bi-media { background: var(--surface); }
.bi-media img, .bi-media video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.vid-badge {
  position: absolute; left: 8px; top: 8px; font-size: 11px; color: #fff; background: rgba(0, 0, 0, .55);
  padding: 2px 6px; border-radius: 2px; pointer-events: none; transition: opacity .15s;
}
.bi-media:hover .vid-badge { opacity: 0; }

.bi-text .txt {
  color: var(--tc); white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; outline: none;
  padding: 4px 6px; min-height: 1.35em; line-height: 1.3;
}
.bi-text.size-s .txt { font-size: 14px; }
.bi-text.size-m .txt { font-size: 18px; }
.bi-text.size-l .txt { font-size: 28px; line-height: 1.25; font-weight: 700; }
.bi-text.size-xl .txt { font-size: 48px; line-height: 1.1; font-weight: 700; }
.bi-text.bold .txt { font-weight: 700; }
.bi-text.note .txt { background: var(--notebg); padding: 14px 16px; min-height: 90px; }
.bi-text .txt[data-empty="1"]::before { content: 'Текст'; color: var(--text3); }
.bi-text.editing .txt { cursor: text; user-select: text; -webkit-user-select: text; box-shadow: 0 0 0 calc(1px * var(--iz)) var(--sel); }

/* Список с чекбоксами */
.bi-list { background: var(--card); border-radius: 4px; box-shadow: 0 0 0 1px var(--line); padding: 12px 12px 10px; font-size: 14px; color: var(--ink); }
.ls-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.ls-title { flex: 1; min-width: 0; font-size: 16px; font-weight: 700; outline: none; word-break: break-word; min-height: 1.25em; line-height: 1.25; }
.ls-title[data-empty="1"]::before { content: 'Список'; color: var(--text3); }
.ls-count { font-size: 12px; font-weight: 700; color: var(--text2); font-variant-numeric: tabular-nums; }
.ls-count.all { color: var(--accent); }
.ls-bar { height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; margin-bottom: 8px; }
.ls-bar span { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.ls-rows { display: flex; flex-direction: column; }
.ls-row { display: flex; align-items: flex-start; gap: 8px; padding: 4px 0; border-radius: 3px; position: relative; }
.ls-box {
  width: 18px; height: 18px; margin-top: 1px; flex-shrink: 0; border-radius: 4px; border: 1.5px solid var(--line2); background: var(--bg);
  display: inline-flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; color: #fff;
}
button.ls-box:hover { border-color: var(--accent); }
.ls-box.on { background: var(--accent); border-color: var(--accent); }
.ls-text { flex: 1; min-width: 0; outline: none; line-height: 1.35; word-break: break-word; min-height: 1.35em; }
.ls-text[data-empty="1"]::before { content: 'Пункт'; color: var(--text3); }
.ls-row.done .ls-text { color: var(--text3); text-decoration: line-through; }
.ls-text.editing, .ls-title.editing { cursor: text; user-select: text; -webkit-user-select: text; box-shadow: 0 0 0 calc(1px * var(--iz)) var(--sel); border-radius: 2px; text-decoration: none; color: var(--ink); }
.ls-del { opacity: 0; border: 0; background: transparent; color: var(--text3); width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; border-radius: 3px; cursor: pointer; flex-shrink: 0; }
.ls-row:hover .ls-del { opacity: 1; }
.ls-del:hover { color: var(--red); background: var(--surface2); }
.ls-add { margin-top: 4px; border: 0; background: transparent; color: var(--text2); font-size: 13px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 2px; cursor: pointer; border-radius: 3px; }
.ls-add:hover { color: var(--ink); }

/* Карточка шота — как блок на Are.na: картинка, подпись снизу */
.shot-card { background: var(--card); border-radius: 4px; padding: 8px; box-shadow: 0 0 0 1px var(--line); }
.sc-prev { aspect-ratio: 16 / 9; background: var(--surface2); overflow: hidden; border-radius: 2px; }
.sc-prev img, .sc-prev video { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.sc-ph { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--text3); font-size: 12px; }
.sc-ph .mono { font-size: 28px; font-weight: 700; color: var(--line2); }
.sc-info { padding: 10px 4px 2px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.sc-row { display: flex; align-items: center; justify-content: center; gap: 8px; }
.sc-code { font-size: 15px; font-weight: 700; color: var(--ink); }
.sc-who { display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; color: var(--text3); }
.sc-who:hover .avatar { box-shadow: 0 0 0 2px var(--accent); }
.sc-who.empty { width: 22px; height: 22px; border: 1px dashed var(--line2); opacity: 0; transition: opacity .1s; }
.shot-card:hover .sc-who.empty, .sc-who.empty:focus-visible { opacity: 1; }
.sc-who.empty:hover { border-color: var(--accent); color: var(--accent); }
.sc-desc { color: var(--text2); font-size: 13px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sc-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-top: 2px; }
.chip {
  font-size: 11.5px; font-weight: 700; padding: 3px 6px; border-radius: 2px; line-height: 1.2; border: 0;
  background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--text);
}
button.chip { cursor: pointer; }
button.chip:hover { box-shadow: inset 0 0 0 1px var(--line2); }
.chip.empty { background: transparent; color: var(--text2); font-weight: 400; box-shadow: inset 0 0 0 1px var(--line2); }
.sc-bar { height: 3px; background: var(--line); overflow: hidden; margin: 10px 0 0; border-radius: 3px; }
.sc-bar span { display: block; height: 100%; background: var(--accent); }
.shot-card.drop-on { outline: calc(2px * var(--iz)) dashed var(--sel) !important; }

.marquee { position: absolute; display: none; border: 1px solid var(--sel); background: var(--sel-soft); pointer-events: none; z-index: 10; }
.board-tools {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 20; display: flex; align-items: center;
  gap: 2px; padding: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow);
  max-width: calc(100vw - 24px); overflow-x: auto;
}
.tb-btn {
  min-width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border: 0;
  background: transparent; border-radius: var(--r); cursor: pointer; color: var(--text2); font-weight: 700; font-size: 12.5px; flex-shrink: 0;
}
.tb-btn:hover { background: var(--surface); color: var(--ink); }
.tb-btn.on { background: var(--accent-soft); color: var(--accent); }
.tb-btn:disabled { opacity: .3; cursor: default; background: transparent; }
.zoom-btn { padding: 0 8px; min-width: 54px; font-variant-numeric: tabular-nums; }
.tb-sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; flex-shrink: 0; }
.board-hint { position: absolute; left: 16px; bottom: 24px; color: var(--text3); font-size: 12px; pointer-events: none; z-index: 5; }
.board-empty { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); text-align: center; color: var(--text2); pointer-events: none; max-width: 420px; padding: 0 20px; font-size: 13px; }
.board-empty h3 { color: var(--text); margin: 0 0 6px; font-size: 16px; }
.ctx-bar {
  position: absolute; left: 0; top: 0; z-index: 25; display: none; align-items: center; gap: 2px; padding: 4px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow);
}
.ctx-bar.show { display: flex; }
.cb-group { display: flex; align-items: center; gap: 2px; }
.cb-group + .cb-group, .cb-btn + .cb-group, .cb-group + .cb-btn { padding-left: 5px; margin-left: 3px; border-left: 1px solid var(--line); }
.cb-btn {
  height: 28px; min-width: 28px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; background: transparent; border-radius: var(--r); cursor: pointer; font-size: 12.5px; font-weight: 700; color: var(--text2);
}
.cb-btn.text { padding: 0 8px; color: var(--text); }
.cb-btn:hover { background: var(--surface); color: var(--ink); }
.cb-btn.on { background: var(--accent-soft); color: var(--accent); }
.cb-btn.danger:hover { color: var(--red); }
.cb-swatch { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--bg); box-shadow: 0 0 0 1px var(--line2); cursor: pointer; padding: 0; margin: 0 1px; }
.cb-swatch.note { border-radius: 2px; }
.cb-swatch.none { background: linear-gradient(135deg, transparent 45%, var(--red) 45% 55%, transparent 55%) !important; }
.cb-swatch.on { box-shadow: 0 0 0 1.5px var(--ink); }

/* ───── Аниматик ───── */
.anim-band { flex-shrink: 0; padding: 4px 16px 10px; }
.anim-band.empty { padding: 4px 16px 0; }
.anim-add { width: 100%; height: 38px; border: 1px dashed var(--line2); border-radius: var(--r); background: transparent; color: var(--text2); font-size: 12.5px; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; }
.anim-add:hover { color: var(--ink); border-color: var(--accent); }
.anim-bar { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.anim-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink); }
.anim-tag .ic { color: var(--accent); }
.anim-body { background: var(--surface); border-radius: 4px; overflow: hidden; display: flex; justify-content: center; }
.anim-body video, .anim-body img { display: block; max-width: 100%; height: min(34vh, 360px); object-fit: contain; background: #000; }
.anim-band.collapsed .anim-body { display: none; }
.anim-band.collapsed .anim-bar { margin-bottom: 0; }
.anim-card { background: var(--card); border-radius: 4px; padding: 10px; box-shadow: 0 0 0 1px var(--line); }
.anim-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.anim-hint { font-size: 11.5px; color: var(--text3); }
.anim-media { aspect-ratio: 16 / 9; background: #000; overflow: hidden; border-radius: 2px; }
.anim-media video, .anim-media img { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.anim-field { display: flex; align-items: center; gap: 10px; }
.anim-field.drop-on { outline-offset: 4px; }
.anim-drop { flex: 1; height: 44px; border: 1px dashed var(--line2); border-radius: var(--r); background: var(--surface); color: var(--text2); font-size: 13px; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; }
.anim-drop:hover { color: var(--ink); border-color: var(--accent); }
.anim-thumb { width: 96px; height: 54px; background: var(--surface2); border-radius: 3px; overflow: hidden; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: var(--text2); }
.anim-thumb video, .anim-thumb img { width: 100%; height: 100%; object-fit: cover; }
.anim-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--ink); }
.anim-info b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ───── Версии ───── */
.sp-preview { position: relative; }
.sp-ver-tab {
  position: absolute; top: 8px; right: 8px; z-index: 2; display: flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px 0 6px;
  border: 0; border-radius: var(--r); background: rgba(0, 0, 0, .62); color: #fff; font-size: 12px; cursor: pointer; backdrop-filter: blur(4px);
}
.sp-ver-tab span { opacity: .7; }
.sp-ver-tab:hover, .sp-ver-tab.on { background: var(--accent); color: #fff; }
.sp-gallery {
  position: fixed; top: 56px; right: 400px; bottom: 0; width: 230px; z-index: 39; background: var(--bg);
  border-left: 1px solid var(--line); display: flex; flex-direction: column;
  transform: translateX(calc(100% + 400px)); transition: transform .18s ease; box-shadow: -12px 0 30px rgba(0, 0, 0, .18);
}
.sp-gallery.open { transform: none; }
.sp-gallery.drop-on { outline-offset: -6px; }
.gal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 8px 8px 14px; font-size: 13px; color: var(--text); }
.gal-add { margin: 0 10px 8px; height: 30px; border: 1px dashed var(--line2); border-radius: var(--r); background: transparent; color: var(--text2); font-size: 12px; display: flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; }
.gal-add:hover { color: var(--ink); border-color: var(--accent); }
.gal-list { flex: 1; overflow: auto; padding: 0 10px 16px; display: flex; flex-direction: column; gap: 10px; }
.gal-item { position: relative; cursor: pointer; border-radius: 4px; padding: 6px; background: var(--card); box-shadow: 0 0 0 1px var(--line); }
.gal-item:hover { box-shadow: 0 0 0 1px var(--line2); }
.gal-item.cur { box-shadow: 0 0 0 2px var(--accent); }
.gal-thumb { position: relative; aspect-ratio: 16 / 9; background: var(--surface2); overflow: hidden; border-radius: 2px; }
.gal-thumb img, .gal-thumb video { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.gal-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; padding: 6px 2px 0; font-size: 12.5px; color: var(--ink); }
.gal-cur { font-size: 11px; font-weight: 700; color: var(--accent); }
.gal-sub { width: 100%; font-size: 11.5px; color: var(--text2); }
.gal-del { position: absolute; top: 10px; right: 10px; background: rgba(0, 0, 0, .55); color: #fff; opacity: 0; }
.gal-item:hover .gal-del { opacity: 1; }
.gal-del:hover { background: var(--red); color: #fff; }
.sc-ver { position: absolute; top: 14px; right: 14px; font-size: 11px; font-weight: 700; color: #fff; background: rgba(0, 0, 0, .6); padding: 2px 6px; border-radius: 2px; pointer-events: none; }
@media (max-width: 760px) { .sp-gallery { right: 0; width: 100vw; z-index: 41; } }

/* ───── Таймлайн ───── */
#main.view-timeline { display: flex; flex-direction: column; }
.tl-legend { display: flex; gap: 14px; font-size: 12px; color: var(--text2); }
.tl-legend span { display: flex; align-items: center; gap: 6px; }
.lg-bar { width: 18px; height: 8px; border-radius: 2px; background: var(--accent); display: inline-block; }
.lg-bar.done { background: var(--text3); }
.lg-bar.late { background: var(--red); }
.lg-ms { width: 8px; height: 8px; background: var(--ink); transform: rotate(45deg); display: inline-block; }
.tb-summary.late { color: var(--red); font-weight: 700; }
.tl-scroll { flex: 1; min-height: 0; overflow: auto; position: relative; border-top: 1px solid var(--line); }
.tl-inner { position: relative; min-height: 100%; }
.tl-head { position: sticky; top: 0; z-index: 6; display: flex; background: var(--bg); border-bottom: 1px solid var(--line); height: 52px; }
.tl-label {
  position: sticky; left: 0; z-index: 4; width: 260px; flex-shrink: 0; background: var(--bg); border-right: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px; padding: 0 12px 0 16px; min-width: 0;
}
.tl-corner { z-index: 7; }
.tl-scale { position: relative; flex-shrink: 0; }
.tl-months { position: absolute; left: 0; right: 0; top: 0; height: 24px; }
.tl-month { position: absolute; top: 6px; padding-left: 6px; font-size: 12.5px; font-weight: 700; color: var(--text); white-space: nowrap; border-left: 1px solid var(--line2); line-height: 16px; text-transform: capitalize; }
.tl-days { position: absolute; left: 0; right: 0; top: 26px; height: 26px; }
.tl-day { position: absolute; top: 0; height: 26px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11.5px; color: var(--text2); line-height: 1.05; }
.tl-day small { font-size: 9.5px; color: var(--text3); }
.tl-day.we { background: var(--we); }
.tl-day.we span { color: var(--text3); }
.tl-day.today span { background: var(--accent); color: #fff; border-radius: 3px; padding: 0 4px; font-weight: 700; }
.tl-day.wk { align-items: flex-start; padding-left: 4px; }
.tl-body { position: relative; }
.tl-bg { position: absolute; top: 0; pointer-events: none; z-index: 0; }
.tl-we { position: absolute; top: 0; bottom: 0; background: var(--we); }
.lg-we { width: 14px; height: 10px; background: var(--we); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--we) 100%, var(--line2)); display: inline-block; }
.tl-vline { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.tl-vline.month { background: var(--line2); }
.tl-today { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--accent); z-index: 2; }
.tl-today span { position: absolute; top: 2px; left: 4px; font-size: 10px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.tl-pdl { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px dashed var(--red); opacity: .55; }
.tl-row { position: relative; display: flex; height: 46px; border-bottom: 1px solid var(--line); }
.tl-row:hover .tl-label, .tl-row.hl .tl-label { background: var(--surface); }
.tl-row.hl .tl-track { background: var(--sel-soft); }
.tl-row .tl-label { cursor: pointer; }
.tl-project { height: 54px; }
.tl-project .tl-label { cursor: default; }
.tl-thumb { width: 44px; height: 25px; background: var(--surface); flex-shrink: 0; overflow: hidden; border-radius: 2px; }
.tl-thumb img, .tl-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.tl-name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.tl-name b { font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-sub { font-size: 11.5px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-sub.late { color: var(--red); font-weight: 700; }
.tl-track { position: relative; flex-shrink: 0; z-index: 1; }
.tl-track.empty-edit { cursor: crosshair; }
.tl-bar {
  position: absolute; top: 11px; height: 24px; border-radius: 3px; background: color-mix(in srgb, var(--accent) 30%, var(--bg));
  overflow: hidden; display: flex; align-items: center; cursor: pointer; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent);
}
.tl-project .tl-bar { top: 13px; height: 28px; background: color-mix(in srgb, var(--ink) 14%, var(--bg)); box-shadow: inset 0 0 0 1px var(--line2); }
.tl-project .tl-fill { background: color-mix(in srgb, var(--ink) 30%, transparent); }
.tl-bar.edit { cursor: grab; }
.tl-dragging, .tl-dragging * { cursor: grabbing !important; user-select: none; }
.tl-fill { position: absolute; left: 0; top: 0; bottom: 0; background: color-mix(in srgb, var(--accent) 55%, transparent); }
.tl-bar.done { background: var(--surface2); box-shadow: inset 0 0 0 1px var(--line2); }
.tl-bar.done .tl-fill { background: color-mix(in srgb, var(--text3) 45%, transparent); }
.tl-bar.late { background: color-mix(in srgb, var(--red) 22%, var(--bg)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 60%, transparent); }
.tl-bar.late .tl-fill { background: color-mix(in srgb, var(--red) 45%, transparent); }
.tl-bar.ghost { background: var(--sel-soft); box-shadow: inset 0 0 0 1px var(--accent); pointer-events: none; }
.tl-bar-text { position: relative; padding: 0 8px; font-size: 11.5px; font-weight: 700; color: var(--ink); white-space: nowrap; pointer-events: none; }
.tl-h { position: absolute; top: 0; bottom: 0; width: 8px; cursor: ew-resize; z-index: 2; }
.tl-h.l { left: 0; } .tl-h.r { right: 0; }
.tl-bar.edit:hover .tl-h { background: color-mix(in srgb, var(--ink) 18%, transparent); }
.tl-ms { position: absolute; top: 15px; height: 16px; display: flex; align-items: center; gap: 8px; cursor: pointer; transform: translateX(-8px); white-space: nowrap; }
.tl-project .tl-ms { top: 19px; }
.tl-ms i { width: 12px; height: 12px; margin: 0 2px; background: var(--ink); transform: rotate(45deg); border-radius: 2px; flex-shrink: 0; }
.tl-ms.late i { background: var(--red); }
.tl-ms.done i { background: var(--text3); }
.tl-ms.start i { background: transparent; border: 2px solid var(--text3); }
.tl-ms span { font-size: 11.5px; font-weight: 700; color: var(--text2); }
.tl-ms.edit { cursor: grab; }
.tl-empty { padding: 40px 16px; color: var(--text2); font-size: 13px; position: sticky; left: 0; }
.tl-tip { position: fixed; left: 0; top: 0; z-index: 400; display: none; pointer-events: none; background: var(--ink); color: var(--bg); font-size: 12px; font-weight: 700; padding: 5px 8px; border-radius: 3px; white-space: nowrap; }

/* сроки в таблице и панели */
.c-dl { white-space: nowrap; min-width: 130px; }
.c-dl input { width: 128px; font-size: 12.5px; }
.c-dl.late input { color: var(--red); font-weight: 700; }
.dl-note { font-size: 12px; color: var(--text2); }
.dl-note.late { color: var(--red); font-weight: 700; }
.dates { display: flex; align-items: center; gap: 6px; }
.dates input { font-size: 13px; }
.proj-meta .late { color: var(--red); font-weight: 700; }

/* ───── Импорт видео ───── */
.import-drop {
  border: 1px dashed var(--line2); padding: 22px 16px; display: flex; flex-direction: column;
  align-items: center; gap: 6px; text-align: center; color: var(--text2); font-size: 12.5px; background: var(--surface);
}
.import-drop.drop-on { border-color: var(--sel); background: var(--sel-soft); outline: none !important; }
.import-drop-title { color: var(--text); font-weight: 700; font-size: 14px; }
.import-drop .btn { margin-top: 6px; background: var(--bg); }
.import-list { display: flex; flex-direction: column; max-height: 300px; overflow: auto; border-top: 1px solid var(--line); }
.import-list:empty { display: none; }
.import-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 70px 170px 26px; align-items: center; gap: 8px; padding: 4px 2px; border-bottom: 1px solid var(--line); }
.import-row:hover { background: var(--surface); }
.import-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--text); }
.import-code { padding: 4px 6px; text-align: center; font-weight: 700; font-size: 13px; }
.import-note { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.import-note.new { color: var(--green); }
.import-note.upd { color: var(--accent); }
.import-note.skip { color: var(--text3); }
.import-opts { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--text); }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.import-progress { font-size: 12.5px; font-weight: 700; color: var(--text); }
.import-progress:empty { display: none; }
.modal.busy .modal-actions .btn, .modal.busy .import-row .icon-btn { pointer-events: none; opacity: .45; }
.or-sep { display: flex; align-items: center; gap: 10px; color: var(--text3); font-size: 12.5px; }
.or-sep::before, .or-sep::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.bulk-preview { background: var(--surface); padding: 10px 12px; border-radius: var(--r); font-size: 12.5px; color: var(--text2); font-variant-numeric: tabular-nums; }

/* ───── Узкие экраны ───── */
@media (max-width: 760px) {
  .logo-text, .hide-sm, .seg a > span:not(.ic) { display: none; }
  #topbar { gap: 8px; padding: 0 10px; }
  .crumbs { font-size: 14px; }
  .row-2, .row-3, .row-name, .sp-grid { grid-template-columns: 1fr; }
  .import-row { grid-template-columns: minmax(0, 1fr) 64px 26px; }
  .import-row > .muted, .import-note { display: none; }
  .search-input { width: 120px; }
  .board-hint { display: none; }
  .tl-legend { display: none; }
  .page { padding: 20px 16px 40px; }
  .proj-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 12px; }
  .shot-panel { width: 100vw; }
  .board-tools { bottom: max(12px, env(safe-area-inset-bottom)); }
  #toasts { left: 12px; right: 12px; align-items: stretch; }
}
.tl-corner-text { font-size: 12.5px; font-weight: 700; color: var(--text); align-self: flex-start; padding-top: 6px; text-transform: capitalize; }

/* ───── Цвет исполнителя ───── */
.shots-table tbody tr.tinted td { background: color-mix(in srgb, var(--uc) 9%, transparent); }
.shots-table tbody tr.tinted td:first-child { box-shadow: inset 4px 0 0 var(--uc); }
.shots-table tbody tr.tinted:hover td { background: color-mix(in srgb, var(--uc) 15%, transparent); }
.shots-table tbody tr.tinted.hl td { background: color-mix(in srgb, var(--uc) 22%, transparent); }
.shot-card.tinted { background: color-mix(in srgb, var(--uc) 16%, var(--card)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--uc) 45%, transparent); }
.shot-card.tinted::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px; border-radius: 4px 4px 0 0; background: var(--uc); }
.tl-row[data-shot].tinted .tl-label { box-shadow: inset 4px 0 0 var(--uc); }
.av-btn { border: 0; background: none; padding: 0; border-radius: 50%; cursor: pointer; display: flex; }
.av-btn:hover { box-shadow: 0 0 0 2px var(--accent); }
.color-grid { display: grid; grid-template-columns: repeat(6, 26px); gap: 6px; padding: 6px 10px 10px; }
.color-sw { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--bg); box-shadow: 0 0 0 1px var(--line2); cursor: pointer; padding: 0; }
.color-sw.on { box-shadow: 0 0 0 2px var(--ink); }
.color-sw:hover { transform: scale(1.1); }

/* ───── Ревью-плеер ───── */
.review { position: fixed; inset: 0; z-index: 260; background: #0b0b0c; color: #ececec; display: flex; flex-direction: column; --rv-line: #262628; }
.rv-top { display: flex; align-items: center; gap: 12px; height: 52px; padding: 0 10px 0 16px; border-bottom: 1px solid var(--rv-line); flex-shrink: 0; }
.rv-top .icon-btn { color: #bbb; } .rv-top .icon-btn:hover { background: #222; color: #fff; }
.rv-title { font-size: 18px; }
.rv-ver, .rv-fps { width: auto; height: 30px; padding: 0 8px; font-size: 12.5px; font-weight: 700; background: #1a1a1c; color: #eee; border-color: #2c2c2f; }
.rv-hint { font-size: 12px; color: #77777c; }
.rv-main { flex: 1; min-height: 0; display: flex; }
.rv-left { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rv-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 16px; }
.rv-frame { position: relative; background: #000; box-shadow: 0 0 0 1px #222; }
.rv-media, .rv-media video, .rv-media img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: contain; }
.rv-canvas { position: absolute; inset: 0; cursor: crosshair; touch-action: none; }
.rv-canvas.erasing { cursor: cell; }
.rv-controls { flex-shrink: 0; padding: 8px 16px 14px; display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--rv-line); }
.rv-row { display: flex; align-items: center; gap: 6px; }
.rv-btn { min-width: 34px; height: 32px; border: 0; border-radius: 4px; background: #1c1c1f; color: #eee; font-size: 13px; cursor: pointer; }
.rv-btn:hover { background: #2a2a2e; }
.rv-btn.big { min-width: 48px; background: var(--accent); color: #000; font-weight: 700; }
.rv-counter { margin-left: 10px; font-size: 14px; color: #aaa; font-variant-numeric: tabular-nums; }
.rv-counter b { color: #fff; }
.rv-abs { color: #77777c; }
.rv-scrub { position: relative; height: 26px; border-radius: 4px; background: #1a1a1c; cursor: pointer; overflow: hidden; }
.rv-scrub-fill { position: absolute; left: 0; top: 0; bottom: 0; background: color-mix(in srgb, var(--accent) 22%, transparent); pointer-events: none; }
.rv-head { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--accent); pointer-events: none; }
.rv-marks { position: absolute; inset: 0; pointer-events: none; }
.rv-marks i { position: absolute; top: 4px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: #ffcc00; }
.rv-marks i.note { background: #8a8a90; top: 16px; }
.rv-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rv-tools .tb-sep { background: #2c2c2f; }
.rv-tool { height: 32px; padding: 0 10px; display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 4px; background: #1c1c1f; color: #ddd; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.rv-tool:hover { background: #2a2a2e; color: #fff; }
.rv-tool.on { background: var(--accent); color: #000; }
.rv-color { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #0b0b0c; box-shadow: 0 0 0 1px #444; cursor: pointer; padding: 0; }
.rv-color.on { box-shadow: 0 0 0 2px #fff; }
.rv-size { width: 110px; padding: 0; accent-color: var(--accent); border: 0; background: transparent; }
.rv-size-dot { display: inline-block; border-radius: 50%; border: 1px solid #555; min-width: 3px; min-height: 3px; }
.rv-onion { display: inline-flex; align-items: center; gap: 5px; }
.rv-onion-n { width: auto; height: 30px; padding: 0 6px; font-size: 12.5px; font-weight: 700; background: #1a1a1c; color: #eee; border-color: #2c2c2f; }
.rv-onion-lbl { font-size: 12px; color: #9a9aa0; }
.rv-onion-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.rv-side { width: 320px; flex-shrink: 0; border-left: 1px solid var(--rv-line); display: flex; flex-direction: column; background: #101012; }
.rv-side-head { display: flex; align-items: baseline; justify-content: space-between; padding: 14px 14px 10px; font-size: 13px; }
.rv-notes { flex: 1; overflow: auto; padding: 0 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.rv-note { background: #18181b; border-radius: 6px; padding: 8px; box-shadow: 0 0 0 1px #232326; }
.rv-note.cur { box-shadow: 0 0 0 2px var(--accent); }
.rv-note-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.rv-note-frame { border: 0; background: transparent; color: #fff; font-weight: 700; font-size: 13px; padding: 0; cursor: pointer; font-variant-numeric: tabular-nums; }
.rv-note-frame:hover { color: var(--accent); }
.rv-note-draw { color: #ffcc00; display: inline-flex; }
.rv-note-who { margin-left: auto; font-size: 11.5px; color: #77777c; }
.rv-note .icon-btn { color: #888; } .rv-note .icon-btn:hover { background: #2a2a2e; color: #ff6b6b; }
.rv-note textarea { background: #0f0f11; border-color: #2a2a2d; color: #eee; font-size: 13px; resize: none; overflow: hidden; min-height: 0; line-height: 1.4; }
.review.still .rv-controls .rv-row, .review.still .rv-scrub { display: none; }
.gal-rv { margin-left: auto; border: 0; background: var(--surface2); color: var(--text); font-size: 11.5px; font-weight: 700; border-radius: 3px; padding: 2px 6px; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.gal-rv:hover { background: var(--accent); color: #fff; }
@media (max-width: 900px) { .rv-side { display: none; } .rv-hint { display: none; } }

/* ───── Фильтр по исполнителю ───── */
.ass-slot { display: contents; }
.tool-select.active { box-shadow: inset 0 0 0 1px var(--accent); }
.board-filter { position: absolute; left: 16px; top: 12px; z-index: 20; display: flex; align-items: center; gap: 8px; padding: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.board-filter .tool-select { height: 28px; }
.bf-count { font-size: 12px; color: var(--text2); padding: 0 2px; }
.shot-card.dim { opacity: .14; filter: grayscale(1); }
.shot-card.dim:hover { opacity: .5; }
.tl-group { display: flex; height: 30px; border-bottom: 1px solid var(--line); background: var(--surface); position: relative; z-index: 3; }
.tl-group .tl-label { background: var(--surface); gap: 8px; font-size: 12.5px; color: var(--ink); box-shadow: inset 4px 0 0 var(--uc, transparent); }

/* ───── Ревью: списки и вложения в заметках ───── */
.rv-todos { display: flex; flex-direction: column; margin-top: 6px; }
.rv-todo { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.rv-todo .ls-box { background: #0f0f11; border-color: #3a3a3e; width: 17px; height: 17px; margin: 0; }
.rv-todo .ls-box.on { background: var(--accent); border-color: var(--accent); }
.rv-todo-text { flex: 1; min-width: 0; border: 0; background: transparent; color: #eee; padding: 3px 2px; font-size: 13px; box-shadow: none !important; }
.rv-todo-text:focus { background: #0f0f11; }
.rv-todo-text.done { color: #6c6c70; text-decoration: line-through; }
.rv-todo-del { opacity: 0; border: 0; background: transparent; color: #777; width: 20px; height: 20px; border-radius: 3px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.rv-todo:hover .rv-todo-del { opacity: 1; }
.rv-todo-del:hover { color: #ff6b6b; background: #2a2a2e; }
.rv-note-todo { font-size: 11.5px; font-weight: 700; color: #aaa; }
.rv-note-todo.all { color: var(--accent); }
.rv-atts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.rv-att { position: relative; aspect-ratio: 1; border-radius: 4px; overflow: hidden; background: #000; cursor: zoom-in; box-shadow: 0 0 0 1px #2a2a2d; }
.rv-att img, .rv-att video { width: 100%; height: 100%; object-fit: cover; display: block; }
.rv-att .vid-badge { left: 4px; top: 4px; }
.rv-att-del { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border: 0; border-radius: 3px; background: rgba(0,0,0,.65); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; }
.rv-att:hover .rv-att-del { opacity: 1; }
.rv-att-del:hover { background: #ff3b30; }
.rv-note-actions { display: flex; gap: 6px; margin-top: 8px; }
.rv-mini { height: 26px; padding: 0 8px; border: 0; border-radius: 4px; background: #1f1f23; color: #bbb; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.rv-mini:hover { background: #2a2a2e; color: #fff; }
.rv-note.drop-on { outline: 2px dashed var(--accent) !important; outline-offset: 2px; }

/* ───── Telegram: статус связи и прокси ───── */
.tg-status { font-size: 13px; line-height: 1.4; padding: 9px 12px; border-radius: 4px; background: var(--surface2); color: var(--text2); }
.tg-status.ok { color: var(--accent); background: var(--accent-soft); }
.tg-status.bad { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }
.tg-net { border-top: 1px solid var(--line); padding-top: 10px; }
.tg-net summary { cursor: pointer; font-weight: 700; font-size: 13px; margin-bottom: 8px; }
.tg-net .field { margin-top: 10px; }

/* ───── Оплата за секунду анимации ───── */
.pay-box .check { font-weight: 700; }
.pay-fields { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; margin-top: 10px; }
.pay-fields[hidden] { display: none; }
.pay-f { display: flex; flex-direction: column; gap: 4px; width: 150px; }
.pay-fields .field-hint { flex-basis: 100%; }
.shots-table .c-pay { white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.shots-table th.c-pay { text-align: right; }
.btn .rub { font-weight: 700; font-size: 15px; line-height: 1; }
.pay-modal { display: flex; flex-direction: column; gap: 14px; }
.pay-block { border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; }
.pay-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pay-sum { display: flex; flex-direction: column; align-items: flex-end; }
.pay-sum b { font-size: 16px; }
.pay-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.pay-table td { padding: 5px 4px; border-top: 1px solid var(--line); }
.pay-table td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pay-table tr.acc td { color: var(--text); }
.pay-table .pay-ok { width: 20px; color: var(--accent); text-align: center; }
.pay-total { display: flex; align-items: baseline; gap: 12px; justify-content: flex-end; padding: 4px 2px; border-top: 2px solid var(--ink); }
.pay-total b { font-size: 18px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--ink); cursor: pointer; font-weight: 700; }
.link-btn:hover { color: var(--accent); text-decoration: underline; }
.pay-month { display: flex; align-items: center; gap: 8px; }
.pay-month b { font-size: 17px; min-width: 150px; text-align: center; }
.pay-month .muted { margin-left: auto; }
.pay-pending { border-top: 1px solid var(--line); padding-top: 10px; }
.pay-pending summary { cursor: pointer; font-weight: 700; font-size: 13px; color: var(--text2); }
.pay-pending .pay-block { margin-top: 10px; }
.pay-block.slim { padding: 8px 10px; }
/* Таймлайн: все проекты */
.tl-project.multi { border-top: 2px solid var(--line2); }
.tl-project.multi:first-of-type { border-top: 0; }
.tl-project .tl-label.tl-plink { cursor: pointer; }
.tl-project .tl-label.tl-plink:hover b { color: var(--accent); }
.tl-fold { flex: none; margin-left: -8px; margin-right: 2px; }
.tl-fold svg { transition: transform .12s; }
.tl-fold.folded svg { transform: rotate(-90deg); }
.tl-cnt { font-weight: 400; color: var(--text3); }
/* Настройки проекта: матрица уведомлений бота */
.notify-matrix table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.notify-matrix th { font-weight: 700; color: var(--text2); padding: 4px 6px; text-align: center; white-space: nowrap; }
.notify-matrix th .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }
.notify-matrix td { padding: 5px 6px; text-align: center; border-top: 1px solid var(--line); }
.notify-matrix td.nm { text-align: left; font-weight: 700; color: var(--ink); white-space: nowrap; }
.notify-matrix input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; }
.cascade-check { margin-top: 10px; }
