/* ===== Тема: 4 цвета задаются из JS (themes в app.js), режим — data-mode на <html> ===== */
:root {
  --pink: #ff3d8b; --orange: #ff8a3d; --purple: #8b3dff; --teal: #22d8c8; --sun: #ffc53d;
  --accent: var(--pink); --danger: #ff4d61; --ok: var(--teal); --radius: 16px;
  --grad: linear-gradient(100deg, var(--pink), var(--orange));
  --grad-top: linear-gradient(100deg, color-mix(in srgb, var(--purple) 85%, #000) 0%, var(--pink) 60%, var(--orange) 100%);
  --accent-2: color-mix(in srgb, var(--pink) 16%, transparent);
  --nav-h: 62px; --top-h: 52px; --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  /* тёмный режим (по умолчанию) */
  --bg: color-mix(in srgb, var(--purple) 12%, #07060d);
  --card: color-mix(in srgb, var(--purple) 14%, #110e1b);
  --surface: color-mix(in srgb, var(--purple) 20%, #181427);
  --line: color-mix(in srgb, var(--purple) 26%, #231e36);
  --text: #f4f1fb; --muted: #a39cbc; --shadow: 0 8px 24px rgba(0, 0, 0, .3);
  color-scheme: dark;
}
:root[data-mode="light"] {
  --bg: color-mix(in srgb, var(--purple) 6%, #f6f5fa);
  --card: #ffffff;
  --surface: color-mix(in srgb, var(--purple) 7%, #f1f0f5);
  --line: color-mix(in srgb, var(--purple) 13%, #e3e1ea);
  --text: #1b1923; --muted: #6b6680; --shadow: 0 4px 16px rgba(30, 20, 60, .08);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; color: var(--text); background: var(--bg);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; -webkit-tap-highlight-color: transparent; }
body { min-height: 100vh; background:
  radial-gradient(120% 55% at 50% -10%, color-mix(in srgb, var(--purple) 30%, transparent), transparent 60%),
  radial-gradient(70% 40% at 100% 0%, color-mix(in srgb, var(--pink) 16%, transparent), transparent 60%), var(--bg);
  background-attachment: fixed; }
:root[data-mode="light"] body { background:
  radial-gradient(120% 50% at 50% -10%, color-mix(in srgb, var(--purple) 12%, transparent), transparent 60%), var(--bg); background-attachment: fixed; }
a { color: var(--pink); text-decoration: none; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
img, video { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ===== Каркас ===== */
.topbar { position: sticky; top: 0; z-index: 30; height: var(--top-h); padding: var(--safe-t) 8px 0 12px; box-sizing: content-box;
  background: var(--grad-top); color: #fff; display: flex; align-items: center; gap: 2px; }
.brand { display: flex; align-items: center; gap: 9px; color: #fff; font-weight: 900; font-size: 19px; letter-spacing: 3px; margin-right: auto; }
.brand img { width: 30px; height: 30px; border-radius: 9px; }
.topbtn { color: #fff; padding: 8px; display: flex; border-radius: 10px; }
.topbtn:active { background: rgba(255,255,255,.15); }
.nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); display: flex; align-items: center; }
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: 11px; position: relative; height: 100%; }
.nav a.active { color: var(--pink); }
.nav a.plus { flex: 0 0 76px; }
.nav a.plus span.ring { width: 54px; height: 54px; border-radius: 50%; background: var(--grad); color: #fff; display: flex; align-items: center; justify-content: center;
  margin-top: -22px; box-shadow: 0 6px 20px color-mix(in srgb, var(--pink) 55%, transparent), 0 0 0 5px var(--bg); transition: transform .15s; }
.nav a.plus span.ring svg { width: 28px; height: 28px; stroke-width: 2.6; }
.nav a.plus:active span.ring { transform: scale(.92); }
.badge { position: absolute; top: 6px; left: 50%; margin-left: 5px; background: var(--grad); color: #fff; font-size: 11px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px; display: flex; align-items: center; justify-content: center; }
main { max-width: 680px; margin: 0 auto; padding: 10px 10px calc(var(--nav-h) + var(--safe-b) + 20px); }
@media (min-width: 900px) {
  .nav { top: calc(var(--top-h) + 16px); bottom: auto; left: calc(50% - 560px); right: auto; width: 200px; height: auto; flex-direction: column;
    border: 0; background: transparent; backdrop-filter: none; padding: 0; align-items: stretch; gap: 2px; }
  .nav a { flex-direction: row; justify-content: flex-start; gap: 12px; font-size: 15px; padding: 10px 12px; border-radius: 12px; color: var(--text); height: auto; flex: none; }
  .nav a.active { background: var(--card); }
  .nav a.plus { order: -1; flex: none; margin-bottom: 8px; background: var(--grad); color: #fff; justify-content: center; font-weight: 700; }
  .nav a.plus span.ring { width: auto; height: auto; margin: 0; background: none; box-shadow: none; }
  .nav a.plus span.ring svg { width: 22px; height: 22px; }
  .badge { position: static; margin-left: auto; }
  main { padding-bottom: 30px; }
}

/* ===== Базовые элементы ===== */
.card { background: var(--card); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; border: 1px solid color-mix(in srgb, var(--line) 60%, transparent); box-shadow: var(--shadow); }
.card h2, .card h3 { margin: 0 0 10px; font-size: 17px; }
.card h3 { font-size: 16px; }
.muted { color: var(--muted); font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.btn { border: 0; background: var(--grad); color: #fff; padding: 10px 16px; border-radius: 12px; cursor: pointer; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; box-shadow: 0 4px 14px color-mix(in srgb, var(--pink) 30%, transparent); text-align: center; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.secondary { background: var(--accent-2); color: var(--pink); box-shadow: none; }
.btn.ghost { background: transparent; color: var(--muted); padding: 6px 8px; font-weight: 500; box-shadow: none; }
.btn.danger { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); box-shadow: none; }
.btn.block { width: 100%; }
.btn.small { padding: 7px 11px; font-size: 13px; border-radius: 10px; }
.btn.big { padding: 14px 18px; font-size: 16px; border-radius: 14px; }
input[type=text], input[type=password], input[type=url], input[type=date], input[type=tel], input[type=email], input[type=number], input:not([type]), textarea, select {
  width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 12px; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--pink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pink) 18%, transparent); }
textarea { resize: vertical; min-height: 44px; }
input[type=range] { width: 100%; accent-color: var(--pink); }
input[type=color] { width: 44px; height: 44px; border: 0; padding: 0; background: none; border-radius: 12px; cursor: pointer; }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.check { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--pink); flex-shrink: 0; margin: 1px 0 0; }
/* переключатель */
.switch { position: relative; width: 46px; height: 28px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i { position: absolute; inset: 0; background: var(--line); border-radius: 14px; transition: .2s; cursor: pointer; }
.switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + i { background: var(--grad); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:disabled + i { opacity: .4; cursor: default; }
/* сегменты */
.seg { display: flex; background: var(--surface); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 8px 6px; border-radius: 9px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.seg button:disabled { opacity: .4; }
/* строки настроек как в TikTok */
.set-row { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); color: var(--text); min-height: 52px; }
.set-row:last-child { border-bottom: 0; }
.set-row .ico { width: 34px; height: 34px; border-radius: 10px; background: var(--surface); display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; }
.set-row .ttl { font-weight: 600; }
.set-row .sub { color: var(--muted); font-size: 13px; }
.set-row .chev { color: var(--muted); }
.sub-panel { background: var(--surface); border-radius: 12px; padding: 12px; margin: 0 0 10px; }
.sub-panel label.field:last-child { margin-bottom: 0; }

.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: linear-gradient(135deg, var(--purple), var(--pink)); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; flex-shrink: 0; }
.avatar.lg { width: 96px; height: 96px; font-size: 36px; }
.avatar.sm { width: 32px; height: 32px; font-size: 13px; }
.avatar-wrap { position: relative; display: inline-flex; }
.avatar-wrap.online::after { content: ""; position: absolute; right: 1px; bottom: 1px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--ok); border: 2px solid var(--card); }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.tabs { display: flex; gap: 6px; margin-bottom: 10px; overflow-x: auto; }
.tabs a, .tabs button { padding: 7px 14px; border-radius: 18px; background: var(--card); color: var(--text); white-space: nowrap; font-size: 14px; border: 0; cursor: pointer; }
.tabs .active { background: var(--grad); color: #fff; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); color: var(--text); }
.list-item:last-child { border-bottom: 0; }
.list-item .name { font-weight: 600; }
.loader { text-align: center; padding: 20px; color: var(--muted); }
#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + var(--safe-b) + 18px); z-index: 300;
  background: var(--surface); border: 1px solid var(--line); color: var(--text); padding: 10px 16px; border-radius: 12px; max-width: 90vw; font-size: 14px; box-shadow: var(--shadow); }
.progress { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin: 8px 0; }
.progress > i { display: block; height: 100%; background: var(--grad); width: 0; transition: width .3s; }
.warn { background: color-mix(in srgb, var(--sun) 14%, transparent); color: var(--text); border-radius: 10px; padding: 8px 10px; font-size: 13px; margin: 8px 0; }
.code { font-family: ui-monospace, Menlo, monospace; background: var(--surface); color: var(--sun); padding: 2px 6px; border-radius: 6px; word-break: break-all; font-size: 13px; }
:root[data-mode="light"] .code { color: color-mix(in srgb, var(--orange) 70%, #000); }
details.help { font-size: 14px; margin: 8px 0 12px; background: var(--surface); border-radius: 12px; padding: 8px 12px; }
details.help summary { cursor: pointer; color: var(--pink); font-weight: 600; }
details.help ol { padding-left: 20px; margin: 8px 0; }
details.help li { margin-bottom: 5px; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); display: inline-block; flex-shrink: 0; }
.status-dot.on { background: var(--ok); box-shadow: 0 0 8px var(--teal); }
.err { color: var(--danger); font-size: 14px; margin: 6px 0; }
.icon-btn { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 6px; display: inline-flex; border-radius: 10px; }
.icon-btn:hover { background: var(--surface); }

/* ===== Посты ===== */
.post-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.post-head .who { font-weight: 700; color: var(--text); }
.post-text { white-space: pre-wrap; word-wrap: break-word; margin: 6px 0; }
.post-media { display: grid; gap: 3px; margin: 8px -14px; }
.post-media.n1 { grid-template-columns: 1fr; }
.post-media.n2, .post-media.n4 { grid-template-columns: 1fr 1fr; }
.post-media.n3, .post-media.nmany { grid-template-columns: 1fr 1fr 1fr; }
.post-media img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 1; cursor: zoom-in; }
.post-media.n1 img { aspect-ratio: auto; max-height: 560px; object-fit: contain; background: #000; }
.post-media video { width: 100%; max-height: 600px; background: #000; }
.post-actions { display: flex; gap: 6px; margin-top: 8px; }
.act { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 0; border-radius: 16px; padding: 6px 12px; color: var(--muted); cursor: pointer; font-size: 14px; }
.act svg { width: 20px; height: 20px; }
.act.liked { color: var(--pink); background: var(--accent-2); }
.act.liked svg { fill: currentColor; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { font-size: 12px; padding: 4px 9px; border-radius: 12px; background: var(--surface); color: var(--muted); display: inline-flex; gap: 4px; align-items: center; }
.chip.done { background: color-mix(in srgb, var(--teal) 15%, transparent); color: var(--teal); }
:root[data-mode="light"] .chip.done { color: color-mix(in srgb, var(--teal) 60%, #000); }
.chip.error { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.chip.uploading, .chip.queued { background: color-mix(in srgb, var(--sun) 15%, transparent); color: color-mix(in srgb, var(--sun) 80%, var(--text)); }
.chip button { border: 0; background: none; color: inherit; text-decoration: underline; cursor: pointer; padding: 0; font-size: 12px; }
.xp-error { font-size: 12px; color: var(--danger); margin-top: 4px; }
.link-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; background: var(--accent-2); padding: 5px 10px; border-radius: 14px; margin-top: 6px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.processing { background: var(--surface); border-radius: 12px; padding: 14px; text-align: center; margin: 8px 0; }
.create-bar { display: flex; align-items: center; gap: 10px; color: var(--muted); cursor: pointer; }
.create-bar .fake { flex: 1; background: var(--surface); border-radius: 22px; padding: 10px 14px; }
.comments { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 6px; }
.comment { display: flex; gap: 8px; padding: 8px 0; }
.comment .body { flex: 1; min-width: 0; }
.comment .who { font-weight: 600; font-size: 14px; color: var(--text); }
.thumbs { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.thumb { position: relative; width: 76px; height: 76px; border-radius: 10px; overflow: hidden; background: var(--surface); }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; line-height: 1; }
.thumb .pct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.45); color: #fff; font-size: 13px; }
.thumb.add { display: flex; align-items: center; justify-content: center; color: var(--muted); border: 2px dashed var(--line); background: none; cursor: pointer; }

/* ===== Профиль ===== */
.profile-head { display: flex; gap: 16px; align-items: center; }
.profile-head h1 { margin: 0; font-size: 21px; }
.profile-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.info-row { display: flex; gap: 8px; font-size: 14px; margin-top: 4px; }
.info-row b { color: var(--muted); font-weight: 400; min-width: 80px; }

/* ===== Рилсы ===== */
body.reels-mode main { max-width: none; padding: 0; }
.reels { height: calc(100dvh - var(--top-h) - var(--nav-h) - var(--safe-b) - var(--safe-t)); overflow-y: scroll; scroll-snap-type: y mandatory; background: #000; position: relative; }
@media (min-width: 900px) { .reels { height: calc(100dvh - var(--top-h)); max-width: 460px; margin: 0 auto; } }
.reels-tabs { position: sticky; top: 0; z-index: 5; height: 0; display: flex; justify-content: center; gap: 18px; }
.reels-tabs button { margin-top: 12px; height: 30px; background: none; border: 0; color: rgba(255,255,255,.65); font-weight: 700; font-size: 15px; cursor: pointer; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.reels-tabs button.on { color: #fff; border-bottom: 2px solid #fff; }
.reel { height: 100%; scroll-snap-align: start; position: relative; display: flex; align-items: center; justify-content: center; }
.reel video { width: 100%; height: 100%; object-fit: contain; }
.reel .overlay { position: absolute; left: 0; right: 64px; bottom: 0; padding: 16px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.65)); }
.reel .overlay a { color: #fff; }
.reel .overlay .post-text { max-height: 6.5em; overflow: hidden; font-size: 14px; }
.reel .side { position: absolute; right: 8px; bottom: 30px; display: flex; flex-direction: column; gap: 16px; align-items: center; color: #fff; }
.reel .side button, .reel .side a { background: rgba(0,0,0,.35); border: 0; color: #fff; border-radius: 50%; width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center; cursor: pointer; flex-direction: column; font-size: 11px; }
.reel .side .liked svg { fill: var(--pink); stroke: var(--pink); }
.reel .mute { position: absolute; top: 52px; right: 12px; background: rgba(0,0,0,.4); color: #fff; border: 0; border-radius: 16px; padding: 5px 10px; font-size: 13px; }

/* ===== Создание: выбор файла ===== */
.picker { border: 2px dashed var(--line); border-radius: 20px; padding: 40px 16px; text-align: center; cursor: pointer; display: block; color: var(--text); }
.picker .big-ico { width: 76px; height: 76px; margin: 0 auto 12px; border-radius: 50%; background: var(--grad); display: flex; align-items: center; justify-content: center; color: #fff; }
.picker .big-ico svg { width: 36px; height: 36px; }

/* ===== Редактор (как в TikTok) ===== */
body.editor-mode .topbar, body.editor-mode .nav { display: none; }
body.editor-mode main { max-width: 560px; padding: 0; }
body.editor-mode { background: #000; }
.editor { display: flex; flex-direction: column; background: #000; color: #fff; height: 100dvh; padding-top: var(--safe-t); padding-bottom: var(--safe-b); overflow: hidden; }
.ed-top { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; gap: 10px; flex-shrink: 0; }
.ed-x { background: none; border: 0; color: #fff; font-size: 22px; cursor: pointer; padding: 4px 8px; }
.ed-warn { font-size: 12px; color: #ffcf8a; }
.ed-stage { flex: 1; min-height: 0; position: relative; display: flex; justify-content: center; align-items: center; padding: 0 8px; }
.ed-frame { position: relative; height: 100%; max-width: 100%; aspect-ratio: 9 / 16; background: #111; border-radius: 14px; overflow: hidden; touch-action: none; }
.ed-frame video { position: absolute; inset: 0; width: 100%; height: 100%; }
.ed-frame .ed-bg { object-fit: cover; filter: blur(18px); transform: scale(1.15); }
.ed-bigplay { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 64px; height: 64px; border-radius: 50%; background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; color: #fff; cursor: pointer; }
.ed-bigplay svg { width: 30px; height: 30px; margin-left: 4px; }
.ed-rail { position: absolute; right: 14px; top: 8px; display: flex; flex-direction: column; gap: 12px; z-index: 3; }
.ed-rail button { background: none; border: 0; color: #fff; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10px; cursor: pointer; text-shadow: 0 1px 4px rgba(0,0,0,.8); }
.ed-rail button svg { width: 26px; height: 26px; filter: drop-shadow(0 1px 3px rgba(0,0,0,.7)); }
.ed-rail button.on svg { color: var(--pink); }
.ed-rail button:disabled { opacity: .35; }
.ed-texts { position: absolute; inset: 0; pointer-events: none; }
.ed-text { position: absolute; transform: translate(-50%, -50%); white-space: pre; text-align: center; font-weight: 800; line-height: 1.2; pointer-events: auto; cursor: grab;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; user-select: none; -webkit-user-select: none; }
.ed-text.sel { outline: 2px dashed rgba(255,255,255,.85); outline-offset: 4px; }
.ed-text.st-plain { text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.ed-text.st-bg { padding: .12em .4em; border-radius: .25em; }
.ed-text.st-outline { text-shadow: -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000, 0 2px 0 #000, 2px 0 0 #000, 0 -2px 0 #000, -2px 0 0 #000; }
.ed-text.hidden-t { opacity: .2; }
.ed-bottom { flex-shrink: 0; background: #0e0e12; border-radius: 18px 18px 0 0; margin-top: 8px; padding: 6px 14px 10px; }
.ed-ctrl { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; font-size: 12px; color: #bbb; font-variant-numeric: tabular-nums; }
.ed-ctrl span:last-child { text-align: right; }
.ed-ctrl button { background: none; border: 0; color: #fff; cursor: pointer; padding: 4px 12px; display: flex; }
.ed-ctrl button svg { width: 22px; height: 22px; }
/* таймлайн */
.tl { padding: 6px 12px 0; user-select: none; -webkit-user-select: none; }
.tl-strip { position: relative; height: 56px; touch-action: none; cursor: pointer; }
.tl-thumbs { position: absolute; inset: 0; display: flex; border-radius: 6px; overflow: hidden; background: #222; }
.tl-thumbs img { height: 100%; object-fit: cover; flex-shrink: 0; }
.tl-thumbs.fallback { background: linear-gradient(90deg, var(--purple), var(--pink), var(--orange)); }
.tl-dim { position: absolute; top: 0; bottom: 0; left: 0; background: rgba(0,0,0,.65); pointer-events: none; }
.tl-sel { position: absolute; top: -2px; bottom: -2px; border: 3px solid #fff; border-left: 0; border-right: 0; pointer-events: none; }
.tl-sel i { position: absolute; top: -3px; bottom: -3px; width: 16px; background: #fff; pointer-events: auto; touch-action: none; cursor: ew-resize; }
.tl-sel i::after { content: ""; position: absolute; left: 6px; top: 35%; bottom: 35%; width: 4px; border-radius: 2px; background: #111; }
.tl-sel .h-l { left: -16px; border-radius: 6px 0 0 6px; }
.tl-sel .h-r { right: -16px; border-radius: 0 6px 6px 0; }
.tl-head { position: absolute; top: -6px; bottom: -6px; width: 3px; margin-left: -1.5px; background: #fff; border-radius: 2px; box-shadow: 0 0 6px rgba(0,0,0,.8); pointer-events: none; }
.tl-tracks { margin-top: 8px; display: flex; flex-direction: column; gap: 5px; max-height: 92px; overflow-y: auto; }
.tl-track { position: relative; height: 26px; }
.tl-clip { position: absolute; top: 0; bottom: 0; border-radius: 6px; background: color-mix(in srgb, var(--pink) 75%, #000); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; overflow: hidden; touch-action: none; cursor: grab; }
.tl-clip span { flex: 1; padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.tl-clip i { width: 10px; align-self: stretch; background: rgba(255,255,255,.35); cursor: ew-resize; flex-shrink: 0; }
.tl-clip.sel { outline: 2px solid #fff; }
.tl-clip.music { background: color-mix(in srgb, var(--teal) 55%, #000); cursor: default; }
.tl-hint { font-size: 11px; text-align: center; padding: 8px 0 2px; color: #777 !important; }
/* нижний лист инструментов */
.ed-sheet { padding-top: 6px; color: #fff; max-height: 42dvh; overflow-y: auto; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.ed-ok { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--grad); color: #fff; font-size: 17px; cursor: pointer; }
.ed-sheet .muted { color: #aaa; }
.ed-sheet input:not([type=range]):not([type=checkbox]):not([type=color]), .ed-sheet textarea, .ed-sheet select { background: #1c1c1f; border-color: #333; color: #fff; }
.ed-sheet .seg { background: #1c1c1f; }
.ed-sheet .seg button { color: #aaa; }
.ed-sheet .seg button.on { background: #3a3a40; color: #fff; }
.filters { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.filters button { flex: 0 0 auto; background: none; border: 0; color: #ccc; font-size: 12px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.filters .fthumb { width: 58px; height: 78px; border-radius: 10px; object-fit: cover; background: linear-gradient(135deg, var(--purple), var(--orange)); border: 2px solid transparent; }
.filters button.on .fthumb { border-color: var(--pink); }
.filters button.on { color: #fff; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 10px; }
.swatches button { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #444; cursor: pointer; }
.swatches button.on { border-color: #fff; transform: scale(1.12); }
.dual { display: grid; grid-template-columns: 70px 1fr 56px; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 13px; color: #ccc; }

/* ===== Публикация ===== */
.pub-head { display: flex; gap: 12px; }
.pub-cover { width: 92px; aspect-ratio: 9/16; border-radius: 12px; object-fit: cover; background: var(--surface); flex-shrink: 0; }
.pub-cover.photo { aspect-ratio: 1; }
.pub-head textarea { border: 0; background: transparent; padding: 4px 0; min-height: 110px; }
.pub-head textarea:focus { box-shadow: none; }
.quick { display: flex; gap: 6px; margin-top: 6px; }
.quick button { border: 0; background: var(--surface); color: var(--text); border-radius: 14px; padding: 5px 11px; font-size: 13px; cursor: pointer; font-weight: 600; }
.plat-icon { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 14px; flex-shrink: 0; }
.plat-icon.fb { background: #1877f2; } .plat-icon.ig { background: linear-gradient(45deg, #f9a825, #e1306c, #833ab4); }
.plat-icon.yt { background: #ff0000; } .plat-icon.tg { background: #29a9eb; }
.cfg-btn { border: 0; background: var(--surface); color: var(--muted); border-radius: 10px; padding: 6px 8px; cursor: pointer; display: flex; }
.cfg-btn.on { color: var(--pink); }

/* ===== Сообщения ===== */
.chat { display: flex; flex-direction: column; height: calc(100dvh - var(--top-h) - var(--nav-h) - var(--safe-b) - var(--safe-t) - 20px); }
@media (min-width: 900px) { .chat { height: calc(100dvh - var(--top-h) - 40px); } }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--card); border-radius: var(--radius) var(--radius) 0 0; border-bottom: 1px solid var(--line); }
.chat-body { flex: 1; overflow-y: auto; background: var(--card); padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.msg { max-width: 78%; padding: 8px 12px; border-radius: 18px; background: var(--surface); align-self: flex-start; white-space: pre-wrap; word-wrap: break-word; }
.msg.me { background: linear-gradient(135deg, color-mix(in srgb, var(--purple) 70%, var(--pink)), var(--pink)); color: #fff; align-self: flex-end; }
.msg .time { font-size: 11px; color: var(--muted); margin-left: 8px; float: right; margin-top: 4px; }
.msg.me .time { color: rgba(255,255,255,.75); }
.msg a { color: inherit; text-decoration: underline; }
.msg img { border-radius: 12px; margin: 4px 0; max-height: 300px; cursor: zoom-in; }
.day-sep { align-self: center; font-size: 12px; color: var(--muted); margin: 8px 0; }
.chat-input { display: flex; gap: 6px; align-items: flex-end; background: var(--card); padding: 8px; border-radius: 0 0 var(--radius) var(--radius); border-top: 1px solid var(--line); }
.chat-input textarea { min-height: 40px; max-height: 120px; }
.dialog .last { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dialog .unread { background: var(--grad); color: #fff; border-radius: 10px; font-size: 12px; padding: 1px 7px; }

/* ===== Темы ===== */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.theme-card { border: 2px solid var(--line); border-radius: 16px; padding: 10px; cursor: pointer; background: var(--surface); text-align: left; color: var(--text); position: relative; }
.theme-card.on { border-color: var(--pink); }
.theme-card .prev { height: 64px; border-radius: 10px; margin-bottom: 8px; position: relative; overflow: hidden; }
.theme-card .dots { display: flex; gap: 4px; position: absolute; bottom: 8px; left: 8px; }
.theme-card .dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255,255,255,.7); }
.theme-card .del { position: absolute; top: 6px; right: 6px; }
.color-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }

/* ===== Прочее ===== */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 400; display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 100vw; max-height: 100dvh; object-fit: contain; }
.auth { max-width: 400px; margin: 24px auto; }
.auth .logo { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 18px; }
.auth .logo img { width: 88px; height: 88px; border-radius: 24px; box-shadow: 0 10px 34px color-mix(in srgb, var(--pink) 45%, transparent); }
.auth .logo h1 { margin: 0; font-size: 34px; font-weight: 900; letter-spacing: 7px; background: var(--grad-top); -webkit-background-clip: text; background-clip: text; color: transparent; }
body.guest .nav, body.guest .topbar .topbtn:not(.lang-btn) { display: none; }
.legal { line-height: 1.6; }
.legal h1 { font-size: 22px; } .legal h2 { font-size: 17px; margin-top: 22px; }
/* ===== Регистрация: телефон, пароль ===== */
.phone-row { display: flex; gap: 6px; }
.phone-row .cc { width: 118px; flex-shrink: 0; padding-right: 4px; }
.phone-row input { flex: 1; min-width: 0; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 44px; }
.pw-wrap .eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: none; font-size: 17px; cursor: pointer; padding: 6px; opacity: .7; }
.pw-wrap .at { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.pw-meter { height: 4px; background: var(--line); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.pw-meter i { display: block; height: 100%; width: 0; transition: width .2s, background .2s; }
.pw-rules { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.pw-rules span.ok { color: var(--ok); }
:root[data-mode="light"] .pw-rules span.ok { color: color-mix(in srgb, var(--teal) 60%, #000); }
/* ===== Без полос прокрутки и без масштабирования ===== */
html, body, * { scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { display: none; width: 0; height: 0; }
html, body { touch-action: pan-x pan-y; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overscroll-behavior-y: none; }
button, a, label, .act, .set-row { touch-action: manipulation; }
.ed-frame { touch-action: none; }
/* iPhone приближает экран, если шрифт в поле меньше 16px */
input, textarea, select { font-size: 16px !important; }
/* ===== Выбор обложки ===== */
.cover-strip { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 8px; }
.cover-strip img { width: 52px; height: 84px; object-fit: cover; border-radius: 8px; border: 2px solid transparent; cursor: pointer; flex-shrink: 0; opacity: .75; }
.cover-strip img.on { border-color: var(--pink); opacity: 1; }
.pub-cover-btn { position: relative; border: 0; padding: 0; background: none; cursor: pointer; flex-shrink: 0; border-radius: 12px; overflow: hidden; }
.pub-cover-btn span { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; padding: 5px 4px; text-align: center; }
/* ===== Настройки как в TikTok ===== */
.set-group { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin: 16px 8px 6px; }
.action-sheet { position: fixed; inset: 0; z-index: 350; background: rgba(0,0,0,.5); display: flex; align-items: flex-end; justify-content: center; }
.as-box { width: 100%; max-width: 520px; background: var(--card); border-radius: 18px 18px 0 0; padding: 8px 8px calc(12px + var(--safe-b)); display: flex; flex-direction: column; gap: 4px; }
.as-box > button { border: 0; background: var(--surface); color: var(--text); padding: 14px; border-radius: 12px; font-size: 16px; font-weight: 600; cursor: pointer; text-align: left; }
.as-box > button.danger { color: var(--danger); }
.as-box > button[data-a="close"] { text-align: center; margin-top: 4px; }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--pink); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ed-text.ph { opacity: .55; font-style: italic; }
/* ===== Респект (ладонь) и хэштеги ===== */
.act.liked svg.palm, .reel .side .liked svg.palm { fill: none; stroke: var(--pink); stroke-width: 2.4; }
.act.liked svg.palm { animation: pop .35s ease; }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.35) rotate(-12deg); } 100% { transform: scale(1); } }
.tag-count { margin-left: auto; font-size: 12px; color: var(--muted); align-self: center; }
.tag-count.over { color: var(--danger); font-weight: 700; }
.tag-sug { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag-sug button { border: 1px solid var(--line); background: var(--surface); color: var(--pink); border-radius: 14px; padding: 4px 10px; font-size: 13px; font-weight: 600; cursor: pointer; }
/* ===== Репосты ===== */
.repost-by { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin: -4px 0 8px; }
.repost-by svg { width: 15px; height: 15px; }
.repost-by a { color: var(--text); font-weight: 600; }
.act.reposted { color: var(--teal); background: color-mix(in srgb, var(--teal) 15%, transparent); }
:root[data-mode="light"] .act.reposted { color: color-mix(in srgb, var(--teal) 60%, #000); }
.reel .side .reposted svg { stroke: var(--teal); }
.act.reposted svg.rp { animation: pop .35s ease; }
.quick { flex-wrap: wrap; align-items: center; }
.quick button { white-space: nowrap; }
/* ===== Компактное нижнее меню ===== */
:root { --nav-h: 50px; }
@media (max-width: 899px) {
  .nav a { font-size: 10px; gap: 1px; }
  .nav a svg { width: 21px; height: 21px; }
  .nav a.plus { flex: 0 0 64px; }
  .nav a.plus span.ring { width: 44px; height: 44px; margin-top: -14px; box-shadow: 0 4px 14px color-mix(in srgb, var(--pink) 50%, transparent), 0 0 0 4px var(--bg); }
  .nav a.plus span.ring svg { width: 23px; height: 23px; }
  .badge { top: 3px; min-width: 16px; height: 16px; font-size: 10px; }
}
/* ===== Меню ⋯ у постов ===== */
.more-btn { font-size: 22px; line-height: 1; padding: 2px 8px 8px; letter-spacing: 1px; }
.as-form { padding: 14px 12px calc(14px + var(--safe-b)); max-height: 85dvh; overflow-y: auto; }
.as-form .set-row { padding: 10px 4px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats div { background: var(--surface); border-radius: 12px; padding: 12px 6px; text-align: center; display: flex; flex-direction: column; }
.stats b { font-size: 22px; }
.stats span { font-size: 12px; color: var(--muted); }
/* ===== Профиль: вкладки и сетка видео ===== */
.ptabs { display: flex; background: var(--card); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.ptabs a { flex: 1; text-align: center; padding: 11px 4px; color: var(--muted); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; }
.ptabs a.active { color: var(--text); border-bottom-color: var(--pink); }
.ptabs small { color: var(--muted); font-weight: 400; }
.reel-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; border-radius: 12px; overflow: hidden; }
.rg-tile { position: relative; aspect-ratio: 9 / 16; background: var(--surface); display: block; overflow: hidden; }
.rg-tile img { width: 100%; height: 100%; object-fit: cover; }
.rg-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 28px; }
.rg-meta { position: absolute; left: 6px; bottom: 5px; color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 3px; text-shadow: 0 1px 3px rgba(0,0,0,.8); }
.rg-meta svg { stroke: #fff; }
.rg-st { position: absolute; left: 4px; top: 4px; background: rgba(0,0,0,.65); color: #fff; font-size: 10px; padding: 2px 6px; border-radius: 8px; }
.rg-pin { position: absolute; right: 4px; top: 4px; }
.big-text { font-size: 18px; font-weight: 600; line-height: 1.35; }
/* ===== Группы ===== */
.cat-chips { display: flex; gap: 6px; overflow-x: auto; margin-top: 10px; padding-bottom: 2px; }
.cat-chips a { white-space: nowrap; padding: 6px 11px; border-radius: 16px; background: var(--surface); color: var(--text); font-size: 13px; }
.cat-chips a.on { background: var(--grad); color: #fff; }
.group-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 560px) { .group-grid { grid-template-columns: 1fr 1fr; } }
.group-card { background: var(--card); border-radius: var(--radius); overflow: hidden; color: var(--text); border: 1px solid color-mix(in srgb, var(--line) 60%, transparent); box-shadow: var(--shadow); }
.gc-cover { height: 86px; background: linear-gradient(120deg, var(--purple), var(--pink), var(--orange)) center / cover; }
.gc-body { display: flex; gap: 10px; align-items: center; padding: 0 12px 12px; margin-top: -20px; }
.gc-body .avatar-wrap { border: 3px solid var(--card); border-radius: 50%; }
.gc-body .name { font-weight: 700; margin-top: 18px; }
.group-head { padding: 0; overflow: hidden; }
.gh-cover { height: 150px; background: linear-gradient(120deg, var(--purple), var(--pink), var(--orange)) center / cover; }
@media (min-width: 600px) { .gh-cover { height: 210px; } }
.gh-main { display: flex; gap: 14px; align-items: flex-end; padding: 0 14px; margin-top: -40px; }
.gh-main .avatar-wrap { border: 4px solid var(--card); border-radius: 50%; flex-shrink: 0; }
.gh-main h1 { margin: 44px 0 2px; font-size: 21px; }
.group-head .profile-actions { padding: 0 14px 14px; }
.pending-bar { display: block; margin: 0 14px 14px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--sun) 16%, transparent); color: var(--text); font-weight: 600; }
.cover-pick { display: flex; align-items: center; justify-content: center; height: 130px; border-radius: 14px; background: linear-gradient(120deg, var(--purple), var(--pink), var(--orange)) center / cover; color: #fff; font-weight: 700; cursor: pointer; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.badge-line { font-size: 13px; font-weight: 700; color: var(--muted); margin: -2px 0 6px; }
.badge-line.ann { color: var(--orange); }
.sale-box { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: color-mix(in srgb, var(--teal) 12%, transparent); border-radius: 12px; padding: 10px 12px; margin: 4px 0 8px; }
.sale-box .price { font-size: 20px; font-weight: 800; }
/* ===== Приглашения ===== */
.invite-hero { text-align: center; }
.invite-hero .big-ico { width: 72px; height: 72px; margin: 6px auto 8px; border-radius: 50%; background: var(--grad); display: flex; align-items: center; justify-content: center; color: #fff; }
.invite-hero .big-ico svg { width: 34px; height: 34px; }
.invite-link { display: flex; background: var(--surface); border-radius: 12px; padding: 10px; text-align: left; }
.share-row { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.share-row .sh { padding: 7px 12px; border-radius: 16px; color: #fff; font-size: 13px; font-weight: 700; }
.sh.tg { background: #29a9eb; } .sh.wa { background: #25d366; } .sh.vb { background: #7360f2; } .sh.sms { background: #8e8e93; }
.invited-by { background: color-mix(in srgb, var(--teal) 14%, transparent); padding: 10px 12px; border-radius: 12px; margin-bottom: 12px; font-size: 14px; }
.topbar { gap: 0; }
.topbtn { padding: 7px; }
/* ===== Быстрый редактор записи (Threads-стиль) ===== */
.composer2 .c2-row { display: flex; gap: 10px; align-items: flex-start; }
.composer2 textarea { flex: 1; border: 0; background: transparent; padding: 6px 0; min-height: 34px; resize: none; line-height: 1.4; }
.composer2 textarea:focus { box-shadow: none; }
.composer2 .c2-plus { color: var(--pink); }
.c2-items { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px 42px; }
.c2-items .thumb { width: 84px; height: 84px; }
.c2-items .thumb.video { width: 64px; height: 100px; }
.vbadge { position: absolute; left: 4px; bottom: 4px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; border-radius: 6px; padding: 1px 5px; }
.file-chip { display: flex; align-items: center; gap: 8px; background: var(--surface); border-radius: 10px; padding: 8px 10px; color: var(--text); width: 100%; font-size: 14px; }
.file-chip small { color: var(--muted); white-space: nowrap; }
.file-chip button { border: 0; background: none; color: var(--muted); font-size: 18px; cursor: pointer; }
.c2-items .file-chip { margin: 0; }
.c2-poll { margin: 8px 0 4px 42px; background: var(--surface); border-radius: 12px; padding: 10px; }
.c2-seg { margin: 8px 0 0 42px; }
.c2-tools { display: flex; align-items: center; gap: 4px; margin: 8px 0 0 36px; border-top: 1px solid var(--line); padding-top: 8px; flex-wrap: wrap; }
.c2-tool { border: 0; background: none; font-size: 19px; padding: 6px 7px; border-radius: 10px; cursor: pointer; filter: grayscale(.2); }
.c2-tool.on { background: var(--accent-2); }
.c2-tool:disabled { opacity: .3; }
.c2-flags { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 0 42px; }
.c2-flags span { font-size: 12px; background: var(--surface); padding: 3px 8px; border-radius: 10px; color: var(--muted); }
/* ===== Опрос, файлы, спойлер в посте ===== */
.poll { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.poll-opt { position: relative; overflow: hidden; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 12px; padding: 10px 12px; cursor: pointer; text-align: left; font-size: 15px; }
.poll-opt i { position: absolute; left: 0; top: 0; bottom: 0; background: color-mix(in srgb, var(--pink) 22%, transparent); transition: width .4s; }
.poll-opt.mine i { background: color-mix(in srgb, var(--pink) 38%, transparent); }
.poll-opt span, .poll-opt b { position: relative; }
.files { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.spoiler { position: relative; cursor: pointer; margin: 8px -14px; }
.spoiler .post-media { margin: 0; filter: blur(28px) saturate(1.3); transform: scale(1.02); }
.spoiler .spoiler-cover { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; background: rgba(0,0,0,.25); text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.spoiler.shown .post-media { filter: none; transform: none; }
.spoiler.shown .spoiler-cover { display: none; }
/* ===== Плитка «+» в сетке видео ===== */
.rg-add { border: 2px dashed var(--line); background: var(--surface); color: var(--pink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; cursor: pointer; font-weight: 700; font-size: 12px; }
.rg-add svg { width: 30px; height: 30px; }
/* ===== Меню «+» ===== */
.create-sheet { animation: fadeIn .18s ease; }
.create-sheet .as-box { animation: slideUp .22s ease; }
.create-sheet.closing { opacity: 0; transition: opacity .18s; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes slideUp { from { transform: translateY(40px); opacity: .6; } }
.cs-box { padding: 10px 12px calc(16px + var(--safe-b)); gap: 10px; }
.cs-handle { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 6px; }
.cs-cards { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.cs-card { border: 0; border-radius: 18px; padding: 18px 12px; color: #fff; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; box-shadow: var(--shadow); }
.cs-card.video { background: linear-gradient(140deg, var(--pink), var(--orange)); }
.cs-card.wall { background: linear-gradient(140deg, var(--purple), color-mix(in srgb, var(--teal) 70%, var(--purple))); }
.cs-card .cs-ico { font-size: 34px; }
.cs-card b { font-size: 16px; }
.cs-card small { opacity: .9; font-size: 12px; }
.cs-card:active { transform: scale(.97); }
.create-sheet .as-box button.cs-card { text-align: center; }
#csComp .composer2 { box-shadow: none; border: 0; padding: 4px; margin: 0; background: transparent; }
/* сетка видео — квадраты */
.rg-tile { aspect-ratio: 1 / 1; }
.as-box .cs-card { color: #fff; padding: 18px 12px; text-align: center; font-size: 14px; }
.as-box .cs-card.video { background: linear-gradient(140deg, var(--pink), var(--orange)); }
.as-box .cs-card.wall { background: linear-gradient(140deg, var(--purple), color-mix(in srgb, var(--teal) 70%, var(--purple))); }

.c2-tools { flex-wrap: nowrap; gap: 2px; }
.c2-tool { padding: 6px 5px; font-size: 18px; }
.c2-tools .btn.small { padding: 7px 12px; white-space: nowrap; }
.c2-tools .btn.ghost.small { padding: 7px 6px; }
@media (max-width: 380px) { .c2-tools { margin-left: 0; } }

/* Поделиться */
.share-quick { display: flex; gap: 8px; margin-bottom: 10px; }
.as-box .share-quick > button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border-radius: 14px; background: var(--card2, rgba(127,127,127,.12)); border: 0; color: inherit; font-size: 12.5px; font-weight: 600; }
.share-quick span { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--pink), var(--purple)); color: #fff; font-size: 18px; }
.share-quick span svg { width: 20px !important; height: 20px !important; stroke: #fff; }
.share-list { max-height: 42vh; overflow-y: auto; margin: 8px 0; }
.share-h { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; opacity: .6; margin: 10px 4px 4px; font-weight: 700; }
.share-row { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-radius: 12px; cursor: pointer; }
.share-row .grow { display: flex; flex-direction: column; min-width: 0; }
.share-row input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--pink); }
.shared-post { display: block; border: 1px solid color-mix(in srgb, var(--pink) 30%, transparent); border-radius: 14px; padding: 10px; margin-top: 8px; color: inherit; text-decoration: none; }
.sp-media { position: relative; margin-top: 8px; border-radius: 10px; overflow: hidden; max-height: 360px; }
.sp-media img { width: 100%; max-height: 360px; object-fit: cover; display: block; }
.sp-media.blur img { filter: blur(24px); }
.sp-play { position: absolute; inset: 0; display: grid; place-items: center; font-size: 34px; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.6); }

.cs-card.story, .as-box .cs-card.story { background: linear-gradient(140deg, var(--teal), var(--purple)); }
.cs-cards .cs-card { padding: 16px 6px !important; }
.cs-cards .cs-card .cs-ico { font-size: 28px; }
.cs-cards .cs-card small { font-size: 11px; }
/* кольцо историй вокруг аватарки */
@keyframes ringspin { to { transform: rotate(360deg); } }
.avatar-wrap.story-ring { padding: 3px; }
.avatar-wrap.story-ring::before { content: ""; position: absolute; inset: 0; border-radius: 50%; padding: 2.5px;
  background: conic-gradient(from 0deg, var(--pink), var(--orange), var(--teal), var(--purple), var(--pink));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: ringspin 4s linear infinite; }
/* профиль: аватар с плюсиком */
.pav { position: relative; display: inline-flex; flex: none; cursor: pointer; }
.pav-plus { position: absolute; left: -2px; bottom: -2px; width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid var(--card, #fff);
  background: linear-gradient(135deg, var(--pink), var(--orange)); color: #fff; font-size: 18px; font-weight: 800; line-height: 1; display: grid; place-items: center; padding: 0; cursor: pointer; z-index: 2; }
/* лента историй */
.stories-bar { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; }
.stories-bar::-webkit-scrollbar { display: none; }
.st-item { background: none; border: 0; color: inherit; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 68px; flex: none; padding: 0; cursor: pointer; }
.st-item small { font-size: 11.5px; max-width: 68px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-ring { position: relative; padding: 3px; border-radius: 50%; display: inline-flex; }
.st-ring::before { content: ""; position: absolute; inset: 0; border-radius: 50%; padding: 2.5px; background: conic-gradient(var(--pink), var(--orange), var(--teal), var(--purple), var(--pink));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: ringspin 4s linear infinite; }
.st-ring.seen::before { background: color-mix(in srgb, var(--text, #888) 30%, transparent); animation: none; }
.st-ring.add::before { display: none; }
.st-ring .avatar { width: 58px; height: 58px; font-size: 22px; }
.st-ring i { position: absolute; right: 0; bottom: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--pink); color: #fff; font-style: normal; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--bg, #000); }
/* просмотр историй */
.story-view { position: fixed; inset: 0; z-index: 200; background: #000; color: #fff; display: flex; flex-direction: column; touch-action: none; user-select: none; }
.sv-stage { position: absolute; inset: 0; display: grid; place-items: center; }
.sv-stage img, .sv-stage video { width: 100%; height: 100%; object-fit: contain; }
.sv-caption { position: absolute; left: 16px; right: 16px; bottom: 18%; text-align: center; font-size: 22px; font-weight: 800; text-shadow: 0 2px 12px rgba(0,0,0,.7); }
.sv-bars { position: absolute; top: calc(env(safe-area-inset-top) + 8px); left: 8px; right: 8px; display: flex; gap: 4px; z-index: 3; }
.sv-bars span { flex: 1; height: 3px; border-radius: 3px; background: rgba(255,255,255,.35); overflow: hidden; }
.sv-bars i { display: block; height: 100%; background: #fff; width: 0; }
.sv-top { position: absolute; top: calc(env(safe-area-inset-top) + 18px); left: 10px; right: 10px; display: flex; align-items: center; gap: 6px; z-index: 4; }
.sv-x { color: #fff !important; font-size: 20px; }
.sv-tap { position: absolute; top: 70px; bottom: 70px; z-index: 2; }
.sv-tap.l { left: 0; width: 35%; } .sv-tap.r { right: 0; width: 65%; }
.sv-views { position: absolute; bottom: calc(env(safe-area-inset-bottom) + 18px); left: 50%; transform: translateX(-50%); z-index: 4; background: rgba(0,0,0,.45); color: #fff; border: 0; border-radius: 20px; padding: 8px 16px; display: flex; gap: 6px; align-items: center; font-weight: 700; }
.sv-views svg, .act.views svg, .reel .side .rv svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.sv-compose { position: absolute; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom) + 16px); display: flex; gap: 8px; z-index: 4; }
.sv-compose input { flex: 1; background: rgba(0,0,0,.45); color: #fff; border: 1px solid rgba(255,255,255,.3); border-radius: 22px; padding: 10px 14px; }
.sv-prog-up { position: absolute; top: 0; left: 0; right: 0; height: 4px; z-index: 5; } .sv-prog-up i { display: block; height: 100%; width: 0; background: var(--pink); }
body.no-scroll { overflow: hidden; }
/* просмотры */
.act.views { margin-left: auto; cursor: default; opacity: .75; }
.reel .side .rv { display: flex; flex-direction: column; align-items: center; font-size: 12px; font-weight: 700; text-shadow: 0 1px 4px rgba(0,0,0,.6); }

/* экран загрузки видео */
.up-screen { position: fixed; inset: 0; z-index: 390; background: color-mix(in srgb, var(--bg) 96%, transparent); display: grid; place-items: center; padding: 24px; }
.up-card { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.up-thumb { position: relative; width: 150px; aspect-ratio: 9/16; border-radius: 18px; overflow: hidden; background: #000; box-shadow: var(--shadow); margin-bottom: 6px; }
.up-thumb video { width: 100%; height: 100%; object-fit: cover; opacity: .6; }
.up-ring { position: absolute; inset: 0; display: grid; place-items: center; }
.up-ring svg { position: absolute; width: 92px; height: 92px; transform: rotate(-90deg); }
.up-ring circle { fill: none; stroke: rgba(255,255,255,.25); stroke-width: 7; }
.up-ring circle.fg { stroke: var(--pink); stroke-linecap: round; transition: stroke-dashoffset .25s; }
.up-ring b { color: #fff; font-size: 20px; text-shadow: 0 1px 6px rgba(0,0,0,.6); }
/* публикация: кнопка вверху */
.pub-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; margin: -4px -4px 10px; padding: 4px; background: var(--card, var(--surface)); }
.pub-top b { font-size: 17px; }

/* плитка: идёт обработка */
.rg-proc { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: #fff;
  background: linear-gradient(160deg, color-mix(in srgb, var(--purple) 70%, #000), color-mix(in srgb, var(--pink) 60%, #000)); }
.rg-img-dim { }
.rg-tile img + .rg-proc { background: rgba(0,0,0,.55); }
.rg-ring { position: relative; width: 48px; height: 48px; display: grid; place-items: center; }
.rg-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.rg-ring circle { fill: none; stroke: rgba(255,255,255,.25); stroke-width: 4; }
.rg-ring circle.fg { stroke: #fff; stroke-linecap: round; transition: stroke-dashoffset .4s; }
.rg-ring.spin svg { animation: ringspin 1s linear infinite; }
.rg-ring b { font-size: 12px; font-weight: 800; }
.rg-proc small { font-size: 10.5px; font-weight: 600; opacity: .9; }

/* рилсы: карточка видео + счётчики под кружками */
.reel-card { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #000; overflow: hidden; }
.reel .side { gap: 22px; }
.reel .side button, .reel .side a, .reel .side .rv { position: relative; }
.reel .side button > span, .reel .side a:not(.side-av) > span { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 3px; font-size: 12px; font-weight: 700; white-space: nowrap; text-shadow: 0 1px 4px rgba(0,0,0,.7); }
.reel .side .side-av { width: 48px; height: 48px; background: none; padding: 0; }
.reel .side .side-av .avatar { width: 46px; height: 46px; border: 2px solid #fff; }
.reels-nav { display: none; }
@media (min-width: 900px) {
  .reels { max-width: none; background: transparent; scrollbar-width: none; }
  .reels::-webkit-scrollbar { display: none; }
  .reel { padding: 16px 0; gap: 18px; justify-content: center; align-items: stretch; }
  .reel-card { position: relative; inset: auto; height: 100%; aspect-ratio: 9 / 16; max-width: calc(100vw - 420px); border-radius: 16px; box-shadow: 0 10px 40px rgba(0,0,0,.45); }
  .reel-card video { object-fit: cover; }
  .reel .overlay { right: 0; border-radius: 0 0 16px 16px; padding: 18px; }
  .reel .side { position: static; align-self: flex-end; padding-bottom: 8px; gap: 30px; color: var(--text); }
  .reel .side button, .reel .side a:not(.side-av), .reel .side .rv { background: color-mix(in srgb, var(--text) 10%, transparent); color: var(--text); }
  .reel .side .rv { width: 48px; height: 48px; border-radius: 50%; justify-content: center; }
  .reel .side button > span, .reel .side a:not(.side-av) > span, .reel .side .rv > span { text-shadow: none; color: var(--text); }
  .reel .side .rv > span { position: absolute; top: 100%; margin-top: 3px; }
  .reel .side svg { width: 24px; height: 24px; }
  .reel .mute { top: 14px; left: 14px; right: auto; }
  body.reels-mode .reels-nav { display: flex; flex-direction: column; gap: 14px; position: fixed; right: 28px; top: 50%; transform: translateY(-50%); z-index: 20; }
  .reels-nav button { width: 48px; height: 48px; border-radius: 50%; border: 0; background: color-mix(in srgb, var(--text) 12%, transparent); color: var(--text); cursor: pointer; display: grid; place-items: center; }
  .reels-nav button:hover { background: color-mix(in srgb, var(--text) 22%, transparent); }
  .reels-nav svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
}
.reel .side .side-av { display: block; height: 50px; margin-bottom: 8px; overflow: visible; }
.reel .side .side-av .avatar-wrap { display: block; }

svg.bm { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.saved svg.bm { fill: var(--orange); stroke: var(--orange); }
.ptabs { overflow-x: auto; scrollbar-width: none; } .ptabs::-webkit-scrollbar { display: none; } .ptabs a { white-space: nowrap; }
/* ===== Рилсы на ПК v2: как TikTok ===== */
@media (min-width: 900px) {
  body.reels-mode { overflow: hidden; height: 100dvh; }
  body.reels-mode .nav { left: 20px; top: calc(var(--top-h) + 16px); width: 210px; }
  body.reels-mode main { padding: 0; }
  body.reels-mode .reels { height: calc(100dvh - var(--top-h)); margin: 0; padding-left: 250px; padding-right: 90px; box-sizing: border-box; }
  body.reels-mode .reel { padding: 18px 0; gap: 20px; }
  body.reels-mode .reel-card { height: 100%; max-width: none; aspect-ratio: 9 / 16; flex: none; }
  body.reels-mode .reels-tabs { padding-left: 0; }
  body.reels-mode .reels-tabs button { margin-top: 30px; }
  body.reels-mode .reel .mute { top: 18px; left: 18px; width: 36px; height: 36px; padding: 0; border-radius: 50%; display: grid; place-items: center; z-index: 3; }
  body.reels-mode .reel .side { width: 56px; gap: 34px; padding-bottom: 28px; }
  body.reels-mode .reel .side button, body.reels-mode .reel .side a:not(.side-av), body.reels-mode .reel .side .rv { width: 52px; height: 52px; }
  body.reels-mode .reel .side button > span, body.reels-mode .reel .side a:not(.side-av) > span, body.reels-mode .reel .side .rv > span { font-size: 13px; margin-top: 6px; color: var(--text); opacity: .9; }
  body.reels-mode .reel .side .side-av { height: 56px; margin-bottom: 4px; }
  body.reels-mode .reel .side .side-av .avatar { width: 52px; height: 52px; }
  body.reels-mode .reel .overlay { padding: 60px 20px 20px; }
  body.reels-mode .reel .overlay .post-text { font-size: 15px; }
}
@media (min-width: 900px) and (max-width: 1150px) {
  body.reels-mode .nav { width: 60px; }
  body.reels-mode .nav a span, body.reels-mode .nav a .badge { display: none; }
  body.reels-mode .reels { padding-left: 100px; }
}

/* ===== Рилсы v3 (телефон): иконки без кружков, компактно, как TikTok ===== */
.reel-card video { object-fit: cover; }
.reel .side { right: 6px; bottom: 96px; gap: 14px; }
.reel .side button, .reel .side a:not(.side-av) { background: none !important; width: 46px; height: auto; border-radius: 0; flex-direction: column; gap: 2px; padding: 0; filter: drop-shadow(0 1px 3px rgba(0,0,0,.55)); }
.reel .side button > span, .reel .side a:not(.side-av) > span { position: static; transform: none; margin: 0; font-size: 12.5px; font-weight: 700; color: #fff; }
.reel .side svg { width: 32px; height: 32px; stroke-width: 2.2; }
.reel .side .liked svg.palm { stroke: var(--pink); fill: color-mix(in srgb, var(--pink) 35%, transparent); }
.reel .side .saved svg.bm { fill: var(--orange); stroke: var(--orange); }
.reel .side .side-av { height: auto; margin-bottom: 10px; }
.reel .side .side-av .avatar { width: 46px; height: 46px; border: 2px solid #fff; }
.reel .side .more { font-size: 26px; line-height: 1; color: #fff; letter-spacing: 1px; }
.reel .overlay { right: 64px; padding-bottom: 18px; }
@media (min-width: 900px) {
  body.reels-mode .reel .side { gap: 20px; padding-bottom: 20px; }
  body.reels-mode .reel .side button, body.reels-mode .reel .side a:not(.side-av) { width: 52px; height: auto; filter: none; color: var(--text); }
  body.reels-mode .reel .side button svg, body.reels-mode .reel .side a:not(.side-av) svg { width: 48px; height: 48px; padding: 12px; box-sizing: border-box; border-radius: 50%; background: color-mix(in srgb, var(--text) 10%, transparent); }
  body.reels-mode .reel .side button > span, body.reels-mode .reel .side a:not(.side-av) > span { color: var(--text); margin-top: 4px; }
  body.reels-mode .reel .side .more { width: 48px; height: 48px; border-radius: 50% !important; background: color-mix(in srgb, var(--text) 10%, transparent) !important; color: var(--text); justify-content: center; }
  body.reels-mode .reel .overlay { right: 0; }
}

/* ===== Редактор историй ===== */
.sv-canvas { position: relative; height: 100%; max-width: 100%; aspect-ratio: 9 / 16; overflow: hidden; container-type: inline-size; background: #111; }
.sv-canvas > img, .sv-canvas > video { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (min-width: 700px) { .sv-canvas { border-radius: 16px; height: calc(100% - 40px); } }
.st-layer { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.st-ov { position: absolute; pointer-events: auto; white-space: pre-wrap; max-width: 85cqw; text-align: center; font-weight: 800; font-size: 6.5cqw; line-height: 1.15; color: var(--c); text-shadow: 0 1px 6px rgba(0,0,0,.45); padding: .15em .4em; border-radius: .35em; touch-action: none; user-select: none; text-decoration: none; transform-origin: center; }
.st-ov.bg-solid { background: var(--c); color: #000; text-shadow: none; }
.st-ov.bg-solid[style*="--c:#000000"] { color: #fff; }
.st-ov.bg-soft { background: rgba(0,0,0,.55); text-shadow: none; }
.st-ov.t-emoji { font-size: 10cqw; text-shadow: none; padding: 0; }
.st-ov.t-link { display: inline-flex; align-items: center; gap: .3em; font-size: 4.5cqw; padding: .45em .8em; border-radius: 99px; background: #fff; color: #1a1033; text-shadow: none; box-shadow: 0 3px 14px rgba(0,0,0,.3); }
.st-ov.t-link svg { width: 1.1em !important; height: 1.1em !important; stroke: var(--pink); }
.st-ov.t-link.bg-none { background: rgba(255,255,255,.2); color: #fff; backdrop-filter: blur(6px); }
.st-ov.t-link.bg-none svg { stroke: #fff; }
.st-ov.sel { outline: 2px dashed rgba(255,255,255,.85); outline-offset: 3px; }
.st-edit .st-ov { cursor: grab; }
.st-tool { width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(0,0,0,.45); color: #fff; font-weight: 800; font-size: 17px; display: grid; place-items: center; cursor: pointer; }
.st-tool svg { width: 20px !important; height: 20px !important; stroke: #fff; }
.st-trash { position: absolute; left: 50%; bottom: 3%; transform: translateX(-50%) scale(.8); z-index: 4; width: 54px; height: 54px; border-radius: 50%; background: rgba(0,0,0,.5); display: grid; place-items: center; font-size: 24px; opacity: 0; transition: .15s; pointer-events: none; }
.st-trash.on { opacity: 1; } .st-trash.hot { background: #ef4444; transform: translateX(-50%) scale(1.1); }
.st-panel { position: absolute; left: 10px; right: 10px; bottom: calc(env(safe-area-inset-bottom) + 76px); z-index: 6; background: rgba(20,12,40,.88); backdrop-filter: blur(12px); border-radius: 18px; padding: 12px; display: flex; flex-direction: column; gap: 10px; max-width: 520px; margin: 0 auto; }
.st-panel input:not([type=range]) { background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.2); border-radius: 12px; padding: 10px 12px; width: 100%; box-sizing: border-box; }
.st-panel .seg button { color: #fff; }
.st-colors { display: flex; gap: 8px; justify-content: space-between; }
.st-colors button { width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); cursor: pointer; }
.st-colors button.on { border-color: #fff; transform: scale(1.2); }
.st-emojis { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.st-emojis button { font-size: 26px; background: none; border: 0; cursor: pointer; padding: 4px; }
.st-pub { margin-left: auto; padding: 12px 22px; border-radius: 24px; }

svg.mono { width: 1.1em; height: 1.1em; vertical-align: -0.17em; display: inline-block; flex: none; }
.cs-card .cs-ico svg.mono { width: 34px; height: 34px; }
.share-quick span svg.mono { width: 20px; height: 20px; }
/* потянуть для обновления */
.ptr { position: fixed; left: 50%; top: calc(var(--top-h) + var(--safe-t) - 44px); z-index: 25; width: 38px; height: 38px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); display: grid; place-items: center; transform: translate(-50%, 0); opacity: 0; transition: opacity .15s; pointer-events: none; color: var(--muted); }
.ptr.show { opacity: 1; }
.ptr.ready { color: var(--pink); }
.ptr svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ptr.spin svg { animation: ringspin .7s linear infinite; }
html, body { overscroll-behavior-y: contain; }

/* профиль — компактно */
.profile-head { gap: 14px; }
.profile-head .avatar.lg { width: 76px; height: 76px; font-size: 28px; }
.profile-head h1 { font-size: 18px; line-height: 1.2; }
.profile-head .muted { font-size: 12.5px; }
.pav-plus { width: 22px; height: 22px; font-size: 15px; }
.profile-stats b { font-size: 16px !important; }
.profile-stats .muted { font-size: 12px; }
.profile-actions { margin-top: 10px; gap: 6px; }
.profile-actions .btn { padding: 8px 12px; font-size: 14px; border-radius: 10px; }
.ptabs.icons { border-radius: 14px; margin-bottom: 8px; }
.ptabs.icons a { padding: 9px 4px; display: grid; place-items: center; }
.ptabs.icons svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ptabs.icons a.active { color: var(--pink); }
.ptabs.icons a.active svg.bm { fill: none; }

/* истории: медиа по размеру + фон */
.st-mwrap { position: absolute; inset: 0; overflow: hidden; }
.st-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
img.st-bg.blur { filter: blur(28px) brightness(.65); transform: scale(1.15); }
.st-mwrap .st-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transform-origin: center; will-change: transform; }
.sv-canvas > .st-mwrap ~ img, .sv-canvas > .st-mwrap ~ video { display: none; }
canvas.st-draw, img.st-draw { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
canvas.st-draw.on { pointer-events: auto; cursor: crosshair; touch-action: none; }
.st-edit .sv-canvas { touch-action: none; cursor: grab; }
.st-tools { position: absolute; right: 10px; top: calc(env(safe-area-inset-top) + 70px); z-index: 5; display: flex; flex-direction: column; gap: 10px; }
.st-tool svg { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.st-edit.drawing .st-tools .st-tool:not([data-t=draw]) { opacity: .35; }
.st-hint { position: absolute; left: 50%; top: 45%; transform: translate(-50%,-50%); z-index: 4; background: rgba(0,0,0,.55); color: #fff; padding: 10px 14px; border-radius: 14px; font-size: 13px; text-align: center; max-width: 70%; pointer-events: none; transition: opacity .5s; }
.st-hint.gone { opacity: 0; }
.st-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.st-chips button { background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 99px; padding: 7px 12px; font-weight: 700; font-size: 13px; cursor: pointer; }
.st-filters { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.st-filters button { flex: none; background: none; border: 0; color: #fff; font-size: 11.5px; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; opacity: .75; }
.st-filters button.on { opacity: 1; font-weight: 800; }
.st-filters span { width: 54px; height: 76px; border-radius: 10px; background-size: cover; background-position: center; border: 2px solid transparent; }
.st-filters button.on span { border-color: #fff; }
.st-panel .btn.ghost { color: #fff; } .st-panel .btn.ghost.on { background: rgba(255,255,255,.25); }

/* комментарии поверх видео */
.cm-sheet { position: fixed; inset: 0; z-index: 150; background: rgba(0,0,0,0); transition: background .2s; display: flex; align-items: flex-end; justify-content: center; }
.cm-sheet.open { background: rgba(0,0,0,.25); }
.cm-box { width: 100%; max-width: 560px; height: 65dvh; background: var(--card); color: var(--text); border-radius: 20px 20px 0 0; display: flex; flex-direction: column; transform: translateY(100%); transition: transform .22s ease; padding-bottom: var(--safe-b); box-shadow: 0 -10px 40px rgba(0,0,0,.3); }
.cm-sheet.open .cm-box { transform: none; }
.cm-head { display: flex; align-items: center; justify-content: center; position: relative; padding: 4px 12px 8px; font-size: 14px; }
.cm-head .icon-btn { position: absolute; right: 8px; top: -2px; }
.cm-list { flex: 1; overflow-y: auto; padding: 0 14px; }
.cm-form { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--line); }
.cm-form input { flex: 1; }
@media (min-width: 900px) {
  .cm-sheet { justify-content: flex-end; align-items: stretch; }
  .cm-sheet.open { background: transparent; }
  .cm-box { height: auto; margin-top: var(--top-h); width: 420px; border-radius: 0; transform: translateX(100%); }
}
@media (min-width: 900px) { .cm-box .cs-handle { display: none; } .cm-head { padding-top: 14px; } }

/* ===== ПК: меню всегда у левого края, контент по центру оставшегося места ===== */
@media (min-width: 900px) {
  .nav { left: 20px; width: 210px; }
  main { margin-left: max(260px, calc((100vw + 250px - 680px) / 2)); margin-right: auto; }
  main:has(.pf-wide) { max-width: 1180px; margin-left: max(260px, calc((100vw + 250px - 1180px) / 2)); }
  /* профиль как в TikTok */
  .pf-card { display: grid; grid-template-columns: 190px 1fr; column-gap: 28px; row-gap: 6px; align-items: start; background: transparent; border: 0; box-shadow: none; padding: 18px 0 6px; }
  .pf-card .profile-head { display: contents; }
  .pf-card .pav { grid-column: 1; grid-row: 1 / span 9; justify-self: center; }
  .pf-card .pav .avatar.lg { width: 170px; height: 170px; font-size: 60px; }
  .pf-card .pav-plus { width: 34px; height: 34px; font-size: 22px; left: 8px; bottom: 8px; }
  .pf-card > *:not(.profile-head) { grid-column: 2; }
  .pf-card .profile-head > .grow { grid-column: 2; }
  .pf-card h1 { font-size: 26px; }
  .pf-card .profile-head .muted { font-size: 14px; }
  .pf-card .profile-stats { justify-content: flex-start !important; gap: 22px; margin: 4px 0 !important; text-align: left !important; }
  .pf-card .profile-stats > * { display: flex; align-items: baseline; gap: 6px; }
  .pf-card .profile-stats b { font-size: 17px !important; }
  .pf-card .profile-stats .muted { font-size: 15px; color: var(--muted); }
  .pf-card .info-row { margin-top: 0; }
  .pf-card .profile-actions { justify-content: flex-start; margin-top: 8px; }
  .pf-card .profile-actions .btn.grow { flex: 0 0 auto; padding: 9px 22px; }
  .pf-card .profile-actions .btn { font-size: 15px; }
  main:has(.pf-wide) .ptabs.icons { max-width: 520px; background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
  main:has(.pf-wide) .ptabs.icons a { padding: 12px 4px; }
  main:has(.pf-wide) .ptabs.icons svg { width: 24px; height: 24px; }
  main:has(.pf-wide) .reel-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; border-radius: 0; overflow: visible; }
  main:has(.pf-wide) .rg-tile { aspect-ratio: 3 / 4; border-radius: 10px; }
  main:has(.pf-wide) .rg-meta { font-size: 14px; }
  main:has(.pf-wide) #list > .card, main:has(.pf-wide) #comp { max-width: 680px; }
}

.ptabs.icons .tab-in { display: inline-flex; align-items: center; gap: 2px; }
.ptabs.icons svg.dd { width: 15px !important; height: 15px !important; stroke-width: 2.6; }
@media (min-width: 900px) { body.reels-mode main { margin: 0 !important; max-width: none !important; } }
@keyframes swl { from { transform: translateX(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes swr { from { transform: translateX(-40px); opacity: .4; } to { transform: none; opacity: 1; } }
body.swipe-l main { animation: swl .25s ease; } body.swipe-r main { animation: swr .25s ease; }
html, body { overscroll-behavior-x: none; }
.reel .side { bottom: 40px; }
@media (min-width: 900px) {
  main { margin-left: max(260px, calc((100vw - 680px) / 2)); }
  main:has(.pf-wide) { margin-left: max(260px, calc((100vw - 1180px) / 2)); }
}

/* ===== Обзор ===== */
.ex-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-bottom: 8px; }
.ex-tabs::-webkit-scrollbar { display: none; }
.ex-tabs a { flex: none; padding: 8px 14px; border-radius: 99px; background: var(--card); color: var(--muted); font-weight: 700; font-size: 14px; border: 1px solid var(--line); }
.ex-tabs a.on { background: var(--grad); color: #fff; border-color: transparent; }
.ex-scope { margin-bottom: 10px; display: flex; }
.ex-scope a { flex: 1; text-align: center; }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 7px 2px; color: var(--text); border-bottom: 1px solid color-mix(in srgb, var(--line) 50%, transparent); }
.rank-row:last-of-type { border-bottom: 0; }
.rk { width: 24px; text-align: center; color: var(--muted); }
.rk.r1 { color: #f5b301; } .rk.r2 { color: #9ca3af; } .rk.r3 { color: #c2703d; }
.score { font-weight: 800; color: var(--pink); white-space: nowrap; }
.lvl { color: var(--orange); font-size: .8em; letter-spacing: -1px; margin-left: 4px; }
.lvl-line { font-size: 12.5px; color: var(--pink); font-weight: 700; margin-top: 2px; }
.lvl-table > div { padding: 4px 0; font-size: 14px; }
.badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.bdg { font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: color-mix(in srgb, var(--orange) 18%, transparent); color: var(--orange); }
.chips-row { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-bottom: 10px; }
.chips-row::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 99px; background: var(--surface); color: var(--text); font-size: 13px; font-weight: 600; }
.chip.on { background: var(--pink); color: #fff; }
.sale-box .chip { padding: 3px 9px; font-size: 12px; }
.sale-box { flex-wrap: wrap; gap: 6px; }
.c2-market { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.c2-market > * { flex: 1 1 120px; }
.badge-line.q { color: var(--teal); }
.ok { color: var(--teal) !important; font-weight: 700; }
.comment.best { background: color-mix(in srgb, var(--teal) 10%, transparent); border-radius: 12px; padding: 6px; }
.best-tag { font-size: 11.5px; font-weight: 800; color: var(--teal); }
.ch-card { display: block; color: var(--text); }
.ch-card.live { border: 1.5px solid var(--pink); }
.ch-tag { display: inline-block; font-weight: 900; color: #fff; background: var(--grad); padding: 3px 10px; border-radius: 8px; margin-bottom: 6px; }
.ch-banner { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 10px; border-radius: 16px; background: var(--grad); color: #fff; font-size: 13px; }
.ch-banner span svg { width: 26px; height: 26px; }
/* баннер профиля */
.pf-cover { height: 150px; border-radius: var(--radius) var(--radius) 0 0; background: var(--grad) center / cover no-repeat; margin-bottom: -40px; }
.pf-cover.empty { display: flex; align-items: flex-start; justify-content: flex-end; gap: 6px; padding: 10px 14px; color: #fff; font-size: 13px; font-weight: 700; opacity: .9; }
.pf-card.has-cover { position: relative; border-top-left-radius: 0; border-top-right-radius: 0; padding-top: 0; }
.pf-card.has-cover .pav { margin-top: -10px; }
.pf-card.has-cover .pav .avatar.lg { border: 4px solid var(--card); box-sizing: content-box; }
.pf-card.has-cover .profile-head { align-items: flex-end; }
.cover-edit { height: 110px; border-radius: 14px; background: var(--surface) center / cover no-repeat; display: grid; place-items: center; color: var(--muted); font-size: 13px; margin-top: 6px; border: 1px dashed var(--line); }
@media (min-width: 900px) {
  main:has(.pf-wide) .pf-cover { height: 260px; border-radius: 18px; margin-bottom: -70px; }
  .pf-card.has-cover { padding-top: 0; }
  .pf-card.has-cover .pav { margin-top: 0; }
  .pf-card.has-cover .pav .avatar.lg { border-color: var(--bg); }
  .pf-card.has-cover .profile-head > .grow { padding-top: 78px; }
}

/* ===== Картели ===== */
.cartel-emb { position: relative; width: 44px; height: 44px; flex: none; display: grid; place-items: center; }
.cartel-emb svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: var(--kc); stroke: rgba(255,255,255,.85); stroke-width: 1.2; filter: drop-shadow(0 3px 8px color-mix(in srgb, var(--kc) 50%, transparent)); }
.cartel-emb b { position: relative; color: #fff; font-weight: 900; font-size: 17px; margin-top: -2px; }
.cartel-emb.big { width: 72px; height: 72px; } .cartel-emb.big b { font-size: 28px; }
.cartel-row { display: flex; align-items: center; gap: 12px; color: var(--text); }
.cartel-intro b { font-size: 15px; }
.cartel-head { position: relative; overflow: hidden; color: #fff; border: 0; }
.cartel-head .ch-bg { position: absolute; inset: 0; background: linear-gradient(140deg, color-mix(in srgb, var(--kc) 85%, #000), #120a24 85%); }
.cartel-stats { position: relative; display: flex; justify-content: space-around; margin: 14px 0 8px; text-align: center; }
.cartel-stats b { display: block; font-size: 18px; } .cartel-stats span { font-size: 12px; opacity: .8; }
.council { position: relative; display: flex; align-items: center; gap: 4px; font-size: 12.5px; opacity: .95; margin-bottom: 4px; flex-wrap: wrap; }
.council span { margin-right: 4px; }
.cartel-head .btn.secondary { background: rgba(255,255,255,.16); color: #fff; }
.cartel-invite { border: 1.5px solid var(--pink); }
.cartel-chip { display: flex; align-items: center; gap: 8px; margin: 8px 14px 0; padding: 8px 12px; border-radius: 14px; background: color-mix(in srgb, var(--kc, var(--pink)) 14%, transparent); color: var(--text); font-size: 13.5px; border: 0; cursor: pointer; text-align: left; }
.cartel-chip .cartel-emb { width: 28px; height: 28px; } .cartel-chip .cartel-emb b { font-size: 12px; }
.cartel-chip.ghost { background: var(--surface); color: var(--muted); font-weight: 600; }
.cartel-chip.ghost svg { width: 18px; height: 18px; }
.reel .side { bottom: 26px; gap: 10px; } .reel .side .side-av { margin-bottom: 6px; }
@media (min-width: 900px) {
  main:has(.pf-wide) { max-width: 940px; margin-left: max(260px, calc((100vw - 940px) / 2)); }
  main:has(.pf-wide) .ptabs.icons { max-width: none; }
  main:has(.pf-wide) .reel-grid { grid-template-columns: repeat(5, 1fr); }
  .pf-card { grid-template-columns: 200px 1fr; }
}

.logo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.logo-opt { background: var(--surface); border: 2px solid transparent; border-radius: 16px; padding: 10px 6px; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--text); font-weight: 700; font-size: 12.5px; cursor: pointer; }
.logo-opt img { width: 54px; height: 54px; border-radius: 13px; }
.logo-opt.on { border-color: var(--pink); }

/* настройки — компактнее на телефоне */
@media (max-width: 899px) {
  .set-row { padding: 8px 2px; gap: 10px; min-height: 44px; }
  .set-row .ico { width: 30px; height: 30px; border-radius: 9px; font-size: 15px; }
  .set-row .ttl { font-size: 14.5px; }
  .set-row .sub { font-size: 12px; line-height: 1.25; }
  .set-group { font-size: 11.5px; margin: 12px 8px 4px; }
  .set-group + .card, .card:has(> .set-row) { padding: 4px 12px; }
  .card h2 { font-size: 16px; }
}
/* статистика */
.st-period { display: flex; margin-bottom: 8px; } .st-period a { flex: 1; text-align: center; }
.st-tabs { margin: 0 -14px -14px; }
.st-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 10px; }
@media (min-width: 700px) { .st-grid { grid-template-columns: repeat(4, 1fr); } }
.st-tile { background: var(--card); border: 1px solid color-mix(in srgb, var(--line) 60%, transparent); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; color: var(--text); }
.st-tile span { font-size: 12px; color: var(--muted); line-height: 1.2; }
.st-tile b { font-size: 22px; font-weight: 800; }
.st-tile.clk { cursor: pointer; } .st-tile.on { border-color: var(--pink); box-shadow: 0 0 0 1px var(--pink) inset; }
.st-d { font-size: 12px; font-weight: 700; color: var(--muted); } .st-d.up { color: var(--teal); } .st-d.down { color: #ef4444; }
.sc-wrap { position: relative; margin-top: 8px; touch-action: pan-y; }
.sc { width: 100%; height: auto; display: block; overflow: visible; }
.sc-grid { stroke: var(--line); stroke-width: 1; }
.sc-ax { fill: var(--muted); font-size: 11px; }
.sc-line { fill: none; stroke: var(--pink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.sc-area { fill: color-mix(in srgb, var(--pink) 14%, transparent); }
.sc-bar { fill: var(--pink); }
.sc-cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.sc-dot { fill: var(--pink); stroke: var(--card); stroke-width: 2; }
.sc-tip { position: absolute; top: -6px; width: 90px; background: var(--text); color: var(--bg); border-radius: 10px; padding: 5px 8px; font-size: 11.5px; pointer-events: none; display: flex; flex-direction: column; text-align: center; }
.sc-tip b { font-size: 14px; }
.st-insight { font-size: 14px; }
.st-insight svg.mono { color: var(--pink); }
.st-post { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 50%, transparent); color: var(--text); }
.st-post:last-child { border-bottom: 0; }
.st-post img, .st-ph { width: 48px; height: 64px; border-radius: 8px; object-fit: cover; flex: none; background: var(--surface); display: grid; place-items: center; color: var(--muted); }
.st-pt { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-pm { display: flex; gap: 12px; font-size: 12.5px; margin-top: 2px; } .st-pm small { color: var(--muted); }
.st-hb { position: relative; display: flex; gap: 8px; padding: 7px 8px; font-size: 13.5px; margin-bottom: 4px; border-radius: 8px; overflow: hidden; }
.st-hb i { position: absolute; left: 0; top: 0; bottom: 0; background: color-mix(in srgb, var(--pink) 16%, transparent); border-radius: 8px; z-index: 0; }
.st-hb span, .st-hb b { position: relative; z-index: 1; }

.comment { display: flex; gap: 8px; }
.cm-like { background: none; border: 0; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 2px 4px; cursor: pointer; font-size: 11.5px; font-weight: 700; flex: none; align-self: flex-start; }
.cm-like svg { width: 18px; height: 18px; }
.cm-like.liked { color: var(--pink); }
.cm-like.liked svg.palm { stroke: var(--pink); fill: color-mix(in srgb, var(--pink) 30%, transparent); }
.cartel-reach { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--pink) 10%, transparent); }

.cartel-emb.img img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; border: 2px solid var(--kc); box-sizing: border-box; }
.cartel-emb.big.img img { border-radius: 18px; border-width: 3px; }
.cartel-head .ch-cover { position: absolute; inset: 0; background: center / cover no-repeat; }
.cartel-head .ch-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.25), rgba(10,5,25,.85)); }
.cartel-head > *:not(.ch-bg):not(.ch-cover) { position: relative; }
.kf-imgs { display: flex; gap: 8px; margin-top: 6px; }
.kf-emb, .kf-cov { position: relative; height: 84px; border-radius: 14px; background: var(--surface) center / cover no-repeat; border: 1px dashed var(--line); display: grid; place-items: center; color: var(--muted); cursor: pointer; }
.kf-emb { width: 84px; flex: none; } .kf-cov { flex: 1; }
.kf-emb small, .kf-cov small { position: absolute; bottom: 4px; left: 0; right: 0; text-align: center; font-size: 11px; font-weight: 700; text-shadow: 0 0 4px var(--card); }
.kf-emb svg, .kf-cov svg { width: 26px; height: 26px; }

/* баннер профиля всегда 3:1 — как его видят другие */
.cover-edit { height: auto; aspect-ratio: 3 / 1; }
.pf-cover { height: auto !important; aspect-ratio: 3 / 1; }
.pf-cover { margin-bottom: -36px; }
@media (min-width: 900px) { main:has(.pf-wide) .pf-cover { margin-bottom: -60px; } }

/* баннер: карточка не перекрывает его, аватар заходит на баннер */
.pf-cover { margin-bottom: 0 !important; }
.pf-card.has-cover .pav { margin-top: -44px; }
.pf-card.has-cover { padding-top: 8px; }
@media (min-width: 900px) { .pf-card.has-cover .pav { margin-top: -80px; } .pf-card.has-cover .profile-head > .grow { padding-top: 8px; } }
/* редактирование — компактно, кнопки прямо на баннере */
.cover-edit { position: relative; margin-top: 4px; }
.cv-btns { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 6px; }
.cv-btn { display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border-radius: 99px; background: rgba(0,0,0,.6); color: #fff; font-size: 12.5px; font-weight: 700; border: 0; cursor: pointer; backdrop-filter: blur(6px); }
.cv-btn svg { width: 15px; height: 15px; }
.edit-card .field { margin-bottom: 8px; }
.edit-card .field > span { font-size: 12.5px; }
.edit-card input, .edit-card textarea { padding: 9px 12px; font-size: 15px; }
.edit-card .avatar.lg { width: 64px; height: 64px; font-size: 24px; }
.edit-card h2 { margin-bottom: 8px; }

/* редактирование профиля — всё на одном экране */
.edit-card { padding: 10px 12px; }
.edit-card h2 { font-size: 16px; }
.ed-sec { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--text); }
.ed-sec svg { width: 17px; height: 17px; }
.edit-card .cover-edit { margin: 0 0 30px; overflow: visible; }
.ed-av { position: absolute; left: 10px; bottom: -26px; cursor: pointer; }
.ed-av .avatar.lg { width: 60px !important; height: 60px !important; font-size: 22px; border: 3px solid var(--card); box-sizing: content-box; }
.ed-av i { position: absolute; right: -2px; bottom: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; border: 2px solid var(--card); }
.ed-av i svg { width: 13px; height: 13px; }
.ed-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; }
.edit-card .field { margin-bottom: 6px; }
.edit-card .field > span { font-size: 11.5px; margin-bottom: 2px; display: block; }
.edit-card input, .edit-card textarea { padding: 7px 10px !important; font-size: 14.5px !important; min-height: 0; border-radius: 10px; }
.edit-card textarea { resize: none; }
.edit-card #save { padding: 10px; margin-top: 4px; }

.vbadge { width: .95em; height: .95em; vertical-align: -0.12em; margin-left: 4px; flex: none; display: inline-block; }
.vbadge path:first-child { fill: #1d9bf0; }
.vbadge .ck { fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.v-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 14px 6px; }
.v-hero .vbadge, .v-hero svg.mono { width: 54px; height: 54px; margin: 0; }
.v-hero b { font-size: 17px; }
.vf-doc { display: flex; align-items: center; justify-content: center; gap: 8px; height: 90px; border-radius: 14px; border: 1px dashed var(--line); background: var(--surface) center / cover no-repeat; color: var(--muted); cursor: pointer; margin-top: 4px; font-weight: 600; }
.vf-doc.has > * { opacity: 0; }
.vr-row { display: flex; gap: 8px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
svg.vbadge { position: static !important; background: none !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; filter: none !important; display: inline-block !important; width: 16px !important; height: 16px !important; vertical-align: -2px !important; margin-left: 4px; stroke: none; }
h1 svg.vbadge, .pf-card h1 svg.vbadge { width: 20px !important; height: 20px !important; vertical-align: -1px !important; }
.v-hero svg.vbadge { width: 54px !important; height: 54px !important; margin: 0; }
.reel .overlay svg.vbadge { width: 15px !important; height: 15px !important; }
/* аватар автора в рилсах: кольцо историй ровно по кругу */
.reel .side .side-av { display: flex !important; justify-content: center; align-items: center; height: auto !important; width: auto !important; }
.reel .side .side-av .avatar-wrap { display: inline-flex !important; line-height: 0; border-radius: 50%; }
.reel .side .side-av .avatar-wrap.story-ring { padding: 3px; }
.reel .side .side-av .avatar { width: 44px !important; height: 44px !important; border: 2px solid #fff; box-sizing: border-box; }
@media (min-width: 900px) { body.reels-mode .reel .side .side-av .avatar { width: 48px !important; height: 48px !important; } }

.st-stories { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.st-story { position: relative; aspect-ratio: 9 / 16; border-radius: 12px; overflow: hidden; background: var(--surface); display: flex; flex-direction: column; justify-content: flex-end; }
.st-story img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.st-story .st-ph { position: absolute; inset: 0; width: auto; height: auto; }
.st-story .st-sv { position: relative; margin: 0 6px; color: #fff; font-weight: 800; font-size: 13px; text-shadow: 0 1px 4px rgba(0,0,0,.7); display: flex; align-items: center; gap: 4px; }
.st-story small { position: relative; margin: 0 6px 6px; color: #fff; opacity: .85; font-size: 10.5px; text-shadow: 0 1px 4px rgba(0,0,0,.7); }
.st-live { position: absolute; top: 6px; left: 6px; background: var(--pink); color: #fff; font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 6px; }

.st-type { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 6px; background: color-mix(in srgb, var(--pink) 14%, transparent); color: var(--pink); margin-bottom: 2px; }
.st-type svg { width: 12px; height: 12px; }
.st-type.t-question { background: color-mix(in srgb, var(--teal) 16%, transparent); color: var(--teal); }
.st-type.t-sale { background: color-mix(in srgb, var(--orange) 16%, transparent); color: var(--orange); }
.st-type.t-post { background: var(--surface); color: var(--text); }
.st-story .st-type.t-story { position: absolute; top: 6px; right: 6px; margin: 0; background: rgba(0,0,0,.55); color: #fff; }
.st-story .st-type.t-story { left: 6px; right: auto; }
.st-story .st-live { top: 30px; }

/* ===== Компактный мобильный режим (минимализм) ===== */
@media (max-width: 899px) {
  body { font-size: 14.5px; }
  main { padding: 8px 8px calc(var(--nav-h) + var(--safe-b) + 16px); }
  .card { padding: 11px 12px; margin-bottom: 8px; border-radius: 16px; }
  .card h2 { font-size: 16px; margin-bottom: 8px; }
  .card h3 { font-size: 14.5px; margin-bottom: 8px; }
  .muted { font-size: 12px; }
  .btn { padding: 8px 13px; font-size: 14px; border-radius: 11px; }
  .btn.small { padding: 5px 10px; font-size: 12.5px; }
  .btn.block { padding: 10px; }
  .btn.big { padding: 11px; font-size: 15px; }
  input, textarea, select { padding: 8px 11px !important; border-radius: 11px !important; }
  select { width: auto; max-width: 100%; }
  .set-row select, #lang { padding: 5px 28px 5px 10px !important; min-height: 0; height: 34px; font-size: 14px !important; border-radius: 10px !important; width: auto !important; max-width: 150px; }
  .field { margin-bottom: 9px; }
  .field > span { font-size: 12.5px; margin-bottom: 3px; }
  .tabs { gap: 5px; margin-bottom: 8px; }
  .tabs a, .tabs button { padding: 6px 12px; font-size: 13px; }
  .seg button, .seg a { padding: 6px 8px; font-size: 13px; }
  .list-item { padding: 8px 2px; gap: 10px; }
  .list-item .name { font-size: 14px; }
  .avatar.lg { width: 76px; height: 76px; }
  /* посты */
  .post-head { gap: 9px; }
  .post-head .who { font-size: 14.5px; }
  .post-head .muted { font-size: 11.5px; }
  .post-text { font-size: 14.5px; line-height: 1.4; margin: 5px 0; }
  .big-text { font-size: 16.5px; }
  .post-actions { gap: 5px; margin-top: 6px; }
  .act { padding: 5px 10px; font-size: 13px; border-radius: 14px; }
  .act svg { width: 18px; height: 18px; }
  .comment { font-size: 13.5px; }
  /* шапка и меню */
  .topbar { padding-left: 10px; }
  .brand { font-size: 17px; letter-spacing: 2.5px; }
  .brand img { width: 27px; height: 27px; }
  .topbtn { padding: 6px; }
  .topbtn svg { width: 22px; height: 22px; }
  /* обзор / чипы */
  .ex-tabs a { padding: 6px 12px; font-size: 13px; }
  .chip { padding: 5px 10px; font-size: 12.5px; }
  .rank-row { padding: 6px 2px; font-size: 13.5px; }
  /* меню снизу (action sheet) */
  .as-box > button { padding: 12px; font-size: 15px; }
  /* истории */
  .st-ring .avatar { width: 54px; height: 54px; }
  .st-item { width: 62px; }
  .st-item small { font-size: 11px; }
  /* профиль */
  .profile-head h1 { font-size: 17px; }
  .info-row { font-size: 13px; }
  /* сообщения */
  .msg { font-size: 14px; }
  /* статистика */
  .st-tile b { font-size: 19px; }
  .st-tile { padding: 8px 10px; }
  /* группировки и картели */
  .cartel-stats b { font-size: 16px; }
  .gh-main h1 { font-size: 18px; }
  /* композер */
  .composer2 textarea { font-size: 16px !important; }
}

/* баннер 4:1 везде (компактнее) */
.pf-cover, .cover-edit { aspect-ratio: 4 / 1 !important; }
/* профиль на телефоне — компактная шапка */
@media (max-width: 899px) {
  .pf-card { padding: 8px 12px 10px; }
  .pf-card .profile-head { gap: 10px; align-items: flex-end; }
  .pf-card .pav .avatar.lg { width: 64px; height: 64px; font-size: 24px; }
  .pf-card.has-cover .pav { margin-top: -34px; }
  .pf-card .pav-plus { width: 20px; height: 20px; font-size: 14px; left: -2px; bottom: -2px; }
  .pf-card h1 { font-size: 16px; }
  .pf-card .lvl-line { font-size: 11px; margin-top: 0; }
  .pf-card .profile-head .muted { font-size: 11.5px; }
  .pf-card .profile-stats { justify-content: flex-start !important; gap: 16px; margin: 8px 0 2px !important; text-align: left !important; }
  .pf-card .profile-stats > * { display: flex; align-items: baseline; gap: 4px; }
  .pf-card .profile-stats b { font-size: 14.5px !important; }
  .pf-card .profile-stats .muted { font-size: 12.5px; }
  .pf-card .post-text { font-size: 13.5px; margin: 6px 0 0 !important; }
  .pf-card .info-row { font-size: 12.5px; margin-top: 3px; }
  .pf-card .info-row b { min-width: 0; margin-right: 4px; }
  .pf-card .profile-link { margin-top: 6px; padding: 4px 10px; font-size: 12.5px; }
  .pf-card .profile-actions { margin-top: 8px; gap: 6px; }
  .pf-card .profile-actions .btn { padding: 7px 10px; font-size: 13.5px; }
  .pf-card .badges { margin-top: 2px; }
  .ptabs.icons a { padding: 7px 4px; }
  .ptabs.icons svg { width: 19px; height: 19px; }
  /* выпадающие списки в настройках — не во всю ширину */
  .set-row select { flex: none; width: auto !important; max-width: 140px; height: 32px; padding: 4px 26px 4px 10px !important; font-size: 13.5px !important; }
}
.pf-bio { margin: 8px 0 0; }
@media (max-width: 899px) { .set-row select { max-width: 116px !important; min-width: 0 !important; width: auto !important; flex: 0 0 auto !important; } }

/* ===== Редактор видео v3 — компактно, как в TikTok ===== */
.ed-top { padding: 6px 10px; }
.ed-snd { display: inline-flex; align-items: center; gap: 6px; max-width: 55%; background: rgba(255,255,255,.14); color: #fff; border: 0; border-radius: 99px; padding: 6px 14px; font-size: 13px; font-weight: 700; cursor: pointer; }
.ed-snd svg { width: 16px; height: 16px; flex: none; }
.ed-snd span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-stage { padding: 0 6px; }
.ed-rail { right: 10px; top: 10px; gap: 14px; }
.ed-rail button { font-size: 10px; }
.ed-rail button svg { width: 24px; height: 24px; }
.ed-bottom { margin-top: 6px; padding: 2px 12px 8px; border-radius: 16px 16px 0 0; }
.ed-ctrl { font-size: 11.5px; }
.ed-ctrl button { padding: 2px 10px; }
.ed-ctrl button svg { width: 20px; height: 20px; }
.tl-strip { height: 40px; }
.tl-sel i { width: 13px; } .tl-sel .h-l { left: -13px; } .tl-sel .h-r { right: -13px; }
.tl-sel i::after { left: 4.5px; }
.tl-tracks { margin-top: 6px; max-height: 64px; gap: 4px; }
.tl-track { height: 22px; }
.tl-clip { font-size: 11px; }
#tlBox { padding: 4px 12px 2px; }
.ed-sheet { max-height: 34dvh; padding-top: 4px; }
.ed-sheet .sheet-head { margin-bottom: 6px; }
.ed-sheet .sheet-head b { font-size: 14px; }
.ed-ok { width: 30px; height: 30px; font-size: 15px; }
.ed-sheet .seg button { padding: 6px; font-size: 13px; }
.ed-sheet textarea { min-height: 0; }
.filters-row img, .flt img { width: 56px !important; height: 74px !important; }

/* ===== Музыка ===== */
.nav-desk { display: none !important; }
@media (min-width: 900px) { .nav a.nav-desk { display: flex !important; } }
.mu-head h2 { display: flex; align-items: center; gap: 8px; }
.mu-actions { margin-bottom: 6px; gap: 6px; }
.mu-actions .btn svg { width: 14px; height: 14px; }
.tr-row { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-radius: 12px; cursor: pointer; }
.tr-row:hover { background: var(--surface); }
.tr-row.current { background: color-mix(in srgb, var(--pink) 10%, transparent); }
.tr-row.current .tr-info b { color: var(--pink); }
.tr-play { width: 36px; height: 36px; flex: none; border-radius: 50%; border: 0; background: var(--grad); color: #fff; display: grid; place-items: center; cursor: pointer; }
.tr-play svg { width: 15px; height: 15px; }
.tr-cov { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex: none; }
.tr-info { display: flex; flex-direction: column; min-width: 0; }
.tr-info b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-info span { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-dur { font-variant-numeric: tabular-nums; }
.tr-fav, .tr-del { background: none; border: 0; color: var(--muted); padding: 6px; cursor: pointer; display: grid; place-items: center; }
.tr-fav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.tr-fav.on { color: var(--pink); } .tr-fav.on svg { fill: currentColor; }
.tr-del svg { width: 17px; height: 17px; }
.mu-file { display: flex; align-items: center; gap: 8px; padding: 14px; border-radius: 14px; border: 1px dashed var(--line); background: var(--surface); cursor: pointer; font-weight: 600; margin-bottom: 8px; }
/* мини-плеер */
.mplayer { position: fixed; left: 8px; right: 8px; bottom: calc(var(--nav-h) + var(--safe-b) + 6px); z-index: 29; background: color-mix(in srgb, var(--card) 94%, transparent); backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
body.has-player main { padding-bottom: calc(var(--nav-h) + var(--safe-b) + 80px); }
body.reels-mode .mplayer, body.editor-mode .mplayer { display: none; }
.mp-bar { height: 4px; background: var(--surface); cursor: pointer; }
.mp-bar i { display: block; height: 100%; width: 0; background: var(--grad); }
.mp-row { display: flex; align-items: center; gap: 6px; padding: 6px 8px; }
.mp-cov { width: 38px; height: 38px; border-radius: 8px; overflow: hidden; flex: none; background: var(--surface); display: grid; place-items: center; color: var(--muted); }
.mp-cov img { width: 100%; height: 100%; object-fit: cover; }
.mp-info { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.mp-info b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-info span { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-info small { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mp-row button { background: none; border: 0; color: var(--text); width: 32px; height: 32px; display: grid; place-items: center; cursor: pointer; flex: none; padding: 0; }
.mp-row button svg { width: 18px; height: 18px; }
.mp-row .mp-main { width: 38px; height: 38px; border-radius: 50%; background: var(--grad); color: #fff; }
.mp-row .mp-x { color: var(--muted); font-size: 14px; width: 24px; }
@media (min-width: 900px) {
  .nav .mplayer { position: static; margin-top: 14px; left: auto; right: auto; bottom: auto; }
  body.has-player main { padding-bottom: 30px; }
  body.reels-mode .nav .mplayer { display: block; }
  .nav .mplayer .mp-row { flex-wrap: wrap; }
  .nav .mplayer .mp-info { flex: 1 1 100px; }
}

.alb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.alb { display: flex; flex-direction: column; gap: 2px; color: var(--text); min-width: 0; }
.alb img, .alb-ph { width: 100%; aspect-ratio: 1; border-radius: 12px; object-fit: cover; background: var(--surface); display: grid; place-items: center; color: var(--muted); margin-bottom: 4px; }
.alb-ph svg { width: 34px; height: 34px; }
.alb b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alb span, .alb small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alb-top { display: flex; gap: 14px; align-items: flex-end; margin-top: 6px; }
.alb-top img, .alb-ph.big { width: 120px; height: 120px; border-radius: 14px; object-fit: cover; flex: none; margin: 0; }
.tr-no { width: 18px; text-align: right; font-variant-numeric: tabular-nums; }
.al-list { max-height: 34vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.al-row { display: flex; align-items: center; gap: 6px; }
.al-row span { width: 20px; text-align: right; font-size: 12px; }
.al-row input { flex: 1; padding: 6px 10px !important; }
.al-row button { background: none; border: 0; color: var(--muted); cursor: pointer; }
.mu-head .row .btn { white-space: nowrap; }

.mp-rep { position: relative; color: var(--muted) !important; }
.mp-rep svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mp-rep.on { color: var(--pink) !important; }
.mp-rep b { position: absolute; right: 3px; bottom: 3px; font-size: 9px; font-weight: 900; background: var(--pink); color: #fff; border-radius: 6px; padding: 0 3px; line-height: 12px; }
.mp-vol { display: flex; align-items: center; gap: 2px; }
.mp-vol svg path:not([fill]) { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.mp-vol input[type=range] { width: 70px; accent-color: var(--pink); padding: 0 !important; height: 4px; }
@media (max-width: 899px) { .mp-vol input[type=range] { display: none; } .mp-row { gap: 2px; } }
@media (min-width: 900px) {
  .nav .mplayer .mp-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 6px; }
  .nav .mplayer .mp-cov { order: 0; }
  .nav .mplayer .mp-info { order: 1; flex: 1 1 0; }
  .nav .mplayer .mp-x { order: 2; }
  .nav .mplayer .mp-rep { order: 3; }
  .nav .mplayer [data-mp="prev"] { order: 4; }
  .nav .mplayer [data-mp="play"] { order: 5; }
  .nav .mplayer [data-mp="next"] { order: 6; }
  .nav .mplayer .mp-cov + .mp-info { min-width: 0; }
  .nav .mplayer .mp-row::after { content: ""; order: 2; flex-basis: 100%; height: 0; }
  .nav .mplayer .mp-vol { order: 8; flex-basis: 100%; }
  .nav .mplayer .mp-vol input[type=range] { flex: 1; width: auto; }
}

.pf-now { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 8px; padding: 7px 10px; border: 0; border-radius: 12px; background: color-mix(in srgb, var(--pink) 10%, transparent); color: var(--text); text-align: left; cursor: pointer; }
.pf-now .grow { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13.5px; }
.pf-now small { display: block; font-size: 11px; color: var(--pink); font-weight: 700; }
.pf-now > svg { width: 16px; height: 16px; color: var(--pink); flex: none; }
.eq { display: flex; align-items: flex-end; gap: 2px; height: 16px; flex: none; }
.eq i { width: 3px; background: var(--pink); border-radius: 2px; animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: .2s; } .eq i:nth-child(3) { animation-delay: .4s; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 16px; } }
@media (min-width: 900px) { .pf-card .pf-now { max-width: 420px; } }
.tr-fav svg { stroke-linejoin: round; }
@media (min-width: 900px) { .top-mob { display: none !important; } }
.al-row button:disabled { opacity: .25; }
.al-row button { font-size: 14px; padding: 4px 5px; }

.alb-row { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; margin-top: 8px; }
.alb-row::-webkit-scrollbar { display: none; }
.alb-row .alb { flex: 0 0 120px; }

.nav a .kbadge { position: static; margin-left: auto; background: var(--pink); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 99px; font-weight: 800; }
.kreq { color: var(--pink); font-weight: 800; }
@media (min-width: 900px) { .mob-only { display: none !important; } }
@media (max-width: 899px) { .nav a { position: relative; } .nav a #kentBadgeMob { position: absolute; top: 2px; right: 22%; background: var(--pink); color: #fff; font-size: 10px; min-width: 16px; height: 16px; border-radius: 8px; display: grid; place-items: center; padding: 0 4px; } }
.kent-btn { flex: none; }
.kent-btn svg { width: 16px; height: 16px; }
.kent-btn.k-kents { color: var(--teal); }

.acct-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 4px; }
.acct { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 9px 10px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.acct svg { width: 18px; height: 18px; color: var(--pink); }
.acct b { font-size: 13.5px; }
.acct small { font-size: 11px; color: var(--muted); line-height: 1.25; }
.acct.on { border-color: var(--pink); background: color-mix(in srgb, var(--pink) 9%, var(--surface)); }
.acct-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: color-mix(in srgb, var(--pink) 12%, transparent); color: var(--pink); }
.acct-tag svg { width: 13px; height: 13px; }
.acct-tag.a-pro { background: color-mix(in srgb, var(--purple) 14%, transparent); color: var(--purple); }
.acct-tag.a-business { background: color-mix(in srgb, var(--orange) 14%, transparent); color: var(--orange); }

/* кнопки в чужом профиле — компактно */
.pf-card .profile-actions { flex-wrap: nowrap; gap: 5px; }
.pf-card .profile-actions .btn { padding: 6px 10px !important; font-size: 13px !important; border-radius: 10px; min-height: 0; white-space: nowrap; }
.pf-card .profile-actions .btn svg { width: 15px; height: 15px; }
.pf-card .profile-actions .kent-btn { flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; }
.pf-card .profile-actions #moreBtn, .pf-card .profile-actions #shareBtn { flex: none; padding: 6px 9px !important; }
@media (min-width: 900px) { .pf-card .profile-actions .btn.grow { flex: 0 0 auto; } }

.nt-row { display: flex; align-items: center; gap: 10px; padding: 9px 6px; border-radius: 12px; color: var(--text); }
.nt-row + .nt-row { border-top: 1px solid color-mix(in srgb, var(--line) 50%, transparent); }
.nt-row.new { background: color-mix(in srgb, var(--pink) 8%, transparent); }
.nt-t { font-size: 13.5px; line-height: 1.35; }
.nt-row .muted { font-size: 11.5px; }
.nt-th { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; flex: none; }
.nt-sys img { width: 36px; height: 36px; border-radius: 10px; display: block; }
.topbtn { position: relative; }
.tb-badge { position: absolute; top: 0; right: 0; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: #ff2d55; color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; border: 1.5px solid #fff; }
@media (max-width: 899px) { #topInvite { display: none !important; } }
@media (min-width: 900px) { .nav a .badge { position: static; margin-left: auto; background: var(--pink); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 99px; font-weight: 800; min-width: 0; height: auto; } }

.game-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 700px) { .game-grid { grid-template-columns: repeat(3, 1fr); } }
.game-tile { position: relative; display: grid; gap: 4px; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 8px; }
.gt-cover { aspect-ratio: 1; border-radius: 12px; background: linear-gradient(135deg, #2a0f3a, #0d2a3a) center/cover; display: grid; place-items: center; }
.gt-cover svg { width: 40%; height: 40%; opacity: .7; }
.game-tile .muted { font-size: 12px; display: flex; gap: 4px; align-items: center; } .game-tile .muted svg { width: 12px; height: 12px; }
.gt-del { position: absolute; top: 12px; right: 12px; background: #0009; color: #fff; border: 0; border-radius: 99px; width: 26px; height: 26px; }
body.game-mode main { padding: 0 !important; margin: 0 !important; max-width: none !important; }
.game-full { position: fixed; inset: 0; z-index: 60; background: #000; display: flex; flex-direction: column; }
.game-bar { display: flex; align-items: center; gap: 8px; padding: calc(env(safe-area-inset-top) + 4px) 8px 4px; color: #fff; }
.game-bar b { flex: 1; text-align: center; } .game-full iframe { flex: 1; border: 0; width: 100%; background: #000; }

.upd-head { display: flex; gap: 12px; align-items: center; }
.upd-v { font-weight: 900; font-size: 18px; padding: 8px 12px; border-radius: 12px; color: #fff; background: linear-gradient(135deg, var(--pink), #ff8a3d); }
.upd-list { margin: 12px 0; padding-left: 20px; line-height: 1.5; font-size: 14px; }
.upd-fb { border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 6px; }

.ex-hub { display: none; }
@media (max-width: 899px) {
  .ex-hub { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
  .ex-hub a { display: grid; justify-items: center; gap: 6px; padding: 12px 4px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); color: var(--text); font-size: 12.5px; font-weight: 600; }
  .ex-hub svg { width: 26px; height: 26px; color: var(--pink); }
}

#drawerBtn { margin-right: 2px; background: none; border: 0; }
#drawerDot { min-width: 9px; width: 9px; height: 9px; padding: 0; top: 4px; right: 4px; }
@media (max-width: 899px) { #topComm, #topMenu { display: none !important; } }
@media (min-width: 900px) { #drawerBtn, .drawer { display: none !important; } }
.drawer { position: fixed; inset: 0; z-index: 200; }
.dr-back { position: absolute; inset: 0; background: rgba(0,0,0,.45); opacity: 0; transition: opacity .25s; backdrop-filter: blur(2px); }
.dr-panel { position: absolute; top: 0; bottom: 0; left: 0; width: min(80vw, 310px); background: var(--card); box-shadow: 8px 0 30px rgba(0,0,0,.3);
  transform: translateX(-102%); transition: transform .26s cubic-bezier(.2,.8,.2,1); overflow-y: auto; padding: calc(env(safe-area-inset-top) + 12px) 12px calc(env(safe-area-inset-bottom) + 16px);
  border-radius: 0 22px 22px 0; }
.drawer.open .dr-back { opacity: 1; } .drawer.open .dr-panel { transform: translateX(0); }
.dr-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.dr-me { display: flex; align-items: center; gap: 10px; flex: 1; color: var(--text); min-width: 0; }
.dr-me b { display: block; } .dr-me .muted { font-size: 12px; }
.dr-x { background: none; border: 0; font-size: 18px; color: var(--text); }
.dr-create { margin-bottom: 10px; }
.dr-nav { display: grid; gap: 2px; }
.dr-nav a { display: flex; align-items: center; gap: 14px; padding: 11px 12px; border-radius: 12px; color: var(--text); font-weight: 600; font-size: 15px; }
.dr-nav a.on { background: color-mix(in srgb, var(--pink) 12%, transparent); color: var(--pink); }
.dr-nav a svg { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; position: static; background: none; }
.dr-nav a .badge { margin-left: auto; position: static; background: var(--pink); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 99px; font-weight: 800; }
.dr-nav hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }

.brand img { width: 40px !important; height: 40px !important; border-radius: 0 !important; filter: drop-shadow(0 2px 6px rgba(0,0,0,.35)); }
@media (max-width: 899px) { .brand img { width: 36px !important; height: 36px !important; } }
.logo img { border-radius: 0 !important; }
.logo-opt img { border-radius: 0 !important; background: none !important; }
.nt-sys img { border-radius: 0 !important; }

.brand .anda { display: none; }
@media (min-width: 900px) {
  .brand { gap: 3px !important; }
  .brand .anda { display: block; height: 24.1px; width: auto; fill: #fff; margin-top: 1.5px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.3)); }
}

.mu-cats { display: flex; gap: 4px; margin-bottom: 8px; flex-wrap: wrap; }
.mu-cats button { flex: 1; padding: 8px 6px; border-radius: 10px; border: 1px solid var(--line); background: none; color: var(--text); font-weight: 600; font-size: 12.5px; }
.mu-cats button.on { background: var(--pink); color: #fff; border-color: transparent; }
.mu-note { font-size: 12px; display: block; margin: 4px 0; }
.mu-chk { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; margin: 6px 0; } .mu-chk input { width: auto; margin-top: 3px; flex: none; }
.mu-cat { display: inline-block; font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 6px; margin-right: 4px; vertical-align: 1px; border: 1px solid currentColor; opacity: .85; }
.mu-cat.c-open { color: #22b07d; } .mu-cat.c-indie { color: var(--pink); } .mu-cat.c-world { color: #4f9cf9; }
.tr-rep { background: none; border: 0; color: var(--muted); padding: 6px; opacity: .6; } .tr-rep svg { width: 16px; height: 16px; }
.mu-embed { width: 100%; height: 160px; border: 0; border-radius: 12px; margin: 10px 0; background: #000; } .mu-embed.yt { height: auto; aspect-ratio: 16/9; }

.svc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; } .svc-grid button { padding: 12px 8px; border-radius: 12px; border: 1px solid var(--line); background: none; color: var(--text); font-weight: 700; }
.svc-grid button.on { background: var(--pink); color: #fff; border-color: transparent; }
.svc-links { display: flex; flex-wrap: wrap; gap: 6px; } .svc-links a { padding: 7px 12px; border-radius: 99px; border: 1px solid var(--line); color: var(--text); font-size: 13px; font-weight: 600; }
.svc-links a.on { background: var(--pink); color: #fff; border-color: transparent; }
.svc-bar { display: flex; align-items: center; gap: 10px; }
.trk-page { text-align: center; } .trk-cov { width: 220px; height: 220px; border-radius: 18px; object-fit: cover; margin: 6px auto 12px; display: block; box-shadow: 0 10px 30px rgba(0,0,0,.3); }
.trk-cov.ph { display: grid; place-items: center; background: linear-gradient(135deg, var(--purple), var(--pink)); color: #fff; } .trk-cov.ph svg { width: 70px; height: 70px; }
.trk-page h2 { margin: 0 0 4px; }

.fg-box { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; font-size: 13px; }
.fg-item { display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 99px; border: 1px solid var(--line); color: var(--text); cursor: pointer; font-weight: 600; }
.fg-item.on { border-color: var(--pink); background: color-mix(in srgb, var(--pink) 14%, transparent); }
.fg-item .avatar { width: 26px !important; height: 26px !important; }
.pf-groups { display: flex; gap: 6px; margin: 8px 0 2px; overflow-x: auto; }
.pf-grp { display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border-radius: 14px; background: color-mix(in srgb, var(--text) 5%, transparent); color: var(--text); min-width: 0; flex: 1 1 0; }
.pf-grp span { display: grid; min-width: 0; } .pf-grp b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .pf-grp small { font-size: 11px; color: var(--muted); }
.pf-grp { flex-direction: column; text-align: center; gap: 4px; padding: 8px 6px; }
.pf-grp span { width: 100%; }
.pf-grp small { white-space: nowrap; }

.link-ed { display: flex; align-items: center; gap: 8px; width: 100%; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--input, transparent); color: var(--text); font: inherit; text-align: left; }
.link-ed svg { width: 18px; height: 18px; flex: none; }
.ln-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); } .ln-row input { width: auto; flex: none; accent-color: var(--pink); }
.ln-row span { display: grid; min-width: 0; } .ln-row small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; }
.ln-row button { background: none; border: 0; color: var(--muted); padding: 6px; } .ln-row button svg { width: 18px; height: 18px; }
.ln-add { display: grid; gap: 6px; margin-top: 10px; }
.fg-style { display: flex; gap: 4px; } .fg-style button { flex: 1; padding: 7px; border-radius: 10px; border: 1px solid var(--line); background: none; color: var(--text); font-weight: 600; font-size: 12.5px; } .fg-style button.on { background: var(--pink); color: #fff; border-color: transparent; }
.pl-item { margin-top: 10px; } .mu-embed.pl { height: 380px; margin: 6px 0 0; }
.mu-cats { display: grid !important; grid-template-columns: 1fr 1fr; } .mu-scan { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, #22b07d 12%, transparent); margin: 8px 0 4px; } .mu-scan svg { width: 16px; height: 16px; flex: none; color: #22b07d; } .mu-cat.c-ai { color: #a855f7; }
.auth-or { display: flex; align-items: center; gap: 10px; margin: 14px 0 10px; color: var(--muted); font-size: 12px; } .auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
#authErr a { font-weight: 700; }
.pf-pl { display: flex; gap: 6px; align-items: center; overflow-x: auto; margin: 8px 0 2px; font-size: 13px; } .pf-pl > b { display: flex; gap: 4px; align-items: center; flex: none; } .pf-pl > b svg { width: 16px; height: 16px; } .pf-pl button { display: flex; align-items: center; gap: 6px; flex: none; padding: 6px 12px 6px 8px; border-radius: 99px; border: 1px solid var(--line); background: none; color: var(--text); font-weight: 600; font-size: 12.5px; } .pf-pl button svg { width: 14px; height: 14px; } .pf-pl small { color: var(--muted); font-weight: 500; }

.pro-chip { display: inline-block; font-size: 10px; font-weight: 900; letter-spacing: 1px; padding: 2px 7px; border-radius: 6px; color: #fff; background: linear-gradient(135deg, #f5b400, #ff7a00); vertical-align: 2px; margin-left: 6px; }
.pro-hero { text-align: center; background: linear-gradient(135deg, var(--purple), var(--pink) 60%, var(--orange)) !important; color: #fff; }
.pro-hero h2 { margin: 6px 0; color: #fff; } .pro-hero p { opacity: .9; font-size: 14px; }
.pro-badge { display: inline-block; font-weight: 900; letter-spacing: 3px; padding: 6px 14px; border-radius: 10px; background: linear-gradient(135deg, #ffd34d, #ff8a00); color: #3a1d00; }
.pro-free { display: inline-block; margin: 6px 0; padding: 6px 12px; border-radius: 99px; background: rgba(255,255,255,.2); font-weight: 800; }
.pro-list { list-style: none; padding: 0; margin: 0; } .pro-list li { display: flex; gap: 12px; align-items: center; padding: 9px 2px; border-bottom: 1px solid var(--line); }
.pro-list li > svg { width: 22px; height: 22px; color: var(--pink); flex: none; } .pro-list b { display: block; font-size: 14px; } .pro-list small { color: var(--muted); font-size: 12px; }
.pro-list .soon { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--muted); }

.brand img { filter: none !important; image-rendering: auto; -webkit-transform: translateZ(0); transform: translateZ(0); }
.push-ask { display: flex; align-items: center; gap: 10px; border: 1px solid color-mix(in srgb, var(--pink) 40%, transparent); }
/* Поля с иконками внутри: мобильный компактный padding не должен перекрывать иконку */
.pw-wrap input { padding-right: 44px !important; }
.pw-wrap .at ~ input, .pw-wrap input[style*="padding-left"] { padding-left: 30px !important; }
.pw-wrap .at { z-index: 1; pointer-events: none; }
/* Плейсхолдеры в однострочных полях не обрезаются посередине строки */
#c2t[rows="1"] { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; resize: none; }
#c2t::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
input::placeholder { text-overflow: ellipsis; }
#topPro svg { color: #ffd34d; }
@media (max-width: 380px) { .topbar .topbtn { width: 34px; } }

.tune { margin: 0 0 14px; padding: 12px; border-radius: 14px; background: var(--surface); }
.tune label { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 13.5px; margin-bottom: 6px; }
.tune label span { display: flex; align-items: center; gap: 6px; } .tune label svg { width: 16px; height: 16px; }
.tune input[type=range] { width: 100%; accent-color: var(--pink); }
.tune-ends { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; margin-top: 2px; }
.tune-ends button { background: none; border: 0; color: var(--pink); font-weight: 700; font-size: 12px; }
.topbar .topbtn svg, .topbar #drawerBtn svg { filter: drop-shadow(0 1px 1.5px rgba(0,0,0,.35)); }
/* ---------- Фон профиля (BANDA Pro): минималистичные узоры поверх цвета темы ---------- */
body.pbg { --pk: color-mix(in srgb, var(--text) 9%, transparent); --pk2: color-mix(in srgb, var(--pink) 22%, transparent); background-attachment: fixed !important; }
body.pbg-dots { background: radial-gradient(var(--pk) 1.3px, transparent 1.7px) 0 0 / 22px 22px, var(--bg) !important; }
body.pbg-grid { background: linear-gradient(var(--pk) 1px, transparent 1px) 0 0 / 30px 30px, linear-gradient(90deg, var(--pk) 1px, transparent 1px) 0 0 / 30px 30px, var(--bg) !important; }
body.pbg-stars::before { background:
  radial-gradient(1.4px 1.4px at 20px 30px, var(--pk2), transparent 2px), radial-gradient(1px 1px at 90px 80px, var(--pk), transparent 2px),
  radial-gradient(1.8px 1.8px at 140px 20px, var(--pk), transparent 2.5px), radial-gradient(1.2px 1.2px at 60px 150px, var(--pk2), transparent 2px),
  radial-gradient(1px 1px at 170px 130px, var(--pk), transparent 2px) 0 0 / 190px 190px;
  background-size: 190px 190px; }
body.pbg-waves { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='40'%3E%3Cpath d='M0 20 Q30 4 60 20 T120 20' fill='none' stroke='%23ffffff' stroke-opacity='.07' stroke-width='1.5'/%3E%3C/svg%3E") 0 0 / 120px 40px, var(--bg) !important; }
:root[data-mode="light"] body.pbg-waves { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='40'%3E%3Cpath d='M0 20 Q30 4 60 20 T120 20' fill='none' stroke='%23000000' stroke-opacity='.08' stroke-width='1.5'/%3E%3C/svg%3E") 0 0 / 120px 40px, var(--bg) !important; }
.pbg-pick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 4px; }
.pbg-pick button { display: grid; justify-items: center; gap: 4px; padding: 4px; border-radius: 12px; border: 2px solid transparent; background: none; color: var(--text); font-size: 11px; font-weight: 600; }
.pbg-pick button.on { border-color: var(--pink); }
.pbg-sw { display: block; width: 100%; aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--line); --pk: color-mix(in srgb, var(--text) 18%, transparent); background-color: var(--bg); }
.pbg-sw.pbg-dots { background: radial-gradient(var(--pk) 1.3px, transparent 1.7px) 0 0 / 10px 10px, var(--bg); }
.pbg-sw.pbg-grid { background: linear-gradient(var(--pk) 1px, transparent 1px) 0 0 / 12px 12px, linear-gradient(90deg, var(--pk) 1px, transparent 1px) 0 0 / 12px 12px, var(--bg); }
.pbg-sw.pbg-stars { background: radial-gradient(1.5px 1.5px at 6px 8px, var(--pk), transparent 2px), radial-gradient(1.2px 1.2px at 18px 22px, var(--pink), transparent 2px), radial-gradient(1px 1px at 26px 6px, var(--pk), transparent 2px) 0 0 / 34px 34px, var(--bg); background-size: 34px 34px, 34px 34px, 34px 34px, auto; }
.pbg-sw.pbg-waves { background: repeating-radial-gradient(circle at 50% 140%, transparent 0 6px, var(--pk) 6px 7px), var(--bg); }
body.pbg-stars { --pk: color-mix(in srgb, var(--text) 22%, transparent); --pk2: color-mix(in srgb, var(--pink) 45%, transparent); }
/* ===== Редактор рилсов в стиле TikTok ===== */
.editor .ed-top { position: relative; z-index: 4; }
.editor .ed-x { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.12); display: grid; place-items: center; border: 0; color: #fff; }
.editor .ed-x svg, .editor .ed-done svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.editor .ed-done { display: none; width: 38px; height: 38px; border-radius: 50%; background: var(--grad); border: 0; color: #fff; place-items: center; }
.editor .ed-sp { width: 38px; }
.editor .ed-frame { border-radius: 16px; }
.editor .ed-bottom { display: none; }
.editor .ed-rail { gap: 18px; top: 12px; right: 10px; }
.editor .ed-rail button span { display: none; }
.editor .ed-rail.labels button span { display: block; }
.editor .ed-rail button svg { width: 27px; height: 27px; }
.editor .ed-rail .ed-more svg { width: 24px; height: 24px; transition: transform .2s; } .editor .ed-rail.labels .ed-more svg { transform: rotate(180deg); }
.ed-foot { display: flex; gap: 10px; padding: 10px 12px calc(10px + var(--safe-b)); flex-shrink: 0; }
.ed-foot button { flex: 1; height: 50px; border-radius: 99px; border: 0; font-weight: 800; font-size: 16px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.ed-story { background: color-mix(in srgb, var(--pink) 28%, #1a1a1f); color: #fff; border: 1.5px solid color-mix(in srgb, var(--pink) 70%, transparent) !important; } .ed-story .avatar { width: 32px !important; height: 32px !important; font-size: 13px; }
.ed-next { background: var(--grad); color: #fff; }
.ed-tabs { display: none; }
/* режим «Монтаж» */
.editor.adv .ed-rail, .editor.adv .ed-foot, .editor.adv #edSnd { display: none !important; }
.editor.adv .ed-done { display: grid; } .editor.adv .ed-sp { display: none; }
.editor.adv .ed-stage { flex: 0 1 auto; height: 50dvh; }
.editor.adv .ed-bottom { display: block; flex: 1; border-radius: 0; margin: 0; background: #000; overflow-y: auto; }
.editor.adv .ed-ctrl { grid-template-columns: 1fr auto 1fr; padding: 4px 0 6px; } .editor.adv .ed-ctrl b { color: #fff; font-weight: 600; }
.ed-hist { display: flex; justify-content: flex-end; } .ed-hist button { padding: 4px 8px !important; } .ed-hist button svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; width: 20px !important; height: 20px !important; } .ed-hist button:disabled { opacity: .3; }
.editor.adv .ed-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 8px 10px calc(8px + var(--safe-b)); flex-shrink: 0; background: #000; scrollbar-width: none; }
.ed-tabs button { flex: none; min-width: 78px; height: 70px; border-radius: 14px; border: 0; background: #1c1c1f; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 12.5px; font-weight: 600; }
.ed-tabs button svg { width: 24px; height: 24px; } .ed-tabs button.on { background: #2b2b30; color: var(--pink); } .ed-tabs button:disabled { opacity: .35; }
.editor.adv.full .ed-stage { height: 100dvh; } .editor.adv.full .ed-bottom, .editor.adv.full .ed-tabs { display: none !important; }
.editor.adv.full .ed-stage::after { content: ''; }
.editor.adv.tool-open .ed-tabs { display: none; }
.editor .ed-rail [data-adv] svg, .editor .ed-rail .ed-more svg { fill: none; stroke: #fff; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; color: #fff; }
.editor.adv .ed-tabs { order: 10; }
.tl-addmus { width: 100%; height: 34px; border-radius: 8px; border: 0; background: #1f1f23; color: #fff; font-weight: 700; font-size: 13px; text-align: left; padding: 0 12px; margin-top: 6px; }
.editor.adv .tl-tracks { max-height: none; overflow: visible; }
.editor.adv .tl-addmus { margin-top: 2px; }

/* разрезание видео */
.tl-cuts { position: absolute; inset: 0; pointer-events: none; }
.tl-cut { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, rgba(0,0,0,.82) 0 5px, rgba(60,60,60,.82) 5px 10px); }
.tl-split { position: absolute; top: -3px; bottom: -3px; width: 3px; margin-left: -1.5px; background: var(--pink); border-radius: 2px; }
.cut-btns { display: flex; gap: 8px; }
.cut-btns button { flex: 1; height: 62px; border-radius: 14px; border: 0; background: #1c1c1f; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; font-size: 12.5px; font-weight: 700; }
.cut-btns button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cut-btns button:first-child { background: var(--grad); }
.cut-btns button.rest { color: var(--pink); }
.cut-btns button:disabled { opacity: .35; }

/* инструменты справа работают и в обычном режиме: панель выезжает снизу */
.editor.tool-open:not(.adv) .ed-bottom { display: block; flex: 1; border-radius: 16px 16px 0 0; margin: 0; background: #0e0e12; overflow-y: auto; }
.editor.tool-open:not(.adv) .ed-stage { flex: 0 1 auto; height: 46dvh; }
.editor.tool-open:not(.adv) .ed-foot, .editor.tool-open:not(.adv) .ed-rail { display: none !important; }
.ed-tabs [data-act=split] { background: var(--grad); }
.ed-tabs [data-act] svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* лента из клипов (как в TikTok): плитки, переходы между ними, «+» справа */
.tl-row { display: flex; align-items: center; gap: 8px; }
.tl-row .tl-strip { flex: 1; min-width: 0; height: 56px; cursor: pointer; }
.tl-tiles { position: absolute; inset: 0; }
.tl-tile { position: absolute; top: 0; bottom: 0; border-radius: 8px; overflow: hidden; background: #222; box-sizing: border-box; border: 2px solid transparent; transition: border-color .15s; }
.tl-tile.cur { border-color: #fff; }
.tl-fr { position: absolute; inset: 0; display: flex; }
.tl-fr img { height: 100%; object-fit: cover; flex-shrink: 0; pointer-events: none; }
.tl-fr.fallback { background: linear-gradient(90deg, var(--purple), var(--pink), var(--orange)); }
.tl-tr { position: absolute; top: 15px; width: 26px; height: 26px; border-radius: 8px; border: 0; background: #fff; color: #111; display: grid; place-items: center; z-index: 3; padding: 0; box-shadow: 0 1px 6px rgba(0,0,0,.6); }
.tl-tr svg { width: 15px; height: 15px; fill: currentColor; }
.tl-tr.on { background: var(--grad); color: #fff; }
.tl-plus { flex: none; width: 46px; height: 46px; border-radius: 12px; border: 0; background: #fff; color: #111; display: grid; place-items: center; }
.tl-plus svg { width: 24px; height: 24px; }
.tl-plus:disabled { opacity: .4; }
.ed-flash { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: #000; z-index: 2; }
.ed-flash.white { background: #fff; }
.ed-flash.go { animation: edFlash .45s ease; }
@keyframes edFlash { 0% { opacity: 0 } 35% { opacity: 1 } 100% { opacity: 0 } }
.tl-head { z-index: 4; }

/* ---- таймлайн как в TikTok (6.11): полоска по центру ---- */
.tl-view { position: relative; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; padding-top: 2px; }
.tl-scroll { position: relative; width: 0; will-change: transform; }
.tl-ruler { position: relative; height: 18px; }
.tl-ruler span { position: absolute; top: 0; font-size: 10px; color: #8a8a93; transform: translateX(-50%); white-space: nowrap; }
.tl-view .tl-tiles { position: relative; inset: auto; height: 56px; }
.tl-view .tl-tile { overflow: visible; border: 2px solid transparent; background: transparent; }
.tl-view .tl-fr { overflow: hidden; border-radius: 7px; background: #222; }
.tl-view .tl-tile.cur:not(.sel) { border-color: transparent; }
.tl-view .tl-tile.sel { border-color: #fff; border-radius: 8px; z-index: 2; }
.tl-h { position: absolute; top: -2px; bottom: -2px; width: 14px; background: #fff; z-index: 4; touch-action: none; cursor: ew-resize; }
.tl-h.l { left: -14px; border-radius: 8px 0 0 8px; } .tl-h.r { right: -14px; border-radius: 0 8px 8px 0; }
.tl-h::after { content: ""; position: absolute; left: 5px; top: 33%; bottom: 33%; width: 3px; border-radius: 2px; background: #333; }
.tl-badge { position: absolute; left: 4px; top: 3px; z-index: 3; background: rgba(0,0,0,.6); color: #fff; font-size: 10.5px; font-weight: 700; padding: 1px 5px; border-radius: 5px; pointer-events: none; }
.tl-view .tl-plus { position: absolute; top: 8px; width: 40px; height: 40px; border-radius: 10px; border: 0; background: #fff; color: #111; display: grid; place-items: center; padding: 0; z-index: 3; }
.tl-view .tl-plus svg { width: 20px; height: 20px; stroke: currentColor; }
.tl-view .tl-head { position: absolute; left: 50%; top: 0; bottom: 0; margin-left: -1.5px; width: 3px; background: #fff; border-radius: 2px; z-index: 6; box-shadow: 0 0 6px rgba(0,0,0,.8); pointer-events: none; }
.tl-view .tl-tracks { position: relative; max-height: none; overflow: visible; margin-top: 8px; }
.tl-clip.voice { background: color-mix(in srgb, var(--orange) 70%, #000); cursor: default; }
.ed-tabs .lock { opacity: .55; position: relative; }
.ed-tabs .key { position: absolute; top: 4px; right: 6px; font-size: 11px; font-style: normal; }
.ed-tabs.clipbar .ico { min-width: 44px; background: transparent; }
.ed-tabs.clipbar .ico svg { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.ed-tabs [data-act] svg, .ed-tabs [data-tab] svg, .ed-tabs .lock svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ed-tabs [data-act=del] { background: #1c1c1f; }
.ed-guide { position: absolute; pointer-events: none; opacity: 0; transition: opacity .12s; background: rgba(255,255,255,.55); z-index: 4; }
.ed-guide.v { left: 50%; top: 0; bottom: 0; width: 1px; margin-left: -.5px; }
.ed-guide.h { top: 50%; left: 0; right: 0; height: 1px; margin-top: -.5px; }
.ed-guide.show { opacity: 1; } .ed-guide.snap { background: var(--pink); box-shadow: 0 0 6px var(--pink); }
.tl-tr.hid { display: none; } /* рядом с выбранным кадром ручки обрезки важнее кнопки перехода */
.snd-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 74px; padding: 8px 4px; border: 0; border-radius: 14px; background: #1c1c1f; color: #fff; font-size: 12px; font-weight: 700; text-align: center; cursor: pointer; }
.snd-tile b { font-size: 24px; line-height: 1; font-weight: 400; }
.snd-tile.rec { background: #5a1a22; color: #ff8a98; }
/* лого на экране входа: тень по форме иконки, без белых углов */
.auth .logo img { box-shadow: none !important; filter: drop-shadow(0 10px 22px color-mix(in srgb, var(--pink) 45%, transparent)); }

/* ---- 6.12.2: компактный монтаж ---- */
.editor.adv .ed-bottom { display: flex; flex-direction: column; overflow: hidden; }
.editor.adv #tlBox { flex: none; padding-bottom: 2px; }
.editor.adv .ed-sheet { flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; padding-bottom: calc(6px + var(--safe-b)); }
.editor.adv.tool-open .ed-stage { height: 30dvh; }
.editor.adv .tl-tracks { margin-top: 6px; gap: 4px; }
.editor.adv .tl-track { height: 24px; }
.editor.adv .tl-addmus { height: 24px; margin-top: 0; padding: 0 10px; font-size: 12px; font-weight: 600; color: #bbb; display: flex; align-items: center; gap: 6px; }
.tl-addmus svg, .tl-clip svg { width: 13px; height: 13px; flex: none; vertical-align: -2px; }
.tl-clip { gap: 0; } .tl-clip span { display: flex; align-items: center; gap: 5px; }
.tl-clip.voice:not(.sel) i, .tl-clip.voice:not(.sel) .cl, .tl-clip.voice:not(.sel) .cr { display: none; }
.tl-clip.voice, .tl-clip.music { cursor: grab; }
.tl-clip.music { cursor: pointer; }
.tl-clip.voice.sel, .tl-clip.music.sel { outline: 2px solid #fff; outline-offset: 0; }
.ed-tabs button { min-width: 70px; height: 58px; gap: 4px; font-size: 11.5px; }
.ed-tabs button svg { width: 22px; height: 22px; }
.ed-tabs .key { top: 3px; right: 5px; } .ed-tabs .key svg { width: 11px; height: 11px; }
/* панель «Звук» */
.snd-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 2px 0 8px; }
.snd-tile { min-height: 56px; padding: 6px 2px; gap: 5px; border-radius: 12px; font-size: 10.5px; line-height: 1.15; font-weight: 600; }
.snd-tile b { display: grid; place-items: center; font-size: 0; }
.snd-tile b svg { width: 21px; height: 21px; }
.snd-tile.rec { background: #3a1a20; color: #ff8a98; }
.ed-sheet .dual { margin: 4px 0; }
.ed-sheet .muted.sm { font-size: 11.5px; margin: 4px 0; }
.ed-sheet .sheet-head { margin-bottom: 4px; }

/* 6.13: порядок бокового меню на ПК */
@media (min-width: 900px) {
  .nav a[data-tab=me] { order: 1; } .nav a[data-tab=feed] { order: 2; } .nav a[data-tab=reels] { order: 3; }
  .nav a[data-tab=kents] { order: 4; } .nav a[data-tab=im] { order: 5; } .nav a[data-tab=groups] { order: 6; }
  .nav a[data-tab=cartels] { order: 7; } .nav a[data-tab=games] { order: 8; } .nav a[data-tab=music] { order: 9; }
  .nav a[data-tab=market] { order: 10; } .nav a[data-tab=notif] { order: 11; } .nav a[data-tab=help] { order: 12; }
}
/* страница «Помощь» */
.help-hero { padding: 16px; border-radius: 18px; background: var(--grad-top); color: #fff; margin-bottom: 12px; }
.help-hero h2 { margin: 0 0 4px; font-size: 20px; } .help-hero p { margin: 0; opacity: .92; font-size: 14px; }
.help-grid { display: grid; gap: 8px; margin-bottom: 14px; }
.help-grid a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); color: var(--text); }
.help-grid a svg { width: 22px; height: 22px; color: var(--pink); flex: none; }
.help-grid a b { display: block; font-size: 15px; } .help-grid a span { display: block; font-size: 12.5px; color: var(--muted); }
.help-faq details { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; }
.help-faq summary { font-weight: 600; cursor: pointer; } .help-faq details p { margin: 8px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; }

/* меню «+»: четыре карточки */
.cs-cards { grid-template-columns: 1fr 1fr; }
.cs-card { padding: 14px 10px; }
.cs-card small { font-size: 11.5px; opacity: .9; line-height: 1.25; }
.cs-card .cs-ico svg { width: 30px; height: 30px; }
.cs-card.photo { background: linear-gradient(140deg, var(--teal), color-mix(in srgb, var(--teal) 55%, var(--purple))); }
.cs-card.story { background: linear-gradient(140deg, var(--orange), var(--sun)); }

/* меню «+»: компактное */
.create-sheet .cs-box { gap: 0; padding: 8px 14px calc(10px + var(--safe-b)); }
.cs2-title { text-align: center; font-weight: 700; font-size: 15px; margin: 2px 0 12px; }
.cs2-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.create-sheet .as-box button.cs2 { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 12px 2px 10px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); color: var(--text); cursor: pointer; text-align: center; }
.cs2 span { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; background: color-mix(in srgb, var(--pink) 14%, transparent); color: var(--pink); }
.cs2 span svg { width: 22px; height: 22px; }
.cs2 b { font-size: 12.5px; font-weight: 600; }
.cs2:active { transform: scale(.96); }
.cs2-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.create-sheet .as-box button.cs2-pill { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 6px; border: 1px solid var(--line); border-radius: 14px; background: transparent; color: var(--text); font-size: 13.5px; font-weight: 600; cursor: pointer; }
.cs2-pill svg { width: 18px; height: 18px; color: var(--muted); }
.create-sheet .as-box button.cs2-cancel { margin-top: 6px; padding: 10px; border: 0; background: transparent; color: var(--muted); font-size: 14px; cursor: pointer; }
.create-sheet .as-box button.cs2-cancel { width: 100%; text-align: center; }

/* 6.15 marketplace: где искать */
.mloc-bar { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin-bottom: 10px; color: var(--text); cursor: pointer; }
.mloc-bar svg { width: 20px; height: 20px; flex: none; }
.mloc-bar .grow { display: flex; flex-direction: column; min-width: 0; }
.mloc-bar b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mloc-bar small { color: var(--muted); font-size: 12px; }
.mloc-bar i { font-style: normal; color: var(--pink); font-weight: 700; font-size: 13px; }
.pl-box { gap: 8px; max-height: 88vh; overflow-y: auto; }
.pl-search { display: flex; align-items: center; gap: 8px; background: var(--surface); border-radius: 12px; padding: 0 12px; }
.pl-search svg { width: 18px; height: 18px; flex: none; }
.pl-search input { border: 0; background: transparent; flex: 1; padding: 11px 0; color: var(--text); font-size: 16px; outline: none; }
.pl-res { display: flex; flex-direction: column; }
.pl-res button, .pl-my { display: flex; align-items: center; gap: 10px; text-align: left; border: 0; background: transparent; color: var(--text); padding: 10px 6px; border-radius: 10px; cursor: pointer; font-size: 15px; }
.pl-res button:active, .pl-my:active { background: var(--surface); }
.pl-res svg, .pl-my svg { width: 18px; height: 18px; flex: none; }
.pl-my { font-weight: 600; }
.pl-cur { padding: 4px 6px; }
.pl-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pl-chips button { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 14px; padding: 6px 12px; font-weight: 600; cursor: pointer; }
.pl-chips button.on { background: var(--pink); border-color: var(--pink); color: #fff; }

/* ===== 6.16 КОМПАКТНЫЙ ВИД: меньше, тоньше, аккуратнее ===== */
:root { --radius: 14px; }
body { font-size: 14.5px; }
main { padding-top: 8px; }
.card { padding: 10px 12px; margin-bottom: 8px; }
.btn { padding: 8px 14px; border-radius: 11px; font-size: 14px; }
.btn.small { padding: 5px 11px; font-size: 13px; }
.seg { padding: 2px; border-radius: 11px; }
.seg button { padding: 6px 6px; font-size: 13px; }
/* посты */
.post-head { gap: 8px; margin-bottom: 4px; }
.post-head .avatar { width: 36px; height: 36px; font-size: 14px; }
.post-text { margin: 4px 0; line-height: 1.4; }
.act { padding: 4px 10px; gap: 5px; font-size: 13px; border-radius: 14px; }
.act svg { width: 17px; height: 17px; }
.sale-box { padding: 5px 10px; margin: 2px 0 6px; border-radius: 10px; gap: 6px; justify-content: flex-start; flex-wrap: wrap; }
.sale-box .price { font-size: 16px; font-weight: 800; margin-right: auto; }
.sale-box .chip { font-size: 11px; padding: 2px 8px; }
.chip { font-size: 11.5px; padding: 3px 8px; }
/* лента, истории, баннер */
.stories-bar { padding: 2px 2px 6px; gap: 10px; }
.st-item { width: 58px; gap: 3px; }
.st-item .avatar { width: 50px; height: 50px; }
.st-item small { font-size: 11px; max-width: 58px; }
.ch-banner { padding: 7px 12px; margin-bottom: 8px; border-radius: 13px; font-size: 12.5px; }
.ch-banner span svg { width: 20px; height: 20px; }
.composer2 .c2-row { gap: 8px; }
.composer2 textarea { padding: 4px 0; }
/* меню разделов, фильтры */
.ex-tabs a { padding: 5px 12px; font-size: 13px; }
.ex-tabs { margin-bottom: 6px; }
.ex-scope { margin-bottom: 8px; }
.ex-scope a { padding: 6px 4px; font-size: 13px; border-radius: 9px; }
.ex-scope a.on { background: var(--card); color: var(--text); font-weight: 700; }
.chips-row { margin-bottom: 8px; }
.chips-row .chip { padding: 5px 11px; font-size: 12.5px; }
.rank-row { padding: 5px 2px; }
.rank-row .avatar { width: 30px; height: 30px; }
/* настройки и списки */
.set-row { padding: 7px 2px; min-height: 44px; gap: 10px; }
.set-row .ico { width: 30px; height: 30px; border-radius: 9px; font-size: 15px; }
.set-row .ttl { font-size: 14.5px; }
.set-row .sub { font-size: 12px; }
/* группировки */
.gc-cover { height: 52px; }
.gc-body { padding: 0 10px 8px; margin-top: -16px; }
.gc-body .avatar { width: 38px; height: 38px; }
.gc-body .name { margin-top: 16px; font-size: 14.5px; }
/* профиль */
.avatar { width: 40px; height: 40px; }
.avatar.lg { width: 76px; height: 76px; font-size: 28px; }
.profile-head .avatar.lg { width: 64px; height: 64px; font-size: 24px; }
.profile-head h1 { font-size: 17px; }
@media (min-width: 900px) {
  .pf-card .pav .avatar.lg { width: 128px; height: 128px; font-size: 46px; }
  .pf-card { column-gap: 22px; }
  .pf-card h1 { font-size: 22px; }
  .nav a { padding: 8px 12px; font-size: 14.5px; }
}
/* меню «Где искать» и прочие нижние окна */
.as-box { padding-top: 8px; }
.pl-res button, .pl-my { padding: 8px 6px; font-size: 14px; }
.pl-chips button { padding: 4px 10px; font-size: 13px; }
.st-ring .avatar { width: 50px; height: 50px; font-size: 19px; }
.st-ring i { width: 19px; height: 19px; font-size: 14px; }
@media (min-width: 900px) { main:has(.pf-wide) .pf-cover { height: auto !important; max-height: 210px; margin-bottom: -50px; } }
.sale-box .btn.small { padding: 3px 10px; font-size: 12px; box-shadow: none; white-space: nowrap; border-radius: 10px; }
.sale-box .btn.small svg { width: 14px; height: 14px; }

/* ===== 6.17 плавные переходы, экран загрузки ===== */
#boot { position: fixed; inset: 0; z-index: 9999; background: #0e0e12; display: flex; align-items: center; justify-content: center; transition: opacity .28s ease; }
#boot img { width: 96px; height: 96px; border-radius: 22px; animation: bootPulse 1.4s ease-in-out infinite; }
#boot.out { opacity: 0; pointer-events: none; }
@keyframes bootPulse { 0%, 100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.06); opacity: 1; } }
@keyframes vIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
#view.fresh > * { animation: vIn .2s ease-out both; }
.skel { height: 84px; border-radius: var(--radius); margin-bottom: 8px; background: linear-gradient(90deg, var(--card) 25%, var(--surface) 50%, var(--card) 75%); background-size: 200% 100%; animation: skel 1.1s linear infinite; opacity: .8; }
@keyframes skel { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { #view.fresh > *, #boot img, .skel { animation: none; } }

.pbg-cur { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: var(--surface); border: 0; border-radius: 12px; padding: 6px 12px 6px 6px; color: var(--text); cursor: pointer; margin-top: 4px; }
.pbg-cur .pbg-sw { width: 34px; height: 34px; aspect-ratio: auto; flex: none; }
.pbg-cur b { color: var(--muted); font-size: 18px; transition: transform .15s; }
.pbg-cur.open b { transform: rotate(90deg); }
.pbg-cur .pbg-sw.pbg-custom { background: linear-gradient(135deg, var(--purple), var(--pink)); }
.pbg-body { margin-top: 8px; }
.pbg-body[hidden] { display: none; }

/* ===== 7.0: знакомство, рекомендации, поиск ===== */
a.htag { font-weight: 700; color: var(--pink); }
.disc-h { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 8px 2px 2px; }
.disc-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.disc-row .grow { min-width: 0; color: var(--text); display: flex; flex-direction: column; }
.disc-row b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.disc-row small { color: var(--muted); font-size: 12px; }
.disc-row .btn.small { flex: none; }
.btn.secondary.small { background: var(--surface); color: var(--muted); }
.sr-top { padding: 6px 10px; }
.sr-inp { margin: 0; }
.onb { position: fixed; inset: 0; z-index: 400; background: color-mix(in srgb, var(--bg) 92%, #000); display: flex; align-items: center; justify-content: center; padding: 16px; animation: fadeIn .2s ease; }
.onb.closing { opacity: 0; transition: opacity .2s; }
.onb-box { position: relative; width: 100%; max-width: 420px; background: var(--card); border-radius: 22px; padding: 28px 20px 18px; text-align: center; box-shadow: var(--shadow); max-height: 92vh; overflow-y: auto; }
.onb-skip { position: absolute; top: 12px; right: 14px; border: 0; background: none; color: var(--muted); font-size: 13px; cursor: pointer; }
.onb-ic { width: 72px; height: 72px; margin: 6px auto 14px; border-radius: 22px; background: var(--grad); color: #fff; display: flex; align-items: center; justify-content: center; }
.onb-ic svg { width: 34px; height: 34px; }
.onb-box h2 { margin: 0 0 6px; font-size: 20px; }
.onb-box p { margin: 0 0 14px; color: var(--muted); line-height: 1.45; }
.onb-dots { display: flex; justify-content: center; gap: 6px; margin: 10px 0 14px; }
.onb-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.onb-dots i.on { background: var(--pink); width: 18px; border-radius: 4px; }
.onb-list { text-align: left; max-height: 44vh; overflow-y: auto; margin-bottom: 4px; }
@media (min-width: 900px) { .nav a.plus { order: -3 !important; } .nav a.nav-search { order: -2; } }
.sr-types { margin: 8px 0 0; padding-bottom: 2px; }
.sr-types .chip { border: 0; cursor: pointer; }
.sr-types .chip.on { background: var(--grad); color: #fff; }
.sr-fbtn { display: inline-flex; gap: 4px; }
.sr-fbtn svg { width: 14px; height: 14px; }
.sr-filters { margin-top: 8px; display: grid; gap: 8px; }
.sr-f { display: grid; gap: 3px; font-size: 12px; color: var(--muted); }
.sr-f .seg button { font-size: 12.5px; padding: 5px 4px; }
.sr-chk { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text); }
.sr-chk input { width: 18px; height: 18px; accent-color: var(--pink); }
.st-tip { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid color-mix(in srgb, var(--line) 50%, transparent); }
.st-tip:first-of-type { border-top: 0; }
.st-tip-ic { width: 30px; height: 30px; border-radius: 9px; background: var(--surface); display: flex; align-items: center; justify-content: center; flex: none; }
.st-tip-ic svg { width: 18px; height: 18px; }
.st-tip b { font-size: 14px; }
.st-tip .muted { font-size: 13px; margin: 1px 0 4px; line-height: 1.35; }

.sv-like { position: absolute; bottom: calc(env(safe-area-inset-bottom) + 18px); right: 16px; z-index: 5; background: rgba(0,0,0,.45); color: #fff; border: 0; border-radius: 50%; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; }
.sv-like svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; }
.sv-like.on svg { fill: #fff; }
.sv-views svg { width: 16px; height: 16px; }
