/* =========================================================
   LOSEX Messenger — Liquid Glass UI
   Жидкое стекло: преломление, спекулярные блики, анимации.
   ========================================================= */
:root {
  --glass-bg: rgba(255,255,255,0.08);
  --glass-bg-2: rgba(255,255,255,0.14);
  --glass-border: rgba(255,255,255,0.22);
  --glass-hi: rgba(255,255,255,0.5);
  --txt: #eef2f7;
  --txt-dim: #9aa6b8;
  --accent: #7c5cff;
  --accent2: #ff5ca8;
  --ok: #3fb950;
  --blur: 22px;
  --bg-solid: #0e1018;
  --radius: 22px;
  --radius-sm: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
.icon { width: 22px; height: 22px; display: inline-block; vertical-align: middle; flex: 0 0 auto; }
.icon-glass.sm { width: 34px; height: 34px; font-size: 16px; }

/* ответ / цитата */
.reply-bar { display: flex; align-items: center; gap: 10px; margin: 0 16px 6px; padding: 8px 12px; border-radius: 12px; background: rgba(255,255,255,.08); border: 1px solid var(--glass-border); }
.reply-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.reply-body strong { font-size: 12px; color: var(--accent2); }
.reply-body span { font-size: 13px; color: var(--txt-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quote { border-left: 3px solid var(--accent); padding: 2px 0 2px 8px; margin-bottom: 5px; background: rgba(255,255,255,.05); border-radius: 0 8px 8px 0; }
.quote strong { display: block; font-size: 11px; color: var(--accent2); }
.quote span { display: block; font-size: 12px; color: var(--txt-dim); max-width: 60ch; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* действия над сообщением */
.bubble { position: relative; }
.msg-actions { position: absolute; top: -14px; right: 6px; display: none; gap: 2px; background: rgba(18,20,38,.92); border: 1px solid var(--glass-border); border-radius: 10px; padding: 2px; backdrop-filter: blur(10px); z-index: 2; }
.bubble:hover .msg-actions { display: flex; }
.mini { width: 30px; height: 30px; border: none; background: transparent; color: var(--txt); cursor: pointer; border-radius: 8px; display: grid; place-items: center; }
.mini:hover { background: rgba(255,255,255,.14); }
.mini .icon { width: 16px; height: 16px; }
.tick { font-size: 10px; color: var(--txt-dim); }
.tick.read { color: #58a6ff; }
.edit-box { width: 100%; min-height: 42px; background: rgba(0,0,0,.3); color: var(--txt); border: 1px solid var(--glass-border); border-radius: 8px; padding: 6px; font-family: inherit; resize: vertical; }

/* эмодзи-пикер */
.emoji-picker { position: absolute; bottom: 72px; right: 16px; width: 304px; max-height: 210px; overflow-y: auto; display: flex; flex-wrap: wrap; gap: 4px; padding: 10px; background: rgba(18,20,38,.92); border: 1px solid var(--glass-border); border-radius: 16px; backdrop-filter: blur(16px); z-index: 5; }
.emoji-picker button { width: 34px; height: 34px; font-size: 20px; border: none; background: transparent; cursor: pointer; border-radius: 8px; }
.emoji-picker button:hover { background: rgba(255,255,255,.12); }

/* групповой чат: выбор участников */
.pick-list { display: flex; flex-direction: column; gap: 6px; max-height: 240px; overflow-y: auto; }
.pick-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--glass-border); cursor: pointer; background: rgba(255,255,255,.05); }
.pick-item.sel { background: linear-gradient(150deg, rgba(124,92,255,.35), rgba(255,92,168,.35)); border-color: var(--accent); }
.modal-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.tab { flex: 1; padding: 9px; border-radius: 10px; border: 1px solid var(--glass-border); background: rgba(255,255,255,.05); color: var(--txt); cursor: pointer; font-size: 14px; }
.tab.active { background: linear-gradient(150deg, var(--accent), var(--accent2)); border: none; }

/* светлая тема */
body.light { --txt: #14181f; --txt-dim: #5a6473; --glass-bg: rgba(255,255,255,.45); --glass-bg-2: rgba(255,255,255,.6); --glass-border: rgba(10,20,40,.12); --glass-hi: rgba(255,255,255,.8); background: #dde4f0; }
body.light .aurora { filter: saturate(1.2) brightness(1.25); opacity: .9; }
body.light .card, body.light #topnav, body.light .chat-head, body.light .composer { background: rgba(255,255,255,.5); }
body.light input, body.light textarea, body.light select { background: rgba(255,255,255,.7); color: #14181f; }
body.light .bubble.in { background: rgba(255,255,255,.7); color: #14181f; }
body.light .msg-actions, body.light .emoji-picker { background: rgba(255,255,255,.95); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #05060f;
  color: var(--txt);
  font-size: 15px; line-height: 1.5;
  font-weight: 600;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
a { color: #9db4ff; text-decoration: none; }

/* ====================== ЖИВОЙ ФОН ====================== */
.aurora {
  position: fixed; inset: -10%; z-index: 0; overflow: hidden;
  background:
    radial-gradient(120% 120% at 10% 10%, #1a0b3d 0%, transparent 55%),
    radial-gradient(120% 120% at 90% 20%, #0b2a4d 0%, transparent 55%),
    radial-gradient(140% 140% at 50% 100%, #3d0b35 0%, #05060f 60%);
  transition: transform .2s ease-out;
}
.blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .8; mix-blend-mode: screen; animation: float 18s ease-in-out infinite; }
.b1 { width: 46vmax; height: 46vmax; left: -10vmax; top: -12vmax; background: radial-gradient(circle, #7c5cff, transparent 65%); }
.b2 { width: 40vmax; height: 40vmax; right: -12vmax; top: 5vmax; background: radial-gradient(circle, #ff5ca8, transparent 65%); animation-delay: -4s; }
.b3 { width: 38vmax; height: 38vmax; left: 20vmax; bottom: -16vmax; background: radial-gradient(circle, #18c8ff, transparent 65%); animation-delay: -8s; }
.b4 { width: 30vmax; height: 30vmax; right: 8vmax; bottom: -8vmax; background: radial-gradient(circle, #42ffb0, transparent 65%); animation-delay: -12s; }
.b5 { width: 26vmax; height: 26vmax; left: 40%; top: 25%; background: radial-gradient(circle, #ffd166, transparent 65%); animation-delay: -15s; opacity:.5; }
@keyframes float { 0%,100%{transform:translate(0,0) scale(1);} 33%{transform:translate(6vmax,4vmax) scale(1.12);} 66%{transform:translate(-5vmax,-3vmax) scale(.94);} }

/* ====================== БАЗОВОЕ СТЕКЛО ====================== */
.glass, .glass-lg, .glass-soft {
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--blur)) saturate(180%) brightness(1.08);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(180%) brightness(1.08);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(0,0,0,.45), inset 0 1px 0 var(--glass-hi), inset 0 -1px 0 rgba(0,0,0,.25);
  overflow: hidden;
}
.glass-lg { border-radius: 32px; --blur: 30px; }
.glass-soft { background: var(--glass-bg-2); border-radius: var(--radius-sm); }
/* спекулярный блик, следящий за курсором */
.glass::before, .glass-lg::before, .glass-soft::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(280px circle at var(--mx,50%) var(--my,0%), rgba(255,255,255,.18), transparent 60%);
  opacity: .9;
}
/* преломляющая кромка */
.glass::after, .glass-lg::after, .glass-soft::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(150deg, rgba(255,255,255,.45), transparent 40%, rgba(255,255,255,.1));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}

/* ====================== LANDING ====================== */
.landing-shell {
  position: relative; z-index: 1;
  max-width: 1080px; margin: 0 auto; padding: 6vh 20px 40px;
  display: flex; flex-direction: column; gap: 28px;
}
.hero { text-align: center; padding: 56px 24px; animation: rise .8s cubic-bezier(.2,.8,.2,1); }
.hero-mark {
  width: 84px; height: 84px; margin: 0 auto 18px; border-radius: 24px;
  display: grid; place-items: center; font-size: 44px; font-weight: 800; color: #fff;
  background: linear-gradient(150deg, var(--accent), var(--accent2));
  box-shadow: 0 14px 40px rgba(124,92,255,.6), inset 0 1px 0 rgba(255,255,255,.6);
  animation: pulse 4s ease-in-out infinite;
}
.hero-title { font-size: 64px; letter-spacing: 8px; font-weight: 800; margin-bottom: 8px;
  background: linear-gradient(120deg, #fff, #c9b8ff 60%, #ffb8e0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { color: var(--txt-dim); font-size: 18px; min-height: 24px; letter-spacing: 1px; }
.hero-cta { display: flex; gap: 14px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }
.glass-btn {
  padding: 13px 30px; border-radius: 14px; font-weight: 600; font-size: 16px; color: var(--txt);
  background: var(--glass-bg-2); border: 1px solid var(--glass-border); backdrop-filter: blur(12px);
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s; cursor: pointer;
}
.glass-btn:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(124,92,255,.4); }
.glass-btn.primary { background: linear-gradient(150deg, var(--accent), var(--accent2)); border: none; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 16px; }
.feat { padding: 22px; animation: rise .9s cubic-bezier(.2,.8,.2,1) backwards; }
.feat:nth-child(2){animation-delay:.08s} .feat:nth-child(3){animation-delay:.16s} .feat:nth-child(4){animation-delay:.24s}
.feat-ico { font-size: 30px; margin-bottom: 10px; }
.feat h3 { font-size: 17px; margin-bottom: 6px; }
.feat p { color: var(--txt-dim); font-size: 13.5px; }
.landing-foot { position: relative; z-index: 1; max-width: 1080px; margin: 0 auto 24px; text-align: center;
  padding: 14px; color: var(--txt-dim); font-size: 12.5px; border-radius: 14px; }

@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%,100%{transform:scale(1);} 50%{transform:scale(1.06);} }

/* ====================== НАВИГАЦИЯ / КОНТЕЙНЕРЫ ====================== */
#topnav {
  position: relative; z-index: 1; display: flex; gap: 6px; align-items: center;
  padding: 10px 16px; background: rgba(255,255,255,.06);
  backdrop-filter: blur(16px); border-bottom: 1px solid var(--glass-border); flex-wrap: wrap;
}
.nav-link { padding: 8px 12px; border-radius: 10px; color: var(--txt); background: transparent; border: 1px solid transparent; cursor: pointer; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.nav-link:hover { background: rgba(255,255,255,.1); }
.nav-link .nav-ico { width: 18px; height: 18px; }
.nav-link.logout { margin-left: auto; color: #ff8b82; }
.container { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; padding: 18px 16px; }
.card { background: var(--glass-bg); backdrop-filter: blur(16px); border: 1px solid var(--glass-border); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; box-shadow: inset 0 1px 0 var(--glass-hi); }
h1,h2,h3 { font-weight: 700; margin-bottom: 12px; }
.muted { color: var(--txt-dim); }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; }
.spacer { flex: 1; }

/* ====================== ФОРМЫ (авторизация) ====================== */
.auth-wrap { position: relative; z-index: 1; max-width: 400px; margin: 9vh auto; }
.auth-wrap .card { animation: rise .6s cubic-bezier(.2,.8,.2,1); }
label { display: block; margin: 10px 0 4px; font-size: 13px; color: var(--txt-dim); }
input, textarea, select {
  width: 100%; padding: 11px 13px; border-radius: 10px;
  border: 1px solid var(--glass-border); background: rgba(0,0,0,.25); color: var(--txt);
  font-size: 14px; font-family: inherit;
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,92,255,.25); }
button.btn {
  margin-top: 14px; width: 100%; padding: 12px; border-radius: 10px; border: none;
  background: linear-gradient(150deg, var(--accent), var(--accent2)); color: #fff; font-size: 15px; cursor: pointer; font-weight: 600;
  transition: transform .2s, box-shadow .2s;
}
button.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(124,92,255,.45); }
button.btn.secondary { background: rgba(255,255,255,.1); border: 1px solid var(--glass-border); }
button.btn.primary { background: linear-gradient(150deg, var(--accent), var(--accent2)); color: #fff; }
.center { text-align: center; }
.error { color: #ff8b82; font-size: 13px; min-height: 18px; margin-top: 8px; }
.hint { font-size: 13px; color: var(--txt-dim); margin-top: 12px; text-align: center; }

/* ====================== СПИСКИ ====================== */
.list { list-style: none; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--glass-border); border-radius: 14px; margin-bottom: 8px; cursor: pointer; background: rgba(255,255,255,.05); transition: background .2s, transform .15s; }
.list-item:hover { background: rgba(255,255,255,.11); transform: translateX(2px); }
.avatar { width: 46px; height: 46px; border-radius: 50%; flex: 0 0 auto; background: linear-gradient(150deg, var(--accent), var(--accent2)); display: grid; place-items: center; font-weight: 600; color: #fff; font-size: 15px; box-shadow: inset 0 1px 0 rgba(255,255,255,.5); }
.avatar.sm { width: 34px; height: 34px; font-size: 12px; }
.item-body { flex: 1; min-width: 0; }
.item-title { font-weight: 600; }
.item-sub { color: var(--txt-dim); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: linear-gradient(150deg, var(--accent), var(--accent2)); color: #fff; font-size: 12px; display: grid; place-items: center; box-shadow: 0 4px 12px rgba(124,92,255,.5); }
.item-time { color: var(--txt-dim); font-size: 12px; text-align: right; }
.conn-dot { width: 9px; height: 9px; border-radius: 50%; background: #555; display: inline-block; }
.conn-dot.on { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.conn-dot.off { background: #f85149; }
.stat { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.stat:last-child { border-bottom: none; }

/* ====================== ЧАТ ====================== */
.chat-layout { position: relative; z-index: 1; display: flex; flex-direction: column; height: calc(100vh - 53px); }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--glass-border); background: rgba(255,255,255,.06); backdrop-filter: blur(16px); position: sticky; top: 0; }
.messages { padding: 16px; overflow-y: auto; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.messages::-webkit-scrollbar { width: 8px; } .messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 8px; }
.bubble { max-width: 72%; padding: 9px 13px; border-radius: 16px; word-wrap: break-word; white-space: pre-wrap; font-size: 14.5px; animation: pop .35s cubic-bezier(.2,.9,.25,1.2); box-shadow: inset 0 1px 0 rgba(255,255,255,.25); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
.bubble.in { align-self: flex-start; background: rgba(255,255,255,.1); border-bottom-left-radius: 5px; }
.bubble.out { align-self: flex-end; background: linear-gradient(150deg, var(--accent), var(--accent2)); color: #fff; border-bottom-right-radius: 5px; }
.bubble .meta { display: block; font-size: 11px; opacity: .65; margin-top: 3px; text-align: right; }
.forwarded { font-size: 11.5px; opacity: .7; border-left: 2px solid var(--accent); padding-left: 6px; margin-bottom: 3px; }

/* закреплённое сообщение */
.pinned-bar { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-bottom: 1px solid var(--glass-border); background: rgba(124,92,255,.14); backdrop-filter: blur(12px); cursor: default; }
.pinned-info { flex: 1; font-size: 13px; opacity: .92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.pinned-info:hover { text-decoration: underline; }

/* вложения-файлы внутри пузыря */
.file-att { display: flex; flex-direction: column; align-items: stretch; gap: 8px; min-width: 200px; }
.file-ico { font-size: 26px; }
.file-meta { display: flex; flex-direction: column; }
.file-meta a { color: inherit; text-decoration: underline; word-break: break-all; }
.file-meta span { font-size: 11px; opacity: .7; }
.file-img { max-width: 280px; max-height: 280px; border-radius: 12px; cursor: zoom-in; }
.file-video { max-width: 300px; max-height: 280px; border-radius: 12px; background: #000; }
.file-att audio { width: 240px; max-width: 70vw; }
.ttl-badge { font-size: 10px; opacity: .8; border-left: 1px solid currentColor; padding-left: 4px; margin-left: 2px; }
.icon-glass.active { background: linear-gradient(150deg, var(--accent), var(--accent2)); color: #fff; transform: translateY(-2px); }

.composer { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--glass-border); background: rgba(255,255,255,.06); backdrop-filter: blur(16px); align-items: center; }
.composer input { flex: 1; }
.icon-glass { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--glass-border); background: rgba(255,255,255,.1); color: var(--txt); cursor: pointer; font-size: 18px; transition: transform .2s, background .2s; }
.icon-glass:hover { transform: translateY(-2px); background: rgba(255,255,255,.18); }
.send-glass { width: 46px; height: 42px; border-radius: 12px; border: none; cursor: pointer; color: #fff; font-size: 16px; background: linear-gradient(150deg, var(--accent), var(--accent2)); box-shadow: 0 6px 18px rgba(124,92,255,.45); transition: transform .2s; }
.send-glass:hover { transform: scale(1.06) rotate(-6deg); }

.upload-progress { position: relative; z-index: 1; display: none; margin: 0 16px; height: 6px; border-radius: 4px; background: rgba(255,255,255,.1); overflow: hidden; }
.upload-progress > div { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .15s; }

/* поиск в чате */
.chat-search { position: relative; z-index: 1; display: flex; padding: 8px 16px; border-bottom: 1px solid var(--glass-border); background: rgba(255,255,255,.05); }
.chat-search input { flex: 1; }

/* реакции */
.reacts { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.react-chip { border: 1px solid var(--glass-border); background: rgba(255,255,255,.08); color: var(--txt); border-radius: 12px; padding: 2px 9px; font-size: 12.5px; cursor: pointer; transition: transform .15s, background .15s; }
.react-chip:hover { transform: translateY(-1px); background: rgba(255,255,255,.16); }

/* поповер быстрых реакций */
.react-pop { position: absolute; z-index: 50; display: flex; gap: 2px; padding: 6px; border-radius: 14px; background: rgba(18,20,38,.95); border: 1px solid var(--glass-border); backdrop-filter: blur(14px); box-shadow: 0 12px 30px rgba(0,0,0,.5); animation: pop .2s ease; }
.react-pop button { width: 34px; height: 34px; font-size: 20px; border: none; background: transparent; cursor: pointer; border-radius: 9px; }
.react-pop button:hover { background: rgba(255,255,255,.14); transform: scale(1.15); }

/* модалка управления группой / чатом */
.modal { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; background: rgba(3,4,12,.55); backdrop-filter: blur(6px); animation: rise .3s ease; }
.modal-card { width: min(92vw, 460px); max-height: 80vh; overflow-y: auto; padding: 18px; border-radius: 22px; background: rgba(14,16,32,.7); border: 1px solid var(--glass-border); backdrop-filter: blur(26px) saturate(160%); box-shadow: 0 30px 80px rgba(0,0,0,.6), inset 0 1px 0 var(--glass-hi); }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.mm-section { margin: 14px 0; }
.mm-section > label { display: block; font-size: 12px; opacity: .7; margin-bottom: 6px; }
.mm-row { display: flex; gap: 8px; }
.mm-row input { flex: 1; }
.mm-members { display: flex; flex-direction: column; gap: 6px; }
.mm-member { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.06); }
.mm-member small { opacity: .6; margin-left: 6px; }
.mm-block-btn { width: 100%; }

/* ====================== ЗВОНОК (видеокружки) ====================== */
.call-overlay { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; background: rgba(3,4,12,.6); backdrop-filter: blur(8px); }
.call-overlay.pop { animation: rise .35s cubic-bezier(.2,.8,.2,1); }
.call-glass {
  position: relative; width: min(92vw, 720px); height: min(80vh, 560px);
  border-radius: 28px; overflow: hidden; border: 1px solid var(--glass-border);
  background: rgba(10,12,24,.55); backdrop-filter: blur(26px) saturate(160%);
  box-shadow: 0 30px 80px rgba(0,0,0,.6), inset 0 1px 0 var(--glass-hi);
  display: flex; align-items: center; justify-content: center;
}
.call-remote { position: absolute; inset: 0; }
.call-remote video { width: 100%; height: 100%; object-fit: cover; }
.call-remote-name { position: absolute; top: 16px; left: 16px; padding: 6px 14px; border-radius: 12px; background: rgba(0,0,0,.4); font-size: 14px; backdrop-filter: blur(8px); }
/* видеокружка — локальное видео в круге */
.call-local { position: absolute; right: 18px; bottom: 96px; width: 120px; height: 120px; border-radius: 50%; overflow: hidden; border: 2px solid rgba(255,255,255,.5); box-shadow: 0 10px 30px rgba(0,0,0,.5); background: #111; animation: floaty 5s ease-in-out infinite; }
.call-local video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
@keyframes floaty { 0%,100%{transform:translateY(0);} 50%{transform:translateY(-10px);} }
.call-status { position: absolute; bottom: 150px; left: 0; right: 0; text-align: center; font-size: 14px; color: var(--txt-dim); }
.call-controls { position: absolute; bottom: 22px; left: 0; right: 0; display: flex; gap: 16px; justify-content: center; }
.call-btn { width: 60px; height: 60px; border-radius: 50%; border: 1px solid var(--glass-border); background: rgba(255,255,255,.12); color: #fff; font-size: 24px; cursor: pointer; backdrop-filter: blur(10px); transition: transform .2s, background .2s; }
.call-btn:hover { transform: scale(1.08); background: rgba(255,255,255,.22); }
.call-btn.off { background: rgba(248,81,73,.8); }
.call-btn.hang { background: linear-gradient(150deg, #f85149, #ff7b72); }
.call-btn.accept { background: linear-gradient(150deg, #2ea043, #3fb950); }

.incoming-box { position: absolute; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 30px 40px; border-radius: 24px; background: rgba(10,12,24,.6); backdrop-filter: blur(24px); border: 1px solid var(--glass-border); box-shadow: inset 0 1px 0 var(--glass-hi); animation: rise .4s cubic-bezier(.2,.8,.2,1); }
.incoming-avatar { width: 90px; height: 90px; border-radius: 50%; display: grid; place-items: center; font-size: 34px; font-weight: 700; color: #fff; background: linear-gradient(150deg, var(--accent), var(--accent2)); box-shadow: inset 0 1px 0 rgba(255,255,255,.5); animation: pulse 2.5s ease-in-out infinite; }
.incoming-name { font-size: 16px; }

/* ====================== МАСТЕР РЕГИСТРАЦИИ (СЛАЙДЫ) ====================== */
.wizard { overflow: hidden; padding: 0; }
.wizard-track { display: flex; transition: transform .45s cubic-bezier(.4,0,.2,1); }
.slide { min-width: 100%; flex: 0 0 100%; box-sizing: border-box; padding: 24px 22px 26px; display: flex; flex-direction: column; gap: 10px; }
.slide h2 { margin-bottom: 2px; font-size: 20px; }
.slide .row { display: flex; gap: 10px; margin-top: 6px; }
.slide .row .btn { flex: 1; }
.wiz-dots { display: flex; gap: 7px; justify-content: center; margin-top: 12px; }
.wiz-dots .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--glass-border); transition: all .3s; }
.wiz-dots .dot.on { background: var(--accent); width: 22px; border-radius: 6px; }
.btn.ghost { background: transparent; border: 1px solid var(--glass-border); color: var(--txt); }
.btn.ghost:hover { background: rgba(255,255,255,.1); }

/* ====================== ГЛАВНАЯ (ЧАТЫ): HERO ====================== */
.chats-hero { display: flex; align-items: center; gap: 14px; padding: 18px 20px; margin-bottom: 14px; border-radius: var(--radius); background: var(--glass-bg); border: 1px solid var(--glass-border); backdrop-filter: blur(var(--blur)); }
.chats-hero .hero-avatar { width: 52px; height: 52px; font-size: 18px; }
.hero-info { flex: 1; min-width: 0; }
.hero-name { font-size: 19px; font-weight: 600; }
.hero-sub { font-size: 13px; }
.hero-profile { font-size: 22px; text-decoration: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--glass-bg-2); border: 1px solid var(--glass-border); flex: 0 0 auto; }
.hero-profile:hover { background: var(--glass-bg-2); filter: brightness(1.1); }

/* ====================== АДАПТИВ ====================== */
@media (max-width: 600px) {
  .hero-title { font-size: 44px; }
  .call-local { width: 84px; height: 84px; bottom: 90px; }
  .bubble { max-width: 84%; }
}

.ver-badge {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--text);
  background: rgba(124,92,255,.18);
  border: 1px solid rgba(124,92,255,.4);
}

.dev-code {
  display: none;
  margin: 8px 0 2px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(124,92,255,.15);
  border: 1px solid rgba(124,92,255,.4);
  color: var(--text);
  font-family: monospace;
  font-size: 14px;
  letter-spacing: 1px;
}

/* ====================== АПГРЕЙД: SVG-анимации и полировка ====================== */
body > .aurora { z-index: 0; }

.auth-title {
  font-size: 42px; letter-spacing: 7px; font-weight: 800; margin: 0 0 4px;
  background: linear-gradient(120deg, #fff, #c9b8ff 60%, #ffb8e0);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* анимированный SVG-логотип */
.auth-mark { width: 78px; height: 78px; margin: 0 auto 14px; display: block; filter: drop-shadow(0 10px 24px rgba(124,92,255,.5)); }
.auth-mark .ring { transform-origin: 50% 50%; animation: spin 9s linear infinite; }
.auth-mark .pulse { transform-origin: 50% 50%; animation: pulse 3.4s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* блеск по кнопкам */
.btn { position: relative; overflow: hidden; }
.btn:not(.secondary)::after {
  content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.4), transparent);
  transform: skewX(-20deg); animation: shine 3.4s ease-in-out infinite; pointer-events: none;
}
@keyframes shine { 0% { left: -60%; } 55%, 100% { left: 140%; } }

/* пульс индикатора соединения */
.conn-dot.on { animation: ping 1.8s ease-out infinite; }
@keyframes pulse-ping { 0% { box-shadow: 0 0 0 0 rgba(63,185,80,.6); } 70% { box-shadow: 0 0 0 9px rgba(63,185,80,0); } 100% { box-shadow: 0 0 0 0 rgba(63,185,80,0); } }
.conn-dot.on { animation: pulse-ping 1.8s ease-out infinite; }

/* появление пунктов списков */
.list-item { animation: fadeUp .45s cubic-bezier(.2,.8,.2,1) backwards; }
.list-item:nth-child(2){animation-delay:.05s} .list-item:nth-child(3){animation-delay:.1s}
.list-item:nth-child(4){animation-delay:.15s} .list-item:nth-child(5){animation-delay:.2s}
.list-item:nth-child(6){animation-delay:.25s} .list-item:nth-child(7){animation-delay:.3s}
.list-item:nth-child(8){animation-delay:.35s} .list-item:nth-child(9){animation-delay:.4s}
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* пустое состояние с анимированным SVG */
.empty { text-align: center; padding: 46px 20px; color: var(--txt-dim); }
.empty svg { width: 120px; height: 120px; margin-bottom: 12px; }
.empty .dot { animation: bounce 1.3s ease-in-out infinite; transform-origin: center; }
.empty .dot:nth-child(2) { animation-delay: .18s; }
.empty .dot:nth-child(3) { animation-delay: .36s; }
@keyframes bounce { 0%,100% { transform: translateY(2px); opacity: .45; } 50% { transform: translateY(-10px); opacity: 1; } }

/* спиннер загрузки (SVG) */
.spinner { width: 20px; height: 20px; animation: spin 1s linear infinite; }
.spinner circle { stroke: rgba(255,255,255,.3); }
.spinner .arc { stroke: #fff; stroke-linecap: round; stroke-dasharray: 60; stroke-dashoffset: 42; }

/* плавное появление страниц */
.container, .auth-wrap, .chat-layout { animation: rise .6s cubic-bezier(.2,.8,.2,1); }

/* ====================== Telegram-подобный макет чатов ====================== */
.tg { position: relative; z-index: 1; display: flex; height: 100vh; }
.tg-side {
  width: 340px; flex: 0 0 340px; display: flex; flex-direction: column; gap: 10px;
  padding: 14px; border-right: 1px solid var(--glass-border);
  background: rgba(255,255,255,.06); backdrop-filter: blur(18px) saturate(160%); overflow: hidden;
}
.tg-head { display: flex; align-items: center; gap: 10px; }
.tg-logo { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.tg-logo .auth-mark { width: 40px; height: 40px; margin: 0; }
.tg-word { font-size: 22px; font-weight: 800; letter-spacing: 1px;
  background: linear-gradient(120deg, #fff, #c9b8ff 60%, #ffb8e0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tg-side #topnav { border: none; background: none; backdrop-filter: none; padding: 0; flex-direction: column; align-items: stretch; flex-wrap: nowrap; }
.tg-side #topnav .nav-link { width: 100%; text-align: left; border-radius: 10px; padding: 9px 12px; }
.tg-status { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--txt-dim); padding: 0 4px; }
.tg-side #search { margin: 2px 0 4px; }
.tg-side .list { flex: 1; overflow-y: auto; margin: 0; }
.tg-main { flex: 1; display: flex; align-items: center; justify-content: center; min-width: 0; }
.tg-empty { text-align: center; color: var(--txt-dim); padding: 20px; max-width: 360px; }
.tg-empty svg { width: 130px; height: 130px; margin-bottom: 14px; }
.tg-empty .dot { animation: bounce 1.3s ease-in-out infinite; transform-origin: center; }
.tg-empty .dot:nth-child(2) { animation-delay: .18s; }
.tg-empty .dot:nth-child(3) { animation-delay: .36s; }
@media (max-width: 720px) {
  .tg-side { width: 100%; flex: 1; border-right:none; }
  .tg-main { display: none; }
}

/* аватарка-картинка внутри кружка */
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }

/* ====================== ЛЕВАЯ ПАНЕЛЬ (профиль + меню) ====================== */
.tg-nav {
  width: 250px; flex: 0 0 250px; display: flex; flex-direction: column;
  padding: 16px 12px; gap: 10px; border-right: 1px solid var(--glass-border);
  background: rgba(255,255,255,.04); backdrop-filter: blur(20px) saturate(160%); overflow-y: auto;
}
.nav-logo { display: flex; align-items: center; gap: 10px; }
.nav-logo .auth-mark { width: 38px; height: 38px; margin: 0; }

.nav-profile { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 10px 0 4px; }
.nav-ava .avatar { width: 76px; height: 76px; font-size: 28px; }
.nav-name { font-size: 17px; font-weight: 700; }
.nav-status-link { font-size: 12px; color: var(--accent); cursor: pointer; text-decoration: underline; }

.nav-menu { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 10px; border-radius: 10px; border: none; background: transparent;
  color: var(--txt); cursor: pointer; font: inherit; font-weight: 600;
}
.nav-item:hover { background: rgba(255,255,255,.08); }
.nav-item.logout { color: #ff8585; margin-top: 2px; }
.nav-item .ni-ico { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--accent); width: 30px; text-align: center; flex: 0 0 auto; }
.ni-badge { margin-left: auto; font-size: 11px; color: var(--txt-dim); border: 1px solid var(--glass-border); border-radius: 999px; padding: 1px 8px; }
.nav-foot { margin-top: auto; }

/* список чатов: шапка */
.tg-side-head { display: flex; align-items: center; gap: 8px; }
.tg-side-head #search { flex: 1; margin: 0; }
.list-head { display: flex; gap: 8px; padding: 0 2px; }
.list-hbtn { background: transparent; border: 1px solid var(--glass-border); color: var(--txt-dim); border-radius: 10px; padding: 5px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.list-hbtn:hover { color: var(--txt); background: rgba(255,255,255,.06); }
.list-title { font-size: 13px; letter-spacing: .5px; color: var(--txt-dim); text-transform: uppercase; padding: 2px 4px; }

.conn-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; background: #999; }
.conn-dot.on { background: #3fb950; }
.conn-dot.off { background: #f85149; }
.tg-side-head .conn-dot { margin-left: auto; }

/* ====================== ПОНИ-ЛОГО + ПАНЕЛЬ МЕНЮ ====================== */
.pony {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px; line-height: 1.05; color: var(--txt);
  white-space: pre; text-align: center; display: block; margin: 0;
}
.pony.big { font-size: 15px; }
.mi-ico { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--accent); }

.tg-head { align-items: center; }
.tg-id { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.25; }
.tg-name { font-size: 16px; font-weight: 700; }
.tg-status-line { font-size: 12px; color: var(--txt-dim); }

.tg-menu { list-style: none; display: flex; flex-direction: column; gap: 2px; margin: 6px 0; }
.tg-menu .tg-mi {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 12px; border-radius: 10px; border: none; background: transparent;
  color: var(--txt); cursor: pointer; font: inherit; font-weight: 600;
}
.tg-menu .tg-mi:hover { background: rgba(255,255,255,.1); }
.tg-menu .mi-ico { width: 30px; text-align: center; flex: 0 0 auto; }
.tg-sep { height: 1px; background: rgba(255,255,255,.1); margin: 6px 4px; }

/* ====================== ЭКРАНЫ НАСТРОЕК / ПРОФИЛЯ ====================== */
.tg-screen {
  position: relative; z-index: 1; max-width: 520px; margin: 24px auto; min-height: calc(100vh - 48px);
  background: var(--glass-bg); border: 1px solid var(--glass-border); backdrop-filter: blur(var(--blur));
  border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 30px 80px rgba(0,0,0,.45);
}
.set-header { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--glass-border); background: rgba(255,255,255,.04); }
.set-title { font-size: 17px; font-weight: 700; flex: 1; }
.icon-btn { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--glass-border); background: rgba(255,255,255,.08); color: var(--txt); cursor: pointer; font-size: 18px; line-height: 1; }
.icon-btn:hover { background: rgba(255,255,255,.16); }

.set-hero { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 16px 14px; text-align: center; }
.set-hero-ava .avatar { width: 84px; height: 84px; font-size: 30px; }
.set-hero-name { font-size: 18px; font-weight: 700; }
.set-hero-user { font-size: 13px; color: var(--accent); text-decoration: none; cursor: pointer; }
.set-hero-user:hover { text-decoration: underline; }

.set-scroll { flex: 1; overflow-y: auto; padding: 8px 10px 16px; }
.set-list { list-style: none; display: flex; flex-direction: column; margin: 0; padding: 0; }
.set-item {
  display: flex; align-items: center; gap: 10px; padding: 12px 10px;
  border-radius: 12px; cursor: pointer; font-weight: 600; color: var(--txt);
}
.set-item:hover { background: rgba(255,255,255,.08); }
.set-item .mi-ico { flex: 0 0 auto; width: 26px; height: 26px; margin-right: 12px; display: inline-flex; color: var(--accent); }
.info-row-label .mi-ico { width: 16px; height: 16px; margin-right: 6px; vertical-align: middle; }
.set-val { margin-left: auto; color: var(--txt-dim); font-size: 13px; }
.set-link { display: flex; align-items: center; gap: 10px; flex: 1; color: inherit; text-decoration: none; }
.set-link .set-val { margin-left: auto; }
.set-link:hover { color: inherit; }

/* секции настроек (prefs) */
.pref-list { display: flex; flex-direction: column; gap: 4px; padding: 6px 2px; }
.pref-row { display: flex; align-items: center; gap: 12px; padding: 12px 12px; border-radius: 12px; background: rgba(255,255,255,.04); }
.pref-row.col { flex-direction: column; align-items: stretch; gap: 8px; }
.pref-label { flex: 1; font-weight: 600; }
.pref-select { background: rgba(255,255,255,.08); color: var(--txt); border: 1px solid var(--glass-border); border-radius: 10px; padding: 8px 10px; font: inherit; }
.pref-select:focus { outline: none; border-color: var(--accent); }

/* переключатель */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: rgba(255,255,255,.18); border-radius: 999px; transition: background .2s; cursor: pointer; }
.slider:before { content: ""; position: absolute; height: 20px; width: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .2s; }
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider:before { transform: translateX(20px); }

/* папки */
.pref-folders { padding: 6px 2px; }
.folder-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.folder-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: rgba(255,255,255,.1); font-weight: 600; }
.folder-x { border: none; background: transparent; color: var(--txt-dim); cursor: pointer; font-size: 16px; line-height: 1; }
.folder-add { display: flex; gap: 8px; }
.folder-add input { flex: 1; background: rgba(255,255,255,.08); color: var(--txt); border: 1px solid var(--glass-border); border-radius: 10px; padding: 8px 10px; font: inherit; }

/* экран звонков / архива */
.calls-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 48px 16px; color: var(--txt-dim); text-align: center; }
.calls-empty svg { width: 54px; height: 54px; color: var(--accent); opacity: .8; }
.calls-foot { padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.08); }

/* уменьшение анимаций */
body.reduce-anim *, body.reduce-anim *::before, body.reduce-anim *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }

/* редактор My Account */
.set-editor { position: absolute; inset: 0; background: var(--bg-solid); display: none; flex-direction: column; z-index: 5; animation: rise .28s cubic-bezier(.2,.8,.2,1); }
.set-editor[style*="display: none"] { animation: none; }
.set-editor-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--glass-border); }
.set-editor-body { padding: 16px; overflow-y: auto; }
.ava-upload { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 16px; text-align: center; }
.btn.ghost.sm { background: transparent; border: 1px solid var(--glass-border); color: var(--txt); font-size: 13px; padding: 7px 14px; }
.btn.ghost.sm:hover { background: rgba(255,255,255,.1); }

/* плавные переходы и эффекты нажатия для экранов настроек */
.set-item, .set-link, .pref-row, .btn, .icon-btn, .icon-glass, .d-item,
.folder-chip, .call-btn, .nav-link, .list-hbtn, .info-row {
  transition: background .18s ease, transform .12s ease, opacity .18s ease, color .18s ease, box-shadow .18s ease;
}
.set-item:active, .d-item:active, .btn:active, .icon-btn:active,
.icon-glass:active, .list-hbtn:active { transform: scale(.97); }
.set-link:hover { background: rgba(255,255,255,.07); }
.switch .slider { transition: background .2s ease; }
.switch input:checked + .slider:before { transition: transform .2s ease; }

/* экран Info */
.info-body { flex: 1; overflow-y: auto; padding: 22px 18px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.info-avatar .avatar { width: 96px; height: 96px; font-size: 34px; }
.info-name { font-size: 20px; font-weight: 700; }
.info-online { font-size: 13px; color: var(--txt-dim); }
.info-bio { width: 100%; text-align: left; margin-top: 14px; background: rgba(255,255,255,.05); border: 1px solid var(--glass-border); border-radius: 14px; padding: 12px 14px; }
.info-bio-label { font-size: 12px; color: var(--txt-dim); margin-bottom: 6px; display: flex; justify-content: space-between; }
.info-bio-text { font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.info-rows { width: 100%; margin-top: 14px; }
.info-row { display: flex; align-items: center; gap: 10px; padding: 12px 6px; border-bottom: 1px solid rgba(255,255,255,.08); font-weight: 600; }
.info-row:last-child { border-bottom: none; }
.info-row-label { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--accent); width: 110px; flex: 0 0 auto; text-align: left; }
.info-actions { margin-top: 18px; width: 100%; display: flex; justify-content: center; }

/* ====================== ИКОНКИ (без эмодзи) ====================== */
.feat-ico { color: var(--accent); display: flex; align-items: center; justify-content: center; }
.feat-ico svg { width: 30px; height: 30px; }
.tg-back, .tg-close { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--glass-border); background: rgba(255,255,255,.1); color: var(--txt); cursor: pointer; font-size: 16px; }
.tg-back:hover, .tg-close:hover { background: rgba(255,255,255,.18); }
.tg-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.tg-top .spacer { flex: 1; }

/* ====================== ГАМБУРГЕР + ВЫЕЗЖАЮЩЕЕ МЕНЮ ====================== */
.icon-glass {
  width: 40px; height: 40px; flex: 0 0 auto; border-radius: 12px;
  border: 1px solid var(--glass-border); background: rgba(255,255,255,.08);
  color: var(--txt); cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.icon-glass:hover { background: rgba(255,255,255,.16); }
.icon-glass.sm { width: 38px; height: 38px; }
.icon-glass .icon { width: 22px; height: 22px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--glass-border);
  background: rgba(255,255,255,.1); color: var(--txt); cursor: pointer; font-size: 20px; line-height: 1;
}
.icon-btn:hover { background: rgba(255,255,255,.18); }

.drawer-backdrop {
  position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.4);
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }

.tg-drawer {
  position: fixed; top: 0; left: 0; bottom: 0; width: 296px; z-index: 60;
  background: var(--glass-bg); border-right: 1px solid var(--glass-border);
  backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%);
  transform: translateX(-100%);
  transition: transform .28s cubic-bezier(.2,.8,.2,1);
  display: flex; flex-direction: column; padding: 16px 12px; gap: 6px;
}
.tg-drawer.open { transform: translateX(0); box-shadow: 0 0 60px rgba(0,0,0,.55); }

.drawer-top { display: flex; align-items: flex-start; gap: 10px; }
.drawer-profile { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.drawer-ava .avatar { width: 64px; height: 64px; font-size: 24px; }
.drawer-name { font-size: 17px; font-weight: 700; word-break: break-word; }
.drawer-status { font-size: 12px; color: var(--accent); cursor: pointer; text-decoration: underline; }

.drawer-menu { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; }
.d-item {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 11px 12px; border-radius: 13px; border: none; background: transparent;
  color: var(--txt); cursor: pointer; font: inherit; font-weight: 600; font-size: 14px;
}
.d-item:hover { background: rgba(255,255,255,.08); }
.d-item .mi-ico { width: 22px; height: 22px; flex: 0 0 auto; color: var(--accent); }
.d-item span:not(.ni-badge) { flex: 1; min-width: 0; }
.d-item .ni-badge {
  margin-left: auto; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: var(--accent); color: #fff;
}
.d-item.logout { color: #ff8585; margin-top: 4px; }
.d-item.logout .mi-ico { color: #ff8585; }
.drawer-foot { margin-top: auto; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.08); }

/* универсальный контейнер SVG-иконки в меню */
.mi-ico { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; color: var(--accent); }

/* =========================================================
   LOSEX — улучшения интерфейса (добавлено)
   ========================================================= */

/* Плавные переходы при смене темы */
body, .card, #topnav, .chat-head, .composer, .bubble, .modal-card,
.emoji-picker, .sidebar, .messages, .set-editor, .tg-screen, .chat-layout {
  transition: background-color .35s ease, color .35s ease,
              border-color .35s ease, box-shadow .35s ease;
}

/* Кастомные скроллбары */
.messages, .emoji-picker, .modal-card, .mm-members, .set-scroll {
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}
.messages::-webkit-scrollbar,
.emoji-picker::-webkit-scrollbar,
.modal-card::-webkit-scrollbar,
.mm-members::-webkit-scrollbar,
.set-scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.messages::-webkit-scrollbar-thumb,
.emoji-picker::-webkit-scrollbar-thumb,
.modal-card::-webkit-scrollbar-thumb,
.mm-members::-webkit-scrollbar-thumb,
.set-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent), var(--accent2));
  border-radius: 10px;
}
.messages::-webkit-scrollbar-track,
.modal-card::-webkit-scrollbar-track { background: transparent; }

/* Анимация появления сообщений */
@keyframes lx-rise {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
.bubble { animation: lx-rise .28s cubic-bezier(.2,.8,.2,1) both; }
.bubble:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(0,0,0,.28);
}
.bubble.out:hover { box-shadow: 0 10px 30px rgba(124,92,255,.45); }

/* Аватары с градиентным кольцом и онлайн-точкой */
.avatar { position: relative; box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 4px 14px rgba(0,0,0,.3); }
.avatar .online-dot {
  position: absolute; right: 0; bottom: 0; width: 12px; height: 12px;
  border-radius: 50%; background: var(--ok); border: 2px solid var(--bg-solid);
  box-shadow: 0 0 8px var(--ok);
}

/* Разделитель дат */
.day-sep {
  align-self: center; margin: 10px 0 4px; padding: 4px 14px; border-radius: 12px;
  background: rgba(255,255,255,.08); border: 1px solid var(--glass-border);
  font-size: 12px; color: var(--txt-dim); backdrop-filter: blur(8px);
}
body.light .day-sep { background: rgba(255,255,255,.7); color: #14181f; }

/* Кнопка «к последним» */
.jump-btn {
  position: absolute; right: 18px; bottom: 86px; width: 46px; height: 46px;
  border-radius: 50%; border: 1px solid var(--glass-border);
  background: rgba(18,20,38,.9); color: var(--txt); display: none; place-items: center;
  cursor: pointer; backdrop-filter: blur(12px); box-shadow: 0 8px 24px rgba(0,0,0,.4);
  z-index: 6; transition: transform .2s, opacity .2s, background .2s;
}
.jump-btn.show { display: grid; animation: lx-rise .2s ease; }
.jump-btn:hover { transform: translateY(-2px); background: linear-gradient(150deg, var(--accent), var(--accent2)); color: #fff; }
.jump-btn .badge-count {
  position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 10px; background: linear-gradient(150deg, var(--accent), var(--accent2));
  color: #fff; font-size: 11px; display: grid; place-items: center;
  box-shadow: 0 2px 8px rgba(124,92,255,.5);
}

/* Подсветка поиска */
mark.search-hl {
  background: linear-gradient(150deg, rgba(255,210,61,.55), rgba(255,145,0,.55));
  color: inherit; border-radius: 4px; padding: 0 2px;
}

/* Тост уведомлений (копирование и т.п.) */
.lx-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: rgba(18,20,38,.95); color: #fff; padding: 10px 18px; border-radius: 14px;
  border: 1px solid var(--glass-border); backdrop-filter: blur(12px); font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 300;
}
.lx-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
body.light .lx-toast { background: rgba(255,255,255,.96); color: #14181f; }

/* Индикатор печати (точки) */
.typing-dots { display: inline-flex; gap: 3px; vertical-align: middle; margin-left: 6px; }
.typing-dots i {
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
  display: inline-block; animation: lx-blink 1.2s infinite both;
}
.typing-dots i:nth-child(2) { animation-delay: .2s; }
.typing-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes lx-blink {
  0%,80%,100% { opacity: .25; transform: scale(.8); }
  40% { opacity: 1; transform: scale(1); }
}

/* Улучшенные тени и реакции */
.react-chip { transition: transform .15s, background .15s; }
.react-chip:hover { transform: translateY(-2px) scale(1.05); }
.reacts { margin-top: 4px; }
.react-pop {
  background: rgba(18,20,38,.95); border: 1px solid var(--glass-border);
  box-shadow: 0 12px 36px rgba(0,0,0,.5);
}
body.light .react-pop { background: rgba(255,255,255,.97); }

/* Категорийный эмодзи-пикер */
.emoji-picker { flex-direction: column; width: 320px; max-height: 280px; padding: 8px; gap: 6px; }
.emoji-cats {
  display: flex; gap: 2px; overflow-x: auto; padding-bottom: 4px;
  border-bottom: 1px solid var(--glass-border);
}
.emoji-cats button {
  flex: 0 0 auto; border: none; background: transparent; color: var(--txt-dim);
  cursor: pointer; border-radius: 8px; padding: 2px 6px; font-size: 16px;
}
.emoji-cats button.active { background: rgba(255,255,255,.14); color: var(--txt); }
body.light .emoji-cats button.active { background: rgba(10,20,40,.12); }
.emoji-grid {
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px;
  overflow-y: auto; padding: 4px 2px;
}
.emoji-grid button {
  border: none; background: transparent; font-size: 20px; line-height: 1;
  padding: 4px; border-radius: 8px; cursor: pointer;
}
.emoji-grid button:hover { background: rgba(255,255,255,.14); transform: scale(1.15); }
body.light .emoji-grid button:hover { background: rgba(10,20,40,.1); }

/* Расширенная светлая тема */
body.light { --bg-solid: #c7d2e6; }
body.light .chat-layout, body.light .messages { background: rgba(255,255,255,.35); }
body.light .reply-bar, body.light .quote { background: rgba(10,20,40,.06); }
body.light .quote { border-left-color: var(--accent); }
body.light .pinned-bar { background: rgba(255,255,255,.6); border: 1px solid rgba(10,20,40,.12); }
body.light .upProgress { background: rgba(10,20,40,.12); }
body.light .modal-card, body.light .mm-members, body.light .set-editor,
body.light .card, body.light .tg-screen { background: rgba(255,255,255,.85); color: #14181f; }
body.light .bubble.out { color: #fff; }
body.light .file-att { background: rgba(10,20,40,.06); }
body.light .reacts .react-chip { background: rgba(10,20,40,.1); }
body.light .mini:hover { background: rgba(10,20,40,.12); }
body.light .jump-btn { background: rgba(255,255,255,.95); color: #14181f; }
body.light .emoji-cats button { color: #5a6473; }

/* Экран звонка — полировка */
.call-glass {
  border: 1px solid var(--glass-border);
  box-shadow: 0 30px 80px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.2);
  background: linear-gradient(160deg, rgba(20,22,40,.9), rgba(10,12,24,.95));
}
.call-remote-name { text-shadow: 0 2px 10px rgba(0,0,0,.6); }
.call-btn { transition: transform .15s, background .15s; box-shadow: 0 6px 18px rgba(0,0,0,.4); }
.call-btn:hover { transform: translateY(-2px) scale(1.05); }
.call-btn.hang { background: linear-gradient(150deg,#ff5c5c,#ff8a5c); }
.call-btn.accept { background: linear-gradient(150deg,#2ecc71,#1abc9c); }
.incoming-box {
  background: rgba(255,255,255,.1); border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px); border-radius: 24px; padding: 28px; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}

/* Переключатели акцента и внешнего вида */
.accent-swatches { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 4px; }
.accent-swatch {
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; transition: transform .15s, border-color .15s;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}
.accent-swatch:hover { transform: scale(1.12); }
.accent-swatch.sel { border-color: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.5); }
body.light .accent-swatch.sel { border-color: #14181f; box-shadow: 0 0 0 3px rgba(10,20,40,.3); }

.appearance-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 2px; border-bottom: 1px solid var(--glass-border);
}
.appearance-row:last-child { border-bottom: none; }
.appearance-row .lbl { font-size: 15px; }
.seg {
  display: inline-flex; background: rgba(255,255,255,.08);
  border: 1px solid var(--glass-border); border-radius: 12px; overflow: hidden;
}
body.light .seg { background: rgba(10,20,40,.08); }
.seg button {
  border: none; background: transparent; color: var(--txt-dim);
  padding: 7px 14px; cursor: pointer; font-size: 14px;
}
.seg button.active { background: linear-gradient(150deg, var(--accent), var(--accent2)); color: #fff; }
.switch {
  position: relative; width: 48px; height: 28px; border-radius: 14px;
  background: rgba(255,255,255,.15); border: 1px solid var(--glass-border);
  cursor: pointer; transition: background .2s; flex: 0 0 auto;
}
body.light .switch { background: rgba(10,20,40,.15); }
.switch.on { background: linear-gradient(150deg, var(--accent), var(--accent2)); }
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px;
  border-radius: 50%; background: #fff; transition: transform .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.switch.on::after { transform: translateX(20px); }

/* LOSEX Prime */
.prime-card {
  margin-top: 14px; padding: 18px; border-radius: 18px; position: relative; overflow: hidden;
  background: linear-gradient(160deg, rgba(255,179,71,.14), rgba(255,92,168,.14));
  border: 1px solid rgba(255,179,71,.35);
}
.prime-glow {
  font-size: 30px; font-weight: 900; letter-spacing: 3px; text-align: center;
  background: linear-gradient(135deg,#ffb347,#ff5ca8);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 24px rgba(255,179,71,.35); margin-bottom: 8px;
}
.prime-steps { margin: 10px 0 6px; padding-left: 20px; color: var(--txt-dim); font-size: 13px; line-height: 1.7; }
.prime-steps li { margin-bottom: 2px; }
body.light .prime-card { background: linear-gradient(160deg, rgba(255,179,71,.22), rgba(255,92,168,.22)); }

/* Галочка «Верифицирован» */
.verified-badge {
  display: inline-grid; place-items: center; width: 16px; height: 16px;
  margin-left: 6px; border-radius: 50%;
  background: linear-gradient(150deg, var(--accent), var(--accent2));
  color: #fff; font-size: 10px; font-weight: 700; vertical-align: middle;
  box-shadow: 0 2px 6px rgba(124,92,255,.5);
}
body.light .verified-badge { box-shadow: 0 2px 6px rgba(124,92,255,.35); }

/* Теги/метки аккаунта */
.tag { display:inline-block; margin-left:6px; padding:1px 8px; border-radius:999px; font-size:10px; font-weight:700; letter-spacing:.4px; vertical-align:middle; color:#fff; }
.tag-scam { background:linear-gradient(150deg,#ff4d4f,#b91c1c); }
.tag-musician { background:linear-gradient(150deg,#a855f7,#7c3aed); }
.tag-artist { background:linear-gradient(150deg,#14b8a6,#0d9488); }
.tag-blogger { background:linear-gradient(150deg,#fb923c,#ea580c); }
.tag-admin { background:linear-gradient(150deg,#facc15,#ca8a04); color:#1a1500; }
