:root{--brand-ink:#101a12;--brand-deep:#1c2c20;--brand-lime:#cfff57;--brand-lime-2:#91ce2c;--brand-glow:#b8f23d42;--ease-luxury:cubic-bezier(.22,1,.36,1)}
body{background:radial-gradient(circle at 15% 0,#dfff9a26,transparent 34%),#edf0e7}
.rail{background:radial-gradient(circle at 50% 12%,#344c2d 0,transparent 30%),linear-gradient(180deg,#18261b,#0b120d 70%)}
.brand,.auth-logo{background:#101a12 url('/icon-192.png?v=20260731-2') center/cover no-repeat!important;color:transparent!important;box-shadow:0 0 0 1px #d6ff7955,0 12px 34px #91ce2c38}
.auth-logo{width:72px;height:72px;margin-bottom:24px;border-radius:22px;animation:logo-arrival .75s var(--ease-luxury) both}
.auth-card{overflow:hidden}.auth-card::before{content:"";position:absolute;top:-110px;right:-100px;width:230px;height:230px;border-radius:50%;background:radial-gradient(circle,#cfff5738,transparent 67%);pointer-events:none}.auth-card h2{color:var(--brand-ink)}
.primary,.composer .send,.profile-section .profile-primary{background:linear-gradient(145deg,var(--brand-ink),#2f4937)!important;color:var(--brand-lime)!important;box-shadow:0 10px 25px #14241924;transition:transform .2s var(--ease-luxury),box-shadow .2s ease,filter .2s ease}.primary:hover,.composer .send:hover,.profile-section .profile-primary:hover{filter:brightness(1.1);box-shadow:0 13px 32px #91ce2c2b}.primary:active,.composer .send:active,.profile-section .profile-primary:active{transform:scale(.94)}
.search{transition:border-color .25s ease,box-shadow .25s ease,background .25s ease}.search:focus-within{border-color:#9bca3f!important;box-shadow:0 0 0 4px var(--brand-glow)!important}.chat{position:relative;transition:transform .28s var(--ease-luxury),background .25s ease,box-shadow .25s ease}.chat:hover{transform:translateX(3px);background:#eff5e9}.chat.active{background:linear-gradient(100deg,#e7f3d8,#f6f8f2);box-shadow:inset 3px 0 var(--brand-lime-2),0 8px 24px #17231a0d}.chat.active::after{content:"";position:absolute;right:10px;top:50%;width:5px;height:5px;border-radius:50%;background:var(--brand-lime-2);box-shadow:0 0 12px var(--brand-lime-2);transform:translateY(-50%)}
.filters button{position:relative;transition:color .2s ease,background .25s ease,transform .2s var(--ease-luxury)}.filters button:hover{transform:translateY(-1px)}.filters button.active{animation:tab-select .35s var(--ease-luxury) both}
.conversation-header{background:linear-gradient(90deg,#fff,#fbfdf8)}.conversation-header button{transition:transform .22s var(--ease-luxury),border-color .2s ease,box-shadow .2s ease}.conversation-header button:hover{transform:translateY(-2px);border-color:#a9ce5b;box-shadow:0 8px 22px #8fbd3030}.composer{transition:border-color .25s ease,box-shadow .25s ease}.composer:focus-within{border-color:#9bc844;box-shadow:0 10px 38px #78a92320}.bubble{animation:bubble-in .34s var(--ease-luxury) both}.unread-badge{animation:badge-in .42s var(--ease-luxury) both}
.auth-overlay:not(.hidden),.modal-overlay:not(.hidden),.profile-overlay:not(.hidden),.admin-overlay:not(.hidden),.call-overlay:not(.hidden){animation:overlay-in .3s ease-out both}.auth-overlay:not(.hidden) .auth-card,.modal-overlay:not(.hidden) .modal-card,.profile-overlay:not(.hidden) .profile-card,.admin-overlay:not(.hidden) .admin-panel,.call-overlay:not(.hidden) .call-panel{animation:panel-in .48s var(--ease-luxury) both}.context-menu:not(.hidden){transform-origin:top right;animation:menu-in .28s var(--ease-luxury) both}.toast:not(.hidden){animation:toast-in .38s var(--ease-luxury) both}.user-result{transition:transform .22s var(--ease-luxury),background .2s ease,box-shadow .2s ease}.user-result:hover{transform:translateY(-2px);background:#f1f7e9;box-shadow:0 9px 24px #1c2b2015}.profile-actions button{transition:color .2s ease,transform .22s var(--ease-luxury)}.profile-actions button:hover{transform:translateY(-2px);color:#6e9920}.profile-actions b{transition:transform .25s var(--ease-luxury),background .2s ease}.profile-actions button:hover b{transform:scale(1.08);background:#e5f6c5}.admin-user{transition:background .2s ease,transform .22s var(--ease-luxury)}.admin-user:hover{transform:translateX(3px);background:#f8fbf5}
html[data-theme=dark] body{background:radial-gradient(circle at 14% 0,#8dc92d17,transparent 34%),#070d0a}html[data-theme=dark] .conversation-header{background:linear-gradient(90deg,#111c16,#0e1812)}html[data-theme=dark] .chat:hover{background:#17271e}html[data-theme=dark] .chat.active{background:linear-gradient(100deg,#203524,#17251d);box-shadow:inset 3px 0 var(--brand-lime),0 8px 28px #0004}html[data-theme=dark] .user-result:hover,html[data-theme=dark] .admin-user:hover{background:#18291f}html[data-theme=dark] .auth-card h2{color:#f4f7ef}html[data-theme=dark] .auth-card::before{background:radial-gradient(circle,#aee93624,transparent 67%)}
@media(max-width:700px){body.mobile-chat-open .conversation{animation:conversation-in .42s var(--ease-luxury) both}.chat:hover{transform:none}.auth-logo{width:64px;height:64px;border-radius:20px}.modal-overlay:not(.hidden) .modal-card,.profile-overlay:not(.hidden) .profile-card{animation:sheet-in .45s var(--ease-luxury) both}}
@keyframes overlay-in{from{opacity:0}to{opacity:1}}@keyframes panel-in{from{opacity:0;transform:translateY(18px) scale(.975);filter:blur(4px)}to{opacity:1;transform:none;filter:none}}@keyframes sheet-in{from{opacity:.5;transform:translateY(42px)}to{opacity:1;transform:none}}@keyframes menu-in{from{opacity:0;transform:translateY(-5px) scale(.94)}to{opacity:1;transform:none}}@keyframes conversation-in{from{opacity:.65;transform:translateX(22px)}to{opacity:1;transform:none}}@keyframes bubble-in{from{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:none}}@keyframes badge-in{0%{opacity:0;transform:scale(.55)}70%{transform:scale(1.12)}100%{opacity:1;transform:scale(1)}}@keyframes tab-select{from{opacity:.75;transform:scale(.93)}to{opacity:1;transform:none}}@keyframes toast-in{from{opacity:0;transform:translateY(15px) scale(.96)}to{opacity:1;transform:none}}@keyframes logo-arrival{0%{opacity:0;transform:translateY(-10px) rotate(-5deg) scale(.84);box-shadow:0 0 0 #0000}100%{opacity:1;transform:none;box-shadow:0 0 0 1px #d6ff7955,0 14px 38px #91ce2c45}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}

/* Компактная навигационная типографика: сообщения остаются крупными. */
.chat-list h1{font-size:27px}.chat-list>header>span,.auth-kicker{font-size:10px}.filters button{font-size:13px}.auth-card h2,.modal-card h2{font-size:24px}.profile-hero h2{font-size:25px}.profile-section h3{font-size:16px}.admin-panel h2{font-size:25px}.call-identity h2{font-size:24px}.welcome-message strong{font-size:20px}
@media(max-width:700px){.chat-list h1{font-size:25px}.filters button{font-size:12px}.auth-card h2,.modal-card h2{font-size:22px}.profile-hero h2{font-size:23px}.profile-section h3{font-size:15px}.call-identity h2{font-size:22px}}

/* iOS: все закрывающие кнопки находятся внутри visual viewport и ниже status bar. */
@media(max-width:700px){
  .profile-overlay{top:var(--app-top,0px);right:0;bottom:auto;left:0;height:var(--app-height,100dvh);padding:0;align-items:end}
  .profile-card{max-height:calc(var(--app-height,100dvh) - max(8px,env(safe-area-inset-top)));padding-bottom:env(safe-area-inset-bottom)}
  .modal-close,.profile-close{top:14px;right:max(14px,env(safe-area-inset-right));display:grid;place-items:center;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;border-radius:14px;font-size:23px;line-height:1;touch-action:manipulation;-webkit-tap-highlight-color:transparent;box-shadow:0 8px 24px #07100e24}
  .user-search-header{padding-right:54px}
  .profile-hero{padding-top:68px}
}

.security-notice{position:fixed;z-index:180;top:76px;right:18px;display:grid;grid-template-columns:42px minmax(0,1fr) auto 32px;align-items:center;gap:11px;width:min(520px,calc(100vw - 36px));padding:13px;border:1px solid #b9d875;border-radius:18px;background:#fafff2ee;box-shadow:0 24px 70px #08130d50;backdrop-filter:blur(20px);animation:security-notice-in .48s var(--ease-luxury) both}.security-notice-icon{display:grid;place-items:center;width:42px;height:42px;border-radius:13px;background:linear-gradient(145deg,#13221c,#304a36);color:#cfff57;font-size:22px}.security-notice>span{display:grid;gap:3px;min-width:0}.security-notice strong{color:#13221c;font-size:14px}.security-notice small{overflow:hidden;color:#617067;font-size:12px;text-overflow:ellipsis;white-space:nowrap}.security-notice button{height:36px;padding:0 12px;border:0;border-radius:11px;background:#203326;color:#cfff57;font-weight:750}.security-notice #security-notice-close{width:32px;padding:0;background:transparent;color:#526157;font-size:22px}.security-highlight{animation:security-highlight 2.5s ease both}html[data-theme=dark] .security-notice{border-color:#567632;background:#111d16ee}html[data-theme=dark] .security-notice strong{color:#f4f7ef}html[data-theme=dark] .security-notice small{color:#adbaaf}html[data-theme=dark] .security-notice #security-notice-close{color:#dbe5dc}html[data-theme=dark] .security-highlight{animation-name:security-highlight-dark}
@media(max-width:700px){.security-notice{top:calc(var(--app-top,0px) + max(12px,env(safe-area-inset-top)));right:10px;grid-template-columns:38px minmax(0,1fr) 34px;width:calc(100vw - 20px);padding:11px}.security-notice-icon{width:38px;height:38px}.security-notice>button:not(#security-notice-close){grid-column:2/4;width:100%}.security-notice #security-notice-close{grid-column:3;grid-row:1}}
@keyframes security-notice-in{from{opacity:0;transform:translateY(-16px) scale(.96)}to{opacity:1;transform:none}}@keyframes security-highlight{0%,100%{box-shadow:none}15%,75%{box-shadow:inset 4px 0 #bdf043,0 0 0 3px #bdf0432c;background:#f7ffe8}}@keyframes security-highlight-dark{0%,100%{box-shadow:none}15%,75%{box-shadow:inset 4px 0 #bdf043,0 0 0 3px #bdf0432c;background:#1b3021}}

/* Компактный список поиска: прокручиваются только пользователи, заголовок закреплён. */
.user-search-card{grid-template-rows:auto minmax(0,1fr)!important}.user-search-header{position:relative;z-index:2;flex:none}.user-search-card .user-results{align-content:start;grid-auto-rows:max-content;min-height:0;overflow-y:auto!important;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}.user-search-card .user-result{min-height:54px;padding:6px 9px;gap:9px}.user-search-card .user-result .avatar{width:36px;height:36px;border-radius:12px}.user-search-card .user-result span{gap:1px}.user-search-card .user-result strong{font-size:14px}.user-search-card .user-result small,.user-search-card .user-result .user-activity{font-size:11px;line-height:1.25}.user-search-card .user-result b{font-size:17px}
@media(max-width:700px){.modal-card.user-search-card{display:grid;grid-template-rows:auto minmax(0,1fr)!important;overflow:hidden}.user-search-header{position:relative;top:auto}.user-search-card .user-results{display:grid;align-content:start;grid-auto-rows:max-content;max-height:none!important;padding-bottom:max(10px,env(safe-area-inset-bottom))}.user-search-card .user-result{min-height:52px;padding:5px 8px;border-radius:11px}.user-search-card .user-result .avatar{width:34px;height:34px}.user-search-header h2{margin-bottom:6px}.user-search-header .search{margin-top:12px;margin-bottom:10px}}

/* iOS keyboard: один visual viewport, composer всегда у верхней границы клавиатуры. */
@media(max-width:700px){.app-shell{position:fixed;top:var(--app-top,0px);height:var(--app-height,100dvh)}.app-shell .chat-list{height:100%}.app-shell .conversation{position:absolute;inset:0;top:0;width:100%;height:100%;min-height:0;grid-template-rows:auto minmax(0,1fr) auto}.conversation .messages{min-height:0}.conversation .composer{position:relative;z-index:12;align-self:stretch;transform:none!important}.keyboard-open .conversation .composer{bottom:0;padding-top:7px;padding-bottom:8px}.keyboard-open .conversation .messages{padding-bottom:12px}.keyboard-open .emoji-panel{bottom:58px}}

/* Закрытый системный чат администратора: события регистрации без поля отправки. */
.platform-avatar{background:radial-gradient(circle at 30% 20%,#dcff7c,#9bd12d 28%,#15251b 72%)!important;color:#0b160e!important;box-shadow:0 7px 22px #8fc52e52;font-weight:900}.platform-message{justify-content:center}.platform-bubble{width:min(520px,94%);max-width:520px;border-color:#a9ce5f;background:linear-gradient(145deg,#faffef,#edf8dc);box-shadow:0 13px 35px #26391d14}.platform-bubble>strong{display:block;margin-bottom:6px;color:#20321f;font-size:15px}.platform-bubble .platform-identity{display:block;margin-top:8px;color:#5e735e;font-size:11px}.platform-chat-open .composer,.platform-chat-open #call-button,.platform-chat-open #video-call-button{display:none!important}.platform-chat-open .conversation{grid-template-rows:78px minmax(0,1fr)}html[data-theme=dark] .platform-bubble{border-color:#668a37;background:linear-gradient(145deg,#1b2c20,#132019);color:#eef8e9}html[data-theme=dark] .platform-bubble>strong{color:#d7ff78}html[data-theme=dark] .platform-bubble .platform-identity{color:#abc19f}@media(max-width:700px){.platform-chat-open .conversation{grid-template-rows:auto minmax(0,1fr)}.platform-bubble{width:96%}}
.platform-event-head{display:flex;align-items:center;gap:10px;margin-bottom:8px}.platform-event-head>span{display:grid;gap:2px}.platform-event-head strong{color:#20321f;font-size:15px}.platform-event-head .platform-identity{margin:0}.platform-account-avatar{width:40px;height:40px;flex:none;border-radius:13px;background:linear-gradient(145deg,#314b37,#17271d)}.platform-account-avatar img{width:100%;height:100%;border-radius:inherit;object-fit:cover}html[data-theme=dark] .platform-event-head strong{color:#d7ff78}
