:root {
  --bg: #07070a;
  --screen: #000;
  --glass: rgba(255, 255, 255, .045);
  --glass-2: rgba(255, 255, 255, .08);
  --line: rgba(255, 255, 255, .1);
  --text: #f5f5f7;
  --muted: #9b9ba6;
  --blue: #0095f6;
  --grad: linear-gradient(45deg, #f9a03f, #f0522f 35%, #d62976 65%, #962fbf);
  --draft: #8e8e98;
  --review: #4aa8ff;
  --changes: #ffb340;
  --approved: #34d17b;
  --published: #b58cff;
  --rejected: #ff5a5f;
  --danger: #ff5a5f;
  --r: 14px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none;
  background:
    radial-gradient(600px 420px at 12% 8%, rgba(240, 82, 47, .2), transparent 70%),
    radial-gradient(640px 480px at 88% 92%, rgba(150, 47, 191, .2), transparent 70%);
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; display: block; }
svg.i.fill { fill: currentColor; stroke: none; }
.sm svg.i, svg.i.sm { width: 16px; height: 16px; }
::-webkit-scrollbar { width: 0; height: 0; }

/* ---------- каркас ---------- */
#app { position: relative; height: 100%; display: grid; grid-template-columns: 280px minmax(420px, 1fr) minmax(360px, 440px); gap: 20px; padding: 20px; }
#side, #detail {
  background: var(--glass); border: 1px solid var(--line); border-radius: 22px;
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  overflow-y: auto; min-height: 0;
}
#stage { display: flex; align-items: center; justify-content: center; min-height: 0; }
.phone {
  position: relative; width: 392px; height: min(860px, 100%); border-radius: 46px;
  background: var(--screen); border: 9px solid #1b1b20; box-shadow: 0 0 0 1px #2c2c33, 0 40px 80px rgba(0, 0, 0, .55);
  overflow: hidden;
}
.screen { height: 100%; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 96px; }

/* ---------- кнопки и мелочи ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: 10px; font-weight: 600; font-size: 13px;
  background: var(--glass-2); transition: background .15s, transform .15s var(--ease), opacity .15s; white-space: nowrap;
}
.btn:hover { background: rgba(255, 255, 255, .14); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:hover { background: #1aa1ff; }
.btn.grad { background: var(--grad); color: #fff; }
.btn.ok { background: rgba(52, 209, 123, .16); color: var(--approved); }
.btn.warn { background: rgba(255, 179, 64, .16); color: var(--changes); }
.btn.danger { color: var(--danger); }
.btn.bad { background: rgba(255, 90, 95, .14); color: var(--danger); }
.btn.bad:hover { background: rgba(255, 90, 95, .24); }
.btn.wide { flex: 1; }
.btn.big { height: 44px; font-size: 15px; border-radius: 12px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; transition: background .15s; }
.icon-btn:hover { background: var(--glass-2); }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 11.5px; font-weight: 600; background: var(--glass-2); white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.s-draft { --c: var(--draft); } .s-review { --c: var(--review); } .s-changes { --c: var(--changes); }
.s-approved { --c: var(--approved); } .s-published { --c: var(--published); } .s-rejected { --c: var(--rejected); }
.s-draft, .s-review, .s-changes, .s-approved, .s-published, .s-rejected { color: var(--c); }
.muted { color: var(--muted); }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }

/* ---------- боковая панель ---------- */
.m-head .brand-mark { width: 26px; height: 26px; }
#side { padding: 20px 16px; display: flex; flex-direction: column; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.brand-mark { width: 32px; height: 32px; flex: none; }
.logo { display: block; width: 100%; height: 100%; }
.logo .swirl, .logo .swirl ellipse { transform-box: view-box; transform-origin: 50% 50%; }
.logo .swirl { animation: swirl 16s linear infinite; }
.logo .b1 { animation: blob-a 5.5s ease-in-out infinite alternate; }
.logo .b2 { animation: blob-b 6.5s ease-in-out infinite alternate; }
.logo .b3 { animation: blob-a 7.5s ease-in-out infinite alternate-reverse; }
.logo .b4 { animation: blob-b 4.5s ease-in-out infinite alternate-reverse; }
@keyframes swirl { to { transform: rotate(360deg); } }
@keyframes blob-a { from { transform: translate(-3px, -2px) scale(.92); } to { transform: translate(5px, 4px) scale(1.16); } }
@keyframes blob-b { from { transform: translate(4px, -3px) scale(1.12); } to { transform: translate(-4px, 3px) scale(.9); } }
.brand b { display: block; font-size: 17px; font-weight: 700; }
.brand > .grow span { font-size: 12px; font-weight: 500; color: var(--muted); }
.role-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.role-card { display: grid; gap: 8px; justify-items: start; text-align: left; padding: 18px; border-radius: 16px; background: var(--glass); border: 1px solid var(--line); transition: all .2s var(--ease); }
.role-card:hover { border-color: rgba(255, 255, 255, .35); background: var(--glass-2); transform: translateY(-2px); }
.role-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--grad); color: #fff; }
.role-card b { font-size: 15px; font-weight: 600; }
.role-card span { font-size: 13px; color: var(--muted); line-height: 1.5; }
.rv-title { padding: 14px 16px 0; }
.rv-title b { display: block; font-size: 17px; font-weight: 700; }
.rv-title span { font-size: 13px; color: var(--muted); }
.bt-tools { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; padding: 12px; border-radius: 14px; background: var(--glass); border: 1px solid var(--line); }
.bt-tools .field { gap: 4px; }
.bt-tools .input { height: 36px; width: 148px; }
.bt-grid { display: grid; gap: 8px; }
.bt-card { display: flex; align-items: flex-start; gap: 10px; padding: 10px; border-radius: 14px; background: var(--glass); border: 1px solid var(--line); animation: rise .25s var(--ease) backwards; }
.bt-card.sel { border-color: rgba(0, 149, 246, .6); background: rgba(0, 149, 246, .08); }
.bt-card .thumb { position: relative; width: 62px; height: 78px; border-radius: 10px; overflow: hidden; background: #15151a; flex: none; display: block; }
.bt-card .thumb.round { height: 62px; border-radius: 50%; }
.bt-card .thumb img, .bt-card .thumb video { width: 100%; height: 100%; object-fit: cover; }
.bt-card .thumb .n { position: absolute; left: 4px; top: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; font-size: 11px; font-weight: 700; background: rgba(0, 0, 0, .7); display: grid; place-items: center; }
.bt-card .thumb .bar { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.bt-card .thumb .bar i { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--grad); }
.bt-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.bt-row .input { height: 34px; width: 132px; padding: 0 10px; }
.bt-card textarea.input { width: 100%; min-height: 78px; margin-top: 8px; }
.bt-card .cap { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; }
.seg.mini { padding: 2px; }
.seg.mini button { height: 30px; font-size: 12px; padding: 0 8px; gap: 4px; }
.seg.mini button svg.i { width: 14px; height: 14px; }
.side-title { font-size: 11.5px; font-weight: 600; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; margin: 0 6px 8px; }
.proj { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; text-align: left; transition: background .15s; }
.proj:hover { background: var(--glass); }
.proj.on { background: var(--glass-2); }
.proj .ava { width: 34px; height: 34px; font-size: 14px; }
.proj b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj span { font-size: 12px; color: var(--muted); }
.stat-list { display: grid; gap: 2px; }
.stat-row { width: 100%; display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 10px; font-size: 13px; text-align: left; transition: background .15s; }
.stat-row:hover { background: var(--glass-2); }
.stat-row > svg.i:last-child { color: var(--muted); opacity: 0; transform: translateX(-4px); transition: all .15s; }
.stat-row:hover > svg.i:last-child { opacity: 1; transform: none; }
.stat-row b { font-weight: 600; color: var(--text); }
.side-actions { display: grid; gap: 8px; margin-top: auto; }
.side-actions .btn { justify-content: flex-start; height: 40px; background: var(--glass); }
.side-actions .btn:hover { background: var(--glass-2); }
.side-actions .btn.accent { background: rgba(0, 149, 246, .16); color: #7cc4ff; }
.side-actions .btn.accent:hover { background: rgba(0, 149, 246, .26); }
.sync { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); padding: 0 6px; }
.sync i { width: 8px; height: 8px; border-radius: 50%; background: var(--changes); transition: background .3s; }
.sync.on i { background: var(--approved); box-shadow: 0 0 0 4px rgba(52, 209, 123, .15); }

/* ---------- экран профиля ---------- */
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 4px; padding: 14px 10px 8px 16px; background: rgba(0, 0, 0, .86); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.nav-back { margin-left: -8px; animation: rise .25s var(--ease); }
.back-editor { width: 100%; display: flex; align-items: center; gap: 8px; padding: 12px 16px; font-size: 13px; font-weight: 600; color: #7cc4ff; background: rgba(0, 149, 246, .14); transition: background .15s; }
.back-editor:hover { background: rgba(0, 149, 246, .24); }
.handle { display: flex; align-items: center; gap: 4px; font-size: 20px; font-weight: 700; letter-spacing: -.02em; min-width: 0; }
.handle span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile { display: flex; align-items: center; gap: 18px; padding: 8px 16px 0; }
.ava { width: 82px; height: 82px; border-radius: 50%; flex: none; background: var(--grad); display: grid; place-items: center; font-weight: 700; font-size: 30px; color: #fff; overflow: hidden; }
.ava img { width: 100%; height: 100%; object-fit: cover; }
.ava-ring { padding: 3px; border-radius: 50%; background: var(--grad); flex: none; }
.ava-ring .ava { border: 3px solid #000; }
.stats { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; }
.stats b { display: block; font-size: 17px; font-weight: 700; }
.stats span { font-size: 12px; color: var(--text); }
.bio { padding: 10px 16px 0; font-size: 13.5px; }
.bio b { display: block; font-weight: 600; }
.bio p { margin: 2px 0 0; white-space: pre-wrap; color: #e4e4ea; }
.actions { display: flex; gap: 6px; padding: 14px 16px 4px; }
.review-banner { margin: 12px 16px 0; padding: 10px 12px; border-radius: 12px; background: rgba(74, 168, 255, .12); color: #cfe6ff; font-size: 12.5px; }

.period { display: flex; align-items: center; gap: 4px; padding: 10px 16px 12px; }
.period-btn { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 12px; background: #121216; border: 1px solid #1f1f24; font-size: 13px; font-weight: 600; text-align: left; transition: border-color .15s, background .15s; }
.period-btn:hover { border-color: rgba(255, 255, 255, .3); }
.period-btn small { font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.period-btn.on { background: rgba(0, 149, 246, .14); border-color: rgba(0, 149, 246, .5); }
.period-btn.on svg.i { color: var(--blue); }
.check { display: flex; align-items: center; gap: 10px; font-size: 13px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--blue); }
.stories { display: flex; gap: 12px; padding: 14px 16px 12px; overflow-x: auto; }
.story { flex: none; width: 68px; text-align: center; font-size: 11.5px; position: relative; }
.story .ring { width: 68px; height: 68px; border-radius: 50%; padding: 2.5px; background: var(--grad); margin-bottom: 4px; transition: transform .2s var(--ease); }
.story:hover .ring { transform: scale(1.05); }
.story .ring > div { width: 100%; height: 100%; border-radius: 50%; border: 3px solid #000; overflow: hidden; background: #1b1b20; display: grid; place-items: center; }
.story img, .story video { width: 100%; height: 100%; object-fit: cover; }
.story.add .ring { background: none; border: 1.5px dashed rgba(255, 255, 255, .35); }
.story .dot { position: absolute; top: 50px; right: 2px; width: 14px; height: 14px; border-radius: 50%; border: 3px solid #000; background: currentColor; }
.story.sel .ring { box-shadow: 0 0 0 2px #fff; }

.tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border-top: 1px solid #1f1f24; position: sticky; top: 58px; z-index: 4; background: #000; }
.tab { height: 46px; display: grid; place-items: center; color: #6f6f7a; border-bottom: 1.5px solid transparent; transition: color .15s; }
.tab.on { color: #fff; border-color: #fff; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.tile { position: relative; aspect-ratio: 4 / 5; background: #15151a; overflow: hidden; display: block; width: 100%; animation: pop .35s var(--ease) backwards; }
.grid.reels .tile { aspect-ratio: 9 / 16; }
.tile img, .tile video { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s var(--ease), filter .2s; }
.tile:hover img, .tile:hover video { transform: scale(1.04); }
.tile.sel::after { content: ""; position: absolute; inset: 0; border: 2.5px solid #fff; pointer-events: none; }
.tile.s-draft img, .tile.s-draft video { filter: saturate(.55) brightness(.8); }
.tile.s-rejected img, .tile.s-rejected video { filter: grayscale(.9) brightness(.55); }
.tile .shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, .62), transparent 38%, transparent 72%, rgba(0, 0, 0, .35)); pointer-events: none; }
.tile .date { position: absolute; left: 6px; bottom: 6px; color: #fff; font-size: 12px; font-weight: 700; line-height: 1.15; text-align: left; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.tile .date small { display: block; font-size: 10.5px; font-weight: 500; opacity: .85; }
.tile .kind { position: absolute; top: 6px; right: 6px; color: #fff; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .6)); }
.tile .kind svg.i { width: 18px; height: 18px; }
.tile .st { position: absolute; top: 8px; left: 8px; width: 10px; height: 10px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 2px rgba(0, 0, 0, .55); }
.tile .cm { position: absolute; right: 6px; bottom: 6px; display: flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 9px; background: var(--changes); color: #2b1a00; }
.tile .cm svg.i { width: 11px; height: 11px; stroke-width: 2.4; }
@keyframes pop { from { opacity: 0; transform: scale(.94); } }

.rv-progress { padding: 14px 16px; display: grid; gap: 10px; border-bottom: 1px solid #1f1f24; }
.rv-progress b { font-size: 15px; }
.rv-progress .bar { height: 5px; border-radius: 3px; background: #1f1f24; overflow: hidden; }
.rv-progress .bar i { display: block; height: 100%; border-radius: 3px; background: var(--approved); transition: width .5s var(--ease); }
.rv-progress .chip.on { --c: var(--review); }
.rv-card { padding-bottom: 18px; border-bottom: 1px solid #1f1f24; animation: rise .35s var(--ease) backwards; }
.rv-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.rv-head .ava { width: 34px; height: 34px; font-size: 13px; }
.rv-head b { display: block; font-size: 13.5px; font-weight: 600; }
.rv-head .grow span { font-size: 12px; color: var(--muted); }
.rv-card .car > * { max-height: none; }
.rv-body { padding: 10px 14px 0; display: grid; gap: 12px; }
.rv-body .dots { padding: 0; }
.rv-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.rv-actions .full { flex: 1 0 100%; }
.rv-progress small { font-weight: 500; font-size: 13px; color: var(--danger); white-space: nowrap; margin-left: 8px; }
.screen.no-fab { padding-bottom: 24px; }
.rv-card.is-rejected .rv-head { background: rgba(255, 90, 95, .07); }
.rv-card.is-rejected .media { opacity: .55; }
.rv-note { display: grid; gap: 8px; animation: rise .25s var(--ease); }
.rv-note textarea.input { min-height: 96px; }
.rv-more { justify-self: start; font-size: 13px; color: var(--muted); }
.rv-more:hover { color: var(--text); }
.rv-card.is-approved .rv-head, .rv-card.is-published .rv-head { background: rgba(52, 209, 123, .06); }
.rv-card.is-changes .rv-head { background: rgba(255, 179, 64, .06); }
.empty { padding: 56px 32px; text-align: center; color: var(--muted); }
.empty .ring-ico { width: 72px; height: 72px; border-radius: 50%; border: 1.5px solid #fff; color: #fff; display: grid; place-items: center; margin: 0 auto 16px; }
.empty .ring-ico svg.i { width: 32px; height: 32px; stroke-width: 1.3; }
.empty h3 { color: var(--text); font-size: 20px; margin: 0 0 6px; font-weight: 700; }
.empty p { margin: 0 0 18px; }

.feed-day { padding: 18px 16px 8px; font-weight: 700; font-size: 15px; display: flex; align-items: baseline; gap: 8px; }
.feed-day small { font-weight: 500; font-size: 12px; color: var(--muted); }
.feed-card { display: flex; gap: 12px; width: 100%; text-align: left; padding: 10px 16px; transition: background .15s; }
.feed-card:hover, .feed-card.sel { background: #101014; }
.feed-card .thumb { width: 72px; height: 90px; border-radius: 8px; overflow: hidden; background: #15151a; flex: none; position: relative; }
.feed-card .thumb.round { height: 72px; border-radius: 50%; }
.feed-card .thumb img, .feed-card .thumb video { width: 100%; height: 100%; object-fit: cover; }
.feed-card .meta { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; margin-bottom: 4px; flex-wrap: wrap; }
.feed-card p { margin: 0; font-size: 13px; color: #d5d5dc; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; }
.feed-card .note { margin-top: 6px; font-size: 12px; color: var(--changes); display: flex; gap: 5px; align-items: center; }

#fab:empty { display: none; }
#fab { position: absolute; left: 0; right: 0; bottom: 0; height: 92px; display: flex; align-items: center; justify-content: center; pointer-events: none; background: linear-gradient(to top, #000 30%, transparent); }
.fab { pointer-events: auto; width: 58px; height: 58px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 30px rgba(214, 41, 118, .45); transition: transform .2s var(--ease); }
.fab:hover { transform: scale(1.07) rotate(90deg); }
.fab svg.i { width: 28px; height: 28px; stroke-width: 2.2; }

/* ---------- карточка публикации ---------- */
#detail { display: flex; flex-direction: column; }
.d-head { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 8px; padding: 12px 12px 12px 16px; background: rgba(14, 14, 18, .82); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
.d-head h2 { display: flex; align-items: center; min-width: 0; margin: 0; font-size: 15px; font-weight: 700; white-space: nowrap; }
.d-head .d-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.d-head h2 .pcode { flex: none; }
.d-head > .pill, .d-head > .icon-btn { flex: none; }
.media { position: relative; background: #000; }
.car { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; }
.car > * { flex: none; width: 100%; scroll-snap-align: center; aspect-ratio: 4 / 5; max-height: 56vh; display: grid; place-items: center; background: #000; }
.media.tall .car > * { aspect-ratio: 9 / 16; }
.car img, .car video { width: 100%; height: 100%; object-fit: contain; display: block; }
.car-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border-radius: 50%; background: rgba(255, 255, 255, .85); color: #000; display: grid; place-items: center; }
.car-nav svg.i { width: 16px; height: 16px; stroke-width: 2.6; }
.car-nav.l { left: 10px; } .car-nav.r { right: 10px; }
.car-count { position: absolute; top: 12px; right: 12px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 12px; background: rgba(0, 0, 0, .65); }
.dots { display: flex; justify-content: center; gap: 4px; padding: 10px 0 0; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: #4a4a55; transition: background .2s, transform .2s; }
.dots i.on { background: var(--blue); transform: scale(1.2); }
.d-body { padding: 14px 16px 8px; display: grid; gap: 14px; }
.when { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r); background: var(--glass-2); }
.when b { display: block; font-size: 15px; font-weight: 700; }
.when span { font-size: 12px; color: var(--muted); }
.status-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 30px; padding: 0 12px; border-radius: 15px; font-size: 12.5px; font-weight: 600; background: var(--glass); border: 1px solid var(--line); color: var(--muted); transition: all .15s; }
.chip:hover { color: var(--text); }
.chip.on { background: var(--c, #fff); border-color: transparent; }
.chip.on span { color: #0b0b0f; }
.caption { font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.caption b { font-weight: 600; margin-right: 6px; }
.caption .tag { color: #8fc7ff; }
.sec-title { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.comments { display: grid; gap: 10px; }
.comment { display: flex; gap: 10px; animation: rise .3s var(--ease) backwards; }
.comment .who { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--glass-2); }
.comment.reviewer .who { background: var(--grad); color: #fff; }
.comment.bot .who { background: rgba(181, 140, 255, .25); color: var(--published); }
.comment .bubble { flex: 1; min-width: 0; padding: 9px 12px; border-radius: 4px 14px 14px 14px; background: var(--glass-2); }
.comment.reviewer .bubble { background: rgba(255, 179, 64, .12); }
.comment.done { opacity: .5; }
.comment.done .text { text-decoration: line-through; }
.comment .top { display: flex; align-items: baseline; gap: 8px; font-size: 12px; color: var(--muted); }
.comment .top b { color: var(--text); font-weight: 600; font-size: 13px; }
.comment .text { white-space: pre-wrap; word-break: break-word; margin-top: 2px; }
.comment .tools { display: flex; gap: 12px; margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.comment .tools button:hover { color: var(--text); }
.compose { position: sticky; bottom: 0; margin-top: auto; display: flex; gap: 8px; align-items: flex-end; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: rgba(14, 14, 18, .9); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
.compose textarea { flex: 1; resize: none; max-height: 120px; min-height: 40px; padding: 10px 14px; border-radius: 20px; border: 1px solid var(--line); background: var(--glass); outline: none; }
.compose textarea:focus { border-color: rgba(255, 255, 255, .3); }
.verdict { display: flex; gap: 8px; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 12px; padding: 16px; align-items: start; }
.bcard { display: flex; gap: 14px; padding: 14px; border-radius: 16px; background: var(--glass); border: 1px solid var(--line); animation: rise .3s var(--ease) backwards; }
.bcard .thumb { position: relative; width: 96px; height: 120px; border-radius: 10px; overflow: hidden; background: #15151a; flex: none; display: block; }
.bcard .thumb.round { height: 96px; border-radius: 50%; }
.bcard .thumb img, .bcard .thumb video { width: 100%; height: 100%; object-fit: cover; }
.bcard .thumb .kind { position: absolute; top: 6px; right: 6px; color: #fff; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .6)); }
.bcard .thumb .kind svg.i { width: 16px; height: 16px; }
.bcard .meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; margin-bottom: 6px; }
.bcard .cap { margin: 0 0 10px; font-size: 13px; color: #d5d5dc; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bcard .comments { gap: 8px; }
.bcard .row { flex-wrap: wrap; }
.bcard > .grow { min-width: 0; }
.bcard .comment .who { width: 26px; height: 26px; font-size: 11px; }
.agenda { padding: 8px; }
.agenda-head { padding: 12px 10px 4px; }
.agenda-head h2 { margin: 0 0 2px; font-size: 17px; }
.agenda .feed-day { padding: 16px 10px 6px; font-size: 13.5px; }
.agenda .feed-card { padding: 8px 10px; border-radius: 12px; }
.agenda .feed-card:hover { background: var(--glass); }
.agenda .feed-card .thumb { width: 48px; height: 60px; }
.agenda .feed-card .thumb.round { height: 48px; }
.agenda .feed-card p { -webkit-line-clamp: 2; font-size: 12.5px; }

/* ---------- модальные окна ---------- */
#scrim { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .6); opacity: 0; pointer-events: none; transition: opacity .25s; }
#scrim.on { opacity: 1; pointer-events: auto; }
#overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; pointer-events: none; }
.modal {
  pointer-events: auto; width: min(440px, 100%); max-height: 100%; overflow-y: auto; border-radius: 22px;
  background: rgba(24, 24, 30, .92); border: 1px solid var(--line); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6); animation: modal-in .35s var(--ease);
}
.modal.wide { width: min(900px, 100%); }
.modal.mid { width: min(620px, 100%); }
.modal.out { animation: modal-out .2s ease forwards; }
/* окна открываются стопкой в одной ячейке: верхнее по центру поверх нижнего, а не делят экран пополам */
#overlay > .modal { grid-area: 1 / 1; }
#overlay > .modal:not(:last-child):not(.out) { filter: brightness(.4) saturate(.6); pointer-events: none; transition: filter .2s; }
.modal.cover-modal { background: rgba(24, 24, 30, .98); }
@keyframes modal-in { from { opacity: 0; transform: translateY(40px) scale(.97); } }
@keyframes modal-out { to { opacity: 0; transform: translateY(24px) scale(.98); } }
.m-head { display: flex; align-items: center; gap: 8px; padding: 14px 12px 14px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: inherit; z-index: 2; border-radius: 22px 22px 0 0; }
.m-head h2 { margin: 0; font-size: 16px; font-weight: 700; flex: 1; }
.m-body { padding: 18px 20px; display: grid; gap: 16px; align-content: start; }
.m-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: inherit; border-radius: 0 0 22px 22px; }
.field { display: grid; gap: 6px; }
.field > label, .label { font-size: 12px; font-weight: 600; color: var(--muted); display: flex; justify-content: space-between; }
.input { width: 100%; height: 42px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--glass); outline: none; transition: border-color .15s; color-scheme: dark; }
textarea.input { height: auto; min-height: 150px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: rgba(255, 255, 255, .35); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px; border-radius: 12px; background: var(--glass); border: 1px solid var(--line); }
.seg button { height: 36px; border-radius: 9px; font-weight: 600; font-size: 13px; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 6px; transition: all .2s; }
.seg button svg.i { width: 17px; height: 17px; }
.seg button.on { background: #fff; color: #000; }
.hint { font-size: 12px; color: var(--muted); margin: 0; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.quick .chip { height: 26px; font-size: 12px; padding: 0 10px; }

.composer-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; }
.composer-grid .m-body { border-right: 1px solid var(--line); }
.drop { border: 1.5px dashed rgba(255, 255, 255, .25); border-radius: 16px; padding: 22px 16px; text-align: center; color: var(--muted); cursor: pointer; transition: all .2s; }
.drop:hover, .drop.over { border-color: #fff; color: var(--text); background: var(--glass); }
.drop svg.i { width: 30px; height: 30px; margin: 0 auto 8px; stroke-width: 1.4; }
.drop b { display: block; color: var(--text); font-weight: 600; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 2px; }
.th { position: relative; flex: none; width: 84px; height: 105px; border-radius: 10px; overflow: hidden; background: #15151a; animation: pop .3s var(--ease); }
.th img, .th video { width: 100%; height: 100%; object-fit: cover; }
.th .n { position: absolute; left: 5px; top: 5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; font-size: 11px; font-weight: 700; background: rgba(0, 0, 0, .7); display: grid; place-items: center; }
.th .rm { position: absolute; right: 4px; top: 4px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0, 0, 0, .7); display: grid; place-items: center; }
.th .rm svg.i { width: 12px; height: 12px; stroke-width: 2.6; }
.th .mv { position: absolute; bottom: 4px; left: 4px; right: 4px; display: flex; justify-content: space-between; }
.th .mv button { width: 22px; height: 22px; border-radius: 50%; background: rgba(0, 0, 0, .7); display: grid; place-items: center; }
.th .mv svg.i { width: 12px; height: 12px; stroke-width: 2.6; }
.th .bar { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.th .bar i { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--grad); transition: width .2s; }
.th.more { border: 1.5px dashed rgba(255, 255, 255, .25); background: none; display: grid; place-items: center; color: var(--muted); cursor: pointer; }

.pv { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.pv-card { background: #000; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); }
.pv-top { display: flex; align-items: center; gap: 8px; padding: 10px; font-size: 12.5px; font-weight: 600; }
.pv-top .ava { width: 26px; height: 26px; font-size: 11px; }
.pv-media { aspect-ratio: 4 / 5; background: #15151a; display: grid; place-items: center; color: #4a4a55; position: relative; }
.pv-media.tall { aspect-ratio: 9 / 16; }
.pv-media img, .pv-media video { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.pv-icons { display: flex; gap: 12px; padding: 10px 10px 4px; }
.pv-icons svg.i { width: 20px; height: 20px; }
.pv-cap { padding: 0 10px 12px; font-size: 12.5px; white-space: pre-wrap; word-break: break-word; max-height: 130px; overflow-y: auto; }
.pv-cap b { margin-right: 5px; }
.pv-date { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }

.code { position: relative; font: 12px/1.55 ui-monospace, "SF Mono", Menlo, monospace; background: #000; border: 1px solid var(--line); border-radius: 12px; padding: 12px 44px 12px 14px; white-space: pre-wrap; word-break: break-all; color: #d5d5dc; }
.code .icon-btn { position: absolute; right: 4px; top: 4px; }
.api-table { display: grid; gap: 6px; font-size: 12.5px; }
.api-table div { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 4px 10px; align-items: baseline; }
.api-table code { font: 12px ui-monospace, Menlo, monospace; color: #8fc7ff; word-break: break-all; }
.api-table .verb { font: 700 11px ui-monospace, Menlo, monospace; color: var(--approved); }
.api-table span { grid-column: 2; color: var(--muted); }
.hook { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 6px 6px 6px 12px; border-radius: 10px; background: var(--glass); }
.hook span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.menu { display: grid; padding: 8px; }
.menu button { display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 12px; border-radius: 12px; font-weight: 500; text-align: left; }
.menu button:hover { background: var(--glass-2); }
.menu button.danger { color: var(--danger); }

#toasts { position: fixed; z-index: 90; left: 50%; bottom: 28px; transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { padding: 11px 18px; border-radius: 22px; background: #fff; color: #000; font-weight: 600; font-size: 13.5px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); animation: rise .3s var(--ease); max-width: 90vw; }
.toast.err { background: var(--danger); color: #fff; }

.only-mobile { display: none; }

/* ---------- планшет: без правой колонки ---------- */
body.compact #app { grid-template-columns: 260px minmax(0, 1fr); }
body.compact #detail { position: fixed; z-index: 30; top: 20px; right: 20px; bottom: 20px; width: min(440px, calc(100vw - 40px)); transform: translateX(calc(100% + 40px)); transition: transform .4s var(--ease); background: rgba(18, 18, 23, .96); }
body.compact #detail.open { transform: none; }

/* ---------- телефон ---------- */
body.narrow:not(.preview)::before { display: none; }
body.narrow #app { display: block; padding: 0; }
body.narrow #stage { height: 100%; }
body.narrow .phone { width: 100%; max-width: 560px; height: 100%; border: 0; border-radius: 0; box-shadow: none; }
body.narrow .topbar { padding-top: calc(12px + env(safe-area-inset-top)); }
body.narrow .tabs { top: calc(56px + env(safe-area-inset-top)); }
body.narrow #side { position: fixed; z-index: 45; top: 0; left: 0; bottom: 0; width: min(300px, 86vw); border-radius: 0 22px 22px 0; transform: translateX(-105%); transition: transform .35s var(--ease); background: rgba(18, 18, 23, .97); padding-top: calc(20px + env(safe-area-inset-top)); }
body.narrow #side.open { transform: none; }
body.narrow #detail { inset: 0; width: 100%; border-radius: 0; border: 0; background: #0b0b0f; transform: translateX(100%); }
body.narrow .car > * { max-height: calc(var(--vh) * .62); }
body.narrow .only-mobile { display: inline-flex; }
body.narrow #overlay { padding: 0; align-items: end; }
body.narrow .modal, body.narrow .modal.wide, body.narrow .modal.mid { width: 100%; max-height: calc(var(--vh) * .94); border-radius: 24px 24px 0 0; border-bottom: 0; animation-name: sheet-in; padding-bottom: env(safe-area-inset-bottom); }
body.narrow .modal.out { animation-name: sheet-out; }
body.narrow .m-foot { border-radius: 0; }
body.narrow .composer-grid { grid-template-columns: minmax(0, 1fr); }
body.narrow .board-grid { grid-template-columns: minmax(0, 1fr); padding: 12px; }
body.narrow .bcard .thumb { width: 72px; height: 90px; }
body.narrow .bcard .thumb.round { height: 72px; }
body.narrow .composer-grid .m-body { border-right: 0; }
body.narrow .bt-tools .input, body.narrow .bt-row .input { width: 100%; }
body.narrow .bt-row { width: 100%; }
body.narrow .pv { display: none; }
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes sheet-out { to { transform: translateY(100%); } }


/* ---------- переключатель платформ ---------- */
.pf-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; margin: 8px 12px 0; padding: 2px; border-radius: 10px; background: #141418; border: 1px solid #1f1f24; }
.pf-switch button { height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--muted); transition: all .2s var(--ease); min-width: 0; }
.pf-switch button svg.i { width: 14px; height: 14px; flex: none; }
.pf-switch button small { font-size: 10.5px; font-weight: 600; padding: 0 5px; border-radius: 7px; background: var(--glass-2); line-height: 15px; }
.pf-switch button.on { background: #fff; color: #000; }
.pf-switch button.on small { background: rgba(0, 0, 0, .08); }
body.preview .pf-switch { margin-top: 38px; }
body.preview .pf-switch ~ .topbar { padding-top: 10px; }

/* ---------- Telegram ---------- */
.screen:has(.tg-feed) { background: #0e1621 radial-gradient(circle at 20% 30%, rgba(106, 179, 243, .05), transparent 40%) fixed; }
.pf-switch.three { grid-template-columns: repeat(3, 1fr); }
.pf-switch.three button { padding: 0 6px; gap: 4px; }
.pf-switch.three button svg.i { display: none; }
.pf-switch.three button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-sub { font-size: 12px; color: var(--muted); }
.st-wrap { padding: 4px 12px 16px; }
.st-day { display: flex; align-items: baseline; gap: 8px; padding: 14px 2px 8px; font-size: 15px; font-weight: 700; }
.st-day small { font-size: 12px; font-weight: 500; color: var(--muted); }
.st-row { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 4px; }
.st-row::-webkit-scrollbar { height: 0; }
.st-row .st-card { flex: 0 0 104px; scroll-snap-align: start; }
.st-card { position: relative; display: block; width: 104px; aspect-ratio: 9 / 16; max-height: 200px; border-radius: 12px; overflow: hidden; background: #15151a; animation: rise .3s var(--ease) backwards; transition: box-shadow .15s, transform .15s var(--ease); }
.st-card:hover { transform: translateY(-2px); }
.st-card.sel { box-shadow: 0 0 0 2px #fff; }
.st-card img, .st-card video, .st-card .has-play { width: 100%; height: 100%; object-fit: cover; display: block; }
.st-shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, .7), transparent 42%, transparent 74%, rgba(0, 0, 0, .3)); }
.st-when { position: absolute; left: 7px; bottom: 6px; text-align: left; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .65); }
.st-when b { display: block; font-size: 12.5px; font-weight: 700; line-height: 1.2; }
.st-when span { font-size: 11px; opacity: .9; }
.st-dot { position: absolute; top: 7px; left: 7px; width: 9px; height: 9px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 2px rgba(0, 0, 0, .5); }
.st-cm { position: absolute; top: 5px; right: 5px; display: inline-flex; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 700; padding: 1px 5px; border-radius: 8px; background: var(--changes); color: #2b1a00; }
.st-cm svg.i { width: 11px; height: 11px; }

/* карусель сторис за день */
.modal.viewer { width: min(720px, 100%); }
.viewer .m-head small { font-weight: 500; color: var(--muted); }
.sv-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; }
.sv-slide { flex: none; width: 100%; scroll-snap-align: center; display: grid; align-content: start; gap: 12px; padding-bottom: 14px; }
.sv-media { background: #000; display: grid; place-items: center; max-height: 50vh; overflow: hidden; }
.sv-media img, .sv-media video { max-height: 50vh; max-width: 100%; width: auto; object-fit: contain; display: block; }
.sv-media .has-play { width: auto; height: 50vh; }
.sv-info { display: grid; gap: 10px; padding: 0 16px; }
.sv-when { display: flex; align-items: center; gap: 8px; font-size: 13.5px; flex-wrap: wrap; }
.sv-when b { font-weight: 600; }
.sv-cap { margin: 0; font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.sv-verdict .rv-actions { flex-wrap: wrap; }
.cover-thumb { width: 58px; height: 74px; border-radius: 8px; overflow: hidden; background: var(--glass); display: grid; place-items: center; font-size: 11px; flex: none; }
.cover-thumb img { width: 100%; height: 100%; object-fit: cover; }
.modal.cover-modal { width: min(560px, 100%); }
.cover-modal .m-body { gap: 12px; min-width: 0; }
.cover-modal .m-body > * { min-width: 0; }
.cp-stage { display: grid; place-items: center; background: #000; border-radius: 12px; overflow: hidden; max-height: min(52vh, 460px); }
.cp-video { max-height: min(52vh, 460px); max-width: 100%; width: auto; object-fit: contain; display: block; background: #000; }
.cp-line { display: grid; gap: 6px; min-width: 0; }
.cp-strip { position: relative; flex: 1 1 0; min-width: 0; display: flex; gap: 1px; height: 54px; border-radius: 8px; overflow: hidden; background: #0f0f13; cursor: ew-resize; touch-action: none; }
.cp-strip img, .cp-skel { flex: 1; min-width: 0; height: 100%; object-fit: cover; display: block; }
.cp-skel { background: linear-gradient(90deg, #16161c, #1e1e26, #16161c); }
.cp-mark { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .55); pointer-events: none; }
.cp-time { justify-self: end; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
body.narrow #overlay:has(.cover-modal) { align-items: center; padding: 12px; }
body.narrow .modal.cover-modal { width: 100%; max-height: 92dvh; border-radius: 20px; border-bottom: 1px solid var(--line); animation-name: modal-in; }
body.narrow .cover-modal .m-foot { border-radius: 0 0 20px 20px; }
.field.cover .row { gap: 12px; align-items: flex-start; }
.field.cover .hint { margin: 6px 0 0; }
.has-play { position: relative; width: 100%; height: 100%; }
.vq { position: relative; width: 100%; height: 100%; }
.sv-media .vq { width: auto; height: auto; display: inline-block; }
.car > *:has(> .vq), .tg-cell:has(> .vq) { position: relative; }
.car .vq, .tg-cell .vq { position: absolute; inset: 0; width: auto; height: auto; }
.vq-btn { position: absolute; top: 10px; left: 10px; z-index: 2; display: flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px 0 8px; border-radius: 13px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 12px; font-weight: 600; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.vq-btn svg.i { width: 14px; height: 14px; }
.vq-menu { position: absolute; top: 42px; left: 10px; z-index: 3; min-width: 210px; padding: 5px; border-radius: 12px; background: rgba(28, 28, 32, .96); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.vq-item { display: grid; width: 100%; text-align: left; padding: 7px 10px 7px 30px; border-radius: 8px; position: relative; color: var(--text); }
.vq-item:hover { background: var(--glass-2); }
.vq-item b { font-size: 13px; font-weight: 600; }
.vq-item small { font-size: 11.5px; color: var(--muted); }
.vq-item.on::before { content: ""; position: absolute; left: 11px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--blue); }
.has-play img { width: 100%; height: 100%; object-fit: cover; display: block; }
svg.i.play-badge { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 30px; height: 30px; color: #fff; stroke-width: 1.4; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .6)); pointer-events: none; }
.th .play-badge, .bt-card .play-badge, .bcard .play-badge { width: 20px; height: 20px; }
.tg-top { background: rgba(23, 33, 43, .94); }
.phone:has(.tg-feed) #fab { background: linear-gradient(to top, #0e1621 30%, transparent); }
.phone:has(.tg-feed) { background: #0e1621; }
.tg-chan { display: flex; align-items: center; gap: 10px; min-width: 0; text-align: left; }
.tg-chan .ava, .tg-ava { width: 40px; height: 40px; font-size: 16px; background: linear-gradient(135deg, #6ab3f3, #2f7cc4); }
.tg-chan b { display: block; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-chan span { font-size: 12px; color: #7f91a4; }
.tg-feed { padding: 6px 10px 20px; display: grid; gap: 8px; }
.tg-day { justify-self: center; margin: 8px 0 2px; padding: 3px 11px; border-radius: 12px; background: rgba(0, 0, 0, .35); color: #e4ecf2; font-size: 12.5px; font-weight: 600; }
.tg-post { display: grid; gap: 6px; animation: rise .3s var(--ease) backwards; }
.tg-bubble { max-width: 94%; justify-self: start; background: #182533; color: #e4ecf2; border-radius: 14px 14px 14px 4px; overflow: hidden; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: box-shadow .15s; }
.tg-bubble.click { cursor: pointer; }
.tg-bubble.click:hover { box-shadow: 0 0 0 1.5px rgba(106, 179, 243, .45); }
.tg-bubble.sel { box-shadow: 0 0 0 2px #6ab3f3; }
.tg-media { position: relative; display: grid; gap: 2px; }
.tg-light { position: absolute; left: 8px; bottom: 8px; padding: 2px 8px; border-radius: 10px; background: rgba(0, 0, 0, .55); color: #e4ecf2; font-size: 11px; font-weight: 600; pointer-events: none; }
.tg-row { display: flex; gap: 2px; }
.tg-cell { --r: 1; position: relative; flex: var(--r) 1 0; min-width: 0; aspect-ratio: var(--r); background: #0f1a24; overflow: hidden; }
.tg-cell:only-child { flex: 1 1 0; }
.tg-cell img, .tg-cell video, .tg-cell .has-play { width: 100%; height: 100%; object-fit: cover; display: block; }
.tg-text { padding: 8px 11px 0; font-size: 14.5px; line-height: 1.42; white-space: pre-wrap; word-break: break-word; }
.tg-text .tag { color: #6ab3f3; }
.tg-meta { display: flex; align-items: center; gap: 6px; padding: 6px 10px 7px; font-size: 12px; color: #6d8398; }
.tg-meta .pill { height: 20px; font-size: 11px; background: rgba(255, 255, 255, .06); }
.tg-meta svg.i { width: 14px; height: 14px; }
.tg-cm { display: inline-flex; align-items: center; gap: 3px; color: var(--changes); font-weight: 600; }
.tg-notes { padding: 0 4px; }
.tg-verdict { display: grid; gap: 8px; padding: 0 2px 6px; }
.tg-progress { background: transparent; border-bottom: 0; }
.tg-pv { background: #0e1621; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); padding-bottom: 12px; }
.tg-pv .tg-chan { padding: 10px 12px; background: #17212b; margin-bottom: 10px; }
.tg-pv .tg-bubble { margin: 0 10px; max-width: none; }

/* ---------- предпросмотр телефона ---------- */
#device { position: relative; height: 100%; --vh: 100vh; }
body.preview { display: grid; place-items: center; padding: 24px; }
body.preview #device {
  --vh: var(--dh);
  width: var(--dw); height: min(var(--dh), 100%); flex: none;
  transform: translateZ(0); overflow: hidden;
  background: #000; border: 10px solid #1b1b20; border-radius: 48px;
  box-shadow: 0 0 0 1px #2c2c33, 0 40px 90px rgba(0, 0, 0, .6);
}
body.preview #device::after {
  content: ""; position: absolute; z-index: 20; top: 9px; left: 50%; transform: translateX(-50%);
  width: 96px; height: 26px; border-radius: 14px; background: #000; pointer-events: none;
}
body.preview .topbar { padding-top: 40px; }
body.preview .tabs { top: 84px; }
body.preview #side, body.preview #detail { padding-top: 0; }
#preview-bar { display: none; }
body.preview #preview-bar {
  position: fixed; z-index: 100; top: 18px; left: 18px;
  display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 14px; border-radius: 16px;
  background: rgba(24, 24, 30, .9); border: 1px solid var(--line); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
#preview-bar b { font-size: 13px; font-weight: 600; }
#preview-bar .input { height: 32px; width: auto; padding: 0 10px; font-size: 12.5px; }
#preview-bar .btn { height: 32px; }

/* ---------- согласование на телефоне ---------- */
body.narrow .rv-card .car > * { max-height: calc(var(--vh) * .54); }
body.narrow .rv-progress { position: sticky; z-index: 4; top: calc(102px + env(safe-area-inset-top)); padding: 10px 14px; background: rgba(0, 0, 0, .92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
body.preview .rv-progress { top: 130px; }
body.narrow .rv-progress small { display: block; margin: 2px 0 0; }
body.narrow .rv-progress b { font-size: 14.5px; }
body.narrow .rv-actions.verdict {
  position: sticky; z-index: 3; bottom: 0; margin: 2px -14px 0; padding: 14px 14px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, #000 0, #000 62%, rgba(0, 0, 0, .82) 82%, transparent);
}
body.narrow .rv-actions.verdict .btn { height: 50px; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
body.narrow .rv-actions.verdict .btn.ok { background: rgba(52, 209, 123, .3); }
body.narrow .rv-actions.verdict .btn.warn { background: rgba(255, 179, 64, .3); }
body.narrow .rv-actions.verdict .btn.bad { background: rgba(255, 90, 95, .26); }
body.narrow .rv-card { padding-bottom: 16px; }
body.narrow .rv-note textarea.input { min-height: 110px; }
body.narrow .rv-note .btn.big, body.narrow .verdict .btn.big { height: 50px; }
body.narrow .rv-card .rv-head { position: sticky; z-index: 2; top: var(--rv-head-top, 148px); background: rgba(0, 0, 0, .9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
body.narrow .rv { padding-bottom: 8px; }
body.narrow .tg-progress { background: rgba(14, 22, 33, .95); }
body.narrow .tg-verdict .rv-actions.verdict { margin: 2px -10px 0; padding: 14px 10px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(to top, #0e1621 0, #0e1621 62%, rgba(14, 22, 33, .82) 82%, transparent); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- категории, номер, оценка ---------- */
.c-sale { --cat: #34d17b; } .c-viral { --cat: #ff5ea8; } .c-warmup { --cat: #ffb340; } .c-own_viral { --cat: #8f7bff; }
.cat { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 11.5px; font-weight: 700; white-space: nowrap; color: var(--cat); background: color-mix(in srgb, var(--cat) 16%, transparent); border: 1px solid color-mix(in srgb, var(--cat) 38%, transparent); }
.cat.sm { height: 18px; padding: 0 6px; font-size: 10px; border-radius: 9px; color: #fff; background: color-mix(in srgb, var(--cat) 78%, #000); border: 0; }
.cat.big { height: 28px; padding: 0 12px; font-size: 13px; border-radius: 14px; flex: none; }
.cat-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-pick .cat { height: 30px; padding: 0 13px; font-size: 12.5px; border-radius: 15px; background: var(--glass); border-color: var(--line); color: var(--muted); transition: all .15s; }
.cat-pick .cat:hover { color: var(--cat); border-color: color-mix(in srgb, var(--cat) 50%, transparent); }
.cat-pick .cat.on { background: var(--cat); border-color: transparent; color: #0b0b0f; }
.bt-card .cat-pick { margin-top: 8px; gap: 4px; }
.bt-card .cat-pick .cat { height: 24px; padding: 0 9px; font-size: 11.5px; }
.bt-card .grow > .input { margin-top: 8px; }
.pcode { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 6px; font: 600 11.5px/1 ui-monospace, "SF Mono", Menlo, monospace; color: var(--text); background: var(--glass-2); letter-spacing: .02em; white-space: nowrap; }
.pcode.big { height: 22px; margin-left: 8px; font-size: 12.5px; vertical-align: 2px; }
.rv-head b .pcode { margin-left: 6px; vertical-align: 1px; }
.tile .tl-top { position: absolute; top: 6px; left: 6px; right: 30px; display: flex; align-items: center; gap: 5px; pointer-events: none; }
.tile .tl-top .st { position: static; flex: none; margin: 2px; }
.tile .rt { position: absolute; right: 6px; bottom: 6px; display: flex; align-items: center; gap: 2px; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 9px; background: rgba(0, 0, 0, .6); color: #ffd23f; }
.tile .rt svg.i { width: 11px; height: 11px; fill: currentColor; stroke-width: 1.5; }
.tile .rt ~ .cm { bottom: 28px; }
.st-cat { position: absolute; top: 22px; left: 5px; }
.rt-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 700; color: #ffd23f; }
.rt-badge svg.i { width: 12px; height: 12px; fill: currentColor; stroke-width: 1.5; }
.stars { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; background: var(--glass); border: 1px solid var(--line); }
.stars.empty { font-size: 13px; }
.stars-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.stars-row { display: flex; gap: 1px; }
.stars-row > * { display: grid; place-items: center; width: 26px; height: 28px; color: #4a4a55; transition: color .12s, transform .12s; }
.stars-row svg.i { width: 21px; height: 21px; stroke-width: 1.6; }
.stars-row > .on { color: #ffd23f; }
.stars-row > .on svg.i { fill: currentColor; }
.stars.edit .stars-row > button:hover { transform: scale(1.15); }
.stars-val { margin-left: auto; font-size: 14px; font-weight: 700; }
.rv-body > .stars, .sv-info > .stars, .tg-post > .tg-verdict .stars { margin-top: 2px; }
body.narrow .stars { flex-wrap: nowrap; gap: 6px; padding: 8px 10px; }
body.narrow .stars.edit .stars-label { display: none; }
body.narrow .stars-row > * { width: 23px; height: 30px; }
body.narrow .stars-row svg.i { width: 20px; height: 20px; }
.rv-tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 0 14px 10px; }
.d-body > .rv-tags, .sv-info > .rv-tags { padding: 0; }
.tg-tags { padding: 8px 10px 0; }
.ref-link { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 11.5px; font-weight: 600; color: var(--blue); background: rgba(0, 149, 246, .12); text-decoration: none; }
.ref-link:hover { background: rgba(0, 149, 246, .22); }
.ref-link svg.i { width: 12px; height: 12px; }
.comment .top .edited { font-size: 11px; }
.cm-edit { margin-left: auto; width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; color: var(--muted); flex: none; align-self: center; }
.cm-edit:hover { color: var(--text); background: var(--glass-2); }
.cm-edit svg.i { width: 14px; height: 14px; }
.cm-form { display: grid; gap: 8px; margin-top: 6px; }
.cm-form textarea.input { min-height: 70px; }
.cm-form .btn { height: 34px; }
.pf-switch.five { grid-template-columns: repeat(5, 1fr); }
.pf-switch.five button { padding: 0 4px; gap: 4px; }
.pf-switch.five button svg.i { display: none; }
.pf-switch.five button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.narrow .pf-switch.five button small { display: none; }
.pf-badge { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; font-size: 11.5px; font-weight: 600; color: var(--muted); vertical-align: 1px; }
.pf-badge svg.i { width: 13px; height: 13px; }
.bio b { display: flex; align-items: center; }
/* табло оценок */
.r-tools { display: grid; gap: 8px; padding: 12px 16px 0; }
.r-tools .chip.on { --c: #ffd23f; }
.rlist { grid-template-columns: 1fr; max-width: 820px; }
.rcard { display: flex; align-items: center; gap: 14px; width: 100%; padding: 10px 16px 10px 10px; border-radius: 14px; background: var(--glass); border: 1px solid var(--line); text-align: left; transition: background .15s; animation: rise .3s var(--ease) backwards; }
.rcard:hover { background: var(--glass-2); }
.rcard .thumb { position: relative; width: 64px; height: 88px; border-radius: 9px; overflow: hidden; background: #15151a; flex: none; }
.rcard .thumb.round { height: 64px; border-radius: 50%; }
.rcard .thumb img, .rcard .thumb video, .rcard .thumb .has-play { width: 100%; height: 100%; object-fit: cover; }
.rcard .thumb .play-badge { width: 18px; height: 18px; }
.rcard .grow { min-width: 0; display: grid; gap: 5px; justify-items: start; }
.rcard .meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.rcard .cap { margin: 0; font-size: 12.5px; color: #cfcfd6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rscore { flex: none; width: 76px; display: grid; justify-items: end; gap: 3px; text-align: right; }
.rscore b { font-size: 30px; font-weight: 800; line-height: 1; color: #ffd23f; }
.rscore small { font-size: 11px; color: var(--muted); }
.rscore.none small { font-size: 12px; }
.rbar { width: 100%; height: 4px; border-radius: 2px; background: var(--glass-2); overflow: hidden; }
.rbar i { display: block; height: 100%; background: #ffd23f; border-radius: 2px; }
/* хэштеги */
.ht { display: grid; gap: 8px; justify-items: start; }
.btn.sm-btn { height: 32px; font-size: 12.5px; padding: 0 12px; }
.ht-list { display: flex; flex-wrap: wrap; gap: 6px; }
.ht-list .chip { height: 26px; font-size: 12px; padding: 0 10px; }
.ht-list .chip.on { --c: rgba(0, 149, 246, .35); }
.ht-list .chip.on span { color: #fff; }
.ht-list .chip.all { color: var(--blue); }
a.btn { text-decoration: none; color: var(--text); }
.d-body > .rv-tags a.btn { height: 34px; color: var(--blue); }

/* ---------- уведомления ---------- */
.push-banner { display: flex; align-items: center; gap: 10px; margin: 10px 12px 0; padding: 10px 8px 10px 12px; border-radius: 14px; background: linear-gradient(120deg, rgba(0, 149, 246, .16), rgba(150, 47, 191, .14)); border: 1px solid rgba(0, 149, 246, .25); }
.push-banner .grow { min-width: 0; display: grid; gap: 2px; }
.push-banner b { font-size: 13px; font-weight: 600; }
.push-banner span { font-size: 12px; color: #c9c9d2; line-height: 1.35; }
.push-banner .btn { height: 34px; flex: none; }
.push-banner .icon-btn { flex: none; width: 30px; height: 30px; }
.push-ico { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; background: rgba(0, 149, 246, .22); color: #fff; }
.push-ico svg.i { width: 18px; height: 18px; }

/* ---------- вкладка «Статистика»: доска виджетов ---------- */
.modal.statsboard { --s1: #3987e5; --s2: #d95926; --s3: #199e70; --grid-c: rgba(255, 255, 255, .07); --ink-2: #c3c2b7;
  width: min(1400px, 100%); height: 100%; max-height: 100%; background: rgba(14, 14, 18, .985); border-radius: 22px; padding-bottom: 24px; }
.st-head { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 10px; padding: 14px 16px 14px 22px; background: rgba(14, 14, 18, .96); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.st-head h2 { margin: 0; font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.st-acc { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px 0 4px; border-radius: 18px; background: var(--glass-2); border: 1px solid var(--line); font-size: 13.5px; }
.st-acc img, .st-acc > i { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: var(--glass-2); }
.st-periods { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 22px 0; }
.st-periods .chip.on { --c: #fff; }
.st-range { font-size: 12px; }
.st-loading, .st-error, .st-notes, .st-editbar { margin: 12px 22px 0; padding: 10px 14px; border-radius: 12px; font-size: 13px; display: flex; align-items: center; gap: 10px; }
.st-loading { background: rgba(57, 135, 229, .12); color: #cfe2fb; }
.st-loading i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.st-error { background: rgba(255, 90, 95, .12); color: #ffc2c4; }
.st-notes { background: var(--glass); color: var(--muted); }
.st-editbar { background: rgba(255, 179, 64, .1); color: #f3dcb6; justify-content: space-between; flex-wrap: wrap; }
.sw-board { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; padding: 16px 22px 0; align-items: stretch; }
.sw { grid-column: span 6; min-width: 0; display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 16px; border-radius: 16px; background: rgba(255, 255, 255, .035); border: 1px solid var(--line); }
.sw-s { grid-column: span 3; } .sw-m { grid-column: span 6; } .sw-l { grid-column: span 12; }
body.compact .sw-s { grid-column: span 6; } body.compact .sw-m { grid-column: span 12; }
body.narrow .sw-board { padding: 12px 12px 0; gap: 10px; } body.narrow .sw-s { grid-column: span 6; }
body.narrow .st-head { padding: 12px 12px 12px 16px; } body.narrow .st-periods { padding: 10px 12px 0; }
body.narrow .st-loading, body.narrow .st-error, body.narrow .st-notes, body.narrow .st-editbar { margin: 10px 12px 0; }
.sw-head { display: flex; align-items: center; gap: 6px; min-height: 22px; }
.sw-head h3 { margin: 0; font-size: 12.5px; font-weight: 600; color: var(--muted); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-tools { display: flex; align-items: center; gap: 2px; flex: none; }
.sw-tools .icon-btn { width: 28px; height: 28px; }
.sw-size { width: 28px; height: 28px; border-radius: 8px; font-size: 11.5px; font-weight: 700; background: var(--glass-2); }
.sw.editing { border-style: dashed; border-color: rgba(255, 255, 255, .22); cursor: grab; }
.sw.drag { opacity: .4; } .sw.over { outline: 2px solid var(--s1); outline-offset: 2px; }
.sw-add { align-items: center; justify-content: center; gap: 6px; flex-direction: row; min-height: 120px; color: var(--muted); font-weight: 600; border-style: dashed; cursor: pointer; }
.sw-add:hover { color: var(--text); background: var(--glass-2); }
.sw-skel { flex: 1; min-height: 60px; border-radius: 10px; background: linear-gradient(90deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, .07), rgba(255, 255, 255, .03)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.sw-empty { color: var(--muted); font-size: 13px; padding: 18px 0; text-align: center; }
.sw-note { margin: 6px 0 0; font-size: 11.5px; color: var(--muted); }
.sw-kpi { display: grid; gap: 4px; align-content: start; }
.sw-kpi-val { font-size: 28px; font-weight: 750; letter-spacing: -.01em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.sw-sub { font-size: 12px; color: var(--muted); }
.sw-delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; font-weight: 650; }
.sw-delta small { font-weight: 500; color: var(--muted); }
.sw-delta svg.i { width: 13px; height: 13px; stroke-width: 2.6; }
.sw-delta.up { color: var(--approved); } .sw-delta.down { color: var(--rejected); }
.sw-spark { width: 100%; height: 34px; margin-top: 6px; }
.sw-spark path { fill: none; stroke: var(--s1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.sw-chart { width: 100%; min-height: 180px; position: relative; }
.sw-chart svg { display: block; }
.sw-chart-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 13px; margin-bottom: 4px; }
.sw-chart-head .muted { font-size: 11.5px; }
.sw-grid { stroke: var(--grid-c); stroke-width: 1; }
.sw-axis { fill: var(--muted); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.sw-line { fill: none; stroke: var(--s1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.sw-area { fill: rgba(57, 135, 229, .13); }
.sw-cross { stroke: rgba(255, 255, 255, .35); stroke-width: 1; }
.sw-dot { fill: var(--s1); stroke: rgb(20, 20, 26); stroke-width: 2; }
.sw-tip { position: fixed; left: 0; top: 0; z-index: 200; pointer-events: none; padding: 7px 10px; border-radius: 9px; font-size: 12px; line-height: 1.4; background: rgba(10, 10, 14, .96); border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0, 0, 0, .5); color: var(--text); white-space: nowrap; }
.sw-tip b { font-weight: 650; }
.sw-cols { display: flex; align-items: stretch; gap: 3px; height: 170px; }
.sw-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: default; }
.sw-col-bar { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid var(--grid-c); }
.sw-col-bar i { display: block; width: min(100%, 24px); background: var(--s1); border-radius: 4px 4px 0 0; }
.sw-col:hover .sw-col-bar i { filter: brightness(1.2); }
.sw-col span { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.sw-bars { display: grid; gap: 7px; }
.sw-bar { display: grid; grid-template-columns: minmax(70px, 34%) 1fr auto; align-items: center; gap: 10px; font-size: 12.5px; }
.sw-bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.sw-bar-track { height: 14px; display: flex; align-items: center; }
.sw-bar-track i { display: block; height: 14px; background: var(--s1); border-radius: 0 4px 4px 0; }
.sw-bar:hover .sw-bar-track i { filter: brightness(1.2); }
.sw-bar b { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 48px; text-align: right; }
.sw-split { display: grid; gap: 12px; }
.sw-split-bar { display: flex; gap: 2px; height: 22px; }
.sw-split-bar i { display: block; min-width: 3px; }
.sw-split-bar i:first-child { border-radius: 4px 0 0 4px; } .sw-split-bar i:last-child { border-radius: 0 4px 4px 0; }
.sw-split .c0, .sw-legend .c0 { background: var(--s1); } .sw-split .c1, .sw-legend .c1 { background: var(--s2); } .sw-split .c2, .sw-legend .c2 { background: var(--s3); }
.sw-legend { display: grid; gap: 4px; font-size: 12.5px; color: var(--ink-2); }
.sw-legend span { display: flex; align-items: center; gap: 7px; }
.sw-legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.sw-tops { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.sw-top { display: grid; gap: 2px; color: var(--text); text-decoration: none; }
.sw-thumb { position: relative; aspect-ratio: 4 / 5; border-radius: 10px; overflow: hidden; background: #15151a; }
.sw-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sw-rank { position: absolute; left: 6px; top: 6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: rgba(0, 0, 0, .65); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.sw-top b { font-size: 15px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.sw-top small { font-size: 11px; color: var(--muted); }
.sw-top:hover .sw-thumb img { filter: brightness(1.1); }
.sw-table-wrap { overflow-x: auto; margin: 0 -4px; max-height: 520px; overflow-y: auto; }
.sw-table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.sw-table th { position: sticky; top: 0; background: rgb(22, 22, 28); text-align: left; font-weight: 600; color: var(--muted); padding: 6px 8px; white-space: nowrap; z-index: 1; }
.sw-table th button { color: inherit; font: inherit; } .sw-table th button.on { color: var(--text); }
.sw-table td { padding: 6px 8px; border-top: 1px solid var(--grid-c); white-space: nowrap; }
.sw-table .num { text-align: right; }
.sw-table tr:hover td { background: rgba(255, 255, 255, .03); }
.sw-mcell { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; max-width: 340px; }
.sw-mcell img, .sw-mcell i { width: 30px; height: 38px; border-radius: 5px; object-fit: cover; background: #15151a; flex: none; }
.sw-mcell span { overflow: hidden; text-overflow: ellipsis; }
.sw-profile { display: flex; gap: 14px; align-items: center; }
.sw-ava { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--glass-2); flex: none; }
.sw-profile b { font-size: 15px; } .sw-profile .grow > span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.sw-pstats { display: flex; gap: 18px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.sw-pstats b { display: block; font-size: 16px; color: var(--text); }
.sw-stories { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.sw-story { position: relative; flex: none; width: 74px; aspect-ratio: 9 / 16; border-radius: 9px; overflow: hidden; background: #15151a; }
.sw-story img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sw-story small { position: absolute; left: 5px; bottom: 4px; font-size: 10.5px; font-weight: 600; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .8); }
.sw-cat { display: grid; gap: 8px; }
.sw-cat-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; }
.sw-cat-item { display: grid; gap: 2px; text-align: left; padding: 10px 12px; border-radius: 12px; background: var(--glass); border: 1px solid var(--line); font-size: 13px; }
.sw-cat-item:hover { background: var(--glass-2); }
.sw-cat-item small { font-size: 11px; color: var(--muted); }
.sw-cat-item.used b { color: var(--muted); }
body.narrow .modal.statsboard { border-radius: 0; height: 100dvh; }
body.narrow #overlay:has(.modal.statsboard) { padding: 0; }
body.narrow #overlay:has(.modal.statsboard) { align-items: stretch; }
body.narrow .modal.statsboard { max-height: none; }
.side-actions .btn.stats-btn { background: rgba(52, 209, 123, .14); border-color: rgba(52, 209, 123, .3); color: #8ee6b5; }
.side-actions .btn.stats-btn:hover { background: rgba(52, 209, 123, .22); }
.sw-line.cmp { stroke: #8a8a96; stroke-width: 1.5; stroke-dasharray: 4 4; opacity: .9; }
.sw-legend.row { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 6px; font-size: 11.5px; }
.sw-legend .ln { width: 16px; height: 0; border-top: 2px solid var(--s1); border-radius: 0; background: none; }
.sw-legend .ln.cmp { border-top: 2px dashed #8a8a96; }
.sw-tip-cmp { color: #b9b9c4; }
.sw-tip small { color: var(--muted); }
.st-compare { padding-top: 8px; }
.st-compare > .muted { font-size: 12.5px; }
.st-compare .chip.on { --c: #c9c9d2; }
.update-bar { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 300; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 14px; background: rgba(20, 20, 26, .97); border: 1px solid rgba(0, 149, 246, .45); box-shadow: 0 12px 40px rgba(0, 0, 0, .55); font-size: 13.5px; font-weight: 600; animation: rise .3s var(--ease); }
.update-bar .btn { height: 34px; }
body.narrow .update-bar { bottom: calc(14px + env(safe-area-inset-bottom)); width: calc(100% - 24px); }
body.narrow .update-bar span { flex: 1; }
/* номер публикации: строкой в конце описания и значком на плитке */
.cap-code { margin-top: 10px; font: 600 12px/1 ui-monospace, "SF Mono", Menlo, monospace; color: var(--muted); letter-spacing: .03em; }
.tile .tl-code { position: absolute; top: 6px; right: 6px; padding: 2px 5px; border-radius: 6px; font: 700 10.5px/1.2 ui-monospace, "SF Mono", Menlo, monospace; color: #fff; background: rgba(0, 0, 0, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); pointer-events: none; }
.tile .tl-code.with-kind { right: 30px; }
.tile .tl-top { right: 70px; }

/* ---------- хранилище ---------- */
.storage .disk { display: grid; gap: 8px; }
.disk-bar { height: 10px; border-radius: 5px; background: var(--glass-2); overflow: hidden; }
.disk-bar i { display: block; height: 100%; background: var(--blue); border-radius: 5px; }
.disk-bar.full i { background: var(--danger); }
.storage .disk .hint { margin: 0; }
.storage .btn.danger { justify-self: start; }
.files { display: grid; gap: 6px; }
.file { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 10px; border-radius: 12px; background: var(--glass); border: 1px solid var(--line); }
.file-thumb { width: 44px; height: 44px; border-radius: 8px; overflow: hidden; background: #15151a; display: grid; place-items: center; flex: none; color: var(--muted); }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file .grow { min-width: 0; display: grid; gap: 1px; }
.file b { font-size: 13.5px; }
.file span { font-size: 12px; color: var(--muted); }
.file .file-used { color: #9fd9b8; }
.file .file-free { color: var(--changes); }
.file .icon-btn[disabled] { opacity: .3; cursor: not-allowed; }
/* на телефоне шапка, вкладки, прогресс и шапка карточки уезжают вверх вместе с лентой —
   иначе закреплённые слои съедали полэкрана и видео не помещалось */
body.narrow .topbar, body.narrow .tabs, body.narrow .rv-progress, body.narrow .rv-card .rv-head { position: relative; top: auto; }
body.narrow .rv-card { scroll-margin-top: 0; }
body.narrow .rv-card .car > * { max-height: calc(var(--vh) * .74); }
.d-nav { display: flex; align-items: center; gap: 2px; flex: none; }
.d-nav span { font-size: 12px; font-variant-numeric: tabular-nums; min-width: 34px; text-align: center; }
.d-nav .icon-btn { width: 32px; height: 32px; }
.d-nav .icon-btn[disabled] { opacity: .3; }
body.narrow .d-nav span { display: none; }

/* переключатель площадок над телефоном (на компьютере) */
#stage { flex-direction: column; gap: 12px; }
#pf-bar { width: 392px; max-width: 100%; flex: none; }
#pf-bar:empty { display: none; }
#pf-bar .pf-switch { margin: 0; padding: 3px; border-radius: 14px; background: rgba(255, 255, 255, .05); border-color: var(--line); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
#pf-bar .pf-switch button { height: 34px; border-radius: 11px; font-size: 13px; }
.phone { height: min(860px, calc(100% - 50px)); }
body.narrow #pf-bar { display: none; }
.pf-switch.five { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 1fr; }
#pf-bar .pf-switch button { padding: 0 4px; min-width: 0; }
#pf-bar .pf-switch button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- профиль TikTok ---------- */
.tt-profile { display: flex; align-items: flex-start; gap: 14px; padding: 10px 16px 4px; }
.tt-profile h2 { margin: 0; font-size: 24px; font-weight: 800; line-height: 1.15; letter-spacing: -.01em; }
.tt-handle { display: block; margin-top: 2px; font-size: 13.5px; color: var(--muted); }
.tt-stats { display: flex; gap: 18px; margin-top: 12px; }
.tt-stats div { display: grid; }
.tt-stats b { font-size: 16px; font-weight: 700; }
.tt-stats span { font-size: 11.5px; color: var(--muted); }
.tt-ava .ava { width: 92px; height: 92px; font-size: 32px; }
.tt-actions .btn { height: 42px; border-radius: 21px; background: #26262b; border: 0; }
.tt-actions .btn.primary { background: #fe2c55; color: #fff; }
.tt-actions .btn:disabled { color: #8a8a93; }
.tt-actions .btn:not(.wide) { width: 42px; }
.tt-bio { position: relative; padding-right: 40px; }
.tt-bio p { margin: 0; font-size: 13.5px; line-height: 1.45; }
.bio b { display: flex; align-items: center; gap: 6px; }
.bio-edit { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; color: var(--muted); flex: none; }
.bio-edit:hover { color: var(--text); background: var(--glass-2); }
.tt-bio .bio-edit { position: absolute; right: 12px; top: 6px; }
.grid.tt-grid { gap: 1px; }
.grid.tt-grid .tile { aspect-ratio: 3 / 4; }
.grid.tt-grid .tile .date { display: flex; align-items: center; gap: 4px; }

/* ---------- компактная шапка профиля (~15% экрана) ---------- */
.ph { display: flex; align-items: center; gap: 10px; padding: 4px 14px 6px; }
.ph-ava { flex: none; padding: 2px; border-radius: 50%; background: var(--grad); }
.ph-ava .ava { width: 30px; height: 30px; font-size: 12px; border: 2px solid #000; }
.ph.tt .ph-ava { background: none; padding: 0; }
.ph-name { flex: 1; min-width: 0; display: grid; line-height: 1.2; }
.ph-name b { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-name span { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-stats { display: flex; gap: 10px; flex: none; text-align: center; }
.ph-stats div { display: grid; line-height: 1.15; }
.ph-stats b { font-size: 13px; font-weight: 700; }
.ph-stats span { font-size: 9.5px; color: var(--muted); }
.ph-bio { position: relative; padding: 0 40px 6px 14px; }
.ph-bio p { margin: 0; font-size: 11px; line-height: 1.4; color: #d6d6dc; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.ph-bio p.open { display: block; }
.ph-bio .bio-edit { position: absolute; right: 10px; top: -4px; }
.ph-row { display: flex; align-items: center; gap: 6px; padding: 2px 14px 10px; }
.ph-row .btn { height: 32px; font-size: 12.5px; border-radius: 10px; }
.ph-main { flex: 1; min-width: 0; padding: 0 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-icon { width: 32px; padding: 0; flex: none; }
.ph-row.tt .ph-main.primary { background: #fe2c55; color: #fff; }
.ph-period { flex: none; display: flex; align-items: center; gap: 5px; height: 32px; padding: 0 10px; border-radius: 10px; background: #121216; border: 1px solid #1f1f24; font-size: 12px; font-weight: 600; white-space: nowrap; max-width: 46%; }
.ph-period span { overflow: hidden; text-overflow: ellipsis; }
.ph-period.on { background: rgba(0, 149, 246, .14); border-color: rgba(0, 149, 246, .5); }
.ph-period svg.i { width: 14px; height: 14px; flex: none; }
.ph-reset { width: 28px; height: 28px; flex: none; }
.ph-hint { flex: 1; min-width: 0; font-size: 11.5px; color: var(--muted); }
/* шапка-строка: аватар, имя, цифры, «+» и меню */
.topbar.ph { padding: 10px 6px 8px 12px; gap: 8px; }
.topbar.ph .ph-name { text-align: left; }
.topbar.ph .ph-stats { gap: 8px; }
/* номер на плитке — над датой внизу, сверху только статус, категория и формат */
.tile .date .tl-code { position: static; display: table; margin-bottom: 3px; }
.tile .tl-top { right: 28px; }
.tile .tl-top .cat.sm { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* шапка на 25% крупнее */
.topbar.ph { padding: 12px 8px 10px 14px; gap: 10px; }
.ph-ava .ava { width: 38px; height: 38px; font-size: 15px; }
.ph-name b { font-size: 16px; }
.ph-name span { font-size: 13.5px; }
.topbar.ph .ph-stats { gap: 10px; }
.ph-stats b { font-size: 16px; }
.ph-stats span { font-size: 12px; }
.ph-bio { padding: 0 44px 8px 14px; }
.ph-bio p { font-size: 13.5px; }
.ph-row { gap: 8px; padding: 2px 14px 12px; }
.ph-row .btn { height: 40px; font-size: 14px; border-radius: 12px; }
.ph-icon { width: 40px; }
.ph-period { height: 40px; font-size: 14px; border-radius: 12px; padding: 0 12px; }
.ph-period svg.i { width: 16px; height: 16px; }
.ph-hint { font-size: 13.5px; }
.tabs { top: var(--top-h, 58px); }
/* кнопки боковой панели не шире самой панели: длинный текст обрезается */
.side-actions { grid-template-columns: minmax(0, 1fr); }
.side-actions .btn { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-actions .btn .btn-note { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--muted); }
/* правое окно: вертикальный ролик целиком — по высоте экрана, ширина по 9:16, без обрезки */
#detail .media.tall .car { justify-content: center; }
#detail .media.tall .car > * { width: auto; height: min(60vh, 640px); max-height: none; aspect-ratio: 9 / 16; }
#detail .media.tall .car > * > img, #detail .media.tall .car > * > video, #detail .media.tall .vq video { object-fit: contain; }
#detail .media.tall { background: #000; }
body.narrow #detail .media.tall .car > * { height: min(68vh, 640px); }

/* окно сторис на компьютере: сторис слева во всю высоту, информация и кнопки справа — всё видно без прокрутки */
body:not(.narrow) .modal.viewer { width: min(1000px, 100%); }
body:not(.narrow) .sv-slide { grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 18px; padding: 16px 18px 18px; }
body:not(.narrow) .sv-media { max-height: min(76vh, 760px); border-radius: 14px; background: #000; }
body:not(.narrow) .sv-media img, body:not(.narrow) .sv-media video { max-height: min(76vh, 760px); max-width: min(430px, 46vw); }
body:not(.narrow) .sv-media .has-play { height: min(76vh, 760px); }
body:not(.narrow) .sv-info { padding: 0; align-content: start; }
body:not(.narrow) .sv-info .rv-actions .btn.big { height: 46px; }
/* строка с названием аккаунта (лента согласования, сторис, TG) — компактнее */
.topbar:not(.ph) { padding: 8px 8px 6px 14px; min-height: 0; }
.topbar:not(.ph) .handle { font-size: 16px; }
.topbar:not(.ph) .icon-btn { width: 34px; height: 34px; }
.topbar:not(.ph) .st-sub { font-size: 11.5px; }
/* тень под кнопкой «+» слабее: затемнение внизу и розовое свечение мягче */
#fab { height: 76px; background: linear-gradient(to top, rgba(0, 0, 0, .55) 0, transparent); }
.phone:has(.tg-feed) #fab { background: linear-gradient(to top, rgba(14, 22, 33, .55) 0, transparent); }
.fab { box-shadow: 0 4px 12px rgba(214, 41, 118, .22); }
/* лента согласования в рамке телефона: Reels и сторис целиком, а не во всю ширину */
body:not(.narrow) .rv-card .media.tall .car { justify-content: center; }
body:not(.narrow) .rv-card .media.tall .car > * { width: auto; height: min(65vh, 600px); max-height: none; aspect-ratio: 9 / 16; }
body:not(.narrow) .rv-card .media.tall .car > * > img, body:not(.narrow) .rv-card .media.tall .car > * > video, body:not(.narrow) .rv-card .media.tall .vq video { object-fit: contain; }
.side-actions .btn.batch-btn { background: rgba(255, 94, 168, .14); border-color: rgba(255, 94, 168, .3); color: #ff9cc8; }
.side-actions .btn.batch-btn:hover { background: rgba(255, 94, 168, .22); }
/* сворачиваемые разделы левой панели */
.side-toggle { display: flex; align-items: center; justify-content: space-between; width: calc(100% - 12px); text-align: left; cursor: pointer; padding: 2px 0; }
.side-toggle:hover { color: var(--text); }
.side-toggle svg.i { width: 14px; height: 14px; transition: transform .2s var(--ease); }
.side-sec.closed .side-toggle svg.i { transform: rotate(-90deg); }
.side-sec.closed > .stat-list { display: none; }
.side-sec.closed .side-toggle { margin-bottom: 0; }

/* ---------- «Светофор» ---------- */
.z-green { --z: #34d17b; } .z-yellow { --z: #ffb340; } .z-red { --z: #ff5a5f; } .z-none { --z: #6b6b76; }
.zchip { display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 6px; border-radius: 10px; font-size: 11px; font-weight: 700; color: var(--z); background: color-mix(in srgb, var(--z) 16%, transparent); white-space: nowrap; }
.zchip svg.i { width: 10px; height: 10px; }
.tile .tl-br { position: absolute; right: 6px; bottom: 6px; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.tile .tl-br .rt, .tile .tl-br .cm { position: static; }
.tile .tl-br .zchip { background: rgba(0, 0, 0, .62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.ig-views { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--z) 10%, transparent); border: 1px solid color-mix(in srgb, var(--z) 35%, transparent); color: var(--text); text-decoration: none; }
.ig-views > svg.i { width: 22px; height: 22px; color: var(--z); flex: none; }
.ig-views .grow { display: grid; } .ig-views b { font-size: 14.5px; } .ig-views span { font-size: 12px; color: var(--muted); }
.ig-open { display: flex; align-items: center; gap: 2px; font-size: 12.5px; font-weight: 600; color: var(--z) !important; }
.side-actions .btn.traffic-btn { background: rgba(255, 179, 64, .12); border-color: rgba(255, 179, 64, .3); color: #ffd08a; }
.side-actions .btn.traffic-btn:hover { background: rgba(255, 179, 64, .2); }
.modal.traffic { width: min(1200px, 100%); height: 100%; max-height: 100%; background: rgba(14, 14, 18, .985); padding-bottom: 24px; }
body.narrow .modal.traffic { border-radius: 0; height: 100dvh; }
body.narrow #overlay:has(.modal.traffic) { padding: 0; align-items: stretch; }
.tr-sum { font-size: 12.5px; }
.tr-hint { margin: 12px 22px 0; }
.tr-zone { margin: 16px 22px 0; padding: 14px; border-radius: 16px; background: color-mix(in srgb, var(--z) 6%, rgba(255, 255, 255, .02)); border: 1px solid color-mix(in srgb, var(--z) 28%, transparent); }
body.narrow .tr-zone { margin: 12px 12px 0; } body.narrow .tr-hint { margin: 10px 12px 0; }
.tr-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.tr-head h3 { margin: 0; font-size: 15px; }
.tr-head .muted { font-size: 12.5px; }
.tr-head > b { font-size: 18px; color: var(--z); }
.tr-lamp { width: 14px; height: 14px; border-radius: 50%; background: var(--z); box-shadow: 0 0 12px color-mix(in srgb, var(--z) 70%, transparent); flex: none; }
.tr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.tr-card { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 12px; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); text-align: left; color: var(--text); }
.tr-card:hover { border-color: color-mix(in srgb, var(--z) 60%, transparent); }
.tr-thumb { width: 54px; height: 72px; border-radius: 8px; overflow: hidden; background: #15151a; flex: none; }
.tr-thumb img, .tr-thumb video, .tr-thumb .has-play { width: 100%; height: 100%; object-fit: cover; }
.tr-thumb .play-badge { width: 16px; height: 16px; }
.tr-info { min-width: 0; display: grid; gap: 3px; }
.tr-top { display: flex; align-items: center; gap: 6px; font-size: 11.5px; }
.tr-views { display: flex; align-items: center; gap: 5px; font-size: 18px; color: var(--z); font-variant-numeric: tabular-nums; }
.tr-views svg.i { width: 13px; height: 13px; }
.tr-none { font-size: 12.5px; }
.tr-cap { font-size: 12px; color: #c9c9d2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-empty { margin: 0; font-size: 13px; }
/* окно просмотра ролика поверх «Светофора» */
.modal.tr-view { width: min(560px, 100%); background: rgba(20, 20, 26, .99); }
.tr-view .m-head h2 { display: flex; align-items: center; gap: 4px; }
.tr-view .m-head .zchip { margin-right: 4px; }
.tr-view .media.tall .car { justify-content: center; }
.tr-view .media.tall .car > * { width: auto; height: min(62vh, 620px); max-height: none; aspect-ratio: 9 / 16; }
.tr-view .media .car > * { max-height: min(62vh, 620px); }
.tr-view .car img, .tr-view .car video { object-fit: contain; }
.tr-view-info { display: grid; gap: 10px; padding: 14px 18px 18px; }
.tr-view-info .muted { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.tr-view-views { display: flex; align-items: center; gap: 6px; color: var(--z); font-size: 15px; }
.tr-view-views svg.i { width: 14px; height: 14px; }
.tr-view-cap { margin: 0; font-size: 13.5px; white-space: pre-wrap; max-height: 120px; overflow-y: auto; color: #d8d8de; }
.tr-view-info .row { flex-wrap: wrap; }
.tr-period { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 22px 0; }
.tr-period > .muted { font-size: 12.5px; }
.tr-period label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.tr-period .input { height: 34px; padding: 0 10px; width: auto; }
.tr-period .chip.on { --c: #fff; }
body.narrow .tr-period { margin: 10px 12px 0; }

/* ---------- текст Telegram с форматированием ---------- */
.tg-edit { position: relative; height: auto; min-height: 150px; max-height: 420px; overflow-y: auto; padding: 12px 14px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; cursor: text; }
.bt-card .tg-edit { min-height: 78px; margin-top: 8px; }
.tg-edit.empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; position: absolute; }
.tg-edit a, .tg-text a, .tg-rich a { color: #6ab3f3; text-decoration: underline; text-underline-offset: 2px; }
.tg-edit code, .tg-text code, .tg-rich code { font: 13px/1.4 ui-monospace, "SF Mono", Menlo, monospace; padding: 1px 4px; border-radius: 4px; background: rgba(255, 255, 255, .08); color: #8fd1ff; }
.tg-edit blockquote, .tg-text blockquote, .tg-rich blockquote { display: block; margin: 4px 0; padding: 2px 8px 2px 10px; border-left: 3px solid #6ab3f3; border-radius: 4px; background: rgba(106, 179, 243, .1); }
.tg-edit .tg-spoiler { background: rgba(255, 255, 255, .14); border-radius: 4px; outline: 1px dashed rgba(255, 255, 255, .3); }
.tg-text .tg-spoiler, .tg-rich .tg-spoiler { border-radius: 4px; background: #3b4b5c; color: transparent; cursor: pointer; transition: color .2s, background .2s; }
.tg-text .tg-spoiler:hover, .tg-rich .tg-spoiler:hover { color: inherit; background: rgba(255, 255, 255, .08); }

.ctx-menu { position: fixed; z-index: 1000; min-width: 230px; padding: 6px; border-radius: 12px; background: #1c2733; border: 1px solid rgba(255, 255, 255, .08); box-shadow: 0 12px 40px rgba(0, 0, 0, .5); color: #e4ecf2; font-size: 14px; }
.ctx-menu hr { margin: 5px 4px; border: 0; border-top: 1px solid rgba(255, 255, 255, .08); }
.ctx-item { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 24px; width: 100%; padding: 8px 12px; border: 0; border-radius: 8px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.ctx-item:hover:not([disabled]), .ctx-item.has-sub:hover { background: rgba(255, 255, 255, .07); }
.ctx-item[disabled] { color: #5f6f80; cursor: default; }
.ctx-item kbd { font: inherit; font-size: 13px; color: #7f91a4; }
.ctx-item[disabled] kbd { color: inherit; }
.ctx-item svg.i { width: 14px; height: 14px; }
.ctx-sub { display: none; position: absolute; left: 100%; top: -6px; margin-left: 4px; }
.ctx-sub.left { left: auto; right: 100%; margin: 0 4px 0 0; }
.has-sub:hover > .ctx-sub { display: block; }
.has-sub::after { content: ''; position: absolute; left: 100%; top: 0; bottom: 0; width: 8px; }
.tg-link { display: grid; gap: 8px; width: 290px; padding: 12px; }
.tg-link .row-end { display: flex; justify-content: flex-end; gap: 6px; }

/* ---------- сборщик сторис ---------- */
.side-actions .btn.sb-btn { background: rgba(184, 243, 74, .12); border-color: rgba(184, 243, 74, .32); color: #d2f78f; }
.side-actions .btn.sb-btn:hover { background: rgba(184, 243, 74, .2); }
.modal.sbuilder { width: min(1500px, 100%); height: 100%; max-height: 100%; display: flex; flex-direction: column; overflow: hidden; background: rgba(14, 14, 18, .985); border-radius: 22px; }
.sb-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px 12px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.sb-head h2 { margin: 0; font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.sb-steps { margin-left: 8px; }
.sb-steps button { padding: 0 12px; }

.sb-pick { flex: 1; overflow-y: auto; padding: 22px; display: grid; align-content: start; gap: 18px; transition: background .15s; }
.sb-pick.over { background: rgba(74, 168, 255, .06); }
.sb-hint { display: grid; gap: 4px; text-align: center; }
.sb-hint b { font-size: 16px; }
.sb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; max-width: 980px; width: 100%; justify-self: center; }
.sb-tile { position: relative; aspect-ratio: 9 / 16; border-radius: 14px; overflow: hidden; background: #15151a; border: 1px solid var(--line); cursor: grab; }
.sb-tile.over { outline: 2px solid var(--review); outline-offset: 2px; }
.sb-tile img, .sb-tile video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.sb-num { position: absolute; left: 8px; top: 8px; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px; display: grid; place-items: center; background: #b8f34a; color: #111; font-weight: 800; font-size: 13px; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
.sb-del { position: absolute; right: 6px; top: 6px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .6); color: #fff; }
.sb-arrows { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; padding: 6px; background: linear-gradient(transparent, rgba(0, 0, 0, .55)); opacity: 0; transition: opacity .15s; }
.sb-tile:hover .sb-arrows { opacity: 1; }
.sb-arrows button { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .16); color: #fff; }
.sb-arrows button[disabled] { opacity: .25; }
.sb-prog { position: absolute; left: 10px; right: 10px; bottom: 10px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .2); overflow: hidden; }
.sb-prog i { display: block; height: 100%; width: 0; background: #b8f34a; transition: width .2s; }
.sb-prog.big { position: static; height: 6px; margin: 4px 0; }
.sb-add { display: grid; place-content: center; justify-items: center; gap: 8px; padding: 10px; border-style: dashed; color: var(--muted); font-size: 13px; text-align: center; cursor: pointer; }
.sb-next { display: flex; justify-content: center; padding-bottom: 10px; }
.sb-next .btn { min-width: 220px; }

.sb-edit { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 300px; }
.sb-strip { display: flex; gap: 18px; padding: 22px; overflow-x: auto; align-items: flex-start; }
.sb-col { flex: none; display: grid; gap: 8px; width: calc(min(66vh, 640px) * 9 / 16); }
.sb-card { position: relative; aspect-ratio: 9 / 16; border-radius: 16px; overflow: hidden; background: #15151a; border: 1px solid var(--line); transition: box-shadow .15s; user-select: none; }
.sb-card.on { box-shadow: 0 0 0 2px var(--review); }
.sb-card img, .sb-card video, .sb-stage img, .sb-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.sb-layer { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: default; }
.sb-under { display: flex; align-items: center; gap: 4px; color: var(--muted); }
.sb-under b { color: var(--text); font-size: 13px; min-width: 18px; text-align: center; }
.sb-under .icon-btn { width: 30px; height: 30px; }
.sb-under .icon-btn[disabled] { opacity: .3; }
.sb-more { aspect-ratio: 9 / 16; place-content: center; justify-items: center; border-radius: 16px; border: 1px dashed var(--line); color: var(--muted); font-size: 13px; padding: 12px; text-align: center; }

.sb-panel { border-left: 1px solid var(--line); padding: 16px; overflow-y: auto; display: grid; align-content: start; gap: 10px; }
.sb-panel .label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-top: 6px; }
.sb-selbox { display: grid; gap: 8px; padding: 12px; border-radius: 14px; background: var(--glass); border: 1px solid var(--line); font-size: 13px; }
.sb-selbox .label { margin-top: 0; }
.sb-text { min-height: 80px !important; }
.sb-row { display: flex; align-items: center; gap: 8px; }
.sb-row > .muted { width: 62px; font-size: 12.5px; }
.sb-row input[type=range] { flex: 1; accent-color: #b8f34a; }
.sb-row .seg { grid-auto-columns: 34px; }
.sb-sws { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sb-sw { width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .12); }
.sb-sw.on { box-shadow: 0 0 0 2px #0e0e12, 0 0 0 4px #fff; }
.sb-color { width: 30px; height: 30px; padding: 0; border: 0; background: none; cursor: pointer; }
.sb-fonts, .sb-styles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sb-fonts { grid-template-columns: repeat(2, 1fr); }
.sb-font, .sb-st { display: grid; justify-items: center; gap: 4px; padding: 10px 4px 8px; border-radius: 12px; background: var(--glass); border: 1px solid var(--line); color: var(--text); }
.sb-font.on, .sb-st.on { border-color: #b8f34a; background: rgba(184, 243, 74, .08); }
.sb-font span { font-size: 22px; line-height: 1; }
.sb-font small, .sb-st small { font-size: 11.5px; color: var(--muted); }
.sb-st span { display: inline-block; padding: 3px 8px; border-radius: 6px; font-weight: 800; font-size: 15px; }
.sb-st { background: linear-gradient(135deg, #3a3f4a, #20242c); }
.sb-note { font-size: 12px; }

.sb-player { position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; background: rgba(0, 0, 0, .92); }
.sb-phone { position: relative; height: min(92vh, 900px); aspect-ratio: 9 / 16; border-radius: 18px; overflow: hidden; background: #000; }
.sb-stage { position: absolute; inset: 0; }
.sb-bars { position: absolute; z-index: 2; left: 8px; right: 8px; top: 8px; display: flex; gap: 4px; }
.sb-bars i { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .35); overflow: hidden; }
.sb-bars i b { display: block; height: 100%; width: 0; background: #fff; }
.sb-bars i.done b { width: 100%; }
@keyframes sbbar { to { width: 100%; } }
.sb-tap { position: absolute; z-index: 1; top: 0; bottom: 0; width: 35%; background: none; border: 0; }
.sb-tap.prev { left: 0; } .sb-tap.next { right: 0; width: 65%; }
.sb-close { position: absolute; right: 18px; top: 18px; color: #fff; }

body.narrow .sb-edit { grid-template-columns: 1fr; grid-template-rows: auto auto; overflow-y: auto; }
body.narrow .sb-panel { border-left: 0; border-top: 1px solid var(--line); }
body.narrow .sb-col { width: calc(min(58vh, 520px) * 9 / 16); }
body.narrow .modal.sbuilder { border-radius: 0; height: 100dvh; }
body.narrow #overlay:has(.modal.sbuilder) { padding: 0; align-items: stretch; }

/* сборщик сторис: проекты, бренды, шаблоны */
.sb-name { min-width: 120px; width: 240px; height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid transparent; background: transparent; font-weight: 700; font-size: 15px; outline: none; }
.sb-name:hover, .sb-name:focus { border-color: var(--line); background: var(--glass); }
.sb-saved { font-size: 12px; min-width: 90px; }
.sb-projs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; max-width: 1100px; width: 100%; justify-self: center; }
.sb-proj { position: relative; display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 12px; padding: 10px; border-radius: 16px; background: var(--glass); border: 1px solid var(--line); cursor: pointer; text-align: left; transition: border-color .15s; }
.sb-proj:hover { border-color: rgba(255, 255, 255, .3); }
.sb-proj-cover { width: 64px; aspect-ratio: 9 / 16; border-radius: 10px; overflow: hidden; background: #15151a; display: grid; place-items: center; color: var(--muted); }
.sb-proj-cover img, .sb-proj-cover video { width: 100%; height: 100%; object-fit: cover; }
.sb-proj-info { display: grid; gap: 4px; min-width: 0; }
.sb-proj-info b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-proj-info span { font-size: 12.5px; }
.sb-proj-new { grid-template-columns: 1fr; justify-items: center; align-content: center; min-height: 134px; border-style: dashed; color: var(--muted); }
.sb-media { position: absolute; object-fit: cover; display: block; pointer-events: none; }
.sb-card .sb-media, .sb-stage .sb-media { inset: auto; }
.sb-brands { margin-top: 4px; }
.sb-brands button { padding: 0 8px; }
.sb-tpls, .sb-layouts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.sb-layouts { grid-template-columns: repeat(3, 1fr); }
.sb-tpl, .sb-lay { display: grid; justify-items: center; gap: 6px; padding: 8px 6px; border-radius: 12px; background: var(--glass); border: 1px solid var(--line); color: var(--text); text-align: center; }
.sb-lay.on { border-color: #b8f34a; background: rgba(184, 243, 74, .08); }
.sb-tpl small, .sb-lay small { font-size: 11px; color: var(--muted); line-height: 1.25; }
.sb-tpl-pic { position: relative; width: 52px; aspect-ratio: 9 / 16; border-radius: 6px; overflow: hidden; background: linear-gradient(160deg, #8a7a6a, #3d3530); }
.sb-tpl-pic i, .sb-tpl-pic em { position: absolute; display: block; }
.tpl-bubble i { left: 8%; top: 18%; width: 72%; height: 10%; border-radius: 99px; background: #4a2384; }
.tpl-outline i { left: 8%; bottom: 16%; width: 78%; height: 11%; border-radius: 99px; background: #fff; box-shadow: inset 0 0 0 1px #b99ee8; }
.tpl-card, .lay-pb-purple { background: #4a2384; }
.tpl-card i, .lay-pb-purple i { left: 5%; top: 3%; width: 90%; height: 64%; border-radius: 4px; background: linear-gradient(160deg, #8a7a6a, #3d3530); }
.tpl-card em { left: 7%; top: 71%; width: 86%; height: 22%; border-radius: 4px; background: #fff; }
.tpl-logo, .lay-pb-white { background: #fff; }
.tpl-logo i, .lay-pb-white i { left: 5%; top: 37%; width: 90%; height: 60%; border-radius: 4px; background: linear-gradient(160deg, #8a7a6a, #3d3530); }
.tpl-logo em { left: 36%; top: 4%; width: 28%; height: 7%; background: #6a3d9e; border-radius: 2px; box-shadow: -10px 14px 0 -1px #4a2384, 10px 14px 0 -1px #4a2384; }
.lay-full i { inset: 0; }
.sb-styles.two { grid-template-columns: repeat(2, 1fr); }
.sb-st.light { background: linear-gradient(135deg, #8a7a6a, #3d3530); }
.sb-stickers { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.sb-stk { aspect-ratio: 1; border-radius: 10px; background: #f3f0f8; display: grid; place-items: center; padding: 4px; border: 1px solid var(--line); }
.sb-stk img { max-width: 100%; max-height: 100%; object-fit: contain; }
.sb-panel { min-width: 0; overflow-x: hidden; }
.sb-tpls, .sb-styles.two, .sb-fonts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sb-layouts, .sb-styles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sb-stickers { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.sb-brands { grid-auto-columns: minmax(0, 1fr); }
.sb-frame { position: absolute; overflow: hidden; pointer-events: none; }
.sb-frame > img, .sb-frame > video { transform-origin: center; will-change: transform; }
.sb-card.on .sb-layer { cursor: grab; }
.sb-card.panning .sb-layer { cursor: grabbing; }
.sb-stk.mine { position: relative; padding: 0; }
.sb-stk-add { width: 100%; height: 100%; display: grid; place-items: center; padding: 4px; }
.sb-stk-add img { max-width: 100%; max-height: 100%; object-fit: contain; }
.sb-stk-del { position: absolute; right: -5px; top: -5px; width: 20px; height: 20px; border-radius: 50%; display: none; place-items: center; background: #2a2a31; color: #fff; border: 1px solid var(--line); }
.sb-stk-del svg.i { width: 11px; height: 11px; }
.sb-stk.mine:hover .sb-stk-del { display: grid; }
.sb-stk-up { background: var(--glass); color: var(--muted); border-style: dashed; }
.sb-stk { background-image: linear-gradient(45deg, #e9e4f1 25%, transparent 25%, transparent 75%, #e9e4f1 75%), linear-gradient(45deg, #e9e4f1 25%, transparent 25%, transparent 75%, #e9e4f1 75%); background-size: 10px 10px; background-position: 0 0, 5px 5px; }
.sb-stk-up { background-image: none; }
.sb-tools { position: absolute; z-index: 3; display: flex; gap: 8px; transform: translateX(-50%); }
.sb-tool { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: #111; box-shadow: 0 2px 8px rgba(0, 0, 0, .4); }
.sb-tool svg.i { width: 15px; height: 15px; }
.sb-tool.danger { color: #e5484d; }
.sb-tool:hover { transform: scale(1.08); }
.sb-tools[hidden] { display: none; }
.sb-search { height: 36px; font-size: 13px; padding: 0 12px; }
.sb-peek { position: fixed; z-index: 1200; width: 220px; padding: 10px; border-radius: 14px; background: #1c1c22; border: 1px solid var(--line); box-shadow: 0 16px 40px rgba(0, 0, 0, .55); pointer-events: none; animation: rise .15s var(--ease); }
.sb-peek-img { height: 200px; border-radius: 10px; display: grid; place-items: center; padding: 10px; background-color: #f6f3fa; background-image: linear-gradient(45deg, #e9e4f1 25%, transparent 25%, transparent 75%, #e9e4f1 75%), linear-gradient(45deg, #e9e4f1 25%, transparent 25%, transparent 75%, #e9e4f1 75%); background-size: 16px 16px; background-position: 0 0, 8px 8px; }
.sb-peek-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.sb-peek-name { margin-top: 8px; font-size: 13px; font-weight: 600; text-align: center; }
.sb-stickers[hidden], .sb-panel .label[hidden] { display: none; }
.sb-layers { grid-auto-columns: 34px; }
#sb-ctx { z-index: 1300; min-width: 220px; }
.sb-plus-wrap { position: relative; display: grid; }
.sb-plus-wrap > .sb-tpl, .sb-plus-wrap > .sb-st { width: 100%; }
.sb-plus { position: absolute; right: 5px; top: 5px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #b8f34a; color: #111; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); opacity: .85; transition: transform .12s, opacity .12s; }
.sb-plus svg.i { width: 13px; height: 13px; stroke-width: 2.4; }
.sb-plus:hover { opacity: 1; transform: scale(1.12); }
.sb-card.drop { box-shadow: 0 0 0 3px #b8f34a; }
.sb-tpl[draggable], .sb-st[draggable], .sb-stk[draggable] { cursor: grab; }

/* сборщик сторис: начертания выделенного текста и свои шаблоны */
.sb-text { height: auto; max-height: 220px; overflow-y: auto; padding: 10px 12px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; font-size: 14px; }
.sb-text .w-bold { font-weight: 800; }
.sb-text .w-thin { font-weight: 300; }
.sb-text .it { font-style: italic; }
.sb-text .un { text-decoration: underline; }
.sb-fmt { display: flex; gap: 4px; }
.sb-fmt button { width: 32px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--glass-2); color: var(--text); font-size: 14px; }
.sb-fmt button:hover { background: rgba(255, 255, 255, .16); }
.sb-fmt-bold { font-weight: 800; }
.sb-fmt-thin { font-weight: 300; }
.sb-fmt-italic { font-style: italic; }
.sb-fmt-under { text-decoration: underline; }
.sb-tpl-canvas { width: 60px; aspect-ratio: 9 / 16; border-radius: 6px; display: block; }
.sb-tpl-del { position: absolute; left: 5px; top: 5px; width: 22px; height: 22px; border-radius: 50%; display: none; place-items: center; background: #2a2a31; color: #fff; border: 1px solid var(--line); }
.sb-tpl-del svg.i { width: 11px; height: 11px; }
.sb-plus-wrap:hover .sb-tpl-del { display: grid; }

/* сборщик сторис: в публикацию */
.sb-pub-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.sb-pub-list { display: grid; gap: 6px; max-height: 44vh; overflow-y: auto; }
.sb-pub-row { display: grid; grid-template-columns: 20px 26px 34px minmax(0, 1fr) 110px; align-items: center; gap: 8px; padding: 6px; border-radius: 10px; background: var(--glass); }
.sb-pub-row.off { opacity: .45; }
.sb-pub-th { width: 34px; aspect-ratio: 9 / 16; border-radius: 5px; overflow: hidden; background: #15151a; }
.sb-pub-th img, .sb-pub-th video { width: 100%; height: 100%; object-fit: cover; display: block; }
.sb-pub-row .input { height: 36px; padding: 0 10px; }
.sb-plates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sb-plate { padding: 4px; border-radius: 10px; background: linear-gradient(135deg, #8a7a6a, #3d3530); border: 1px solid var(--line); cursor: grab; }
.sb-plate-canvas { width: 100%; display: block; }
.sb-up { display: grid; place-items: center; align-content: center; gap: 6px; min-height: 60px; background: var(--glass); border-style: dashed; color: var(--muted); cursor: pointer; }
.sb-tpl.sb-up { min-height: 120px; }
.sb-tpls.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sb-tpl-thumb { width: 100%; max-width: 62px; aspect-ratio: 9 / 16; object-fit: contain; border-radius: 6px; background: repeating-conic-gradient(#8a8a8a 0 25%, #6e6e6e 0 50%) 0 0 / 12px 12px; display: block; }
.sb-tpls.three .sb-plus { width: 20px; height: 20px; right: 3px; top: 3px; }
.sb-panel { grid-template-columns: minmax(0, 1fr); }
.sb-panel > .btn { white-space: normal; height: auto; min-height: 36px; padding-top: 6px; padding-bottom: 6px; line-height: 1.25; text-align: center; }

/* сборщик сторис: цвет текста */
.sb-colors { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 2px 4px; }
.sb-color-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .25); }
.sb-color-dot:hover { transform: scale(1.12); }
.sb-color-own { width: 24px; height: 24px; padding: 0; border: 0; background: none; cursor: pointer; }

/* сборщик сторис: обрезка видео */
.sb-main { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.sb-main .sb-strip { flex: 1; min-height: 0; }
.sb-tl { flex: none; padding: 10px 16px 14px; border-top: 1px solid var(--line); background: rgba(14, 14, 18, .96); animation: rise .2s var(--ease); }
.sb-tl[hidden] { display: none; }
.sb-tl-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 13px; }
.sb-tl-top .btn { height: 32px; font-size: 13px; }
.sb-tl-track { position: relative; height: 64px; border-radius: 8px; background: #15151a; touch-action: none; user-select: none; cursor: pointer; }
.sb-tl-frames { position: absolute; inset: 0; display: flex; overflow: hidden; border-radius: 8px; }
.sb-tl-cell { flex: 1; background-size: cover; background-position: center; }
.sb-tl-dim { position: absolute; top: 0; bottom: 0; background: rgba(0, 0, 0, .68); pointer-events: none; }
.sb-tl-grip { position: absolute; top: -3px; bottom: -3px; width: 14px; margin-left: -7px; border-radius: 4px; background: #b8f34a; cursor: ew-resize; z-index: 3; touch-action: none; }
.sb-tl-grip::after { content: ''; position: absolute; left: 6px; top: 22px; bottom: 22px; width: 2px; background: #1a2600; }
.sb-tl-cuts { position: absolute; inset: 0; pointer-events: none; }
.sb-tl-cut { position: absolute; top: 0; bottom: 0; display: grid; place-items: center; color: #fff; background: repeating-linear-gradient(45deg, rgba(229, 57, 53, .75) 0 8px, rgba(120, 20, 20, .75) 8px 16px); outline: 2px solid #e53935; pointer-events: auto; cursor: grab; z-index: 2; touch-action: none; }
.sb-tl-edge { position: absolute; top: 0; bottom: 0; width: 12px; cursor: ew-resize; background: #e53935; touch-action: none; }
.sb-tl-edge.l { left: -6px; } .sb-tl-edge.r { right: -6px; }
.sb-tl-del { position: absolute; top: -9px; right: -9px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: #111; z-index: 4; }
.sb-tl-del svg.i { width: 11px; height: 11px; }
.sb-tl-head { position: absolute; top: -5px; bottom: -5px; width: 2px; left: 0; background: #fff; box-shadow: 0 0 4px rgba(0, 0, 0, .7); pointer-events: none; z-index: 4; }

/* сборщик сторис: лупа — все сторис на одном экране */
.sb-zoom-btn.on { background: #b8f34a; color: #111; }
.sb-strip.overview { flex-wrap: wrap; justify-content: center; align-content: center; gap: 12px; padding: 12px; overflow: auto; }
.sb-strip.overview .sb-col:not(.sb-more) { width: var(--sb-col, 120px); gap: 2px; }
.sb-strip.overview .sb-more { display: none; }
.sb-strip.overview .sb-card { border-radius: 8px; }
.sb-strip.overview .sb-under { height: 24px; justify-content: center; }
.sb-strip.overview .sb-under .icon-btn, .sb-strip.overview .sb-under .grow { display: none; }
.sb-panel > .btn.sb-guides.on { background: rgba(255, 45, 120, .16); border-color: rgba(255, 45, 120, .5); color: #ff8db4; }
.sb-undo[disabled], .sb-redo[disabled] { opacity: .3; }

/* сборщик сторис: телефон */
.sb-burger, .sb-scrim, .sb-drawer-head, .sb-drawer-acts { display: none; }
.modal.sbuilder { position: relative; }
body.narrow .sb-wide { display: none; }
body.narrow .sb-burger { display: grid; }
body.narrow .sb-head { flex-wrap: nowrap; gap: 4px; padding: 8px 8px calc(8px); padding-top: max(8px, env(safe-area-inset-top)); }
body.narrow .sb-head .sb-back { width: 36px; padding: 0; justify-content: center; flex: none; }
body.narrow .sb-head .icon-btn { flex: none; width: 36px; height: 36px; }
body.narrow .sb-name { flex: 1; width: auto; min-width: 0; font-size: 14px; padding: 0 6px; }
body.narrow .sb-head > .grow { display: none; }
body.narrow .modal.sbuilder { height: 100dvh; width: 100%; }
body.narrow .sb-edit { display: block; position: static; flex: 1; min-height: 0; overflow: hidden; }
body.narrow .sb-main { height: 100%; container-type: size; }
body.narrow .sb-strip { gap: 12px; padding: 10px calc((100cqw - var(--sb-card)) / 2); scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; align-items: center; overflow-y: hidden; --sb-card: min(100cqw - 56px, (100cqh - 64px) * 9 / 16); }
body.narrow .sb-main:has(.sb-tl:not([hidden])) .sb-strip { --sb-card: min(100cqw - 56px, (100cqh - 180px) * 9 / 16); }
body.narrow .sb-col { width: var(--sb-card); scroll-snap-align: center; gap: 4px; }
body.narrow .sb-under .icon-btn { width: 34px; height: 34px; }
body.narrow .sb-card .sb-layer { touch-action: pan-x; }
body.narrow .sb-card.grab .sb-layer { touch-action: none; }
body.narrow .sb-scrim { display: block; position: absolute; inset: 0; z-index: 20; background: rgba(0, 0, 0, .55); opacity: 0; pointer-events: none; transition: opacity .22s; }
body.narrow .sb-scrim.on { opacity: 1; pointer-events: auto; }
body.narrow .sb-panel { position: absolute; z-index: 21; top: 0; bottom: 0; right: 0; width: min(88%, 360px); border-left: 1px solid var(--line); border-top: 0; background: #101014; transform: translateX(102%); transition: transform .26s var(--ease); box-shadow: -12px 0 40px rgba(0, 0, 0, .5); padding: 12px 14px calc(16px + env(safe-area-inset-bottom)); }
body.narrow .sb-panel.open { transform: none; }
body.narrow .sb-drawer-head { display: flex; align-items: center; gap: 8px; }
body.narrow .sb-drawer-acts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
body.narrow .sb-drawer-acts .btn { min-height: 40px; font-size: 13px; padding: 0 6px; justify-content: center; }
body.narrow .sb-drawer-acts .btn.primary { grid-column: 1 / -1; }
body.narrow .sb-panel .btn.on { background: rgba(184, 243, 74, .16); border-color: #b8f34a; }
body.narrow .sb-text { font-size: 16px; }
body.narrow .sb-row input[type=range] { height: 28px; }
body.narrow .sb-fmt button { width: 40px; height: 38px; }
body.narrow .sb-color-dot { width: 30px; height: 30px; }
body.narrow .sb-tl { padding: 8px 10px 10px; }
body.narrow .sb-tl-top { flex-wrap: nowrap; gap: 4px; margin-bottom: 8px; }
body.narrow .sb-tl-top .btn { height: 30px; padding: 0 8px; font-size: 12px; gap: 4px; white-space: nowrap; flex: none; }
body.narrow .sb-tl-top .grow { display: none; }
body.narrow .sb-tl-top .muted { margin-left: auto; font-size: 11px; text-align: right; line-height: 1.15; min-width: 0; }
body.narrow .sb-tl-track { height: 52px; margin: 0 8px; }
body.narrow .sb-tl-grip { width: 22px; margin-left: -11px; }
body.narrow .sb-tl-grip::after { left: 10px; }
body.narrow .sb-tl-edge { width: 18px; } 
body.narrow .sb-tl-edge.l { left: -9px; } body.narrow .sb-tl-edge.r { right: -9px; }
body.narrow .sb-tl-del { width: 26px; height: 26px; }
body.narrow .sb-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
body.narrow .sb-pick { padding: 12px; }
body.narrow .sb-projs { grid-template-columns: minmax(0, 1fr); }
body.narrow .sb-phone { height: min(100dvh, 177.78vw); border-radius: 0; }
body.narrow .sb-pub-top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body.narrow .sb-pub-row { grid-template-columns: 20px 22px 28px minmax(0, 1fr) 92px; gap: 5px; padding: 4px; }
body.narrow .sb-pub-th { width: 28px; }
body.narrow .sb-pub-row .input { padding: 0 6px; font-size: 13px; }
body.narrow .ctx-menu { max-width: calc(100vw - 16px); }
@media (hover: none) {
  .sb-arrows { opacity: 1; }
  .sb-stk.mine .sb-stk-del, .sb-plus-wrap .sb-tpl-del { display: grid; }
}
/* белые стикеры: на светлой плитке их не видно */
.sb-stk.dark, .sb-peek-img.dark { background: #4a2384; background-image: none; }
.sb-stk { min-width: 0; min-height: 0; overflow: hidden; }
.sb-stk > img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sb-stk.mine { overflow: visible; }
