.before-load,.before-load *{opacity:0!important;pointer-events:none!important;transition:none!important}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; transition: background-color 0.3s ease, border-color 0.3s ease; }
input, textarea { user-select: text; -webkit-user-select: text; }

:root {
  --purple: #7c3aed; --purple-dark: #4c1d95; --purple-light: #a78bfa;
  --bg: #f8fafc; --card: #ffffff; --text: #0f172a; --text2: #64748b;
  --text3: #94a3b8; --border: #e2e8f0; --danger: #ef4444;
  --radius: 16px; --radius-sm: 12px; --sidebar-w: 200px;
}
:root.dark {
  --bg: #0f0f1a; --card: #1a1a2e; --text: #f1f5f9; --text2: #94a3b8;
  --text3: #64748b; --border: #2d2d4a;
}

body { font-family: 'Inter', sans-serif; background: var(--bg); height: 100dvh; color: var(--text); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.loading { display:none !important; }
:root, :root.dark { color-scheme: light; } :root.dark { color-scheme: dark; }

/* ═══════════════ SCREENS ═══════════════ */
.screen { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; flex-direction: column; gap: clamp(14px, 3vh, 24px); background: linear-gradient(135deg, var(--bg) 0%, var(--card) 100%); z-index: 10000; }
.screen.active { display: flex; }

/* PIN-код отключён
.pin-logo { font-family: 'Unbounded', sans-serif; font-size: 72px; font-weight: 900; background: linear-gradient(135deg, var(--purple-light), #c084fc, var(--purple)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; line-height: 1; position:relative; display:inline-block; }
.pin-logo::after { content:''; display:block; width:60%; height:2px; margin:4px auto 0; background:linear-gradient(90deg,transparent,var(--purple-light),var(--purple),var(--purple-light),transparent); border-radius:2px; }
.pin-title { font-size: 13px; color: var(--text2); letter-spacing: 5px; text-transform: uppercase; margin-top: -4px; }
.pin-dots { display: flex; gap: clamp(10px, 2.5vw, 14px); }
.pin-dot { width: clamp(13px, 3vw, 16px); height: clamp(13px, 3vw, 16px); border-radius: 50%; border: 2px solid rgba(167,139,250,0.3); background: transparent; transition: all 0.2s; }
.pin-dot.filled { background: var(--purple-light); border-color: var(--purple-light); box-shadow: 0 0 12px rgba(167,139,250,0.4); }
.pin-dot.error  { background: var(--danger); border-color: var(--danger); box-shadow: 0 0 12px rgba(239,68,68,0.4); }
.pin-pad { display: grid; grid-template-columns: repeat(3, clamp(56px, 13vw, 72px)); gap: clamp(8px, 2vw, 12px); }
.pin-btn { width: clamp(56px, 13vw, 72px); height: clamp(56px, 13vw, 72px); background: rgba(255,255,255,0.06); border: 1.5px solid rgba(167,139,250,0.15); border-radius: 14px; color: var(--text); font-size: clamp(18px, 4vw, 22px); font-weight: 700; cursor: pointer; transition: all 0.12s; font-family: 'Unbounded', sans-serif; touch-action: manipulation; }
.pin-btn:active { background: rgba(167,139,250,0.2); transform: scale(0.94); border-color: var(--purple-light); }
.pin-btn.del { font-size: clamp(14px, 3vw, 17px); color: var(--text2); }
.pin-error { font-size: 12px; color: var(--danger); min-height: 18px; text-align: center; }
.pin-error:empty { opacity: 0; }
.pin-error.show { animation: errorPop 0.35s ease; } */

.auth-box { width: 100%; max-width: 360px; display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 0 24px; }
.auth-logo { font-family: 'Unbounded', sans-serif; font-size: 56px; font-weight: 900; background: linear-gradient(135deg, var(--purple-light), #c084fc, var(--purple)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; line-height: 1; position:relative; display:inline-block; }
.auth-logo::after { content:''; display:block; width:50%; height:2px; margin:3px auto 0; background:linear-gradient(90deg,transparent,var(--purple-light),var(--purple),var(--purple-light),transparent); border-radius:2px; }
.auth-subtitle { font-size: 14px; color: var(--text2); margin-top: -8px; margin-bottom: 4px; }
.auth-input { width: 100%; padding: 14px 16px; font-size: 15px; font-family: 'Inter', sans-serif; border: 1.5px solid var(--border); border-radius: var(--radius-sm); outline: none; color: var(--text); background: var(--card); transition: border-color 0.2s, box-shadow 0.2s; -webkit-appearance: none; }
.auth-input:focus { border-color: var(--purple-light); box-shadow: 0 0 0 3px rgba(167,139,250,0.15); }
.auth-input::placeholder { color: var(--text3); }
.auth-input-wrap { position: relative; width: 100%; }
.auth-input-wrap .auth-input { padding-right: 44px; }
.auth-eye { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; padding: 4px; touch-action: manipulation; color: var(--text2); line-height: 1; }
.auth-eye svg { transition: transform 0.25s ease, opacity 0.2s ease; display: block; }
.auth-eye:active svg { transform: scale(0.8); }
.auth-btn { width: 100%; padding: 14px; border: none; border-radius: 50px; font-size: 15px; font-weight: 700; cursor: pointer; font-family: 'Inter', sans-serif; transition: transform 0.1s, opacity 0.2s; touch-action: manipulation; }
.auth-btn:active { transform: scale(0.97); }
.auth-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.auth-btn-primary { background: linear-gradient(135deg, var(--purple), #6d28d9); color: #fff; }
.auth-link { font-size: 13px; color: var(--purple-light); cursor: pointer; text-decoration: none; font-weight: 500; transition: opacity 0.2s; }
.auth-error { width: 100%; font-size: 12px; color: var(--danger); text-align: center; min-height: 18px; }
.auth-error:empty { opacity: 0; }
.auth-error.show { animation: errorPop 0.35s ease; }

/* ═══ SUCCESS ═══ */
#successOverlay { position: fixed; inset: 0; z-index: 20000; background: linear-gradient(135deg, var(--bg) 0%, var(--card) 100%); display: none; align-items: center; justify-content: center; flex-direction: column; gap: 20px; }
#successOverlay.active { display: flex; }
.success-circle { width: 90px; height: 90px; border-radius: 50%; background: linear-gradient(135deg, var(--purple), #6d28d9); display: flex; align-items: center; justify-content: center; animation: successPop 0.6s cubic-bezier(0.34,1.56,0.64,1) both; }
.success-circle svg { width: 44px; height: 44px; stroke: #fff; stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.success-circle svg polyline { animation: checkDraw 0.5s 0.3s ease both; }
.success-text { font-family: 'Unbounded', sans-serif; font-size: 22px; font-weight: 700; animation: fadeIn 0.5s 0.4s ease both; background: linear-gradient(135deg, var(--purple-light), #c084fc); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.success-sub { font-size: 13px; color: var(--text2); animation: fadeIn 0.5s 0.6s ease both; }
@keyframes successPop { 0% { transform: scale(0); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes checkDraw { 0% { stroke-dashoffset: 30; stroke-dasharray: 30; } 100% { stroke-dashoffset: 0; } }

/* ═══ PROFILE SETUP (after reg) ═══ */
#setupScreen {
  position: fixed; inset: 0; z-index: 19000;
  background: linear-gradient(135deg, var(--bg) 0%, var(--card) 100%);
  display: none; align-items: center; justify-content: center;
  flex-direction: column; gap: 16px; padding: 24px;
}
#setupScreen.active { display: flex; }
.setup-box { width: 100%; max-width: 380px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.setup-title { font-family: 'Unbounded', sans-serif; font-size: 18px; font-weight: 700; color: var(--text); text-align: center; }
.setup-desc { font-size: 13px; color: var(--text2); text-align: center; margin-bottom: 4px; }
.setup-input { width: 100%; padding: 14px 16px; font-size: 15px; font-family: 'Inter', sans-serif; border: 1.5px solid var(--border); border-radius: var(--radius-sm); outline: none; color: var(--text); background: var(--card); transition: border-color 0.2s; -webkit-appearance: none; }
.setup-input:focus { border-color: var(--purple-light); }
.setup-input::placeholder { color: var(--text3); }
.setup-input-wrap { width: 100%; display: flex; align-items: center; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--card); transition: border-color 0.2s; }
.setup-input-wrap:focus-within { border-color: var(--purple-light); }
.setup-input-prefix { padding: 14px 0 14px 16px; font-size: 15px; color: var(--text2); font-weight: 600; white-space: nowrap; }
.setup-input-wrap .setup-input { border: none; padding-left: 4px; background: transparent; }
.setup-input-wrap .setup-input:focus { box-shadow: none; }

.force-uname-ok { color:#22c55e; }
.force-uname-error { color:#ef4444; }
.force-uname-checking { color:var(--text3); }
/* ═══ APP ═══ */
#app { display: none; height: 100dvh; width: 100%; flex-direction: column; background: var(--bg); position: fixed; inset: 0; z-index: 9000; overflow: hidden; }
#app.active { display: flex; }

.app-body { display: flex; flex: 1; overflow: hidden; min-height: 0; }

/* HEADER */
.app-header { height: 52px; background: var(--card); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 16px; flex-shrink: 0; }
.app-header-logo { font-family: 'Unbounded', sans-serif; font-size: 13px; font-weight: 700; display:inline-flex; align-items:center; gap:6px; }
.app-header-logo .logotext { background: linear-gradient(135deg, var(--purple-light), #c084fc, var(--purple)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; position:relative; }
.app-header-logo .logotext::after { content:''; display:block; width:100%; height:2px; margin-top:2px; background:linear-gradient(90deg,var(--purple-light),var(--purple),var(--purple-light)); border-radius:2px; }
.app-header-version { font-family: 'Inter', sans-serif; font-size: 9px; color: var(--text3); font-weight: 400; background: none; -webkit-text-fill-color: var(--text3); }
.app-header-right { display: flex; gap: 10px; align-items: center; }
.app-header-btn { width: 34px; height: 34px; border-radius: 50%; border: none; background: rgba(255,255,255,0.05); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 16px; transition: background 0.2s; touch-action: manipulation; position:relative; }
.app-header-btn:active { background: rgba(255,255,255,0.12); }
.app-header-avatar-placeholder { width: 30px; height: 30px; border-radius: 50%; cursor: pointer; background: rgba(167,139,250,0.2); color: var(--purple-light); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; border: 2px solid var(--purple); }

/* SIDEBAR */
.sidebar { width: var(--sidebar-w); background: var(--card); border-right: 1px solid var(--border); display: none; flex-direction: column; padding: 12px 0; flex-shrink: 0; }
.sidebar-item { display: flex; align-items: center; gap: 10px; padding: 12px 20px; background: none; border: none; cursor: pointer; color: var(--text); font-size: 13px; font-family: 'Inter', sans-serif; touch-action: manipulation; text-align: left; }
.sidebar-item:hover { background: rgba(167,139,250,0.08); }
.sidebar-item:active { background: rgba(167,139,250,0.15); }
.sidebar-item .nav-icon { font-size: 18px; }
.sidebar-item.active { color: var(--purple-light); background: rgba(167,139,250,0.1); border-right: 3px solid var(--purple); }

/* CONTENT AREA */
.app-content { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 80px; }
.app-content::-webkit-scrollbar { width: 3px; }
.app-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* POST */
.post { background: var(--card); border-radius: var(--radius); margin: 8px 12px; padding: 16px; animation: fadeIn 0.35s ease; border: 1px solid var(--border); }
.post-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.post-avatar { width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; background: linear-gradient(135deg, rgba(167,139,250,0.2), rgba(124,58,237,0.2)); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; color: var(--purple-light); }
.post-author { font-weight: 600; font-size: 13px; }
.post-user { font-size: 10px; color: var(--text3); margin-top: 1px; }
.post-time { font-size: 10px; color: var(--text2); margin-top: 2px; }
.post-text { font-size: 14px; line-height: 1.6; color: var(--text); word-break: break-word; white-space: pre-wrap; }
.post-actions { display: flex; gap: 32px; padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--border); }
.post-action { display: flex; align-items: center; gap: 6px; font-size: 18px; color: var(--text2); cursor: pointer; background: none; border: none; font-family: 'Inter', sans-serif; transition: color 0.2s; touch-action: manipulation; padding: 4px 2px; }
.post-action:active { transform: scale(0.92); }
.post-action.liked { color: var(--danger); }
.post-action span { font-size: 14px; }

.new-post-bar { margin: 8px 12px; background: var(--card); border-radius: var(--radius); padding: 12px 16px; display: flex; align-items: center; gap: 10px; cursor: pointer; transition: background 0.2s; border: 1px solid var(--border); }
.new-post-bar:active { background: rgba(255,255,255,0.03); }
.new-post-bar-avatar { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; background: rgba(167,139,250,0.2); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; color: var(--purple-light); }
.new-post-bar-text { color: var(--text3); font-size: 13px; flex: 1; }

/* BOTTOM NAV (mobile) */
.bottom-nav { height: 56px; background: var(--card); border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-evenly; flex-shrink: 0; position: fixed; bottom: 0; left: 0; right: 0; z-index: 100; padding-bottom: env(safe-area-inset-bottom); }
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: none; cursor: pointer; color: var(--text); font-size: 9px; font-family: 'Inter', sans-serif; touch-action: manipulation; min-width: 48px; padding: 4px 0; }
.nav-item .nav-icon { font-size: 20px; line-height: 1; }
.nav-item.active { color: var(--purple-light); }

/* MODAL */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 15000; display: none; align-items: flex-end; justify-content: center; backdrop-filter: blur(4px); }
.modal-overlay.active { display: flex; }
.modal-content { background: var(--card); border-radius: var(--radius) var(--radius) 0 0; width: 100%; max-width: 500px; max-height: 80vh; overflow-y: auto; padding: 24px 20px; }
.modal-overlay.active .modal-content { animation: slideUp 0.3s ease; }
#createChannelModal { align-items:center !important; justify-content:center !important; }
#createChannelModal .modal-content { animation: fadeIn 0.2s ease !important; border-radius:16px !important; max-height:90vh; overflow-y:auto; }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-title { font-size: 17px; font-weight: 700; margin-bottom: 14px; text-align: center; }
.modal-textarea { width: 100%; min-height: 110px; padding: 14px; font-size: 14px; font-family: 'Inter', sans-serif; border: 1.5px solid var(--border); border-radius: var(--radius-sm); outline: none; resize: vertical; background: var(--card); color: var(--text); transition: border-color 0.2s; line-height: 1.5; }
.modal-textarea:focus { border-color: var(--purple-light); }
.modal-textarea::placeholder { color: var(--text3); }
.modal-count { text-align: right; font-size: 10px; color: var(--text3); margin-top: 4px; }
.modal-btn { width: 100%; padding: 13px; margin-top: 10px; background: linear-gradient(135deg, var(--purple), #6d28d9); color: #fff; border: none; border-radius: 50px; font-size: 14px; font-weight: 700; cursor: pointer; font-family: 'Inter', sans-serif; transition: transform 0.1s; touch-action: manipulation; }
.modal-btn:active { transform: scale(0.97); }
.modal-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.modal-btn-ghost { background: transparent; color: var(--text2); margin-top: 2px; }

/* PROFILE */
.profile-card { text-align: center; padding: 32px 16px 20px; background: var(--design-card-bg, var(--card)); margin: 8px 12px; border-radius: var(--radius); border: 1px solid var(--design-card-border, var(--border)); }
.profile-avatar-wrap { width: 110px; height: 110px; border-radius: 50%; margin: 0 auto 14px; position: relative; cursor: pointer; border: 3px solid var(--design-avatar-border, transparent); }
.profile-avatar-big { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: linear-gradient(135deg, rgba(167,139,250,0.2), rgba(124,58,237,0.3)); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 38px; color: var(--purple-light); border: 3px solid var(--purple); transition: filter 0.2s; }
.profile-avatar-overlay { position: absolute; inset: 0; border-radius: 50%; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.2s; font-size: 36px; color: #fff; border: 3px solid var(--purple); }
.profile-avatar-wrap:hover .profile-avatar-overlay, .profile-avatar-wrap:active .profile-avatar-overlay { opacity: 1; }
.profile-name { font-size: 22px; font-weight: 700; }
.profile-username { font-size: 13px; color: var(--text3); margin-top: 2px; }
.profile-bio { font-size: 13px; color: var(--text2); margin-top: 8px; padding: 0 20px; max-width: 500px; margin-left: auto; margin-right: auto; word-break: break-word; white-space: pre-wrap; }
.profile-stats { display: flex; justify-content: center; gap: 36px; margin-top: 16px; }
.profile-stat { text-align: center; }
.profile-stat-num { font-size: 20px; font-weight: 700; }
.profile-stat-label { font-size: 11px; color: var(--text2); margin-top: 2px; }

.profile-device { text-align: center; font-size: 10px; color: var(--text3); padding: 16px 12px 12px; }

/* SEARCH */
.search-input { width: 100%; padding: 12px 16px; font-size: 14px; font-family: 'Inter', sans-serif; border: 1.5px solid var(--border); border-radius: var(--radius-sm); outline: none; color: var(--text); background: var(--card); transition: border-color 0.2s; -webkit-appearance: none; }
.search-input:focus { border-color: var(--purple-light); }
.search-input::placeholder { color: var(--text3); }
.user-row { background: var(--card); border-radius: var(--radius-sm); margin: 0 12px 6px; padding: 12px 14px; display: flex; align-items: center; gap: 2px; cursor: pointer; transition: background 0.2s; border: 1px solid var(--border); }
.user-row:active { background: rgba(255,255,255,0.03); }

.empty-state { text-align: center; padding: 50px 24px; color: var(--text2); }
.empty-state-icon { font-size: 40px; margin-bottom: 10px; }
.empty-state-text { font-size: 13px; }

/* ANIMATIONS */
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeOut { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-12px); } }
@keyframes marquee { 0% { transform: translateX(0); } 10% { transform: translateX(0); } 75% { transform: translateX(calc(-100% + 160px)); } 85% { transform: translateX(calc(-100% + 160px)); } 100% { transform: translateX(0); } }
.audio-name-wrap { overflow:hidden; white-space:nowrap; flex:1; }
.audio-name { display:inline-block; white-space:nowrap; width:auto; }
.audio-name-wrap .audio-name { overflow:hidden; text-overflow:ellipsis; max-width:140px; }
.audio-name-wrap:hover .audio-name { overflow:hidden; text-overflow:ellipsis; animation:none; }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-8px)} 40%,80%{transform:translateX(8px)} }
@keyframes errorPop { 0%{opacity:0;transform:translateY(-6px) scale(0.95)} 50%{transform:translateY(2px) scale(1.02)} 100%{opacity:1;transform:translateY(0) scale(1)} }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(20px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(-50%) translateY(0); } to { opacity: 0; transform: translateX(-50%) translateY(20px); } }
.shake { animation: shake 0.35s ease; }
.anim-in { animation: fadeIn 0.1s ease; }
.anim-stagger { animation: fadeIn 0.4s ease both; }

/* ═══ COMMENTS PAGE ═══ */
.cmt-page-title { font-size:15px; font-weight:600; color:var(--text); padding:12px 16px; background:var(--card); border-bottom:1px solid var(--border); display:flex; align-items:center; gap:8px; flex-shrink:0; }
.cmt-page-title button { background:none; border:none; color:var(--text); font-size:18px; cursor:pointer; padding:4px; }
.cmt-input-row { display:flex; gap:8px; padding:12px 16px 20px; background:var(--card); border-top:1px solid var(--border); flex-shrink:0; }
.cmt-page-title.anim-in, .cmt-input-row.anim-in, .cmt-item.anim-in { animation: fadeIn 0.3s ease both; }
.cmt-input-row input { flex:1; padding:11px 14px; font-size:14px; font-family:Inter,sans-serif; border:1.5px solid var(--border); border-radius:12px; outline:none; color:var(--text); background:var(--bg); }
.cmt-input-row input:focus { border-color:var(--purple-light); }
.cmt-input-row input::placeholder { color:var(--text3); }
.cmt-input-row button { width:42px; height:42px; border-radius:50%; border:none; background:var(--purple); color:#fff; font-size:17px; cursor:pointer; flex-shrink:0; }
.cmt-input-row button:disabled { opacity:0.4; cursor:not-allowed; }
.cmt-item { padding:10px 16px; border-bottom:1px solid var(--border); display:flex; gap:10px; transition:box-shadow 0.4s ease; }
.cmt-item.highlight { box-shadow:0 0 0 3px var(--purple-light); border-radius:8px; }
.chat-msg { transition:background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.4s ease; }
.chat-msg .audio-item { width:450px!important; max-width:100%!important; }
.chat-msg.highlight { box-shadow:0 0 0 3px var(--purple-light) !important; }
.cmt-item-avatar { width:32px; height:32px; border-radius:50%; flex-shrink:0; }
.cmt-item-body { flex:1; min-width:0; }
.cmt-item-author { font-size:13px; font-weight:600; color:var(--text); }
.cmt-item-text { font-size:13px; color:var(--text2); margin-top:2px; line-height:1.4; word-break:break-word; }
.cmt-item-time { font-size:10px; color:var(--text3); margin-top:2px; }
.cmt-item-actions { display:flex; gap:12px; margin-top:6px; }
.cmt-item-action { background:none; border:none; color:var(--text3); cursor:pointer; font-size:15px; display:flex; align-items:center; gap:3px; padding:3px; touch-action:manipulation; transition:color 0.15s; }
.cmt-item-action:active { transform:scale(0.9); }
.cmt-item-action.liked { color:var(--danger); }
.cmt-item-action span { font-size:11px; color:var(--text3); margin-left:1px; }
.cmt-empty { text-align:center; padding:40px 20px; color:var(--text2); font-size:13px; }
.cmt-pinned { background:rgba(29,155,240,0.05); border-left:2px solid #1d9bf0; }

/* ═══ CONTEXT MENU ═══ */
.ctx-menu { position:fixed; z-index:30000; background:var(--card); border:1px solid var(--border); border-radius:12px; padding:4px; min-width:160px; box-shadow:0 8px 32px rgba(0,0,0,0.3); visibility:hidden; opacity:0; transform:scale(0.95); transition:opacity 0.12s ease,transform 0.12s ease,visibility 0.12s; }
.ctx-menu.active { visibility:visible; opacity:1; transform:scale(1); }
.ctx-item { display:flex; align-items:center; gap:8px; padding:10px 14px; border:none; background:none; color:var(--text); font-size:13px; width:100%; text-align:left; cursor:pointer; border-radius:8px; font-family:Inter,sans-serif; transition:background 0.15s; }
.ctx-item:hover { background:rgba(167,139,250,0.1); }
.ctx-item.danger { color:var(--danger); }

/* ═══ VERIFIED BADGE ═══ */
.ver-badge { display:inline-flex; align-items:center; justify-content:center; min-width:16px; width:16px; height:16px; border-radius:50%; background:linear-gradient(135deg,#1d9bf0,#0d7ed4); color:#fff; font-size:9px; font-weight:700; vertical-align:middle; margin-left:3px; flex-shrink:0; box-shadow:0 1px 3px rgba(0,0,0,0.15); line-height:1; }
.ver-badge-grey { display:inline-flex; align-items:center; justify-content:center; min-width:16px; width:16px; height:16px; border-radius:50%; background:linear-gradient(135deg,#9ca3af,#6b7280); color:#fff; font-size:9px; font-weight:700; vertical-align:middle; margin-left:3px; flex-shrink:0; box-shadow:0 1px 3px rgba(0,0,0,0.15); line-height:1; }

/* ═══ TITLES ═══ */
.title-badge { display:inline-flex; align-items:center; padding:3px 10px; font-size:11px; font-weight:600; border-radius:6px; margin-top:6px; line-height:1.4; letter-spacing:0.3px; white-space:nowrap; }
.title-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; max-width:400px; margin:0 auto; }
.title-grid-btn { display:flex; align-items:center; justify-content:center; padding:18px 8px; font-size:13px; font-weight:600; border-radius:6px; cursor:pointer; border:2px solid transparent; transition:opacity 0.15s,transform 0.1s; font-family:'Inter',sans-serif; touch-action:manipulation; min-height:52px; }
.title-grid-btn:active { transform:scale(0.96); }

/* ═══ OFFLINE DOT ═══ */
@keyframes dotWave { 0%,100%{opacity:0.3;transform:scale(0.6)} 50%{opacity:1;transform:scale(1.4);color:#fbbf24} }
.dot-wave { display:inline-flex; align-items:center; gap:2px; margin-left:4px; vertical-align:middle; }
.dot-wave span { display:inline-block; width:5px; height:5px; border-radius:50%; background:currentColor; animation:dotWave 1.2s ease infinite; }
.dot-wave span:nth-child(2) { animation-delay:0.15s; }
.dot-wave span:nth-child(3) { animation-delay:0.3s; }
.cooldown-bar { animation:cooldownIn 0.4s ease; margin:8px 12px; background:var(--card); border-radius:var(--radius); border:1px solid var(--border); }
@keyframes cooldownIn { from{opacity:0;transform:translateY(-8px)} to{opacity:0.9;transform:translateY(0)} }

/* TOAST */
.toast { position: fixed; bottom: 80px; left: 50%; z-index: 99999; transform: translateX(-50%); background: var(--card); color: var(--text); padding: 12px 24px; border-radius: 50px; font-size: 13px; font-weight: 500; border: 1px solid var(--border); pointer-events: none; animation: toastIn 0.3s ease; box-shadow: 0 4px 24px rgba(0,0,0,0.3); }
.toast.hide { animation: toastOut 0.25s ease forwards; }

/* RESPONSIVE */
@media (min-width: 768px) {
  .sidebar { display: flex; }
  .bottom-nav { display: none; }
  .app-content { padding-bottom: 12px; }
  .post { margin: 8px auto; max-width: 600px; }
  .new-post-bar, .cooldown-bar { max-width: 600px; margin: 8px auto; }
  .user-row { max-width: 588px; margin: 0 auto 6px; }
  .empty-state { max-width: 600px; margin: 0 auto; }
  .search-input { max-width: 588px; margin: 0 auto; display: block; }
  #searchResults { max-width: 600px; margin: 0 auto; }
  .profile-card { max-width: 700px; margin: 8px auto; }
  .profile-device { max-width: 700px; margin: 0 auto; }
}
@media (min-width: 1200px) {
  .profile-card { max-width: none; margin: 8px 24px; border-radius: var(--radius); }
  .profile-device { max-width: none; margin: 0 24px; }
  .post { max-width: none; margin: 8px 24px; }
  .new-post-bar { max-width: none; margin: 8px 24px; }
  .user-row { max-width: none; margin: 0 24px 6px; }
  .empty-state { max-width: none; margin: 0 24px; }
  .search-input { max-width: none; margin: 0 24px; display: block; }
  #searchResults { max-width: none; margin: 0 24px; }
}
.dev-toggle { position:relative; display:inline-block; width:44px; height:24px; cursor:pointer; }
.dev-toggle input { opacity:0; width:0; height:0; position:absolute; }
.dev-toggle-bg { position:absolute; inset:0; background:var(--border); border-radius:12px; transition:0.3s; }
.dev-toggle input:checked + .dev-toggle-bg { background:var(--purple); }
.dev-toggle-slider { position:absolute; top:2px; left:2px; width:20px; height:20px; border-radius:50%; background:#fff; transition:0.3s; }
.dev-toggle input:checked + .dev-toggle-bg + .dev-toggle-slider { transform:translateX(20px); }

/* Админ-панель: сетка */
.admin-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; max-width:500px; margin:0 auto; }
.admin-grid > div { background:var(--card); border:1px solid var(--border); border-radius:20px; padding:14px 8px; text-align:center; }
.admin-grid .admin-grid-icon { font-size:clamp(28px,6vw,40px); color:#fff; width:clamp(44px,10vw,64px); height:clamp(44px,10vw,64px); border-radius:14px; display:flex; align-items:center; justify-content:center; margin:0 auto; }
@media (max-width: 550px) { .admin-grid { gap:5px; } .admin-grid > div { padding:10px 4px; border-radius:14px; } .admin-grid .admin-grid-icon { width:38px; height:38px; border-radius:10px; font-size:22px; } }

/* Онлайн-точка */
@keyframes onlinePulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.7;transform:scale(1.1)} }
.online-dot { position:absolute; bottom:0; right:0; width:10px; height:10px; border-radius:50%; background:#22c55e; border:2px solid var(--card); animation:onlinePulse 2s ease-in-out infinite; transition:opacity 0.6s ease, visibility 0.6s ease; }
.online-dot.offline { opacity:0; visibility:hidden; animation:none; }
.avatar-wrap { position:relative; display:inline-block; flex-shrink:0; }

/* Статус в сети в профиле */
.online-profile-status { display:flex; align-items:center; justify-content:center; gap:4px; margin-top:6px; opacity:0; visibility:hidden; transition:opacity 0.6s ease, visibility 0.6s ease; }
.online-profile-status.online { opacity:1; visibility:visible; }

/* Непрочитанные сообщения */
.msg-unread-badge { position:absolute; top:-6px; right:-6px; min-width:18px; height:18px; padding:0 5px; border-radius:9px; background:#ef4444; color:#fff; font-size:10px; font-weight:700; display:flex; align-items:center; justify-content:center; line-height:1; box-shadow:0 1px 3px rgba(0,0,0,0.3); }

/* Медиа в постах */
.post-media { display:flex; gap:6px; margin-top:10px; flex-wrap:wrap; }
.post-media-item { border-radius:12px; overflow:hidden; cursor:pointer; max-width:100%; flex-shrink:0; }
.post-media-item { position:relative; }
.post-media-item img, .post-media-item video { display:block; max-width:100%; max-height:400px; object-fit:contain; border-radius:12px; background:#000; }
.post-media-item .vid-play { position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); width:44px; height:44px; border-radius:50%; background:rgba(0,0,0,0.55); border:2px solid rgba(255,255,255,0.7); cursor:pointer; display:flex; align-items:center; justify-content:center; z-index:2; transition:opacity 0.3s; }
.post-media-item .vid-play::after { content:''; display:block; width:0; height:0; border-left:13px solid #fff; border-top:8px solid transparent; border-bottom:8px solid transparent; margin-left:3px; }

@media (max-width:768px){.channel-input-wrap{padding-bottom:70px!important}}
/* Полноэкранный просмотр */
.media-viewer { position:fixed; inset:0; z-index:99999; background:rgba(0,0,0,0.92); display:none; align-items:center; justify-content:center; flex-direction:column; backdrop-filter:blur(8px); }
.media-viewer.active { display:flex; }
.media-viewer-close { position:absolute; top:16px; right:16px; width:40px; height:40px; border-radius:50%; background:rgba(255,255,255,0.15); border:none; color:#fff; font-size:22px; cursor:pointer; display:flex; align-items:center; justify-content:center; z-index:10; }
.media-viewer-content { max-width:90vw; max-height:80vh; display:flex; align-items:center; justify-content:center; }
.media-viewer-content img, .media-viewer-content video { max-width:100%; max-height:80vh; border-radius:8px; object-fit:contain; }
.media-viewer-download { margin-top:16px; padding:10px 24px; border-radius:50px; background:rgba(255,255,255,0.1); border:1px solid rgba(255,255,255,0.2); color:#fff; font-size:13px; cursor:pointer; font-family:'Inter',sans-serif; }

/* Мобильные отступы в скроллах */
@media (max-width:767px){
  #appContent > *:last-child { margin-bottom: 16px; }
  [style*="overflow-x:auto"] { padding: 0 0 8px 4px; }
  [style*="overflow-x:auto"] > *:last-child { margin-right: 16px; }
}

/* Кнопка + для медиа */
.media-add-btn { width:38px; height:38px; border-radius:50%; border:1.5px dashed var(--border); background:transparent; color:var(--text3); cursor:pointer; display:flex; align-items:center; justify-content:center; font-size:18px; flex-shrink:0; transition:all 0.2s; touch-action:manipulation; }
.media-add-btn:active { background:rgba(167,139,250,0.1); border-color:var(--purple-light); color:var(--purple-light); }
.media-preview-row { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:8px; }
.media-preview-item { width:70px; height:70px; border-radius:10px; overflow:hidden; position:relative; flex-shrink:0; }
.media-preview-item img, .media-preview-item video { width:100%; height:100%; object-fit:cover; }
.media-preview-del { position:absolute; top:2px; right:2px; width:20px; height:20px; border-radius:50%; background:rgba(0,0,0,0.6); border:none; color:#fff; font-size:12px; cursor:pointer; display:flex; align-items:center; justify-content:center; line-height:1; }

/* Secret rarity */
.secret-name { background:var(--secret-grad,linear-gradient(180deg,#fef08a,#ca8a04)); -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; font-weight:800; }
.exclusive-name { color:#a855f7 !important; font-weight:900; -webkit-text-fill-color:#a855f7 !important; text-shadow:-0.5px -0.5px 0 #fff,0.5px -0.5px 0 #fff,-0.5px 0.5px 0 #fff,0.5px 0.5px 0 #fff; animation:exclusiveShake 0.3s ease-in-out infinite; display:inline-block; background:none !important; }
@keyframes exclusiveShake { 0%{transform:translate(-0.5px,-0.5px) rotate(-0.5deg)} 25%{transform:translate(0.5px,-0.5px) rotate(0.5deg)} 50%{transform:translate(-0.5px,0.5px) rotate(-0.3deg)} 75%{transform:translate(0.5px,0.5px) rotate(0.3deg)} 100%{transform:translate(-0.5px,-0.5px) rotate(-0.5deg)} }
@keyframes shimmer { 0%{background-position:0% 50%} 50%{background-position:100% 50%} 100%{background-position:0% 50%} }
@keyframes shimmerStroke { 0%{stroke:#a78bfa} 20%{stroke:#8b5cf6} 40%{stroke:#3b82f6} 60%{stroke:#6366f1} 80%{stroke:#a78bfa} 100%{stroke:#a78bfa} }
.watermark { position:absolute; bottom:8px; right:12px; font-size:32px; font-weight:900; background:var(--watermark-grad,linear-gradient(180deg,#fef08a,#ca8a04)); -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; opacity:0.6; pointer-events:none; z-index:0; line-height:1; white-space:nowrap; }
.watermark-exclusive { position:absolute; bottom:8px; right:12px; font-size:32px; font-weight:900; color:#000; -webkit-text-stroke:1.5px #fff; text-stroke:1.5px #fff; animation:exclusiveShake 0.3s ease-in-out infinite; opacity:1; pointer-events:none; z-index:0; line-height:1; white-space:nowrap; text-shadow:0 0 4px rgba(255,255,255,0.5); }


