*{box-sizing:border-box}body{margin:0;font-family:Avenir Next,Segoe UI,sans-serif;background:radial-gradient(circle at top left,#eff6ff,#f8fafc 45%,#eef2ff);color:#0f172a}.container{max-width:1040px;margin:0 auto;padding:24px}.container.user-mode{max-width:1280px;padding:16px 20px}.topbar{background:#fff;border:1px solid #dbe4ef;border-radius:14px;padding:10px 12px;display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:12px;box-shadow:0 8px 20px #0f172a0d}.topbar-main{display:flex;align-items:baseline;gap:12px;min-width:0}.topbar-main-meta{display:flex;flex-direction:column;gap:2px;min-width:0}.topbar-main h1{margin:0;white-space:nowrap}.container:not(.user-mode) .topbar-main h1{font-size:26px}.container.user-mode .topbar{padding:8px 10px;border-radius:12px}.container.user-mode .topbar-main{gap:8px}.container.user-mode .topbar-main h1{font-size:20px;font-weight:600;letter-spacing:.1px}.container.user-mode .topbar-main .sub{font-size:13px;color:#64748b}.topbar-main .sub{margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.topbar-actions{display:flex;align-items:center;gap:10px;flex-shrink:0}.topbar-admin-nav{display:inline-flex;align-items:center;gap:4px;padding:0;border-radius:999px;border:none;background:transparent;box-shadow:none}.topbar-admin-nav .nav-btn{min-height:31px;padding:6px 13px;border-radius:999px;border:1px solid #e2e8f0;background:transparent;color:#334155;font-size:12px;font-weight:700;letter-spacing:.1px;line-height:1;box-shadow:none;transition:background-color .18s ease,color .18s ease,border-color .18s ease,box-shadow .18s ease}.topbar-admin-nav .topbar-btn.nav-btn{background:#374151!important;color:#fff!important;border:1px solid #1f2937!important}.topbar-admin-nav .nav-btn:hover{background:#4b5563;color:#fff;border-color:#374151;box-shadow:0 1px 3px #0f172a38}.topbar-admin-nav .topbar-btn.nav-btn:hover{background:#4b5563!important;color:#fff!important;border-color:#374151!important}.topbar-admin-nav .nav-btn.active{background:linear-gradient(135deg,#2563eb,#1d4ed8);color:#fff;border-color:#1e3a8a;box-shadow:0 4px 10px #2563eb59}.topbar-admin-nav .topbar-btn.nav-btn.active{background:linear-gradient(135deg,#2563eb,#1d4ed8)!important;color:#fff!important;border-color:#1e3a8a!important}.topbar-admin-nav .nav-btn:active{transform:none;filter:brightness(.98)}.topbar-actions .sub{margin:0;white-space:nowrap}.topbar-lang{display:inline-flex;align-items:center;gap:6px;white-space:nowrap;color:#475569;font-size:14px}.topbar-lang select{padding:6px 8px;border-radius:8px;border:1px solid #cbd5e1;background:#fff}.topbar-btn{margin-top:0;white-space:nowrap}.topbar .topbar-btn{padding:6px 10px;font-size:14px;border-radius:8px;line-height:1.2;background:#dc2626}.topbar .topbar-btn:hover{background:#b91c1c}.topbar-admin{flex-wrap:nowrap}.row{display:grid;grid-template-columns:1fr auto;gap:8px}.auth{display:grid;gap:8px;max-width:420px;background:#fff;border:1px solid #e2e8f0;border-radius:12px;padding:14px}input,button{padding:10px;font-size:16px}input{border:1px solid #cbd5e1;border-radius:10px;background:#fff}button{cursor:pointer;background:linear-gradient(135deg,#2563eb,#1d4ed8);color:#fff;border:none;border-radius:10px;font-weight:600}button[disabled]{opacity:.6;cursor:not-allowed}.link{margin-top:10px;background:#111827}.topbar .topbar-btn{margin-top:0}.sub{color:#555;margin:4px 0}.typing-indicator{margin:4px 0;font-size:12px;color:#64748b;font-weight:400}.typing-dots span{opacity:.2;animation:typingDot 1.2s infinite}.typing-dots span:nth-child(2){animation-delay:.2s}.typing-dots span:nth-child(3){animation-delay:.4s}@keyframes typingDot{0%,20%{opacity:.2}50%{opacity:1}to{opacity:.2}}.status-line{display:inline-flex;align-items:center;gap:6px}.status-dot{width:9px;height:9px;border-radius:50%;display:inline-block}.status-dot.on{background:#16a34a}.status-dot.off{background:#94a3b8}.lang-row{display:flex;align-items:center;gap:8px;margin:8px 0 4px}.lang-row select{padding:8px 10px;border-radius:8px;border:1px solid #cbd5e1;background:#fff}.error{color:#b91c1c;margin:8px 0}.messages{margin:12px 0;background:#fff;border:1px solid #dbe4ef;border-radius:14px;padding:14px;min-height:320px;max-height:460px;overflow:auto;display:flex;flex-direction:column;gap:10px;box-shadow:0 10px 24px #0f172a0f}.older-loading{text-align:center;color:#64748b;font-size:12px;padding:4px 0}.user-mode .messages{min-height:calc(100vh - 240px);max-height:calc(100vh - 240px);border-radius:16px;padding:12px 14px}.message{max-width:95%;border-radius:14px;padding:10px 12px;display:grid;gap:6px;line-height:1.35;word-break:break-word;align-self:flex-start;background:#f8fafc;border:1px solid #e2e8f0}.message-own,.message-other{align-self:flex-start}.message-meta{font-size:12px;font-weight:600}.message-head{display:flex;align-items:center;justify-content:space-between;gap:10px}.message-own .message-meta{color:#1d4ed8}.message-other .message-meta{color:#b45309}.message-time{font-size:11px;color:#64748b;margin-left:auto;white-space:nowrap}.msg-recalled-time{font-size:12px;color:#92400e;font-weight:400;justify-self:center;background:#fef9c3;border:1px solid #fde68a;border-radius:999px;padding:2px 8px}.msg-recall-link{justify-self:center;padding:0;font-size:12px;border:none;background:transparent;color:#dc2626;font-weight:400;cursor:pointer;text-decoration:none}.msg-attachment{margin-top:4px;border-radius:10px;max-width:320px}.msg-image{width:min(320px,100%);border:1px solid #dbe4ef}.msg-image-btn{border:none;padding:0;margin:0;background:transparent;cursor:zoom-in;width:fit-content}.msg-video{width:min(360px,100%);border:1px solid #dbe4ef;background:#000}.msg-audio{width:min(320px,100%)}.msg-audio-wrap{display:grid;gap:6px}.msg-audio-fallback{width:min(320px,100%);background:#0f172a}.msg-link{color:#1d4ed8;text-decoration:none;font-weight:600}.msg-link:hover{text-decoration:underline}.image-lightbox{position:fixed;top:0;right:0;bottom:0;left:0;background:#020617c7;display:grid;place-items:center;padding:24px;z-index:1200}.image-lightbox-content{position:relative;max-width:min(1200px,96vw);max-height:92vh}.image-lightbox-img{display:block;max-width:100%;max-height:92vh;border-radius:12px;box-shadow:0 20px 40px #0006}.image-lightbox-close{position:absolute;top:-12px;right:-12px;width:34px;height:34px;border-radius:999px;background:#111827;color:#fff;border:1px solid #1f2937;padding:0;line-height:1;font-size:24px;cursor:pointer}.admin-grid{display:grid;grid-template-columns:320px 1fr;gap:14px;margin-top:14px}.admin-tool-page{margin-top:14px;background:#fff;border:1px solid #dbe4ef;border-radius:14px;padding:14px;box-shadow:0 10px 24px #0f172a0f}.admin-tool-page h3{margin:0 0 10px;color:#1e3a8a}.admin-tool-form{max-width:480px}.admin-empty{display:flex;align-items:center;justify-content:center}.admin-empty-card{width:100%;min-height:320px;border:1px dashed #bfdbfe;border-radius:16px;background:linear-gradient(140deg,#f8fbff,#eef6ff);display:grid;place-content:center;text-align:center;padding:24px;color:#334155}.admin-empty-card h3{margin:0 0 8px;color:#1e3a8a}.admin-empty-card p{margin:0}.admin-chat-fixed-header{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:2px 0 8px;padding:10px 12px;border-radius:10px;border:1px solid #c7d2fe;color:#1e3a8a;font-size:14px;font-weight:600}.admin-chat-fixed-header>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.user-chat-shell{display:flex;flex-direction:column;gap:8px;min-height:calc(100svh - 130px)}.user-chat-shell h3{margin:4px 0}.user-composer-wrap{position:sticky;bottom:0;z-index:6;padding-top:8px;padding-bottom:calc(6px + env(safe-area-inset-bottom,0px));background:linear-gradient(180deg,#eff6ff00,#eff6ff 28%)}.user-mode .row input{padding:12px}.user-mode .row button:not(.mic-btn){min-width:110px}.users{background:#fff;border:1px solid #dbe4ef;border-radius:12px;padding:10px;max-height:calc(100vh - 180px);overflow:auto;box-shadow:0 10px 24px #0f172a0d}.users h3{margin:2px 2px 8px;font-size:14px;color:#475569;font-weight:600}.users-head{display:flex;align-items:center;gap:8px;margin-bottom:8px}.users-head h3{margin:0;white-space:nowrap}.users-search{margin-left:auto;height:30px;padding:5px 8px;font-size:12px;border-radius:8px;border:1px solid #cbd5e1;background:#fff}.user-item{width:100%;text-align:left;display:block;align-items:center;gap:8px;margin-bottom:6px;padding:7px 8px;border-radius:10px;background:#f8fbff;color:#0f172a}.user-item.active{outline:1px solid #2563eb;background:#eaf2ff}.user-item-label{display:inline-flex;align-items:center;gap:8px;width:100%}.user-item-text{display:grid;gap:1px;min-width:0;flex:1}.user-item-topline{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0}.user-item-restrictions{display:inline-flex;align-items:center;gap:6px;margin-left:8px;margin-top:0;flex-shrink:0}.mini-block-icon{width:16px;height:16px;display:inline-flex;align-items:center;justify-content:center;font-size:11px;border-radius:999px;background:#e2e8f0;color:#64748b;opacity:.85}.mini-block-icon.is-blocked{background:#fee2e2;color:#dc2626;border:1px solid #fca5a5;opacity:1}.user-item-subline{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0}.user-item-name{font-size:13px;color:#0f172a;line-height:1.2}.user-item-email{font-size:11px;color:#64748b;font-weight:400;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.2}.user-typing-indicator{font-size:10px;color:#16a34a;font-weight:400;white-space:nowrap}.unread-badge{min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:#dc2626;color:#fff;font-size:11px;font-weight:700;display:inline-flex;align-items:center;justify-content:center;margin-left:auto}.user-presence-dot{width:9px;height:9px;border-radius:50%;display:inline-block;flex:0 0 auto}.user-presence-dot.on{background:#16a34a}.user-presence-dot.off{background:#94a3b8}.file-btn{display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;padding:0;border-radius:10px;background:#0f766e;color:#fff;font-weight:600;cursor:pointer}.file-icon{font-size:20px;line-height:1}.mic-btn{width:42px;height:42px;border-radius:10px;border:none;background:#0f172a;color:#fff;font-size:18px;cursor:pointer}.mic-btn.recording{background:#b91c1c;animation:pulse 1s ease-in-out infinite}@keyframes pulse{0%{box-shadow:0 0 #b91c1c59}70%{box-shadow:0 0 0 10px #b91c1c00}to{box-shadow:0 0 #b91c1c00}}.file-btn.disabled{opacity:.6;cursor:not-allowed;pointer-events:none}.composer-row{display:flex;align-items:center;gap:8px;flex-wrap:nowrap}.composer-row input{flex:1;min-width:0}.composer-row .mic-btn{flex:0 0 auto;min-width:42px}.composer-row button[type=submit]{flex:0 0 auto}.attach-pending{margin:8px 0;padding:8px 10px;border:1px solid #cbd5e1;border-radius:10px;background:#f8fafc;display:inline-flex;align-items:center;gap:8px;max-width:100%}.pending-image-btn{border:none;background:transparent;padding:0;margin:0;cursor:zoom-in;line-height:0}.pending-image-thumb{width:44px;height:44px;border-radius:8px;object-fit:cover;border:1px solid #cbd5e1;display:block}.attach-name{max-width:280px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:13px}.attach-remove{background:#ef4444;color:#fff;border:none;border-radius:999px;width:22px;height:22px;line-height:1;padding:0;margin:0;cursor:pointer}.support-unavailable-card{margin:8px 0;padding:12px 14px;border:1px solid #f59e0b;border-radius:12px;background:#fffbeb;color:#92400e;font-size:15px;font-weight:600;text-align:center}.restriction-actions{display:flex;flex-wrap:nowrap;gap:6px;margin:0;justify-content:flex-end;flex-shrink:0;position:relative}.restriction-menu{position:relative}.restriction-menu summary{list-style:none}.restriction-menu summary::-webkit-details-marker{display:none}.restriction-menu-trigger{border:1px solid #cbd5e1;background:#fff;border-radius:999px;width:34px;height:34px;padding:0;font-size:16px;line-height:1;cursor:pointer;display:inline-grid;place-items:center;color:#334155;box-shadow:0 2px 8px #0f172a24}.restriction-menu-list{position:absolute;right:0;top:calc(100% + 6px);z-index:30;min-width:210px;display:grid;gap:6px;padding:8px;border-radius:12px;border:1px solid #dbe2ea;background:#fff;box-shadow:0 14px 30px #0f172a33}.restriction-btn{border:1px solid transparent;border-radius:10px;width:100%;min-height:36px;padding:8px 10px;font-size:13px;font-weight:600;letter-spacing:.1px;line-height:1.2;text-decoration:none;transition:transform .12s ease,box-shadow .12s ease,opacity .12s ease;display:inline-flex;align-items:center;justify-content:flex-start;gap:8px;position:relative;box-shadow:none;cursor:pointer}.restriction-btn:hover{transform:translateY(-1px);box-shadow:0 4px 10px #0f172a1f}.restriction-btn:active{transform:translateY(0)}.restriction-btn.is-blocked{font-weight:700}.restriction-btn-chat.is-blocked{color:#fff;background:linear-gradient(135deg,#ef4444,#dc2626);border-color:#b91c1c}.restriction-btn-voice.is-blocked{color:#fff;background:linear-gradient(135deg,#f97316,#ea580c);border-color:#c2410c}.restriction-btn-file.is-blocked{color:#fff;background:linear-gradient(135deg,#a855f7,#7e22ce);border-color:#6b21a8}.restriction-btn.is-open{font-weight:600}.restriction-btn-chat.is-open{color:#15803d;background:linear-gradient(135deg,#dcfce7,#bbf7d0);border-color:#22c55e}.restriction-btn-chat .restriction-icon-base{width:18px;height:18px;display:inline-block;background-image:url(https://cdn-icons-png.flaticon.com/512/5962/5962463.png);background-size:contain;background-repeat:no-repeat;background-position:center;font-size:0}.restriction-btn-voice.is-open{color:#0f766e;background:linear-gradient(135deg,#d1fae5,#a7f3d0);border-color:#14b8a6}.restriction-btn-file.is-open{color:#0369a1;background:linear-gradient(135deg,#e0f2fe,#bae6fd);border-color:#0ea5e9}.restriction-btn-file .restriction-icon-base{width:18px;height:18px;display:inline-block;background-image:url(https://cdn-icons-png.flaticon.com/512/5442/5442202.png);background-size:contain;background-repeat:no-repeat;background-position:center;font-size:0}.restriction-icon-base{line-height:1;pointer-events:none;flex:0 0 auto}.restriction-btn-text{flex:1 1 auto;text-align:left}.restriction-btn-voice .restriction-icon-base{width:18px;height:18px;display:inline-block;background-image:url(https://www.citypng.com/public/uploads/preview/microphone-mic-vocal-sound-black-icon-hd-png-701751695037651vlicflcg1s.png);background-size:contain;background-repeat:no-repeat;background-position:center;font-size:0}.mini-block-icon-voice,.mini-block-icon-chat,.mini-block-icon-file{font-size:11px;background-image:none}.restriction-icon-overlay{position:static;margin-left:auto;width:16px;height:16px;border-radius:50%;display:grid;place-items:center;background:#fff;color:#dc2626;font-size:11px;line-height:1;box-shadow:0 1px 3px #0f172a4d;pointer-events:none}@media (max-width: 900px){.container:not(.user-mode){padding:10px}.admin-grid{grid-template-columns:1fr}.admin-grid{gap:8px;margin-top:8px}.topbar-admin{gap:8px;align-items:flex-start}.topbar-admin .topbar-main h1{font-size:16px}.topbar-admin .topbar-main .sub{font-size:12px;white-space:normal}.topbar-admin .topbar-actions{width:100%;justify-content:space-between;gap:8px}.topbar-admin-nav{flex-wrap:wrap;justify-content:flex-end}.topbar-admin-nav .nav-btn{min-height:28px;padding:5px 10px;font-size:12px}.users{max-height:34svh;padding:8px}.users-head{margin-bottom:6px}.users-search{width:44%;min-width:130px}.user-item{margin-bottom:4px;padding:6px 7px}.admin-grid>section{display:flex;flex-direction:column;min-height:calc(100svh - 320px)}.admin-chat-fixed-header{margin:0 0 6px;padding:8px 10px;font-size:13px;flex-wrap:wrap}.admin-grid>section .messages{min-height:0;max-height:none;flex:1;margin:6px 0;padding:10px}.admin-grid>section .composer-row{position:sticky;bottom:0;z-index:5;padding-top:6px;background:linear-gradient(180deg,#eff6ff00,#eff6ff 28%)}.admin-empty-card{min-height:180px;padding:18px}.topbar{flex-wrap:wrap}.topbar-main{width:100%}.topbar-actions{width:100%;justify-content:space-between}.topbar-lang{margin-left:auto}.container.user-mode{padding:10px}.container.user-mode .topbar{flex-wrap:nowrap;align-items:center;gap:8px;margin-bottom:8px}.container.user-mode .topbar-main{width:auto;min-width:0}.container.user-mode .topbar-main .sub{display:none}.container.user-mode .topbar-actions{width:auto;margin-left:auto;justify-content:flex-end;gap:6px}.container.user-mode .status-prefix,.container.user-mode .lang-prefix{display:none}.container.user-mode .topbar-main h1{font-size:16px}.container.user-mode .topbar-lang select{font-size:13px;padding:5px 6px}.container.user-mode .topbar .topbar-btn{font-size:13px;padding:5px 8px}.user-chat-shell{min-height:calc(100svh - 98px);height:calc(100svh - 98px);gap:6px}.user-mode .messages{min-height:0;max-height:none;height:auto;flex:1;margin:6px 0;padding:10px}.user-chat-shell .sub,.user-chat-shell .error{margin:0;font-size:12px}.user-composer-wrap{padding-top:6px}.composer-row{gap:6px}.composer-row input{padding:10px}.file-btn,.mic-btn{width:38px;height:38px;min-width:38px}.composer-row button[type=submit]{min-width:74px;padding:10px 12px;font-size:14px}.restriction-actions{gap:6px;margin:0;justify-content:flex-end}.restriction-menu-list{min-width:190px;right:0}.restriction-btn{min-height:34px;font-size:12px}}@media (max-width: 640px){.container:not(.user-mode){padding:8px}.topbar-admin{flex-wrap:wrap;align-items:stretch;gap:6px}.topbar-admin .topbar-main{width:100%;min-width:0}.topbar-admin .topbar-main h1{font-size:15px}.topbar-admin .topbar-main .sub{display:none}.topbar-admin .topbar-actions{width:100%;gap:6px;justify-content:space-between;flex-wrap:wrap}.topbar-admin .status-line{font-size:12px}.topbar .topbar-btn{padding:5px 8px;font-size:13px}.topbar-admin-nav{width:100%;justify-content:flex-end}.topbar-admin-nav .nav-btn{min-height:27px;padding:5px 9px;font-size:11px}.admin-grid{gap:6px;margin-top:6px}.admin-tool-page{margin-top:8px;padding:10px}.users{max-height:40svh;padding:7px}.users-head{gap:6px}.users-head h3{font-size:12px}.users-search{width:56%;min-width:0;font-size:12px}.user-item{padding:6px;margin-bottom:4px}.user-item-name{font-size:12px}.user-item-email{font-size:10px}.admin-grid>section{min-height:calc(100svh - 332px)}.admin-chat-fixed-header{padding:7px 8px;font-size:12px;gap:6px}.admin-chat-fixed-header>span{white-space:normal;overflow:visible}.admin-grid>section .messages{padding:8px;border-radius:12px}.admin-grid>section .composer-row{gap:6px;padding-top:4px}.admin-grid>section .composer-row input{padding:9px;font-size:14px}.admin-grid>section .composer-row button[type=submit]{min-width:68px;padding:9px 10px;font-size:13px}.restriction-menu-list{min-width:min(220px,92vw)}}
