/* ═══════════════════ Kros — интерфейс ═══════════════════ */
:root {
  --a1: #8b5cf6; --a2: #06b6d4;
  --grad: linear-gradient(135deg, var(--a1), var(--a2));
  --bg: #0b0d17; --bg2: #11142200; --panel: rgba(20, 23, 38, .72); --panel-solid: #151828;
  --line: rgba(255, 255, 255, .07); --line2: rgba(255, 255, 255, .12);
  --text: #eef0f8; --muted: #8b90a8; --hover: rgba(255, 255, 255, .055); --active: rgba(139, 92, 246, .16);
  --in: rgba(34, 38, 60, .92); --out: linear-gradient(135deg, color-mix(in srgb, var(--a1) 88%, #000 12%), color-mix(in srgb, var(--a2) 70%, var(--a1) 30%));
  --out-text: #fff; --input: rgba(255, 255, 255, .06);
  --shadow: 0 10px 40px rgba(0, 0, 0, .45); --r: 18px;
  --green: #22c55e; --red: #ef4444; --warn: #f59e0b;
  --ease: cubic-bezier(.2, .8, .2, 1); --spring: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #eef0f8; --panel: rgba(255, 255, 255, .78); --panel-solid: #ffffff;
  --line: rgba(15, 20, 40, .08); --line2: rgba(15, 20, 40, .14);
  --text: #141726; --muted: #6b7088; --hover: rgba(15, 20, 40, .05); --active: color-mix(in srgb, var(--a1) 14%, transparent);
  --in: #ffffff; --input: rgba(15, 20, 40, .05); --shadow: 0 10px 40px rgba(30, 40, 90, .14);
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { font: 15px/1.42 Inter, "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, textarea, select { font: inherit; color: inherit; }
a { color: color-mix(in srgb, var(--a2) 80%, #fff 20%); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.pad { padding: 16px; }
.mt { margin-top: 10px; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; }
.gap { gap: 12px; }
.ic { display: inline-flex; align-items: center; justify-content: center; flex: none; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }
::selection { background: color-mix(in srgb, var(--a1) 40%, transparent); }

/* фон — плавающие пятна */
#bg { position: fixed; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
#bg i { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(90px); opacity: .22; animation: drift 28s ease-in-out infinite alternate; }
#bg i:nth-child(1) { background: var(--a1); left: -20vmax; top: -25vmax; }
#bg i:nth-child(2) { background: var(--a2); right: -25vmax; bottom: -30vmax; animation-delay: -9s; }
#bg i:nth-child(3) { background: #ec4899; left: 30vw; top: 40vh; width: 35vmax; height: 35vmax; opacity: .1; animation-delay: -17s; }
[data-theme="light"] #bg i { opacity: .16; }
@keyframes drift { to { transform: translate(8vmax, 6vmax) scale(1.15); } }
#root { position: relative; z-index: 1; height: 100%; height: 100dvh; }

.glass { background: var(--panel); backdrop-filter: blur(22px) saturate(1.4); -webkit-backdrop-filter: blur(22px) saturate(1.4); border: 1px solid var(--line); }

/* логотип */
.logo-mark { width: 26px; height: 26px; border-radius: 8px; background: var(--grad); position: relative; flex: none; box-shadow: 0 4px 18px color-mix(in srgb, var(--a1) 45%, transparent); }
.logo-mark::after { content: "K"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px; letter-spacing: -.5px; }
.logo-mark.big { width: 76px; height: 76px; border-radius: 24px; }
.logo-mark.big::after { font-size: 44px; }
.spin-in { animation: spinIn .9s var(--spring) both; }
@keyframes spinIn { from { transform: rotate(-120deg) scale(.3); opacity: 0; } }
.float { animation: float 5s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-8px) rotate(3deg); } }
.boot { height: 100%; display: grid; place-content: center; justify-items: center; gap: 16px; }
.boot .logo-mark { animation: pulse 1.4s ease-in-out infinite; }
.boot-text { font-size: 28px; font-weight: 800; letter-spacing: .5px; }
@keyframes pulse { 50% { transform: scale(.9); opacity: .7; } }

/* ═══ кнопки и поля ═══ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 42px; padding: 0 18px; border-radius: 13px; font-weight: 600; transition: transform .15s var(--ease), background .2s, box-shadow .2s, opacity .2s; user-select: none; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--grad); color: #fff; box-shadow: 0 6px 22px color-mix(in srgb, var(--a1) 40%, transparent); }
.btn.primary:hover { box-shadow: 0 8px 30px color-mix(in srgb, var(--a1) 55%, transparent); }
.btn.ghost { background: var(--hover); }
.btn.ghost:hover { background: var(--line2); }
.btn.danger { color: var(--red); }
.btn.danger.primary, .modal-foot .btn.danger { background: var(--red); color: #fff; }
.btn.wide { width: 100%; }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn:disabled { opacity: .6; pointer-events: none; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: inline-grid; place-items: center; color: var(--muted); transition: background .2s, color .2s, transform .15s; flex: none; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn:active { transform: scale(.92); }
.icon-btn.danger { color: var(--red); }
.field { display: grid; gap: 6px; margin: 12px 0; }
.field > span { font-size: 13px; color: var(--muted); font-weight: 500; }
.field input, .field textarea, .card input:not([type]), .card textarea, .card select, .modal input:not([type]), .modal-body > div > .row input {
  width: 100%; border: 1px solid var(--line); background: var(--input); border-radius: 12px; padding: 11px 14px; outline: none; transition: border .2s, box-shadow .2s, background .2s; resize: none;
}
.field input:focus, .field textarea:focus, .card input:focus, .card textarea:focus, .modal input:focus { border-color: color-mix(in srgb, var(--a1) 70%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--a1) 18%, transparent); }
.card select { width: auto; padding: 7px 10px; }
.field small.ok { color: var(--green); } .field small.bad { color: var(--red); }
.form-err { color: var(--red); font-size: 13.5px; min-height: 18px; margin: 6px 0; text-align: center; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; display: inline-block; animation: spin .7s linear infinite; vertical-align: middle; opacity: .8; }
@keyframes spin { to { transform: rotate(360deg); } }
.seg { display: flex; background: var(--input); border-radius: 13px; padding: 4px; gap: 4px; }
.seg button { flex: 1; height: 36px; border-radius: 10px; color: var(--muted); font-weight: 600; transition: all .25s var(--ease); }
.seg button.on { background: var(--panel-solid); color: var(--text); box-shadow: 0 2px 10px rgba(0, 0, 0, .2); }

/* ═══ вход ═══ */
.auth { height: 100%; overflow: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 16px; gap: 22px; }
.auth-brand { text-align: center; display: grid; justify-items: center; gap: 6px; }
.brand-name { font-size: 40px; font-weight: 800; letter-spacing: -1px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; margin-top: 8px; }
.brand-sub { color: var(--muted); font-size: 14px; }
.auth-card { width: min(430px, 100%); border-radius: 26px; padding: 22px; box-shadow: var(--shadow); animation: rise .6s var(--ease) both .1s; }
.auth-card h1, .auth-card h2 { text-align: center; margin: 10px 0 6px; font-size: 22px; }
.auth-form { margin-top: 10px; }
.auth-icon { width: 72px; height: 72px; margin: 10px auto 4px; border-radius: 22px; background: color-mix(in srgb, var(--a1) 18%, transparent); color: var(--a1); display: grid; place-items: center; }
.ekv-input { width: 100%; text-align: center; font: 600 15px/1 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: 1.2px; padding: 16px 10px; border-radius: 14px; border: 1px solid var(--line2); background: var(--input); outline: none; margin: 10px 0 0; text-transform: uppercase; }
.ekv-input:focus { border-color: var(--a1); box-shadow: 0 0 0 4px color-mix(in srgb, var(--a1) 20%, transparent); }
.field .ekv-input { margin: 0; font-size: 13px; letter-spacing: .6px; padding: 13px 8px; }
.steps { display: flex; gap: 6px; justify-content: center; margin: 16px 0 0; }
.steps i { width: 28px; height: 5px; border-radius: 5px; background: var(--line2); transition: background .4s, width .4s var(--ease); }
.steps i.on { background: var(--grad); width: 44px; }
.avatar-pick { width: 96px; height: 96px; border-radius: 50%; background: var(--input); border: 2px dashed var(--line2); color: var(--muted); display: inline-grid; place-items: center; overflow: hidden; transition: transform .2s, border-color .2s; margin: 6px auto 0; }
.avatar-pick:hover { transform: scale(1.04); border-color: var(--a1); color: var(--a1); }
.avatar-pick img { width: 100%; height: 100%; object-fit: cover; }
.avatar-pick.sm { width: 60px; height: 60px; margin: 0; flex: none; }
.meter { height: 5px; border-radius: 5px; background: var(--line); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--red); transition: width .3s var(--ease), background .3s; }
.meter[data-s="2"] i, .meter[data-s="3"] i { background: var(--warn); }
.meter[data-s="4"] i, .meter[data-s="5"] i { background: var(--green); }
.keygen { padding: 24px 0 14px; }
.keygen-orb { width: 110px; height: 110px; margin: 0 auto 10px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; animation: orb 1.6s ease-in-out infinite; }
@keyframes orb { 50% { transform: scale(1.08); box-shadow: 0 0 0 18px color-mix(in srgb, var(--a1) 16%, transparent), 0 0 60px var(--a1); } }
.fade-up { animation: rise .45s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.shake { animation: shake .45s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* ═══ приложение ═══ */
.app { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; height: 100%; padding: 12px; gap: 12px; }
.sidebar { display: flex; flex-direction: column; min-height: 0; border-radius: 24px; background: var(--panel); backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4); border: 1px solid var(--line); overflow: hidden; animation: rise .5s var(--ease) both; }
.side-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 8px; }
.me-btn { border-radius: 50%; transition: transform .2s var(--spring); }
.me-btn:hover { transform: scale(1.08); }
.side-title { flex: 1; display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 19px; letter-spacing: -.3px; min-width: 0; }
.conn-state { font-size: 12px; font-weight: 500; color: var(--warn); display: flex; align-items: center; gap: 6px; }
.conn-state:not(.ok)::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); animation: pulse 1s infinite; }
.search-wrap { margin: 4px 14px 8px; position: relative; display: flex; align-items: center; }
.search-wrap .ic { position: absolute; left: 13px; color: var(--muted); pointer-events: none; }
.search-input { width: 100%; height: 42px; border-radius: 14px; border: 1px solid transparent; background: var(--input); padding: 0 14px 0 40px; outline: none; transition: all .2s; }
.search-input.solo { padding-left: 14px; margin-bottom: 8px; }
.search-input:focus { border-color: color-mix(in srgb, var(--a1) 60%, transparent); background: transparent; box-shadow: 0 0 0 4px color-mix(in srgb, var(--a1) 14%, transparent); }
.chat-list { flex: 1; overflow-y: auto; padding: 4px 8px 8px; }
.list-sec { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); padding: 12px 10px 6px; }
.list-empty { padding: 28px 16px; text-align: center; }
.side-foot { font-size: 11.5px; color: var(--muted); padding: 10px 16px 12px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 6px; justify-content: center; opacity: .8; }

.chat-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 16px; cursor: pointer; transition: background .18s, transform .18s var(--ease); position: relative; user-select: none; }
.chat-item:hover { background: var(--hover); }
.chat-item:active { transform: scale(.985); }
.chat-item.active { background: var(--active); }
.chat-item.active::before { content: ""; position: absolute; left: -8px; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0; background: var(--grad); }
.ci-av { position: relative; flex: none; }
.online-dot { position: absolute; right: 1px; bottom: 1px; width: 13px; height: 13px; border-radius: 50%; background: var(--green); border: 2.5px solid var(--panel-solid); animation: pop .4s var(--spring); }
.call-dot { position: absolute; left: -2px; bottom: -2px; width: 20px; height: 20px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; border: 2px solid var(--panel-solid); animation: pulse 1.2s infinite; }
@keyframes pop { from { transform: scale(0); } }
.ci-body { flex: 1; min-width: 0; }
.ci-top, .ci-bot { display: flex; align-items: center; gap: 8px; }
.ci-title { flex: 1; min-width: 0; font-weight: 650; display: flex; align-items: center; gap: 5px; }
.ci-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ci-title .ic { color: var(--muted); }
.ci-time { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 2px; flex: none; }
.ci-prev { flex: 1; min-width: 0; color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.ci-prev .who { color: var(--text); opacity: .85; }
.typing { color: var(--a2) !important; }
.typing::after { content: ""; display: inline-block; width: 18px; animation: dots 1.2s steps(4) infinite; overflow: hidden; vertical-align: bottom; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
.ticks { display: inline-flex; color: var(--muted); }
.ticks.read { color: var(--a2); }
.ticks.err { color: var(--red); font-weight: 800; }
.badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--grad); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; flex: none; animation: pop .35s var(--spring); }
.badge.muted { background: var(--line2); color: var(--muted); }
.role { font-size: 12px; color: var(--a2); flex: none; }
.check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line2); display: grid; place-items: center; color: transparent; transition: all .2s var(--spring); flex: none; }
.check.on { background: var(--grad); border-color: transparent; color: #fff; transform: scale(1.08); }

.avatar { border-radius: 50%; overflow: hidden; display: grid; place-items: center; color: #fff; font-weight: 700; flex: none; user-select: none; position: relative; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ═══ окно чата ═══ */
main.chat { min-width: 0; min-height: 0; border-radius: 24px; overflow: hidden; position: relative; background: var(--panel); backdrop-filter: blur(24px) saturate(1.3); -webkit-backdrop-filter: blur(24px) saturate(1.3); border: 1px solid var(--line); animation: rise .5s var(--ease) both .05s; }
.empty { height: 100%; display: grid; place-items: center; padding: 20px; }
.empty-card { max-width: 440px; text-align: center; padding: 30px 26px; border-radius: 26px; display: grid; justify-items: center; gap: 8px; }
.empty-card h2 { margin: 10px 0 0; }
.feat { display: grid; gap: 10px; margin: 12px 0 18px; text-align: left; }
.feat div { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 14px; }
.feat .ic { color: var(--a1); }
.chat-pane { height: 100%; display: flex; flex-direction: column; position: relative; opacity: 0; transform: translateX(14px); transition: opacity .3s var(--ease), transform .35s var(--ease); }
.chat-pane.in { opacity: 1; transform: none; }
.chat-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); min-height: 64px; z-index: 3; }
.chat-head .back { display: none; }
.ch-who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; cursor: pointer; padding: 4px 8px; border-radius: 14px; transition: background .2s; }
.ch-who:hover { background: var(--hover); }
.ch-who > div:last-child { min-width: 0; }
.ch-title { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.e2e { color: var(--green); display: inline-flex; opacity: .85; }
.ch-status { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-status .on { color: var(--a2); }
.ch-actions { display: flex; gap: 2px; }
.call-bar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: color-mix(in srgb, var(--green) 12%, transparent); border-bottom: 1px solid var(--line); font-size: 14px; animation: rise .3s var(--ease); }
.cb-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); animation: pulse 1s infinite; }
.cb-text { flex: 1; }
.scroll-wrap { flex: 1; min-height: 0; position: relative; }
.scroller { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }
.msgs { display: flex; flex-direction: column; padding: 14px clamp(10px, 4%, 48px) 10px; min-height: 100%; justify-content: flex-end; max-width: 980px; margin: 0 auto; }
.to-bottom { position: absolute; right: 18px; bottom: 14px; width: 46px; height: 46px; border-radius: 50%; background: var(--panel-solid); box-shadow: var(--shadow); color: var(--text); display: grid; place-items: center; transition: transform .25s var(--spring), opacity .2s; z-index: 4; border: 1px solid var(--line); }
.to-bottom .ic { transform: rotate(-90deg); }
.to-bottom.hidden { display: grid !important; transform: scale(0); opacity: 0; pointer-events: none; }
.tb-badge { position: absolute; top: -6px; right: -4px; background: var(--grad); color: #fff; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; border-radius: 10px; display: grid; place-items: center; padding: 0 5px; }
.drop-zone { position: absolute; inset: 10px; border-radius: 20px; border: 2px dashed var(--a1); background: color-mix(in srgb, var(--a1) 14%, var(--panel)); display: none; place-items: center; text-align: center; z-index: 10; font-weight: 600; color: var(--a1); backdrop-filter: blur(6px); }
.chat-pane.dragging .drop-zone { display: grid; animation: rise .2s; }
.load-more { text-align: center; padding: 10px; color: var(--muted); }
.chat-start { text-align: center; font-size: 12.5px; padding: 8px 20px 14px; display: flex; gap: 6px; justify-content: center; align-items: center; }
.chat-hello { margin: auto auto 20px; text-align: center; padding: 26px 24px; border-radius: 24px; max-width: 360px; display: grid; justify-items: center; gap: 4px; animation: rise .5s var(--ease); }
.chat-hello h3 { margin: 10px 0 0; }
.hello-stickers { display: flex; gap: 8px; margin-top: 10px; }
.hello-stickers button { font-size: 30px; width: 58px; height: 58px; border-radius: 18px; background: var(--hover); transition: transform .2s var(--spring); }
.hello-stickers button:hover { transform: scale(1.15) rotate(-6deg); }
.day-sep { display: flex; justify-content: center; margin: 12px 0 8px; position: sticky; top: 6px; z-index: 2; pointer-events: none; }
.day-sep span { font-size: 12.5px; font-weight: 600; padding: 4px 12px; border-radius: 12px; background: color-mix(in srgb, var(--panel-solid) 80%, transparent); backdrop-filter: blur(10px); border: 1px solid var(--line); color: var(--muted); }
.sys-msg { display: flex; justify-content: center; margin: 8px 0; }
.sys-msg span { font-size: 13px; color: var(--muted); padding: 5px 13px; border-radius: 14px; background: var(--hover); text-align: center; }
.sys-msg.call span { cursor: pointer; }
.sys-msg.call span:hover { background: var(--line2); }
.trim-note { align-self: center; font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: 12px; background: color-mix(in srgb, var(--warn) 10%, transparent); margin-bottom: 8px; }

/* пузыри */
.msg { display: flex; align-items: flex-end; gap: 8px; margin-top: 2px; max-width: 100%; position: relative; }
.msg.first { margin-top: 10px; }
.msg.out { justify-content: flex-end; }
.msg-av { width: 34px; flex: none; visibility: hidden; }
.msg.last .msg-av { visibility: visible; }
.bubble { max-width: min(560px, 78%); padding: 7px 11px 7px; border-radius: 20px; background: var(--in); position: relative; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); word-wrap: break-word; overflow-wrap: anywhere; transition: transform .15s; }
[data-theme="light"] .bubble { box-shadow: 0 1px 3px rgba(20, 30, 70, .1); }
.msg.out .bubble { background: var(--out); color: var(--out-text); }
.msg.in.last .bubble { border-bottom-left-radius: 6px; }
.msg.out.last .bubble { border-bottom-right-radius: 6px; }
.msg.in:not(.first) .bubble { border-top-left-radius: 8px; }
.msg.out:not(.first) .bubble { border-top-right-radius: 8px; }
.msg.in:not(.last) .bubble { border-bottom-left-radius: 8px; }
.msg.out:not(.last) .bubble { border-bottom-right-radius: 8px; }
.msg.appear .bubble { animation: msgIn .35s var(--spring) both; }
.msg.out.appear .bubble { transform-origin: bottom right; }
.msg.in.appear .bubble { transform-origin: bottom left; }
@keyframes msgIn { from { opacity: 0; transform: translateY(10px) scale(.92); } }
.msg.vanish { animation: vanish .22s var(--ease) forwards; }
@keyframes vanish { to { opacity: 0; transform: scale(.85); height: 0; margin: 0; } }
.msg.flash .bubble { animation: flash 1.2s var(--ease); }
@keyframes flash { 30% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--a2) 60%, transparent); transform: scale(1.02); } }
.sender { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.fwd { font-size: 12.5px; opacity: .8; margin-bottom: 3px; display: flex; align-items: center; gap: 4px; }
.reply-q { border-left: 3px solid var(--a2); padding: 3px 9px; margin: 2px 0 5px; border-radius: 6px 10px 10px 6px; background: rgba(127, 127, 160, .12); font-size: 13.5px; cursor: pointer; display: grid; max-width: 100%; }
.msg.out .reply-q { border-color: rgba(255, 255, 255, .8); background: rgba(255, 255, 255, .14); }
.reply-q b { font-size: 13px; color: var(--a2); }
.msg.out .reply-q b { color: #fff; }
.reply-q span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .85; }
.text { white-space: pre-wrap; line-height: 1.4; }
.text .meta { float: right; margin: 6px 0 -4px 12px; }
.text.tight { min-height: 0; }
.text.broken { font-style: italic; opacity: .7; }
.text.big-emoji { font-size: 46px; line-height: 1.15; }
.msg.emoji-only .bubble { background: none !important; box-shadow: none; padding: 0; }
.msg.emoji-only .meta { color: var(--muted) !important; background: var(--hover); padding: 1px 6px; border-radius: 9px; }
.meta { font-size: 11.5px; display: inline-flex; align-items: center; gap: 3px; color: var(--muted); white-space: nowrap; user-select: none; position: relative; top: 2px; }
.msg.out .meta { color: rgba(255, 255, 255, .78); }
.msg.out .ticks { color: rgba(255, 255, 255, .78); }
.msg.out .ticks.read { color: #fff; }
.edited { font-style: italic; }
.text code { font: 13px ui-monospace, Consolas, monospace; background: rgba(127, 127, 160, .2); padding: 1px 5px; border-radius: 5px; }
.text pre { font: 13px ui-monospace, Consolas, monospace; background: rgba(0, 0, 0, .25); padding: 8px 10px; border-radius: 10px; overflow-x: auto; margin: 4px 0; white-space: pre; }
.spoiler { background: currentColor; border-radius: 4px; cursor: pointer; transition: background .3s; }
.spoiler:hover { background: transparent; }
.msg.out .text a { color: #fff; }
.retry { width: 26px; height: 26px; border-radius: 50%; background: var(--red); color: #fff; font-weight: 800; align-self: center; flex: none; order: -1; animation: pop .3s var(--spring); }
.reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.reacts.pop .react { animation: pop .35s var(--spring); }
.react { height: 28px; padding: 0 8px; border-radius: 14px; background: rgba(127, 127, 160, .16); display: inline-flex; align-items: center; gap: 4px; font-size: 15px; transition: transform .15s var(--spring); }
.react span { font-size: 12.5px; font-weight: 700; }
.react:hover { transform: scale(1.08); }
.react.mine { background: color-mix(in srgb, var(--a2) 35%, transparent); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--a2) 80%, transparent); }
.msg.out .react { background: rgba(255, 255, 255, .18); }
.msg.out .react.mine { background: rgba(255, 255, 255, .34); box-shadow: inset 0 0 0 1.5px #fff; }

/* медиа в пузыре */
.bubble.media-only { padding: 3px; }
.bubble:has(.media) { padding: 3px; }
.bubble:has(.media) .text { padding: 4px 8px 4px; }
.bubble:has(.media) .sender, .bubble:has(.media) .fwd, .bubble:has(.media) .reply-q { margin-left: 8px; margin-right: 8px; margin-top: 4px; }
.bubble:has(.media) .reacts { padding: 0 6px 4px; }
.media { position: relative; border-radius: 17px; overflow: hidden; max-width: 100%; cursor: pointer; background: rgba(127, 127, 160, .15); min-width: 140px; max-height: 420px; }
.media .thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(14px); transform: scale(1.15); }
.media .full { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s; }
.media .full.ready { opacity: 1; }
.media:hover .full { transform: scale(1.015); transition: transform .4s var(--ease), opacity .35s; }
.play-ic { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px; border-radius: 50%; background: rgba(0, 0, 0, .45); backdrop-filter: blur(6px); color: #fff; display: grid; place-items: center; transition: transform .2s var(--spring); }
.media:hover .play-ic { transform: scale(1.1); }
.dur { position: absolute; left: 8px; top: 8px; background: rgba(0, 0, 0, .5); color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 10px; display: flex; align-items: center; gap: 3px; backdrop-filter: blur(6px); z-index: 2; }
.meta-over { position: absolute; right: 9px; bottom: 9px; z-index: 2; }
.meta-over .meta { background: rgba(0, 0, 0, .45); color: #fff !important; padding: 2px 8px; border-radius: 10px; backdrop-filter: blur(6px); top: 0; }
.meta-over .ticks { color: #fff !important; }
.media-dl { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgba(0, 0, 0, .5); color: #fff; border-radius: 26px; padding: 10px 16px; display: flex; gap: 6px; align-items: center; backdrop-filter: blur(8px); font-weight: 600; font-size: 13px; transition: transform .2s; }
.media-dl:hover { transform: translate(-50%, -50%) scale(1.06); }
.media-dl.over { font-size: 12px; text-align: center; width: 80%; }
.pring { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px; border-radius: 50%; background: rgba(0, 0, 0, .5); backdrop-filter: blur(6px); display: grid; place-items: center; color: #fff; z-index: 3; }
.pring svg { position: absolute; inset: 4px; transform: rotate(-90deg); }
.pring circle { fill: none; stroke-width: 3.5; }
.pring .bg { stroke: rgba(255, 255, 255, .2); }
.pring .fg { stroke: #fff; stroke-dasharray: 113; stroke-linecap: round; transition: stroke-dashoffset .3s; }
.pring .pct { font-size: 11px; font-weight: 700; text-align: center; line-height: 1.1; max-width: 52px; }
.file-ic .pring, .voice .pring { position: static; margin: 0; width: 46px; height: 46px; }
.voice .pring { position: absolute; left: 6px; top: 50%; margin-top: -23px; }

/* голосовые */
.voice { display: flex; align-items: center; gap: 10px; min-width: 230px; padding: 3px 0 2px; position: relative; }
.vplay { width: 44px; height: 44px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; flex: none; transition: transform .2s var(--spring); }
.msg.out .vplay { background: rgba(255, 255, 255, .95); color: var(--a1); }
.vplay:hover { transform: scale(1.08); }
.vmid { flex: 1; min-width: 0; }
.wave { display: flex; align-items: center; gap: 2px; height: 28px; cursor: pointer; }
.wave i { flex: 1; min-width: 2px; max-width: 4px; border-radius: 2px; background: currentColor; opacity: .35; transition: opacity .15s; }
.wave i.on { opacity: 1; }
.vtime { font-size: 12px; opacity: .75; }

/* файлы */
.file { display: flex; align-items: center; gap: 11px; padding: 4px 2px; cursor: pointer; min-width: 220px; }
.file-ic { width: 48px; height: 48px; border-radius: 14px; background: var(--grad); color: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 800; flex: none; position: relative; transition: transform .2s; }
.msg.out .file-ic { background: rgba(255, 255, 255, .22); }
.file:hover .file-ic { transform: scale(1.05); }
.file-info { min-width: 0; }
.file-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; }
.msg.out .file-size { color: rgba(255, 255, 255, .75); }

/* ═══ поле ввода ═══ */
.composer { padding: 8px 14px 14px; position: relative; z-index: 3; max-width: 1010px; margin: 0 auto; width: 100%; }
.ctx-bar { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; margin: 0 58px 6px 0; border-radius: 16px; background: var(--hover); color: var(--a2); animation: rise .25s var(--ease); }
.ctx-body { flex: 1; min-width: 0; display: grid; border-left: 3px solid var(--a2); padding-left: 10px; }
.ctx-body b { font-size: 13px; }
.ctx-body span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13.5px; }
.comp-row { display: flex; align-items: flex-end; gap: 8px; }
.comp-box { flex: 1; display: flex; align-items: flex-end; border-radius: 24px; padding: 3px 4px; min-height: 50px; transition: box-shadow .25s, border-color .25s; }
.comp-box:focus-within { border-color: color-mix(in srgb, var(--a1) 50%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--a1) 12%, transparent); }
.comp-box .icon-btn { border-radius: 50%; margin-bottom: 2px; }
.input { flex: 1; resize: none; border: 0; outline: none; background: transparent; padding: 12px 6px; max-height: 180px; line-height: 1.4; min-width: 0; }
.send-btn { width: 50px; height: 50px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; flex: none; position: relative; box-shadow: 0 6px 20px color-mix(in srgb, var(--a1) 40%, transparent); transition: transform .2s var(--spring), box-shadow .2s; }
.send-btn:hover { transform: scale(1.06); }
.send-btn:active { transform: scale(.92); }
.send-btn > span { position: absolute; transition: transform .3s var(--spring), opacity .2s; }
.send-btn .i-mic { transform: scale(0) rotate(-90deg); opacity: 0; }
.send-btn.mic .i-send { transform: scale(0) rotate(90deg); opacity: 0; }
.send-btn.mic .i-mic { transform: none; opacity: 1; }
.composer.recording .comp-box { display: none; }
.rec-bar { flex: 1; display: flex; align-items: center; gap: 12px; height: 50px; padding: 0 8px; border-radius: 24px; background: var(--hover); animation: rise .2s; }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--red); transition: transform .1s; box-shadow: 0 0 12px var(--red); }
.rec-time { font-variant-numeric: tabular-nums; font-weight: 600; }
.rec-hint { font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ═══ меню ═══ */
.ctx-menu { position: fixed; z-index: 1000; min-width: 210px; border-radius: 18px; padding: 6px; box-shadow: var(--shadow); opacity: 0; transform: scale(.92); transform-origin: top left; transition: opacity .15s, transform .2s var(--spring); background: color-mix(in srgb, var(--panel-solid) 88%, transparent); }
.ctx-menu.show { opacity: 1; transform: none; }
.ctx-menu.out { opacity: 0; transform: scale(.95); }
.ctx-menu > button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border-radius: 12px; text-align: left; font-size: 14.5px; transition: background .15s; }
.ctx-menu > button:hover { background: var(--hover); }
.ctx-menu > button .ic { color: var(--muted); }
.ctx-menu > button.danger, .ctx-menu > button.danger .ic { color: var(--red); }
.ctx-reacts { display: flex; gap: 2px; padding: 2px 2px 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.ctx-reacts button { width: 34px; height: 34px; border-radius: 50%; font-size: 21px; display: grid; place-items: center; transition: transform .15s var(--spring), background .15s; }
.ctx-reacts button:hover { transform: scale(1.3); background: var(--hover); }
.ctx-reacts .more { color: var(--muted); background: var(--hover); }
.emoji-pop { position: fixed; z-index: 1001; width: 340px; height: 360px; border-radius: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; opacity: 0; transform: translateY(8px) scale(.97); transition: opacity .15s, transform .25s var(--spring); background: color-mix(in srgb, var(--panel-solid) 92%, transparent); }
.emoji-pop.show { opacity: 1; transform: none; }
.ep-tabs { display: flex; padding: 6px; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; flex: none; }
.ep-tabs button { width: 34px; height: 32px; border-radius: 10px; font-size: 18px; flex: none; opacity: .6; transition: all .15s; }
.ep-tabs button.on { background: var(--hover); opacity: 1; }
.ep-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(8, 1fr); padding: 6px; align-content: start; }
.ep-grid button { height: 38px; font-size: 24px; border-radius: 10px; transition: transform .12s var(--spring), background .12s; }
.ep-grid button:hover { background: var(--hover); transform: scale(1.2); }
.ep-empty { grid-column: 1 / -1; padding: 30px; text-align: center; }

/* ═══ модалки ═══ */
.modal-wrap { position: fixed; inset: 0; z-index: 900; background: rgba(5, 6, 14, .5); display: grid; place-items: center; padding: 16px; opacity: 0; transition: opacity .2s; backdrop-filter: blur(4px); }
.modal-wrap.show { opacity: 1; }
.modal { width: min(460px, 100%); max-height: min(720px, 92vh); display: flex; flex-direction: column; border-radius: 24px; box-shadow: var(--shadow); transform: translateY(20px) scale(.96); transition: transform .3s var(--spring); background: color-mix(in srgb, var(--panel-solid) 92%, transparent); }
.modal-wrap.show .modal { transform: none; }
.modal.tall { height: min(640px, 92vh); }
.modal-head { display: flex; align-items: center; padding: 14px 14px 6px 20px; }
.modal-head h3 { flex: 1; margin: 0; font-size: 18px; }
.modal-body { padding: 6px 20px 12px; overflow-y: auto; flex: 1; min-height: 0; }
.modal-body > p { margin-top: 0; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 10px 16px 16px; }
.pick-list { display: grid; gap: 2px; margin: 4px -8px 0; }
.pick-list .chat-item { padding: 8px; }
.pick-wrap { display: grid; gap: 12px; }
.pick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; max-height: 340px; overflow-y: auto; }
.pick-grid.one { grid-template-columns: 1fr; }
.pick { position: relative; border-radius: 14px; overflow: hidden; background: var(--hover); aspect-ratio: 1; }
.pick-grid.one .pick { aspect-ratio: auto; max-height: 340px; }
.pick img, .pick video { width: 100%; height: 100%; object-fit: cover; display: block; }
.pick-grid.one .pick img, .pick-grid.one .pick video { object-fit: contain; max-height: 340px; }
.pick-badge { position: absolute; right: 6px; bottom: 6px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 11px; padding: 2px 7px; border-radius: 8px; }
.file-pick { aspect-ratio: auto !important; display: flex; gap: 12px; align-items: center; padding: 12px; grid-column: 1 / -1; }
.file-pick b { word-break: break-all; }
.cap-input { width: 100%; }
.switch-row { display: flex; align-items: center; gap: 12px; cursor: pointer; padding: 8px 0; }
.switch-row input { display: none; }
.switch { width: 44px; height: 26px; border-radius: 13px; background: var(--line2); position: relative; flex: none; transition: background .25s; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); transition: transform .3s var(--spring); }
.switch-row input:checked + .switch { background: var(--grad); }
.switch-row input:checked + .switch::after { transform: translateX(18px); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 16px; background: var(--active); font-size: 13.5px; cursor: pointer; animation: pop .25s var(--spring); }

/* ═══ просмотрщик ═══ */
.lightbox { position: fixed; inset: 0; z-index: 950; background: rgba(4, 5, 10, .94); display: flex; flex-direction: column; opacity: 0; transition: opacity .2s; }
.lightbox.show { opacity: 1; }
.lb-top { display: flex; align-items: center; gap: 6px; padding: 10px 14px; color: #fff; }
.lb-top .icon-btn { color: #fff; }
.lb-cap { flex: 1; display: flex; align-items: center; gap: 10px; }
.lb-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px 60px 30px; gap: 12px; }
.lb-media { max-width: 100%; max-height: 100%; min-height: 0; border-radius: 10px; object-fit: contain; transition: transform .3s var(--ease); animation: zoomIn .3s var(--spring); cursor: zoom-in; }
.lb-media.zoom { transform: scale(2); cursor: zoom-out; }
@keyframes zoomIn { from { transform: scale(.9); opacity: 0; } }
.lb-text { color: #fff; max-width: 700px; text-align: center; }
.lb-nav { position: absolute; top: 50%; width: 50px; height: 80px; margin-top: -40px; color: #fff; font-size: 44px; opacity: .5; transition: opacity .2s; }
.lb-nav:hover { opacity: 1; }
.lb-nav.prev { left: 6px; } .lb-nav.next { right: 6px; }

/* ═══ боковые панели ═══ */
.drawer { position: fixed; top: 12px; bottom: 12px; width: min(400px, calc(100vw - 24px)); z-index: 800; border-radius: 24px; background: color-mix(in srgb, var(--panel-solid) 94%, transparent); backdrop-filter: blur(24px); border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .4s var(--ease), opacity .3s; opacity: 0; pointer-events: none; overflow: hidden; }
.drawer.right { right: 12px; transform: translateX(30px); }
.drawer.left { left: 12px; transform: translateX(-30px); }
.drawer.open { transform: none; opacity: 1; pointer-events: auto; }
.shade { position: fixed; inset: 0; z-index: 700; background: rgba(5, 6, 14, .35); opacity: 0; pointer-events: none; transition: opacity .3s; }
.shade.show { opacity: 1; pointer-events: auto; }
.dr { height: 100%; display: flex; flex-direction: column; }
.dr-head { display: flex; align-items: center; gap: 8px; padding: 12px; }
.dr-head h3 { margin: 0; font-size: 18px; }
.dr-body { flex: 1; overflow-y: auto; padding: 0 14px 18px; }
.hero { display: grid; justify-items: center; text-align: center; padding: 6px 0 16px; gap: 2px; }
.hero h2 { margin: 12px 0 0; font-size: 22px; }
.hero-av { box-shadow: 0 10px 40px color-mix(in srgb, var(--a1) 35%, transparent); animation: pop .5s var(--spring); }
.clickable { cursor: pointer; position: relative; border-radius: 50%; }
.av-edit { position: absolute; right: 2px; bottom: 2px; width: 34px; height: 34px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; border: 3px solid var(--panel-solid); }
.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.quick-actions button { display: grid; justify-items: center; gap: 4px; padding: 12px 4px 10px; border-radius: 16px; background: var(--hover); font-size: 12.5px; color: var(--a2); transition: transform .2s var(--spring), background .2s; }
.quick-actions button span { color: var(--text); }
.quick-actions button:hover { transform: translateY(-2px); background: var(--line2); }
.card { background: var(--hover); border-radius: 18px; padding: 14px; margin-bottom: 12px; display: grid; gap: 8px; }
.card .field { margin: 4px 0; }
.card-title { font-weight: 700; display: flex; align-items: center; gap: 6px; font-size: 14.5px; }
.card-title .ic { color: var(--a1); }
.kv { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; }
.safety { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; font: 600 14px ui-monospace, Consolas, monospace; text-align: center; letter-spacing: 1px; }
.safety span { background: var(--hover); padding: 6px 0; border-radius: 8px; }
.fp { font: 12px ui-monospace, Consolas, monospace; color: var(--muted); text-align: right; }
.bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--grad); border-radius: 4px; transition: width .5s var(--ease); }
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 3px; background: var(--line2); outline: none; margin: 8px 0 2px; }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--grad); border: 3px solid #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .35); cursor: grab; transition: transform .2s var(--spring); }
.range::-webkit-slider-thumb:active { transform: scale(1.25); }
.range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--a1); border: 3px solid #fff; }
.range-lbl { display: flex; justify-content: space-between; }
.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.mg { aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--line); cursor: pointer; position: relative; }
.mg img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.mg:hover img { transform: scale(1.08); }
.mg-v { position: absolute; right: 4px; bottom: 4px; color: #fff; background: rgba(0, 0, 0, .5); border-radius: 50%; width: 24px; height: 24px; display: grid; place-items: center; }
.danger-zone { background: color-mix(in srgb, var(--red) 6%, transparent); }
.accents { display: flex; gap: 10px; }
.accents button { width: 34px; height: 34px; border-radius: 50%; transition: transform .2s var(--spring); }
.accents button.on { box-shadow: 0 0 0 3px var(--panel-solid), 0 0 0 5px var(--text); transform: scale(1.06); }
.device { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.device .ic { color: var(--a1); }
.store-row { display: flex; align-items: center; gap: 12px; cursor: pointer; padding: 6px; border-radius: 12px; }
.store-row:hover { background: var(--hover); }
.store-row .bar { margin-top: 5px; height: 6px; }

/* ═══ уведомления ═══ */
.toasts { position: fixed; left: 50%; top: 18px; transform: translateX(-50%); z-index: 2000; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { padding: 11px 18px; border-radius: 16px; background: color-mix(in srgb, var(--panel-solid) 94%, transparent); backdrop-filter: blur(16px); box-shadow: var(--shadow); border: 1px solid var(--line); font-size: 14px; max-width: min(520px, 92vw); opacity: 0; transform: translateY(-14px) scale(.95); transition: all .35s var(--spring); }
.toast.show { opacity: 1; transform: none; }
.toast.ok { border-left: 4px solid var(--green); }
.toast.warn { border-left: 4px solid var(--warn); }
.toast.error { border-left: 4px solid var(--red); }

/* ═══ звонки ═══ */
.call-overlay { position: fixed; inset: 0; z-index: 1500; background: radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--a1) 35%, #07080f), #05060c 70%); display: flex; flex-direction: column; color: #fff; animation: callIn .4s var(--ease); }
@keyframes callIn { from { opacity: 0; transform: scale(1.04); } }
.call-top { text-align: center; padding: 22px 16px 8px; display: grid; gap: 3px; justify-items: center; }
.call-title { font-size: 22px; font-weight: 700; }
.call-status { opacity: .8; font-variant-numeric: tabular-nums; }
.call-code { font-size: 15px; background: rgba(255, 255, 255, .1); padding: 4px 12px; border-radius: 14px; display: inline-flex; gap: 6px; align-items: center; margin-top: 4px; cursor: help; letter-spacing: 2px; }
.call-code.dim { font-size: 12.5px; letter-spacing: 0; opacity: .7; }
.call-grid { flex: 1; min-height: 0; display: grid; gap: 10px; padding: 10px 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); grid-auto-rows: 1fr; position: relative; }
.call-grid.solo { grid-template-columns: 1fr; }
.tile { position: relative; border-radius: 22px; overflow: hidden; background: rgba(255, 255, 255, .06); display: grid; place-items: center; min-height: 160px; transition: box-shadow .2s, transform .3s var(--ease); animation: pop .4s var(--spring); }
.tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s; }
.tile.has-video video { opacity: 1; }
.tile.screen video { object-fit: contain; background: #000; }
.tile.mirror video { transform: scaleX(-1); }
.tile.has-video .tile-av { opacity: 0; }
.tile-av { display: grid; justify-items: center; gap: 14px; transition: opacity .3s; }
.tile-wait { opacity: .8; }
.tile-name { position: absolute; left: 12px; bottom: 10px; display: flex; align-items: center; gap: 6px; background: rgba(0, 0, 0, .4); backdrop-filter: blur(8px); padding: 4px 10px; border-radius: 12px; font-size: 13.5px; }
.mic-off { color: #ff6b6b; display: inline-flex; }
.tile.speaking { box-shadow: 0 0 0 3px var(--green), 0 0 30px color-mix(in srgb, var(--green) 50%, transparent); }
.tile.speaking .avatar { animation: speak .6s ease-in-out infinite alternate; }
@keyframes speak { to { transform: scale(1.06); box-shadow: 0 0 0 10px rgba(34, 197, 94, .25); } }
.tile.focus { position: fixed; inset: 0; z-index: 5; border-radius: 0; }
.tile.waiting { background: transparent; }
.tile.self-pip { position: absolute; right: 26px; bottom: 16px; width: clamp(120px, 22vw, 240px); aspect-ratio: 3 / 4; min-height: 0; z-index: 3; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); border: 2px solid rgba(255, 255, 255, .15); }
@media (min-aspect-ratio: 1/1) { .tile.self-pip { aspect-ratio: 16 / 10; } }
.tile.self-pip .avatar { width: 56px !important; height: 56px !important; font-size: 20px !important; }
.tile.self-pip .tile-name { font-size: 12px; left: 8px; bottom: 6px; }
.call-controls { display: flex; justify-content: center; gap: 14px; padding: 16px 16px max(22px, env(safe-area-inset-bottom)); }
.cbtn { width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; color: #fff; transition: transform .2s var(--spring), background .2s; flex: none; }
.cbtn:hover { transform: scale(1.08); }
.cbtn:active { transform: scale(.94); }
.cbtn.glass { background: rgba(255, 255, 255, .14); backdrop-filter: blur(10px); }
.cbtn.glass.on { background: #fff; color: #111; }
.cbtn.red { background: var(--red); box-shadow: 0 8px 26px rgba(239, 68, 68, .45); }
.cbtn.green { background: var(--green); box-shadow: 0 8px 26px rgba(34, 197, 94, .45); animation: ringBtn 1.4s ease-in-out infinite; }
@keyframes ringBtn { 50% { transform: scale(1.08) rotate(-8deg); } }
.cbtn.small { width: 38px; height: 38px; animation: none; }
.ring-wrap { position: fixed; inset: 0; z-index: 1600; display: grid; place-items: center; background: rgba(5, 6, 14, .55); backdrop-filter: blur(10px); animation: rise .3s var(--ease); }
.ring-card { width: min(360px, 92vw); text-align: center; padding: 34px 24px 28px; border-radius: 30px; background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--a1) 45%, #10121e), #0d0f1a 75%); color: #fff; box-shadow: var(--shadow); display: grid; justify-items: center; gap: 6px; animation: pop .45s var(--spring); }
.ring-pulse { border-radius: 50%; position: relative; }
.ring-pulse::before, .ring-pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--a2) 70%, #fff); animation: ripple 2s ease-out infinite; }
.ring-pulse::after { animation-delay: 1s; }
@keyframes ripple { to { transform: scale(1.8); opacity: 0; } }
.ring-title { font-size: 22px; font-weight: 700; margin-top: 18px; }
.ring-sub { opacity: .75; font-size: 14px; }
.ring-actions { display: flex; gap: 22px; margin-top: 22px; }
.call-pill { position: fixed; z-index: 1400; left: 50%; top: 14px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border-radius: 26px; background: color-mix(in srgb, var(--green) 85%, #000); color: #fff; box-shadow: var(--shadow); animation: rise .3s var(--spring); }
.pill-dot { width: 9px; height: 9px; border-radius: 50%; background: #fff; animation: pulse 1s infinite; }
.pill-text { display: grid; line-height: 1.15; cursor: pointer; padding-right: 6px; font-size: 12.5px; }
.pill-text b { font-size: 14px; }

/* ═══ мобильные ═══ */
@media (max-width: 799px) {
  .app { grid-template-columns: 1fr; padding: 0; gap: 0; }
  .sidebar, main.chat { border-radius: 0; border: 0; grid-area: 1 / 1; }
  main.chat { transform: translateX(100%); transition: transform .35s var(--ease); z-index: 5; background: var(--bg); }
  body.chat-open main.chat { transform: none; }
  body.chat-open .sidebar { transform: translateX(-25%); opacity: .4; }
  .sidebar { transition: transform .35s var(--ease), opacity .35s; padding-top: env(safe-area-inset-top); }
  .chat-head { padding-top: max(10px, env(safe-area-inset-top)); }
  .chat-head .back { display: inline-grid; }
  .ch-actions .icon-btn[title="Поиск по чату"] { display: none; }
  .composer { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .bubble { max-width: 85%; }
  .drawer { top: 0; bottom: 0; width: 100vw; border-radius: 0; }
  .drawer.left { left: 0; } .drawer.right { right: 0; }
  .lb-stage { padding: 10px; }
  .cbtn { width: 56px; height: 56px; }
  .call-controls { gap: 10px; }
  .ctx-bar { margin-right: 0; }
  .empty { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ═══════════════════ Kros 2.0 — монохром ═══════════════════ */
:root, [data-theme="dark"] {
  --a1: #f2f2ef; --a2: #bdbdb8; --grad: #f2f2ef;
  --bg: #0c0c0c; --panel: #131313; --panel-solid: #161616;
  --line: rgba(255,255,255,.08); --line2: rgba(255,255,255,.16);
  --text: #f2f2ef; --muted: #8a8a86; --hover: rgba(255,255,255,.05); --active: rgba(255,255,255,.09);
  --in: #1b1b1b; --out: #f2f2ef; --out-text: #0c0c0c; --input: rgba(255,255,255,.05);
  --shadow: 0 12px 40px rgba(0,0,0,.55); --r: 14px; --acc-text: #0c0c0c;
  --green: #e8e8e4; --red: #ff5a4e; --warn: #d9c27a;
  color-scheme: dark;
}
[data-theme="oled"] { --bg: #000; --panel: #070707; --panel-solid: #0a0a0a; --in: #141414; --line: rgba(255,255,255,.09); }
[data-theme="light"] {
  --a1: #111; --a2: #444; --grad: #111;
  --bg: #f4f4f2; --panel: #fbfbfa; --panel-solid: #ffffff;
  --line: rgba(0,0,0,.09); --line2: rgba(0,0,0,.18);
  --text: #111; --muted: #6d6d69; --hover: rgba(0,0,0,.045); --active: rgba(0,0,0,.075);
  --in: #ffffff; --out: #111; --out-text: #f4f4f2; --input: rgba(0,0,0,.045); --acc-text: #f4f4f2;
  --shadow: 0 12px 36px rgba(0,0,0,.12); --green: #111; --red: #d0342c;
  color-scheme: light;
}
body { font-family: Onest, "Segoe UI Variable", "Segoe UI", system-ui, sans-serif; letter-spacing: -.005em; }
code, .fp, .inv-code, .ci-time, .meta, .cb-text, .circ-time, .stat b { font-family: "JetBrains Mono", ui-monospace, Consolas, monospace; }
h1, h2, h3, .wordmark, .ch-title, .card-title, .modal-head h3, .dr-head h3 { font-family: Unbounded, Onest, sans-serif; letter-spacing: -.01em; font-weight: 600; }
#bg { display: none; }
a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
::selection { background: var(--text); color: var(--bg); }
.glass { background: var(--panel); backdrop-filter: none; -webkit-backdrop-filter: none; }
.btn.primary, .send-btn, .badge:not(.muted), .ftab.on { background: var(--text) !important; color: var(--acc-text) !important; box-shadow: none !important; }
.btn.primary:hover { filter: none; opacity: .88; }
.btn.danger, .danger { color: var(--red); }
.msg.out .bubble { background: var(--out) !important; color: var(--out-text) !important; }
.msg.out .bubble .meta, .msg.out .bubble .ticks { color: color-mix(in srgb, var(--out-text) 55%, transparent) !important; }
.msg.out .bubble a { color: var(--out-text); }
.msg.in .bubble { background: var(--in); border: 1px solid var(--line); }
.msg.media-only .bubble, .bubble.media-only { background: transparent !important; border: 0 !important; }
.chat-item.active { background: var(--active); box-shadow: inset 2px 0 0 var(--text); }
.online-dot { background: var(--text) !important; border-color: var(--panel-solid) !important; }
.sidebar, .chat-head, .composer, .drawer, .modal, .ctx-menu, .emoji-pop { background: var(--panel-solid) !important; backdrop-filter: none !important; }
.sidebar { border-right: 1px solid var(--line); }
.side-foot { font-size: 11px; }
:root[data-density="compact"] .chat-item { padding-top: 6px; padding-bottom: 6px; }
:root[data-density="compact"] .msg { margin-top: 1px; }
:root[data-density="airy"] .chat-item { padding-top: 13px; padding-bottom: 13px; }
:root[data-density="airy"] .msg.first { margin-top: 12px; }

/* логотип и словесный знак */
.logo { display: inline-flex; flex: none; line-height: 0; }
.lg-bg { fill: var(--text); }
.lg-k { stroke: var(--bg); }
.wordmark { font-family: Unbounded, sans-serif; font-weight: 700; letter-spacing: .14em; font-size: 22px; }
.wordmark.sm { font-size: 13px; letter-spacing: .18em; }
.side-title { display: flex; align-items: center; gap: 9px; }
.boot { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; }
.boot-text { font-family: Unbounded, sans-serif; letter-spacing: .3em; font-size: 14px; color: var(--muted); }
.logo-mark { background: var(--text) !important; box-shadow: none !important; }
.logo-mark::after { color: var(--bg) !important; }

/* аватары-заглушки: шесть оттенков серого */
.avatar.ph { color: var(--text); background: #2a2a2a; font-weight: 600; display: grid; place-items: center; }
.avatar.tone-0 { background: #2b2b2b; } .avatar.tone-1 { background: #3a3a3a; } .avatar.tone-2 { background: #474744; }
.avatar.tone-3 { background: #d9d9d4; color: #111; } .avatar.tone-4 { background: #f2f2ef; color: #111; } .avatar.tone-5 { background: #1f1f1f; box-shadow: inset 0 0 0 1px var(--line2); }
[data-theme="light"] .avatar.tone-0 { background: #e2e2de; color: #111; } [data-theme="light"] .avatar.tone-1 { background: #cfcfca; color: #111; }
[data-theme="light"] .avatar.tone-2 { background: #b5b5b0; color: #111; } [data-theme="light"] .avatar.tone-5 { background: #fff; color: #111; }
[data-theme="light"] .avatar.tone-3 { background: #2b2b2b; color: #fff; } [data-theme="light"] .avatar.tone-4 { background: #111; color: #fff; }
.avatar.saved { background: var(--text) !important; color: var(--bg) !important; }

/* экран входа */
.auth { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(360px, 520px); min-height: 100dvh; height: 100dvh; overflow: auto; }
.auth-side { display: flex; flex-direction: column; justify-content: space-between; padding: 48px; border-right: 1px solid var(--line); gap: 30px; }
.auth-brand { display: flex; align-items: center; gap: 14px; }
.auth-claim { font-family: Unbounded, sans-serif; font-size: clamp(28px, 4vw, 50px); line-height: 1.08; font-weight: 600; }
.auth-claim .dim { color: var(--muted); }
.auth-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; color: var(--muted); }
.auth-points li { display: flex; gap: 10px; align-items: center; }
.auth-foot { font: 11px "JetBrains Mono", monospace; color: var(--muted); letter-spacing: .06em; }
.auth-main { display: grid; place-items: center; padding: 28px; }
.auth-main .auth-card { width: 100%; max-width: 420px; background: transparent; border: 0; box-shadow: none; }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth-side { border-right: 0; border-bottom: 1px solid var(--line); padding: 26px; } .auth-points, .auth-foot { display: none; } .auth-claim { font-size: 26px; } }

/* папки-вкладки */
.folder-tabs { display: flex; gap: 6px; padding: 2px 12px 8px; overflow-x: auto; scrollbar-width: none; flex: none; }
.folder-tabs::-webkit-scrollbar { display: none; }
.ftab { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line2); font-size: 13px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; color: var(--muted); }
.ftab:hover { color: var(--text); }
.ftab.on { border-color: var(--text); }
.ftab i { font: 600 11px "JetBrains Mono", monospace; font-style: normal; opacity: .8; }
.ftab.add { padding: 6px 9px; }
.chat-item.hit mark { background: var(--text); color: var(--bg); border-radius: 3px; padding: 0 2px; }
.list-sec { padding: 12px 16px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }

/* настройки */
.nav-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 6px; border-radius: 10px; text-align: left; }
.nav-row:hover { background: var(--hover); }
.nav-row small { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }
.nav-row .chev { font-style: normal; color: var(--muted); font-size: 20px; }
.card.nav { padding: 6px 10px; }
.themes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.theme-pick { display: grid; gap: 6px; justify-items: center; padding: 8px 4px; border-radius: 12px; border: 1px solid var(--line); font-size: 12px; }
.theme-pick.on { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.theme-pick i { display: flex; width: 100%; height: 40px; border-radius: 8px; padding: 7px; gap: 4px; flex-direction: column; justify-content: flex-end; }
.theme-pick i b { height: 8px; border-radius: 4px; width: 60%; }
.theme-pick i b + b { align-self: flex-end; }
.th-dark i { background: #0c0c0c; } .th-dark i b { background: #2a2a2a; } .th-dark i b + b { background: #f2f2ef; }
.th-oled i { background: #000; } .th-oled i b { background: #1a1a1a; } .th-oled i b + b { background: #fff; }
.th-light i { background: #f4f4f2; border: 1px solid #ddd; } .th-light i b { background: #fff; } .th-light i b + b { background: #111; }
.th-auto i { background: linear-gradient(90deg, #0c0c0c 50%, #f4f4f2 50%); } .th-auto i b { background: #777; }
.seg { display: flex; border: 1px solid var(--line2); border-radius: 10px; overflow: hidden; }
.seg button { flex: 1; padding: 8px 6px; font-size: 13px; }
.seg button.on { background: var(--text); color: var(--bg); }
.colophon { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 18px; font: 11px "JetBrains Mono", monospace; letter-spacing: .08em; }
.st-emojis { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chip { border: 1px solid var(--line2); border-radius: 999px; padding: 5px 11px; font-size: 13px; }
.chip.on, .chip:hover { border-color: var(--text); }
.chip.on { background: var(--text); color: var(--bg); }
.st-e { width: 64px !important; text-align: center; font-size: 20px; }
.st-emoji { font-style: normal; font-size: 13px; margin-left: 2px; }
.ch-status .st { color: var(--muted); }
.me-btn { position: relative; }
.dnd-dot { position: absolute; right: -2px; bottom: -2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text); color: var(--bg); display: grid; place-items: center; border: 2px solid var(--panel-solid); font-style: normal; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.stat { border: 1px solid var(--line); border-radius: 10px; padding: 10px 6px; display: grid; justify-items: center; gap: 2px; }
.stat b { font-size: 18px; }
.stat span { font-size: 11px; color: var(--muted); text-align: center; }
.role.danger { color: var(--red); }
.user-item.banned { opacity: .55; }
.invite-fresh { border: 1px dashed var(--text) !important; }
.inv-code { display: block; font-size: 22px; letter-spacing: .08em; text-align: center; padding: 14px 4px; user-select: all; }
.inv-row { align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); }

/* шапка, закрепы, отложенные */
.pin-bar { display: flex; align-items: center; gap: 10px; padding: 6px 14px; border-bottom: 1px solid var(--line); background: var(--panel-solid); cursor: pointer; }
.pb-lines { display: flex; flex-direction: column; gap: 2px; align-self: stretch; justify-content: center; }
.pb-lines i { width: 2px; flex: 1; max-height: 10px; background: var(--line2); border-radius: 1px; }
.pb-lines i.on { background: var(--text); }
.pb-body { flex: 1; min-width: 0; display: grid; font-size: 13px; }
.pb-body b { font-size: 12px; }
.pb-body span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.sched-btn { position: relative; }
.sched-btn i { position: absolute; top: 2px; right: 2px; font: 600 10px "JetBrains Mono", monospace; background: var(--text); color: var(--bg); border-radius: 8px; padding: 0 4px; font-style: normal; }
.call-bar.room .cb-dot.off { background: var(--muted); animation: none; }
.room-ppl { display: inline-flex; margin-left: 8px; vertical-align: middle; }
.room-ppl .avatar { margin-left: -6px; border: 2px solid var(--panel-solid); }
.cb-dot { background: var(--text) !important; }
.composer.ro { padding: 10px 14px; }

/* превью ссылок */
.link-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-left: 2px solid var(--text); margin: 0 10px 6px; }
.link-bar .ctx-body { flex: 1; min-width: 0; display: grid; font-size: 13px; }
.link-bar .ctx-body span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-card { display: flex; gap: 10px; text-decoration: none !important; color: inherit !important; border-left: 2px solid currentColor; padding: 4px 10px; margin: 4px 2px 6px; max-width: 420px; }
.lc-body { flex: 1; min-width: 0; }
.lc-site { font: 600 11px "JetBrains Mono", monospace; text-transform: uppercase; letter-spacing: .06em; opacity: .7; }
.lc-title { font-weight: 600; margin: 2px 0; }
.lc-desc { font-size: 13px; opacity: .78; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.lc-img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; flex: none; }

/* опросы */
.poll { min-width: 240px; max-width: 360px; padding: 4px 2px; display: grid; gap: 6px; }
.poll-q { font-weight: 600; font-size: 15.5px; }
.poll-opt { position: relative; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; border: 1px solid color-mix(in srgb, currentColor 22%, transparent); text-align: left; overflow: hidden; }
.poll-opt:not([disabled]):hover { border-color: currentColor; }
.poll-opt.sel { border-color: currentColor; box-shadow: inset 0 0 0 1px currentColor; }
.po-check { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid currentColor; display: grid; place-items: center; flex: none; opacity: .8; }
.poll-opt.mine .po-check { background: currentColor; }
.poll-opt.mine .po-check .ic { color: var(--bg); }
.msg.out .poll-opt.mine .po-check .ic { color: var(--out); }
.po-text { flex: 1; min-width: 0; position: relative; z-index: 1; display: flex; gap: 6px; align-items: center; }
.po-who { display: inline-flex; } .po-who .avatar { margin-left: -4px; }
.po-pct { font: 600 12px "JetBrains Mono", monospace; position: relative; z-index: 1; }
.po-bar { position: absolute; left: 0; top: 0; bottom: 0; background: color-mix(in srgb, currentColor 13%, transparent); transition: width .5s var(--ease); }
.poll-opts-edit { display: grid; gap: 6px; margin: 6px 0 10px; }
.poll-foot { margin-top: 2px; }

/* видео-кружки */
.circle { position: relative; width: 240px; height: 240px; border-radius: 50%; overflow: hidden; cursor: pointer; background: #222; --p: 0; }
.circle::after { content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none; background: conic-gradient(var(--text) calc(var(--p) * 360deg), transparent 0); -webkit-mask: radial-gradient(circle, transparent 66%, #000 67.5%); mask: radial-gradient(circle, transparent 66%, #000 67.5%); opacity: .9; }
.circle-v { width: 100%; height: 100%; object-fit: cover; display: block; }
.circle-play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; background: rgba(0,0,0,.25); transition: opacity .2s; }
.circle.playing .circle-play { opacity: 0; }
.circle.loading .circle-play { animation: pulse 1s infinite alternate; }
.circle-dur { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); font: 600 11px "JetBrains Mono", monospace; background: rgba(0,0,0,.55); color: #fff; padding: 2px 7px; border-radius: 8px; }
.circle.up { opacity: .6; }
@keyframes pulse { to { opacity: .4; } }
.circ-rec { position: fixed; inset: 0; z-index: 90; background: color-mix(in srgb, var(--bg) 88%, transparent); display: grid; place-content: center; justify-items: center; gap: 16px; backdrop-filter: blur(6px); }
.circ-stage { position: relative; width: min(72vw, 360px); aspect-ratio: 1; }
.circ-prev { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; transform: scaleX(-1); background: #111; }
.circ-ring { position: absolute; inset: -8px; border-radius: 50%; --p: 0; background: conic-gradient(var(--text) calc(var(--p) * 360deg), var(--line) 0); -webkit-mask: radial-gradient(circle, transparent 69%, #000 70%); mask: radial-gradient(circle, transparent 69%, #000 70%); }
.circ-time { font-size: 18px; }
.k-circle .bubble, .k-sticker .bubble { background: transparent !important; border: 0 !important; box-shadow: none !important; }

/* стикеры */
img.sticker { width: 170px; height: 170px; object-fit: contain; display: block; }
.emoji-pop.stk .ep-grid { grid-template-columns: repeat(4, 1fr); }
.ep-grid .stk, .ep-grid .stk-add { aspect-ratio: 1; border-radius: 10px; display: grid; place-items: center; padding: 4px; }
.ep-grid .stk:hover { background: var(--hover); }
.ep-grid .stk img { width: 100%; height: 100%; object-fit: contain; }
.ep-grid .stk-add { border: 1px dashed var(--line2); color: var(--muted); }
.ep-grid .ep-empty { grid-column: 1 / -1; padding: 10px; }
.msg.post .bubble { max-width: min(560px, 92%); }
.views { display: inline-flex; gap: 3px; align-items: center; }
.sign { opacity: .8; }
