/* АнаДми — стили */
:root {
  --bg: #ECEEF1;
  --surface: #FFFFFF;
  --surface-2: #F4F5F8;
  --ink: #1B2130;
  --muted: #6F7887;
  --line: #E1E4EA;
  --accent: #2B59C3;
  --accent-hover: #234AA6;
  --accent-soft: #E6ECFA;
  --accent-ink: #FFFFFF;
  --circle: #E3336C;
  --circle-soft: #FCE7EE;
  --ok: #1D9A68;
  --danger: #D13A3A;
  --bubble-in: #F0F2F6;
  --bubble-out: #DCE6FB;
  --r-card: 14px;
  --r-ctl: 10px;
  --top: 56px;
  --side: 196px;
  --font: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161D;
    --surface: #1B2029;
    --surface-2: #222833;
    --ink: #E7EAF0;
    --muted: #8A93A3;
    --line: #2B323E;
    --accent: #5F89F0;
    --accent-hover: #779BF4;
    --accent-soft: #233050;
    --accent-ink: #0E1320;
    --circle: #F2527F;
    --circle-soft: #3B2230;
    --bubble-in: #262D39;
    --bubble-out: #26365A;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.47 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
h1, h2, h3 { margin: 0; line-height: 1.25; }

/* ── icons ── */
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic.fill { fill: currentColor; stroke: none; }

/* ── controls ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 16px; border: 0; border-radius: var(--r-ctl);
  background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 14px;
  white-space: nowrap; transition: background .15s;
}
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.secondary { background: var(--accent-soft); color: var(--accent); }
.btn.secondary:hover { background: color-mix(in srgb, var(--accent-soft) 80%, var(--accent)); }
.btn.plain { background: var(--surface-2); color: var(--ink); }
.btn.plain:hover { background: var(--line); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.small { height: 30px; padding: 0 12px; font-size: 13px; }
.btn.wide { width: 100%; height: 42px; font-size: 15px; }

.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none;
  border: 0; border-radius: 50%; background: transparent; color: var(--muted);
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 13px; color: var(--muted); }
.input, textarea.input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--r-ctl);
  background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.input { resize: vertical; min-height: 84px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; margin-bottom: 14px; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }

.card { background: var(--surface); border-radius: var(--r-card); border: 1px solid var(--line); }
.card-pad { padding: 18px 20px; }
.card-title { font-size: 16px; font-weight: 650; margin-bottom: 14px; }

.badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 10px; background: var(--circle); color: #fff; font-size: 12px; font-weight: 650; line-height: 1;
}
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.tag.admin { background: var(--accent-soft); color: var(--accent); }
.tag.blocked { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }

/* ── avatar ── */
.av {
  position: relative; display: inline-block; flex: none;
  width: var(--s); height: var(--s); border-radius: 50%;
}
.av img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.av-ph { background: var(--c); color: #fff; display: inline-grid; place-items: center; }
.av-ph b { font-weight: 650; font-size: calc(var(--s) * .38); letter-spacing: .02em; }
.av .dot {
  position: absolute; right: calc(var(--s) * .02); bottom: calc(var(--s) * .02);
  width: max(9px, calc(var(--s) * .22)); height: max(9px, calc(var(--s) * .22));
  border-radius: 50%; background: var(--ok); border: 2px solid var(--surface);
}

/* ── top bar ── */
.top {
  position: sticky; top: 0; z-index: 30; height: var(--top);
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.top-in { max-width: 1080px; height: 100%; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 24px; }
.logo { display: flex; align-items: center; gap: 9px; color: var(--ink); width: var(--side); flex: none; }
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--circle) 0 74%, color-mix(in srgb, var(--circle) 22%, transparent) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent 58%, #000 61%, #000 100%) , radial-gradient(farthest-side, #000 30%, transparent 33%);
  mask: radial-gradient(farthest-side, transparent 58%, #000 61%, #000 100%), radial-gradient(farthest-side, #000 30%, transparent 33%);
}
.logo-word { font-weight: 750; font-size: 19px; letter-spacing: -.02em; }
.search {
  flex: 1; min-width: 0; max-width: 300px; height: 36px; display: flex; align-items: center; gap: 8px;
  padding: 0 12px; border-radius: var(--r-ctl); background: var(--surface-2); color: var(--muted);
}
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); }
.search .ic { width: 18px; height: 18px; }
.me-wrap { margin-left: auto; position: relative; }
.me-btn { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border: 0; border-radius: 22px; background: transparent; }
.me-btn:hover { background: var(--surface-2); }
.me-btn .me-name { font-weight: 600; font-size: 14px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 200px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 25, 45, .14);
}
.menu a, .menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px;
  background: none; color: var(--ink); font-size: 14px; text-align: left;
}
.menu a:hover, .menu button:hover { background: var(--surface-2); text-decoration: none; }
.menu .ic { color: var(--muted); }

/* ── layout ── */
.wrap { max-width: 1080px; margin: 0 auto; padding: 16px; display: flex; gap: 20px; align-items: flex-start; }
.side { width: var(--side); flex: none; position: sticky; top: calc(var(--top) + 16px); display: grid; gap: 2px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 10px; border-radius: var(--r-ctl);
  color: var(--ink); font-size: 14px; font-weight: 500;
}
.nav-link .ic { color: var(--accent); }
.nav-link:hover { background: color-mix(in srgb, var(--surface) 70%, transparent); text-decoration: none; }
.nav-link.on { background: var(--surface); font-weight: 650; }
.nav-link .badge { margin-left: auto; }
.side hr { border: 0; border-top: 1px solid var(--line); margin: 8px 10px; }
main { flex: 1; min-width: 0; }
.tabbar { display: none; }

.cols { display: flex; gap: 16px; align-items: flex-start; }
.col-main { flex: 1; min-width: 0; display: grid; gap: 12px; }
.col-side { width: 260px; flex: none; display: grid; gap: 12px; position: sticky; top: calc(var(--top) + 16px); }

.filter { padding: 6px; display: grid; gap: 2px; }
.filter button {
  border: 0; background: none; text-align: left; padding: 9px 12px; border-radius: 8px; font-size: 14px; color: var(--ink);
}
.filter button:hover { background: var(--surface-2); }
.filter button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.empty { padding: 44px 24px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.more { justify-self: center; }
.loading { padding: 32px; text-align: center; color: var(--muted); }

/* ── composer ── */
.composer { padding: 14px 16px; }
.composer-row { display: flex; gap: 12px; align-items: flex-start; }
.composer textarea {
  flex: 1; min-height: 38px; max-height: 320px; padding: 8px 0; border: 0; outline: 0; resize: none;
  background: transparent; line-height: 1.45;
}
.composer-bar { display: flex; align-items: center; gap: 4px; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.composer-bar .btn { margin-left: auto; }
.attach-preview { position: relative; display: inline-block; margin: 10px 0 0 48px; }
.attach-preview img { max-height: 180px; border-radius: 10px; }
.attach-preview .icon-btn { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; background: rgba(0,0,0,.55); color: #fff; }

/* ── posts ── */
.posts { display: grid; gap: 12px; }
.post { padding: 16px 18px 6px; }
.post-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.post-who { flex: 1; min-width: 0; }
.post-who .name { font-weight: 650; color: var(--ink); }
.post-who .via { color: var(--muted); margin: 0 4px; }
.post-text { white-space: normal; overflow-wrap: anywhere; margin-bottom: 10px; }
.post-img { width: calc(100% + 36px); max-width: none; margin: 0 -18px 10px; max-height: 560px; object-fit: contain; background: var(--surface-2); cursor: zoom-in; }
.post-foot { display: flex; gap: 6px; padding-top: 4px; border-top: 1px solid var(--line); margin-top: 4px; padding: 6px 0; }
.react {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 0;
  border-radius: 16px; background: var(--surface-2); color: var(--muted); font-size: 14px; font-weight: 600;
}
.react:hover { color: var(--ink); }
.react .ic { width: 19px; height: 19px; }
.react.on { color: var(--circle); background: var(--circle-soft); }
.react.on .ic { fill: currentColor; }
.react.pop .ic { animation: pop .35s ease; }
@keyframes pop { 40% { transform: scale(1.35); } }

.comments { border-top: 1px solid var(--line); padding: 10px 0 8px; }
.cmt { display: flex; gap: 10px; padding: 7px 0; }
.cmt-body { flex: 1; min-width: 0; font-size: 14px; }
.cmt-body .name { font-weight: 650; color: var(--ink); font-size: 14px; }
.cmt-text { overflow-wrap: anywhere; }
.cmt .icon-btn { width: 28px; height: 28px; opacity: 0; }
.cmt:hover .icon-btn, .cmt .icon-btn:focus-visible { opacity: 1; }
.cmt .icon-btn .ic { width: 16px; height: 16px; }
.cmt-form { display: flex; gap: 10px; align-items: center; padding-top: 6px; }
.cmt-form input { flex: 1; height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-2); outline: 0; }
.cmt-form input:focus { border-color: var(--accent); background: var(--surface); }

/* ── profile ── */
.profile { display: grid; gap: 12px; }
.cover { overflow: hidden; }
.cover-band { height: 120px; background:
  radial-gradient(circle at 82% 30%, color-mix(in srgb, var(--circle) 55%, transparent) 0 46px, transparent 47px),
  radial-gradient(circle at 92% 85%, color-mix(in srgb, #fff 30%, transparent) 0 22px, transparent 23px),
  linear-gradient(120deg, var(--uc, var(--accent)), color-mix(in srgb, var(--uc, var(--accent)) 55%, #0b1430)); }
.cover-body { display: flex; gap: 20px; align-items: flex-end; padding: 0 22px 18px; flex-wrap: wrap; }
.big-av { position: relative; margin-top: -56px; }
.big-av .av { border: 4px solid var(--surface); box-sizing: content-box; }
.big-av .av .dot { border-width: 3px; }
.av-edit {
  position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); white-space: nowrap;
  border: 0; border-radius: 14px; padding: 4px 10px; font-size: 12px; font-weight: 600;
  background: rgba(15, 20, 30, .7); color: #fff; opacity: 0; transition: opacity .15s;
}
.big-av:hover .av-edit, .av-edit:focus-visible { opacity: 1; }
.cover-info { flex: 1; min-width: 200px; padding-top: 12px; }
.cover-info h1 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.status-line { margin-top: 2px; overflow-wrap: anywhere; }
.status-line button { border: 0; background: none; padding: 0; color: var(--muted); font-size: 14px; }
.status-line button:hover { color: var(--accent); }
.status-line input { width: 100%; max-width: 420px; }
.cover-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.info-list { display: grid; gap: 10px; font-size: 14px; margin: 0; }
.info-list dt { color: var(--muted); font-size: 13px; }
.info-list dd { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
.mini-friends { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 6px; }
.mini-friends a { display: grid; justify-items: center; gap: 4px; color: var(--ink); font-size: 12px; text-align: center; }
.mini-friends a span { max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-friends a:hover { text-decoration: none; color: var(--accent); }
.side-title { display: flex; justify-content: space-between; align-items: baseline; font-weight: 650; margin-bottom: 12px; color: var(--ink); }
.side-title:hover { text-decoration: none; }
.wall-head { display: flex; align-items: baseline; gap: 8px; padding: 4px 4px 0; font-weight: 650; }

/* ── people ── */
.tabs { display: flex; gap: 4px; padding: 6px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { padding: 8px 14px; border-radius: 8px; color: var(--ink); font-size: 14px; font-weight: 500; white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.tabs a:hover { background: var(--surface-2); text-decoration: none; }
.tabs a.on { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.people-search { padding: 12px 16px 4px; }
.person { display: flex; gap: 14px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.person:last-child { border-bottom: 0; }
.person-info { flex: 1; min-width: 0; }
.person-info .name { font-weight: 650; color: var(--ink); }
.person-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

/* ── messages ── */
.im { display: flex; gap: 12px; height: calc(100vh - var(--top) - 32px); height: calc(100dvh - var(--top) - 32px); min-height: 420px; }
.im-list { width: 320px; flex: none; display: flex; flex-direction: column; overflow: hidden; }
.im-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--line); min-height: 57px; }
.im-head b { font-size: 16px; }
.dialogs { flex: 1; overflow-y: auto; padding: 6px; }
.dlg { display: flex; gap: 12px; align-items: center; padding: 9px 10px; border-radius: 10px; color: var(--ink); }
.dlg:hover { background: var(--surface-2); text-decoration: none; }
.dlg.on { background: var(--accent-soft); }
.dlg-body { flex: 1; min-width: 0; }
.dlg-top { display: flex; justify-content: space-between; gap: 8px; }
.dlg-top b { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dlg-last { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 14px; }
.dlg-last .txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dlg.unread .dlg-last .txt { color: var(--ink); }
.pv-circle { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2.5px solid var(--circle); vertical-align: -1px; margin-right: 5px; }

.im-chat { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); min-height: 57px; }
.chat-head .back { display: none; }
.chat-peer { display: flex; align-items: center; gap: 10px; color: var(--ink); min-width: 0; }
.chat-peer:hover { text-decoration: none; }
.chat-peer b { display: block; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 12px 16px 8px; overscroll-behavior: contain; }
.chat-placeholder { flex: 1; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 24px; }
.chat-placeholder .big-ring { width: 96px; height: 96px; margin: 0 auto 16px; border-radius: 50%; border: 6px solid var(--circle-soft); border-top-color: var(--circle); }
.older { display: block; margin: 0 auto 10px; }
.day { text-align: center; margin: 14px 0 10px; }
.day span { display: inline-block; padding: 3px 12px; border-radius: 12px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 600; }

.msg { display: flex; align-items: flex-end; gap: 6px; margin-top: 3px; }
.msg.gap { margin-top: 12px; }
.msg.out { flex-direction: row-reverse; }
.bubble {
  max-width: min(520px, 78%); padding: 7px 12px 6px; border-radius: 18px; background: var(--bubble-in);
  overflow-wrap: anywhere; position: relative;
}
.msg.out .bubble { background: var(--bubble-out); }
.msg.in .bubble { border-bottom-left-radius: 6px; }
.msg.out .bubble { border-bottom-right-radius: 6px; }
.meta { float: right; display: inline-flex; align-items: center; gap: 3px; margin: 6px 0 -3px 10px; font-size: 11px; color: var(--muted); line-height: 1; user-select: none; }
.meta .ic { width: 15px; height: 15px; stroke-width: 2; }
.meta .ic.read { color: var(--accent); }
.bubble.photo { padding: 3px; }
.bubble.photo img { border-radius: 15px; max-height: 340px; max-width: 100%; cursor: zoom-in; background: var(--surface-2); }
.bubble.photo .meta { position: absolute; right: 10px; bottom: 9px; margin: 0; padding: 3px 7px; border-radius: 9px; background: rgba(0, 0, 0, .5); color: #fff; float: none; }
.bubble.photo .caption { padding: 6px 9px 4px; }
/* ── video circles (кружочки) ── */
.circle-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.msg.in .circle-wrap { align-items: flex-start; }
.circle-wrap .meta { float: none; margin: 0 8px; padding: 3px 8px; border-radius: 10px; background: var(--surface-2); }
.vcircle {
  --size: 220px; --p: 0;
  position: relative; width: var(--size); height: var(--size); border-radius: 50%;
  cursor: pointer; flex: none; transition: width .28s cubic-bezier(.3, .7, .3, 1), height .28s cubic-bezier(.3, .7, .3, 1);
  -webkit-tap-highlight-color: transparent;
}
.vcircle.playing { --size: 300px; }
.vcircle video { position: absolute; inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); border-radius: 50%; object-fit: cover; background: var(--surface-2); }
.vc-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); pointer-events: none; }
.vc-ring circle { fill: none; stroke-width: 3; }
.vc-track { stroke: color-mix(in srgb, var(--circle) 22%, transparent); }
.vc-prog { stroke: var(--circle); stroke-linecap: round; stroke-dasharray: 304.8px; stroke-dashoffset: calc(304.8px - var(--p) * 304.8px); }
.vcircle:not(.playing) .vc-prog { opacity: 0; }
.vc-badge {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 11px;
  background: rgba(10, 14, 22, .55); color: #fff; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
  pointer-events: none; backdrop-filter: blur(6px);
}
.vc-badge .ic { width: 14px; height: 14px; }
.vc-play {
  position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(10, 14, 22, .5); color: #fff; opacity: 0; transition: opacity .15s; pointer-events: none;
}
.vc-play .ic { width: 26px; height: 26px; margin-left: 3px; }
.vcircle.paused .vc-play { opacity: 1; }
.vcircle.broken video { opacity: .4; }

/* composer in chat */
.chat-input { display: flex; align-items: flex-end; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--line); }
.chat-input textarea {
  flex: 1; min-height: 40px; max-height: 160px; padding: 9px 14px; resize: none; outline: 0;
  border: 1px solid var(--line); border-radius: 20px; background: var(--surface-2); line-height: 1.4;
}
.chat-input textarea:focus { border-color: var(--accent); background: var(--surface); }
.chat-input .icon-btn { width: 40px; height: 40px; }
.round-btn { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border: 0; border-radius: 50%; color: #fff; }
.round-btn.send { background: var(--accent); }
.round-btn.rec { background: var(--circle); }
.round-btn.rec .ic { width: 22px; height: 22px; }
.round-btn:hover { filter: brightness(1.08); }
.round-btn:disabled { opacity: .5; }

/* recorder overlay */
.recorder {
  position: fixed; inset: 0; z-index: 60; display: grid; grid-template-rows: 1fr auto; justify-items: center;
  padding: 24px 16px calc(28px + env(safe-area-inset-bottom)); background: rgba(9, 12, 20, .86); backdrop-filter: blur(10px); color: #fff;
}
.rec-stage { display: grid; place-items: center; align-content: center; gap: 18px; }
.rec-frame { --p: 0; position: relative; }
.recorder.circle .rec-frame { width: min(78vw, 56vh, 380px); aspect-ratio: 1; }
.recorder.vertical .rec-frame { height: min(68vh, 640px); aspect-ratio: 9 / 16; max-width: 86vw; }
.rec-frame canvas, .rec-frame video { position: absolute; inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px); object-fit: cover; background: #000; }
.recorder.circle .rec-frame canvas, .recorder.circle .rec-frame video { border-radius: 50%; }
.recorder.vertical .rec-frame canvas, .recorder.vertical .rec-frame video { inset: 0; width: 100%; height: 100%; border-radius: 18px; }
.rec-frame .vc-ring circle { stroke-width: 2.4; }
.rec-frame .vc-track { stroke: rgba(255, 255, 255, .16); }
.rec-frame .vc-prog { transition: stroke-dashoffset .2s linear; }
.rec-line { position: absolute; left: 12px; right: 12px; top: 10px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .25); z-index: 1; overflow: hidden; }
.rec-line i { display: block; height: 100%; width: 0; background: var(--circle); transition: width .2s linear; }
.rec-max { color: rgba(255, 255, 255, .5); }
.rec-time { display: flex; align-items: center; gap: 8px; font-size: 15px; font-variant-numeric: tabular-nums; color: rgba(255, 255, 255, .85); min-height: 22px; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--circle); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.rec-hint { font-size: 13px; color: rgba(255, 255, 255, .6); text-align: center; max-width: 320px; }
.rec-controls { display: flex; gap: 18px; align-items: center; }
.rc { width: 56px; height: 56px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(255, 255, 255, .12); color: #fff; transition: background .15s, transform .15s; }
.rc:hover { background: rgba(255, 255, 255, .2); }
.rc .ic { width: 24px; height: 24px; }
.rc.primary { width: 68px; height: 68px; background: var(--circle); }
.rc.primary:hover { background: color-mix(in srgb, var(--circle) 85%, #fff); }
.rc.send { background: var(--accent); }
.rc:disabled { opacity: .4; }

/* ── settings / admin ── */
.stack { display: grid; gap: 12px; max-width: 640px; }
.av-row { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; }
.creds { margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: var(--accent-soft); }
.creds pre { margin: 0 0 10px; font: 600 15px/1.6 var(--font); white-space: pre-wrap; }
.users-table { display: grid; }
.u-row { display: flex; gap: 12px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--line); }
.u-row .grow b { font-weight: 650; }
.u-row .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 3px; }
.danger-zone { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap; }

/* ── modal, toast, lightbox ── */
.modal-back { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; background: rgba(10, 14, 22, .5); animation: fade .15s; }
.modal { width: 100%; max-width: 420px; max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border-radius: 16px; padding: 22px; box-shadow: 0 24px 64px rgba(0, 0, 0, .3); }
.modal h3 { font-size: 18px; margin-bottom: 14px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.lightbox { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(5, 7, 12, .9); cursor: zoom-out; animation: fade .15s; }
.lightbox img { max-width: 94vw; max-height: 92vh; border-radius: 6px; }
@keyframes fade { from { opacity: 0; } }
#toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; pointer-events: none; }
.toast { padding: 10px 16px; border-radius: 10px; background: var(--ink); color: var(--surface); font-size: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; max-width: 90vw; }
.toast.err { background: var(--danger); color: #fff; }
.toast.show { opacity: 1; transform: none; }

/* ── login ── */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-art {
  position: relative; overflow: hidden; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background: #17295E; color: #fff;
}
.auth-art .logo { color: #fff; width: auto; }
.auth-art h1 { font-size: clamp(34px, 4.4vw, 56px); font-weight: 750; letter-spacing: -.035em; line-height: 1.02; max-width: 12ch; position: relative; z-index: 1; }
.auth-art p { max-width: 34ch; color: rgba(255, 255, 255, .72); font-size: 16px; position: relative; z-index: 1; margin: 16px 0 0; }
.bubbles { position: absolute; inset: 0; pointer-events: none; }
.bub { position: absolute; border-radius: 50%; }
.bub::before { content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(#F2527F calc(var(--p) * 1%), rgba(255, 255, 255, .14) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px)); }
.bub::after { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: var(--fill); }
.b1 { --p: 72; --fill: radial-gradient(circle at 35% 30%, #4E7BEA, #233F94); width: 300px; height: 300px; right: -40px; top: 18%; }
.b2 { --p: 38; --fill: radial-gradient(circle at 40% 35%, #F7A3BC, #C8335F); width: 150px; height: 150px; right: 250px; top: 52%; }
.b3 { --p: 90; --fill: radial-gradient(circle at 40% 35%, #8FE0C3, #1D8A63); width: 104px; height: 104px; right: 70px; bottom: 9%; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; background: var(--surface); }
.auth-box { width: 100%; max-width: 360px; }
.auth-box h2 { font-size: 24px; font-weight: 700; letter-spacing: -.015em; margin-bottom: 6px; }
.auth-box > p { color: var(--muted); margin: 0 0 22px; }
.auth-note { margin-top: 18px; font-size: 13px; color: var(--muted); }
.form-err { color: var(--danger); font-size: 14px; margin: -4px 0 12px; }

/* ── responsive ── */
@media (max-width: 1000px) {
  .col-side { display: none; }
  .profile .col-side { display: grid; position: static; width: auto; }
  .profile .cols { flex-direction: column-reverse; align-items: stretch; }
}
@media (max-width: 820px) {
  :root { --top: 52px; }
  .side { display: none; }
  .logo { width: auto; }
  .logo-word { font-size: 17px; }
  .top-in { gap: 12px; padding: 0 10px; }
  .me-btn .me-name { display: none; }
  .wrap { padding: 10px 8px calc(74px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line);
  }
  .tabbar .nav-link { flex: 1; flex-direction: column; justify-content: center; gap: 2px; height: 52px; padding: 0; font-size: 11px; position: relative; }
  .tabbar .nav-link.on { background: none; color: var(--accent); }
  .tabbar .nav-link .badge { position: absolute; top: 2px; left: calc(50% + 4px); margin: 0; min-width: 18px; height: 18px; font-size: 11px; }
  .card { border-radius: 12px; }
  .post { padding: 14px 14px 4px; }
  .post-img { width: calc(100% + 28px); margin: 0 -14px 10px; }
  .im { height: calc(100dvh - var(--top) - 20px - 64px - env(safe-area-inset-bottom)); }
  .im-list { width: 100%; }
  .im.has-chat .im-list { display: none; }
  .im:not(.has-chat) .im-chat { display: none; }
  body.in-chat .tabbar { display: none; }
  body.in-chat .wrap { padding-bottom: 10px; }
  body.in-chat .im { height: calc(100dvh - var(--top) - 20px); }
  .chat-head .back { display: inline-grid; }
  .vcircle { --size: min(56vw, 220px); }
  .vcircle.playing { --size: min(78vw, 300px); }
  .bubble { max-width: 84%; }
  .cover-band { height: 90px; }
  .cover-body { padding: 0 16px 16px; gap: 12px; }
  .big-av { margin-top: -48px; }
  .big-av .av { --s: 96px !important; }
  .av-edit { opacity: 1; }
  .u-row { padding: 12px 14px; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { min-height: 260px; padding: 28px 24px; }
  .b1 { width: 200px; height: 200px; top: 30px; right: -50px; }
  .b2 { width: 96px; height: 96px; right: 140px; top: auto; bottom: 20px; }
  .b3 { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ═════════ v2: фото/видео, Миги, беседы, игры ═════════ */
body.no-scroll { overflow: hidden; }
.mobile-only { display: none !important; }
.seg { gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.seg button { flex: 1; border: 0; background: none; padding: 8px; border-radius: 9px; font-size: 14px; font-weight: 500; }
.seg button.on { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.tag.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }

/* загрузки */
#uploads { position: fixed; left: 20px; bottom: 20px; z-index: 85; display: grid; gap: 8px; }
.up-pill { width: 300px; padding: 10px 8px 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(10, 20, 40, .18); }
.up-top { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.up-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.up-pct { color: var(--muted); font-variant-numeric: tabular-nums; }
.up-top .icon-btn { width: 28px; height: 28px; }
.up-top .icon-btn .ic { width: 16px; height: 16px; }
.up-bar { height: 4px; margin: 6px 6px 0 0; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.up-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

/* окна-шторки */
.sheet-title { font-weight: 650; font-size: 16px; margin-bottom: 10px; }
.sheet-list { display: grid; gap: 2px; }
.sheet-item { display: flex; align-items: center; gap: 12px; padding: 12px 10px; border: 0; border-radius: 10px; background: none; text-align: left; font-size: 15px; }
.sheet-item:hover { background: var(--surface-2); }
.sheet-item .ic { color: var(--muted); }
.sheet-item.danger, .sheet-item.danger .ic { color: var(--danger); }
.sheet-cancel { margin-top: 10px; }
.sheet-comments .c-list { max-height: 52vh; overflow-y: auto; }
.tall-modal .modal { max-width: 460px; }
.pub-modal .modal { max-width: 480px; }
.pub-preview video { width: 100%; max-height: 38vh; border-radius: 10px; background: #000; display: block; }
.pub-preview.tall video { max-height: 46vh; }
.c-empty { padding: 6px 0 10px; }

/* выбор людей */
.pick-search { margin-bottom: 6px; }
.pick-list { max-height: 44vh; overflow-y: auto; }
.pick { display: flex; gap: 10px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.pick input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }

/* вкладки профиля */
.ptabs { padding: 6px; border: 1px solid var(--line); }
.mtab-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.mtab-head b { font-size: 16px; }
.m-grid { display: grid; gap: 4px; }
.m-grid.photo { grid-template-columns: repeat(3, 1fr); }
.m-grid.video { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px 12px; }
.m-grid.mig { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; }
.m-grid > .empty { grid-column: 1 / -1; padding: 28px 12px; }
.m-tile { position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 0; border-radius: 6px; overflow: hidden; background: var(--surface-2); cursor: pointer; }
.m-grid.video .m-tile { aspect-ratio: 16 / 9; border-radius: 10px; }
.m-grid.mig .m-tile { aspect-ratio: 9 / 16; border-radius: 10px; }
.m-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.m-tile:hover img { transform: scale(1.03); }
.m-noposter { display: grid; place-items: center; width: 100%; height: 100%; color: var(--muted); }
.m-noposter .ic { width: 34px; height: 34px; }
.m-badge { position: absolute; right: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border-radius: 7px; background: rgba(8, 12, 20, .62); color: #fff; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.m-badge .ic { width: 13px; height: 13px; }
.m-play { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; display: grid; place-items: center; background: rgba(8, 12, 20, .5); color: #fff; }
.m-play .ic { width: 20px; height: 20px; margin-left: 2px; }
.m-vid { display: grid; gap: 6px; align-content: start; }
.m-cap { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* просмотр фото и видео */
.viewer { position: fixed; inset: 0; z-index: 65; display: grid; grid-template-columns: 1fr 360px; background: rgba(5, 7, 12, .95); animation: fade .15s; }
.v-stage { position: relative; min-width: 0; min-height: 0; }
.v-media { position: absolute; inset: 0; display: grid; place-items: center; padding: 56px 72px; }
.v-media img, .v-media video { max-width: 100%; max-height: calc(100vh - 112px); border-radius: 4px; }
.v-media video { width: 100%; background: #000; }
.v-top { position: absolute; top: 0; left: 0; right: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 10px 18px; color: rgba(255, 255, 255, .75); font-size: 14px; }
.v-top .icon-btn, .v-nav { color: #fff; }
.v-top .icon-btn:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.v-nav { position: absolute; top: 50%; z-index: 2; width: 48px; height: 48px; margin-top: -24px; border: 0; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .1); }
.v-nav:hover { background: rgba(255, 255, 255, .2); }
.v-nav.prev { left: 12px; }
.v-nav.next { right: 12px; }
.v-side { background: var(--surface); display: flex; flex-direction: column; min-height: 0; padding: 16px 18px; gap: 12px; }
.v-author { display: flex; gap: 10px; align-items: center; color: var(--ink); }
.v-author:hover { text-decoration: none; }
.v-cap { margin-top: 10px; overflow-wrap: anywhere; font-size: 14px; }
.v-actions { display: flex; gap: 6px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.v-comments { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.v-comments .c-list { flex: 1; overflow-y: auto; }

/* Миги */
.migi-page { flex: 1; min-width: 0; }
.migi-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; height: calc(100vh - var(--top) - 32px); height: calc(100dvh - var(--top) - 32px); }
.migi-feed {
  --h: calc(100vh - var(--top) - 32px - 50px); height: var(--h); width: calc(var(--h) * 9 / 16); max-width: 100%;
  overflow-y: auto; scroll-snap-type: y mandatory; border-radius: 16px; background: #05070c; scrollbar-width: none; overscroll-behavior: contain;
}
.migi-feed::-webkit-scrollbar { display: none; }
.migi-bar { display: flex; align-items: center; gap: 8px; width: calc((100vh - var(--top) - 82px) * 9 / 16); max-width: 100%; height: 40px; }
.migi-bar b { flex: 1; font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mig { position: relative; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; overflow: hidden; background: #000; }
.mig video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.mig video.fill { object-fit: cover; }
.mig::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 45%; background: linear-gradient(transparent, rgba(0, 0, 0, .62)); pointer-events: none; }
.mig-info { position: absolute; left: 14px; right: 76px; bottom: 22px; z-index: 2; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.mig-author { display: inline-flex; align-items: center; gap: 8px; color: #fff; font-size: 15px; }
.mig-author .av { box-shadow: 0 0 0 2px #fff; }
.mig-cap { margin-top: 8px; font-size: 14px; line-height: 1.4; max-height: 6.8em; overflow: hidden; overflow-wrap: anywhere; }
.mig-cap a { color: #fff; text-decoration: underline; }
.mig-rail { position: absolute; right: 8px; bottom: 20px; z-index: 2; display: flex; flex-direction: column; gap: 10px; }
.rail-btn { display: grid; justify-items: center; gap: 2px; width: 56px; padding: 6px 0; border: 0; background: none; color: #fff; font-size: 13px; font-weight: 650; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.rail-btn .ic { width: 30px; height: 30px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .4)); }
.rail-btn.on { color: var(--circle); }
.rail-btn.on .ic { fill: currentColor; }
.rail-btn.pop .ic { animation: pop .35s ease; }
.mig-paused { position: absolute; left: 50%; top: 50%; z-index: 2; width: 72px; height: 72px; margin: -36px 0 0 -36px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .45); color: #fff; opacity: 0; transition: opacity .15s; pointer-events: none; }
.mig-paused .ic { width: 34px; height: 34px; margin-left: 4px; }
.mig.paused .mig-paused { opacity: 1; }
.mig.broken::before { content: "Видео не воспроизводится в этом браузере"; position: absolute; left: 20px; right: 20px; top: 45%; z-index: 2; text-align: center; color: rgba(255, 255, 255, .8); font-size: 14px; }
.mig-progress { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; height: 3px; background: rgba(255, 255, 255, .2); }
.mig-progress i { display: block; height: 100%; width: 0; background: #fff; }
.migi-empty { height: 100%; display: grid; place-content: center; text-align: center; gap: 6px; padding: 24px; color: rgba(255, 255, 255, .7); }
.migi-empty b { color: #fff; font-size: 17px; }

/* беседы */
.msg-av { width: 32px; flex: none; align-self: flex-start; }
.msg-col { display: flex; flex-direction: column; align-items: flex-start; max-width: min(520px, 78%); min-width: 0; }
.msg-col .bubble { max-width: 100%; }
.msg-name { font-size: 13px; font-weight: 650; margin: 0 0 3px 12px; }
.msg-more { opacity: 0; width: 28px; height: 28px; align-self: center; }
.msg-more .ic { width: 16px; height: 16px; }
.msg:hover .msg-more, .msg-more:focus-visible { opacity: 1; }
@media (hover: none) { .msg-more { display: none; } .msg { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; } }
.msg.flash .bubble, .msg.flash .vcircle { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 18px; transition: box-shadow .3s; }
.msg.flash .vcircle { border-radius: 50%; }
.sys { margin: 10px auto; max-width: 86%; text-align: center; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.pinned { display: flex; align-items: center; gap: 10px; padding: 7px 10px 7px 16px; border-bottom: 1px solid var(--line); }
.pinned > .ic { color: var(--accent); }
.pin-body { min-width: 0; cursor: pointer; font-size: 13px; }
.pin-body b { color: var(--accent); font-weight: 600; }
.pin-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-head-main { flex: 1; min-width: 0; }
.as-btn { border: 0; background: none; padding: 0; text-align: left; color: var(--ink); width: 100%; }
.dlg-ic { width: 15px; height: 15px; margin-right: 4px; vertical-align: -2px; color: var(--muted); }
.ci-head { display: flex; gap: 14px; align-items: center; }
.ci-av { position: relative; }
.ci-av .av-edit { bottom: -2px; }
.ci-members { max-height: 42vh; overflow-y: auto; }
.ci-member { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ci-member .name { color: var(--ink); font-weight: 600; }

/* игры */
.games-head { margin-bottom: 12px; }
.games-head h2 { font-size: 20px; margin-bottom: 4px; }
.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.game { overflow: hidden; color: var(--ink); display: flex; flex-direction: column; }
.game:hover { text-decoration: none; border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.g-cover { aspect-ratio: 16 / 10; display: grid; place-items: center; padding: 12px; text-align: center;
  background: radial-gradient(circle at 78% 22%, hsl(calc(var(--h) + 40) 85% 70% / .55) 0 18%, transparent 19%),
              linear-gradient(135deg, hsl(var(--h) 65% 52%), hsl(calc(var(--h) + 50) 60% 30%)); }
.g-cover span { color: #fff; font-weight: 750; font-size: 24px; letter-spacing: -.02em; text-shadow: 0 2px 10px rgba(0, 0, 0, .25); }
.g-body { padding: 12px 14px 14px; display: grid; gap: 4px; justify-items: start; }
.game-player { position: fixed; inset: 0; z-index: 55; display: flex; flex-direction: column; background: var(--surface); }
.game-player header { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 8px calc(0px) 8px; padding-top: env(safe-area-inset-top); border-bottom: 1px solid var(--line); box-sizing: content-box; }
.game-player header b { flex: 1; font-size: 16px; }
.game-player iframe { flex: 1; width: 100%; border: 0; background: #fff; }
.g-row { padding: 9px 0; border-bottom: 1px solid var(--line); }

/* меню (телефон) */
.menu-me { display: flex; align-items: center; gap: 14px; padding: 14px 16px; color: var(--ink); }
.menu-me:hover { text-decoration: none; }
.menu-me > div { flex: 1; }
.menu-me > .ic { color: var(--muted); }
.menu-list { display: grid; }
.menu-list a { display: flex; align-items: center; gap: 14px; padding: 14px 16px; color: var(--ink); border-bottom: 1px solid var(--line); font-size: 15px; }
.menu-list a:last-child { border-bottom: 0; }
.menu-list a .ic { color: var(--accent); }
.menu-list a:hover { background: var(--surface-2); text-decoration: none; }

/* админка */
.disk { height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; margin-bottom: 10px; }
.disk i { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.disk-legend { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 18px; font-size: 14px; color: var(--ink); }
.row.two { align-items: flex-start; }

@media (max-width: 820px) {
  .mobile-only { display: flex !important; }
  #uploads { left: 8px; right: 8px; bottom: calc(70px + env(safe-area-inset-bottom)); }
  .up-pill { width: auto; }
  body.in-chat #uploads, body.in-migi #uploads { bottom: calc(12px + env(safe-area-inset-bottom)); }

  .modal-back.as-sheet { place-items: end stretch; padding: 0; }
  .modal-back.as-sheet .modal { max-width: none; border-radius: 18px 18px 0 0; padding: 18px 16px calc(16px + env(safe-area-inset-bottom)); animation: up .2s ease; }
  .modal-back.tall-modal, .modal-back.pub-modal { padding: 8px; }
  @keyframes up { from { transform: translateY(40px); opacity: 0; } }

  .m-grid.photo { gap: 2px; }
  .m-tile { border-radius: 2px; }
  .m-grid.video { grid-template-columns: 1fr 1fr; gap: 12px 8px; }
  .m-grid.mig { grid-template-columns: repeat(3, 1fr); gap: 3px; }
  .m-grid.mig .m-tile { border-radius: 4px; }
  .mtab-head .btn { padding: 0 10px; }

  .viewer { grid-template-columns: 1fr; }
  .v-media { padding: 52px 0 150px; }
  .v-media img, .v-media video { max-height: calc(100dvh - 210px); border-radius: 0; }
  .v-nav { display: none; }
  .v-side { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 14px calc(12px + env(safe-area-inset-bottom)); gap: 8px; background: linear-gradient(transparent, rgba(0, 0, 0, .85) 40%); color: #fff; }
  .v-author, .v-side .muted { color: #fff; }
  .v-side .muted { opacity: .7; }
  .v-cap { max-height: 4.4em; overflow-y: auto; }
  .v-actions { border: 0; padding: 0; }
  .v-actions .react { background: rgba(255, 255, 255, .14); color: #fff; }
  .v-actions .react.on { color: #ff7aa2; }
  .v-comments { display: none; }

  body.in-migi .top { display: none; }
  body.in-migi .wrap { padding: 0; }
  .migi-wrap { position: fixed; left: 0; right: 0; top: 0; bottom: calc(61px + env(safe-area-inset-bottom)); height: auto; gap: 0; z-index: 5; background: #000; }
  .migi-feed { --h: 100%; width: 100%; height: 100%; border-radius: 0; }
  .migi-bar { position: absolute; top: 0; left: 0; right: 0; z-index: 6; width: auto; height: auto; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; color: #fff; background: linear-gradient(rgba(0, 0, 0, .45), transparent); }
  .migi-bar .icon-btn { color: #fff; }
  .migi-bar .btn { background: rgba(255, 255, 255, .18); }
  .migi-bar .btn span { display: none; }
  .migi-bar .btn { width: 36px; padding: 0; border-radius: 50%; }
  .mig-info { bottom: 18px; }

  .msg-col { max-width: 84%; }
  .games-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .g-cover span { font-size: 18px; }
  .g-body { padding: 10px; }
  .g-body .small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .row.two { flex-direction: column; align-items: stretch; gap: 0; }
  .stack { max-width: none; }
}
@media (max-width: 1000px) { .viewer { grid-template-columns: 1fr 320px; } }
@media (max-width: 820px) { .viewer { grid-template-columns: 1fr; } }
.viewer { background: #05070c; }
@media (max-width: 820px) {
  .cover-actions { width: 100%; flex-wrap: nowrap; }
  .cover-actions > * { flex: 1; min-width: 0; padding: 0 10px; }
  .profile .info-card.only-date { display: none; }
  .ptabs { position: sticky; top: var(--top); z-index: 4; }
}
