@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap');
:root{color-scheme:dark;--bg:#0b1020;--panel:#11182a;--panel2:#161f33;--line:#263149;--text:#edf2ff;--muted:#8f9bb4;--accent:#8b7bff;--accent2:#6555e8;--bubble:#182238;--mine:#5549bd;--green:#45d6a0;--danger:#ff7d8a;--shadow:0 24px 70px #02061766}
*{box-sizing:border-box}body{margin:0;min-height:100vh;background:var(--bg);color:var(--text);font-family:'DM Sans',system-ui,sans-serif}button,input,textarea{font:inherit}button{cursor:pointer}button:focus-visible,input:focus-visible,textarea:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.hidden{display:none!important}.muted{color:var(--muted)}.tiny{font-size:11px;line-height:1.6}.auth-screen{min-height:100vh;display:grid;place-items:center;padding:24px;background:radial-gradient(ellipse at 50% 15%,#3d347b55,transparent 48%),var(--bg)}.auth-card{width:min(100%,420px);padding:38px;background:#11182aee;border:1px solid var(--line);border-radius:24px;box-shadow:var(--shadow)}.brand-mark{width:52px;height:52px;display:grid;place-items:center;border-radius:17px;background:linear-gradient(135deg,#9e90ff,#6354e7);color:white;font:800 30px Manrope,sans-serif;box-shadow:0 10px 30px #7465ff44}.brand-mark.small{width:34px;height:34px;border-radius:11px;font-size:21px}.eyebrow{margin:24px 0 6px;color:#a99fff;font-size:10px;font-weight:700;letter-spacing:2.2px}.auth-card h1{font:800 31px Manrope,sans-serif;margin:0}.auth-copy{font-size:13px;margin:10px 0 24px}.auth-tabs{display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:4px;background:#0b1020;border-radius:11px;margin-bottom:22px}.tab{border:0;border-radius:8px;padding:10px;color:var(--muted);background:transparent;font-size:12px;font-weight:600}.tab.active{background:#252e46;color:var(--text)}.auth-form label{display:block;font-size:12px;font-weight:600;margin:15px 0 7px}.auth-form input{display:block;width:100%;margin-top:8px;background:#0c1323;border:1px solid #2c3853;border-radius:10px;padding:13px;color:var(--text);outline:none}.auth-form input:focus{border-color:var(--accent)}.field-hint{margin:-2px 0 10px;color:var(--muted);font-size:10px}.primary{border:0;background:linear-gradient(135deg,#9485ff,#6b5be7);color:white;border-radius:10px;padding:13px 18px;font-weight:700;box-shadow:0 8px 24px #6b5be733}.primary.full{width:100%;margin-top:12px}.primary:disabled{opacity:.55;cursor:wait}.error{min-height:18px;color:var(--danger);font-size:12px;margin:8px 0}.auth-card .tiny{margin:18px 0 0}.app-shell{height:100vh;min-height:550px;display:grid;grid-template-columns:280px minmax(0,1fr);max-width:1600px;margin:0 auto;background:var(--panel)}.sidebar{display:flex;flex-direction:column;min-width:0;border-right:1px solid var(--line);background:#0f1627}.side-header{height:74px;padding:0 20px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line)}.brand-lockup{display:flex;align-items:center;gap:10px;font:800 14px Manrope,sans-serif;letter-spacing:-.3px}.icon-button{width:34px;height:34px;display:grid;place-items:center;border:1px solid transparent;border-radius:10px;background:transparent;color:var(--muted);font-size:19px}.icon-button:hover{background:var(--panel2);color:var(--text)}.profile-row{display:flex;align-items:center;gap:10px;padding:18px 17px 20px}.avatar{flex-shrink:0;width:38px;height:38px;display:grid;place-items:center;border-radius:13px;background:linear-gradient(135deg,#7162e8,#c18dff);color:white;font-weight:700}.profile-info{display:flex;flex:1;min-width:0;flex-direction:column;gap:5px}.profile-info strong{font-size:12px;overflow:hidden;text-overflow:ellipsis}.online-label{font-size:10px;color:var(--muted)}.online-label i,.status-dot{display:inline-block;width:6px;height:6px;background:var(--green);border-radius:50%;margin-right:5px}.side-section-title,.contacts-heading{padding:8px 20px;color:#77839d;font-size:9px;font-weight:700;letter-spacing:1.4px}.conversation{width:calc(100% - 20px);margin:0 10px;display:flex;align-items:center;gap:11px;padding:11px 10px;border:0;border-radius:11px;background:transparent;text-align:left;color:var(--text)}.conversation.active,.conversation:hover{background:#242541}.conversation-icon{width:34px;height:34px;display:grid;place-items:center;border-radius:11px;background:#38315f;color:#b6adff;font-size:21px}.conversation-copy{display:flex;flex-direction:column;gap:4px}.conversation-copy strong{font-size:12px}.conversation-copy small{font-size:10px;color:var(--muted)}.contacts-heading{display:flex;justify-content:space-between;align-items:center;margin-top:23px}.contacts-heading span:last-child{padding:2px 7px;border-radius:6px;background:#202a40;letter-spacing:0}.contacts-list{overflow:auto;padding:4px 10px}.contact{display:flex;align-items:center;gap:10px;width:100%;padding:9px 10px;margin:2px 0;border:0;border-radius:10px;background:transparent;color:var(--text);text-align:left}.contact:hover,.contact.active{background:#202a40}.contact .avatar{width:33px;height:33px;border-radius:11px;font-size:12px}.contact-copy{min-width:0;flex:1;display:flex;flex-direction:column;gap:4px}.contact-copy strong{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.contact-copy small{font-size:10px;color:var(--muted)}.presence-dot{width:7px;height:7px;border-radius:50%;background:#58637a}.presence-dot.online{background:var(--green);box-shadow:0 0 0 3px #45d6a015}.empty-contacts{padding:15px 10px;font-size:11px;color:var(--muted);line-height:1.6}.sidebar-footer{margin-top:auto;border-top:1px solid var(--line);padding:17px 19px;font-size:9px;color:var(--muted)}.chat-panel{display:flex;flex-direction:column;min-width:0;background:var(--panel)}.chat-header{height:74px;flex-shrink:0;display:flex;align-items:center;gap:13px;padding:0 28px;border-bottom:1px solid var(--line)}.chat-avatar{width:40px;height:40px;border-radius:13px;background:#28274a;color:#b6adff}.chat-title{min-width:0;flex:1}.chat-title h2{font:700 14px Manrope,sans-serif;margin:0 0 5px}.chat-title p{font-size:10px;color:var(--muted);margin:0}.header-right{display:flex;align-items:center;gap:13px}.connection{display:flex;align-items:center;gap:6px;font-size:10px;color:var(--muted)}.connection i{width:6px;height:6px;border-radius:50%;background:#f0bd68}.connection i.connected{background:var(--green)}.messages{flex:1;overflow:auto;padding:26px clamp(18px,5vw,70px);display:flex;flex-direction:column;gap:16px}.welcome{margin:auto;text-align:center;max-width:300px;color:var(--muted)}.welcome-symbol{width:54px;height:54px;margin:0 auto 16px;display:grid;place-items:center;border-radius:18px;background:#242342;color:#aaa0ff;font-size:25px}.welcome h3{color:var(--text);font:700 16px Manrope,sans-serif;margin:0 0 8px}.welcome p{font-size:12px;line-height:1.7}.message{max-width:min(78%,620px);display:flex;flex-direction:column;gap:6px;align-self:flex-start;animation:appear .16s ease-out}.message.mine{align-self:flex-end}.message-meta{display:flex;align-items:center;gap:8px;padding:0 4px;font-size:10px;color:var(--muted)}.message.mine .message-meta{justify-content:flex-end}.message-meta strong{color:#c4bcff;font-weight:600}.message-bubble{white-space:pre-wrap;overflow-wrap:anywhere;padding:11px 14px;border:1px solid #2a3650;border-radius:4px 15px 15px 15px;background:var(--bubble);font-size:12px;line-height:1.65}.message.mine .message-bubble{border-color:#6659c4;border-radius:15px 4px 15px 15px;background:var(--mine)}.message.private .message-meta:after{content:'ЛИЧНО';font-size:8px;letter-spacing:.8px;color:#b2aaff;background:#302c56;padding:3px 5px;border-radius:4px}.typing-indicator{height:18px;padding:0 clamp(18px,5vw,70px);font-size:10px;color:var(--muted)}.composer{position:relative;display:flex;align-items:flex-end;gap:10px;margin:0 28px;padding:12px 12px 25px;background:#0e1525;border:1px solid #29354f;border-radius:15px}.composer textarea{flex:1;min-width:0;max-height:140px;resize:none;border:0;outline:0;background:transparent;color:var(--text);padding:7px 2px;font-size:12px;line-height:1.6}.composer textarea::placeholder{color:#6e7a94}.emoji-button{width:32px;height:34px;flex-shrink:0;border:0;background:transparent;color:#929db4;font-size:22px}.send-button{width:36px;height:36px;flex-shrink:0;border:0;border-radius:11px;background:linear-gradient(135deg,#9384ff,#6958e7);color:white;font-size:17px}.composer-hint{position:absolute;left:55px;bottom:7px;color:#65718b;font-size:9px}.footer-note{text-align:center;color:#66728a;font-size:9px;padding:10px 10px 13px}.light{color-scheme:light;--bg:#edf0f8;--panel:#fff;--panel2:#f1f3fa;--line:#e0e4ef;--text:#20263a;--muted:#7c849a;--bubble:#f1f3fb;--mine:#6d5be8}.light .sidebar{background:#f8f9fd}.light .auth-card{background:#fff}.light .auth-form input,.light .auth-tabs,.light .composer{background:#f7f8fc}.light .message-bubble{border-color:#e1e5f0}.light .message.mine .message-bubble{background:#6d5be8;color:#fff}.light .side-header{background:#f8f9fd}.light .conversation.active,.light .conversation:hover,.light .contact:hover,.light .contact.active{background:#eceefa}.light .profile-row .icon-button:hover,.light .icon-button:hover{background:#e8eaf5}.light .auth-form input{color:var(--text)}
@keyframes appear{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:720px){.app-shell{grid-template-columns:76px minmax(0,1fr)}.side-header{justify-content:center;padding:0}.brand-lockup span,.side-header>.icon-button,.profile-info,.profile-row>#logoutButton,.side-section-title,.conversation-copy,.contacts-heading,.contact-copy,.sidebar-footer{display:none}.profile-row{justify-content:center;padding:16px 0}.conversation{width:54px;height:54px;justify-content:center;padding:0;margin:0 auto}.conversation-icon{width:38px;height:38px}.contacts-list{padding:5px 7px}.contact{justify-content:center;padding:8px 0}.contact .avatar{width:38px;height:38px}.chat-header{padding:0 15px;gap:9px}.header-right{gap:5px}.connection span{display:none}.messages{padding:20px 14px}.message{max-width:90%}.composer{margin:0 10px;padding:9px 8px 24px;gap:5px}.composer-hint{left:48px;font-size:8px}.footer-note{font-size:8px}.auth-card{padding:28px 23px}}@media(max-width:420px){.app-shell{grid-template-columns:60px minmax(0,1fr)}.conversation{width:48px}.contact .avatar{width:34px;height:34px}.chat-title h2{font-size:12px}.chat-title p{font-size:9px}.chat-avatar{width:34px;height:34px}.chat-header{padding:0 9px}.header-right .icon-button{width:28px}.connection{display:none}.message-bubble{font-size:11px;padding:9px 11px}}

.search-label{display:block;padding:0 12px 8px}.search-label input{width:100%;min-width:0;padding:10px 11px;border:1px solid var(--line);border-radius:9px;background:#0c1323;color:var(--text);font-size:11px}.search-label input::placeholder{color:var(--muted)}.light .search-label input{background:#f7f8fc;color:var(--text)}@media(max-width:720px){.search-label{padding:4px 7px}.search-label input{padding:8px 3px;font-size:0}.search-label input:focus{font-size:10px}.search-label input::placeholder{color:transparent}}


/* Минималистичные статусы сообщений */
.message-status {
  display: inline-block;
  margin-left: 4px;
  color: var(--muted, #8b93a1);
  font-size: 12px;
  line-height: 1;
  letter-spacing: -2px;
  vertical-align: 1px;
}

.attach-button{font-size:20px}.attachment-card{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:8px;padding:9px;border:1px solid var(--line);border-radius:9px;background:var(--panel2)}.attachment-name{max-width:220px;overflow-wrap:anywhere;font-weight:600}.attachment-card small{color:var(--muted)}.attachment-card a{color:var(--text);font-weight:700;text-decoration:underline}.attach-button:disabled{opacity:.5}

/* Conversation-list first layout and chat navigation */
.app-shell:not(.chat-open) .chat-panel { display: none; }
.app-shell:not(.chat-open) .sidebar { grid-column: 1 / -1; width: 100%; border-right: 0; }
.app-shell:not(.chat-open) .contacts-list { flex: 1; }
.app-shell.chat-open .sidebar { display: none; }
.app-shell.chat-open .chat-panel { display: flex; grid-column: 1 / -1; }
.back-to-chats { flex-shrink: 0; border-color: var(--line); font-size: 24px; }

.chat-panel { position: relative; }
@media (min-width: 721px) {
  .app-shell:not(.chat-open) { grid-template-columns: minmax(280px, 680px); justify-content: center; }
  .app-shell:not(.chat-open) .sidebar { border: 1px solid var(--line); }
}
@media(max-width:720px) {
  .app-shell:not(.chat-open) { grid-template-columns: minmax(0, 1fr); }
  .app-shell:not(.chat-open) .side-header { justify-content: space-between; padding: 0 18px; }
  .app-shell:not(.chat-open) .brand-lockup span,
  .app-shell:not(.chat-open) .side-header > .icon-button,
  .app-shell:not(.chat-open) .profile-info,
  .app-shell:not(.chat-open) .profile-row > #logoutButton,
  .app-shell:not(.chat-open) .side-section-title,
  .app-shell:not(.chat-open) .conversation-copy,
  .app-shell:not(.chat-open) .contacts-heading,
  .app-shell:not(.chat-open) .contact-copy,
  .app-shell:not(.chat-open) .sidebar-footer { display: initial; }
  .app-shell:not(.chat-open) .brand-lockup { display: flex; }
  .app-shell:not(.chat-open) .side-header > .icon-button { display: grid; }
  .app-shell:not(.chat-open) .profile-row { justify-content: initial; padding: 16px 17px; }
  .app-shell:not(.chat-open) .profile-row > #logoutButton { display: grid; }
  .app-shell:not(.chat-open) .side-section-title,
  .app-shell:not(.chat-open) .contacts-heading { display: flex; }
  .app-shell:not(.chat-open) .conversation { width: calc(100% - 20px); height: auto; justify-content: flex-start; padding: 11px 10px; margin: 0 10px; }
  .app-shell:not(.chat-open) .conversation-copy { display: flex; }
  .app-shell:not(.chat-open) .contacts-list { padding: 4px 10px; }
  .app-shell:not(.chat-open) .contact { justify-content: flex-start; padding: 9px 10px; }
  .app-shell:not(.chat-open) .contact .avatar { width: 33px; height: 33px; }
  .app-shell:not(.chat-open) .contact-copy { display: flex; }
  .app-shell:not(.chat-open) .sidebar-footer { display: block; }
}


/* v2.7: inline image previews and image viewer */
.image-attachment{display:block;max-width:min(360px,70vw);padding:7px!important}
.image-preview-button{display:block;padding:0;border:0;background:transparent;cursor:zoom-in;width:100%;border-radius:8px;overflow:hidden}
.message-image-preview{display:block;max-width:100%;max-height:300px;object-fit:contain;border-radius:8px;background:var(--panel2)}
.attachment-image-footer{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:7px 2px 0}
.image-viewer-modal{position:fixed;inset:0;z-index:10000;background:rgba(0,0,0,.88);display:flex;align-items:center;justify-content:center;padding:24px}
.image-viewer-modal.hidden{display:none}
.image-viewer-figure{margin:0;display:flex;flex-direction:column;align-items:center;gap:10px;max-width:95vw;max-height:92vh}
.image-viewer-figure img{max-width:90vw;max-height:82vh;object-fit:contain;border-radius:8px}
.image-viewer-figure figcaption{color:#fff;font-size:13px;overflow-wrap:anywhere;text-align:center}
.image-viewer-close{position:absolute;right:18px;top:12px;border:0;background:rgba(255,255,255,.15);color:white;font-size:32px;line-height:1;width:44px;height:44px;border-radius:50%;cursor:pointer}

/* v2.8 profile customization and navigation polish */
.my-avatar-button{border:2px solid #fff;box-shadow:0 0 0 3px #777,0 5px 18px #0007;cursor:pointer;position:relative;flex-shrink:0}
.my-avatar-button::after{content:'✎';position:absolute;right:-5px;bottom:-5px;width:19px;height:19px;border:2px solid var(--panel);border-radius:50%;display:grid;place-items:center;background:#fff;color:#111;font-size:11px;font-weight:800}
.profile-row{order:-1;border-bottom:1px solid var(--line);margin-bottom:10px;background:linear-gradient(135deg,var(--panel2),var(--panel));border-radius:14px;margin:8px;padding:13px;position:relative}
.profile-row .profile-info{min-width:0;flex:1}.profile-info strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-title{min-width:0;flex:1}.chat-title h2{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-title p{margin:3px 0 0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

.profile-modal{position:fixed;inset:0;z-index:1000;background:#000a;display:grid;place-items:center;padding:18px}.profile-modal.hidden{display:none}.profile-card{width:min(460px,100%);max-height:92vh;overflow:auto;background:var(--panel);color:var(--text);border:1px solid var(--line);border-radius:20px;padding:22px;display:flex;flex-direction:column;gap:14px;box-shadow:0 24px 80px #0008}.profile-modal-header{display:flex;align-items:center;justify-content:space-between;gap:12px}.profile-modal-header h2{margin:0;font-size:22px}.profile-card label{display:flex;flex-direction:column;gap:7px;font-size:13px;color:var(--muted)}.profile-card input:not([type=color]),.profile-card textarea{width:100%;border:1px solid var(--line);border-radius:10px;padding:11px;background:var(--panel2);color:var(--text)}.profile-card input[type=color]{width:100%;height:42px;border:1px solid var(--line);border-radius:10px;background:var(--panel2);padding:3px}.profile-avatar-preview-row{display:flex;align-items:center;gap:12px}.profile-avatar-preview{width:68px;height:68px;object-fit:cover;border-radius:18px;background:var(--panel2);border:1px solid var(--line)}.profile-modal-actions{display:flex;justify-content:flex-end;gap:10px}.profile-modal-actions button{border-radius:10px;padding:10px 16px;border:1px solid var(--line)}.profile-modal-actions .secondary{background:var(--panel2);color:var(--text)}.profile-modal-actions .primary{background:var(--text);color:var(--bg)}
@media(max-width:700px){.profile-row{margin:6px;padding:10px}.chat-header{padding:0 12px;gap:8px}.chat-title h2{font-size:16px}.chat-title p{font-size:11px}}

/* v2.9: softer light theme and profile media */
.light{--bg:#f3f4f7;--panel:#fbfbfc;--panel2:#f0f1f4;--line:#e3e5e9;--text:#292d35;--muted:#737984;--bubble:#f0f1f4;--mine:#7770b8;--shadow:0 20px 55px #1f29370d}
.light .sidebar,.light .side-header{background:#f7f8fa}.light .composer{background:#f7f8fa;border-color:#e0e2e7}.light .search-label input,.light .auth-form input,.light .auth-tabs{background:#f0f1f4;border-color:#e0e2e7}.light .tab.active{background:#e1e3e9;color:#30343c}.light .message-bubble{background:#f2f3f5;border-color:#e1e3e7;color:#292d35}.light .message.mine .message-bubble{background:#7770b8;border-color:#7770b8;color:#fff}.light .contact:hover,.light .contact.active,.light .conversation:hover,.light .conversation.active{background:#e9ebf0}.light .icon-button:hover{background:#e8eaf0}.light .muted,.light .composer-hint{color:#737984}
.my-avatar-button{position:relative;border:2px solid #a99bff;box-shadow:0 0 0 3px #8b7bff20,0 5px 16px #0002;cursor:pointer;transition:transform .15s,box-shadow .15s}.my-avatar-button:hover{transform:translateY(-1px);box-shadow:0 0 0 4px #8b7bff35,0 8px 20px #0003}.my-avatar-button:after{content:'✎';position:absolute;right:-5px;bottom:-5px;width:18px;height:18px;display:grid;place-items:center;border:2px solid var(--panel);border-radius:50%;background:#7162e8;color:white;font-size:10px}
.file-picker-label{display:flex;align-items:center;gap:12px;padding:12px;border:1px solid var(--line);border-radius:13px;background:var(--panel2);cursor:pointer}.file-picker-label:hover{border-color:var(--accent);background:color-mix(in srgb,var(--panel2) 80%,var(--accent) 20%)}.file-picker-icon{width:38px;height:38px;display:grid;place-items:center;border-radius:11px;background:#8b7bff20;color:var(--accent);font-size:23px}.file-picker-label>span:nth-child(2){display:flex;flex:1;flex-direction:column;gap:4px}.file-picker-label strong{font-size:12px}.file-picker-label small{font-size:10px;color:var(--muted)}.file-picker-action{padding:8px 10px;border-radius:9px;background:var(--accent);color:white;font-size:11px;font-weight:700}.visually-hidden{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.profile-background-preview{overflow:hidden;border:1px solid var(--line);border-radius:12px;max-height:200px}.profile-background-preview img,.profile-background-preview video{display:block;width:100%;max-height:200px;object-fit:cover}.chat-avatar{cursor:pointer}.chat-avatar:hover{outline:3px solid #8b7bff44;outline-offset:2px}.public-profile-card{position:relative;width:min(92vw,440px);overflow:hidden;border:1px solid var(--line);border-radius:22px;background:var(--panel);box-shadow:var(--shadow)}.public-profile-close{position:absolute;z-index:2;top:12px;right:12px;background:#11182799;color:#fff;border-color:#ffffff55}.public-profile-cover{height:170px;background:#202020 center/cover no-repeat}.public-profile-cover video{width:100%;height:100%;object-fit:cover}.public-profile-body{position:relative;padding:0 24px 24px}.public-profile-avatar{width:76px;height:76px;border:4px solid var(--panel);border-radius:24px;margin-top:-38px;position:relative}.public-profile-body h2{font-size:21px;margin:12px 0 8px}.public-profile-body p{font-size:13px;line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere}.public-profile-body>span{font-size:11px}.public-profile-modal{z-index:1000}


/* Clean jump-to-latest button: independent from the composer and textarea. */
.chat-panel { position: relative; }
.scroll-bottom-button {
  position: absolute;
  z-index: 50;
  right: 24px;
  bottom: 108px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel2);
  color: var(--text);
  box-shadow: 0 5px 18px #0004;
  font-size: 24px;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s ease, opacity .15s ease, transform .15s ease;
}
.scroll-bottom-button:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-2px);
}
.scroll-bottom-button.hidden { display: none !important; }
.scroll-bottom-button.at-latest { opacity: .72; }
@media (max-width: 700px) {
  .scroll-bottom-button { right: 14px; bottom: 100px; width: 42px; height: 42px; }
}


/* v2.9.8: keep the jump button fixed to the viewport, slightly higher. */
.scroll-bottom-button {
  position: fixed !important;
  right: 24px !important;
  bottom: 140px !important;
  z-index: 9999 !important;
}
@media (max-width: 700px) {
  .scroll-bottom-button {
    right: 16px !important;
    bottom: 128px !important;
  }
}

/* Smoothly tuck the composer away while scrolling up through older messages. */
#messageForm {
  transition: opacity .22s ease, transform .22s ease, filter .22s ease;
  will-change: opacity, transform;
}
#messageForm.composer-away {
  opacity: 0;
  transform: translateY(18px);
  filter: blur(2px);
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  #messageForm { transition: none; }
}

/* Keep the chat header and composer fixed while only history scrolls. */
.chat-panel { height: 100%; min-height: 0; overflow: hidden; }
.chat-header { flex: 0 0 74px; }
#messages.messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  overflow-anchor: none;
}
#typingIndicator { flex: 0 0 18px; }
#messageForm.composer { flex: 0 0 auto; }

.message-status.read{color:#54d6a0;font-weight:800;letter-spacing:-2px}.profile-info strong[role="button"]{cursor:pointer}.profile-info strong[role="button"]:focus-visible{outline:2px solid var(--accent);outline-offset:3px;border-radius:3px}


/* v2.9.14: adapt the chat to Android's changing visual viewport when the keyboard opens/closes. */
html, body { width: 100%; min-height: 100%; }
.app-shell { height: var(--messenger-viewport-height, 100dvh); min-height: 0; }
.chat-panel { min-height: 0; }
@media (max-width: 700px) {
  .app-shell { height: var(--messenger-viewport-height, 100dvh); min-height: 0; }
  .chat-panel { height: 100%; min-height: 0; }
  .chat-header { position: relative; z-index: 2; flex-shrink: 0; }
  #messages.messages { min-height: 0; overscroll-behavior: contain; }
  #messageForm.composer { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .scroll-bottom-button { bottom: calc(90px + env(safe-area-inset-bottom)) !important; }
}

/* v2.9.15: own public-profile shortcut sits beside the avatar, outside settings. */
.my-public-profile-button{flex-shrink:0;display:flex;align-items:center;justify-content:center;min-height:34px;padding:0 10px;border:1px solid #8b7bff55;border-radius:10px;background:#8b7bff18;color:var(--text);font-size:11px;font-weight:700;white-space:nowrap;transition:background .15s,border-color .15s}
.my-public-profile-button:hover{background:#8b7bff30;border-color:#8b7bff}
.profile-view-compact{display:none}
@media(max-width:720px){.my-public-profile-button{width:34px;height:34px;padding:0;font-size:18px}.profile-view-full{display:none}.profile-view-compact{display:inline}}
@media(max-width:720px){.app-shell:not(.chat-open) .my-public-profile-button{width:auto;padding:0 10px;font-size:11px}.app-shell:not(.chat-open) .profile-view-full{display:inline}.app-shell:not(.chat-open) .profile-view-compact{display:none}}


/* v2.10 message actions: compact, responsive, theme-aware */
.message{position:relative;padding-top:2px}
.message-tools{position:absolute;right:-7px;top:-9px;z-index:25}
.message-more{width:27px;height:25px;display:grid;place-items:center;border:1px solid var(--line);border-radius:8px;background:var(--panel2);color:var(--muted);font-size:20px;line-height:1;opacity:0;transition:opacity .12s,background .12s}
.message:hover .message-more,.message.menu-open .message-more,.message-more:focus-visible{opacity:1}
.message-more:hover{background:var(--accent);color:white}
.message-action-menu{position:fixed;z-index:1200;display:flex;flex-direction:column;gap:2px;padding:5px;border:1px solid var(--line);border-radius:12px;background:var(--panel);box-shadow:0 14px 38px #0007;max-height:min(70vh,360px);overflow:auto}
.message-action-menu.hidden{display:none!important}
.message-action-menu button{display:flex;align-items:center;gap:10px;width:100%;padding:10px 11px;border:0;border-radius:8px;background:transparent;color:var(--text);text-align:left;font-size:13px;white-space:nowrap}
.message-action-menu button:hover{background:var(--panel2)}
.message-action-menu button span{flex:1}
.message-action-menu [data-message-action="delete"]{color:var(--danger)}
.message-edited{display:block;margin:0 4px;color:var(--muted);font-size:9px;line-height:1.2}
.message-dialog-card{width:min(420px,100%);max-height:90vh;overflow:auto;padding:20px;border:1px solid var(--line);border-radius:18px;background:var(--panel);color:var(--text);box-shadow:0 24px 80px #0008;display:flex;flex-direction:column;gap:14px}
.message-dialog-header{display:flex;align-items:center;justify-content:space-between;gap:12px}
.message-dialog-header h2{margin:0;font-size:18px;font-weight:700}
#messageEditText{width:100%;resize:vertical;min-height:110px;padding:12px;border:1px solid var(--line);border-radius:11px;background:var(--panel2);color:var(--text);font:inherit;line-height:1.5}
.message-dialog-actions{display:flex;justify-content:flex-end;gap:9px}
.message-dialog-actions button{border-radius:10px;padding:10px 14px;border:1px solid var(--line)}
.message-dialog-actions .secondary{background:var(--panel2);color:var(--text)}
.message-dialog-actions .primary{background:var(--accent);color:#fff;border:0}
.message-delete-copy{margin:0;font-size:12px;line-height:1.5}
.message-delete-options{display:flex;flex-direction:column;gap:8px}
.message-delete-option{display:flex;flex-direction:column;align-items:flex-start;gap:5px;padding:13px;border:1px solid var(--line);border-radius:11px;background:var(--panel2);color:var(--text);text-align:left}
.message-delete-option:hover{border-color:var(--accent)}
.message-delete-option strong{font-size:13px}.message-delete-option small{font-size:11px;color:var(--muted);line-height:1.4}
.message-delete-option.danger-option strong{color:var(--danger)}
.forward-mode-banner{display:flex;align-items:center;gap:8px;margin:0 10px 10px;padding:10px 12px;border:1px solid #8b7bff55;border-radius:11px;background:#8b7bff18;color:var(--text);font-size:11px;line-height:1.4}
.forward-mode-banner span{flex:1}.forward-mode-banner button{width:26px;height:26px;border:0;border-radius:7px;background:transparent;color:var(--muted);font-size:18px}
.forward-mode-banner button:hover{background:var(--panel2);color:var(--text)}
@media(max-width:720px){
  .message-more{display:none!important}
  .message-tools{right:-3px;top:-6px}
  .message-action-menu{border-radius:11px;box-shadow:0 10px 32px #0008}
  .message-action-menu button{padding:12px;font-size:13px;min-height:42px}
  .message{touch-action:pan-y}
  .message-dialog-card{padding:17px;border-radius:16px}
}
@media(hover:none){.message-more{opacity:1;display:none}}
.light .message-action-menu{box-shadow:0 14px 38px #1b24351c}


/* v2.10.1 interaction polish: subtle motion and refined delete icon */
@keyframes actionMenuIn {
  from { opacity: 0; transform: translateY(-5px) scale(.97); filter: blur(1px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
@keyframes dialogIn {
  from { opacity: 0; transform: translateY(10px) scale(.975); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes softPulse {
  0% { box-shadow: 0 0 0 0 #8b7bff00; }
  50% { box-shadow: 0 0 0 4px #8b7bff18; }
  100% { box-shadow: 0 0 0 0 #8b7bff00; }
}
button {
  transition: transform .14s ease, filter .16s ease, box-shadow .16s ease,
    border-color .16s ease, background-color .16s ease, color .16s ease;
  -webkit-tap-highlight-color: transparent;
}
button:active { transform: scale(.965); filter: brightness(1.08); }
.message-action-menu:not(.hidden) { animation: actionMenuIn .17s cubic-bezier(.2,.8,.2,1) both; transform-origin: top right; }
.message-action-menu button { transition: background-color .14s ease, color .14s ease, padding-left .14s ease, transform .14s ease; }
.message-action-menu button:hover { padding-left: 14px; }
.message-action-menu button:active { transform: scale(.985); }
.message-more { transition: opacity .14s ease, background .16s ease, color .16s ease, transform .16s ease, border-color .16s ease; }
.message-more:hover { transform: translateY(-1px); box-shadow: 0 4px 12px #0002; }
.message.menu-open .message-bubble { box-shadow: 0 0 0 1px #8b7bff30; }
.profile-modal:not(.hidden) { animation: fadeIn .16s ease-out both; }
.profile-modal:not(.hidden) .message-dialog-card,
.profile-modal:not(.hidden) .profile-card { animation: dialogIn .2s cubic-bezier(.2,.8,.2,1) both; }
.message-delete-option { transition: transform .15s ease, border-color .15s ease, background-color .15s ease, box-shadow .15s ease; }
.message-delete-option:hover { transform: translateY(-1px); box-shadow: 0 5px 16px #0002; }
.message-delete-option.danger-option:hover { background: color-mix(in srgb, var(--danger) 7%, var(--panel2)); }
.message-delete-icon { width: 17px; height: 17px; flex: 0 0 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: transform .16s ease; }
.message-action-menu [data-message-action="delete"] { color: var(--danger); }
.message-action-menu [data-message-action="delete"] .message-delete-icon { color: var(--danger); }
.message-action-menu [data-message-action="delete"]:hover .message-delete-icon { transform: rotate(-7deg) scale(1.08); }
.message-action-menu [data-message-action="delete"]:hover { background: color-mix(in srgb, var(--danger) 9%, var(--panel)); }
.light .message-action-menu [data-message-action="delete"]:hover { background: color-mix(in srgb, var(--danger) 8%, white); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}


/* v2.10.2: reliable mobile long-press selection without browser text highlighting */
@media (max-width: 720px), (hover: none) {
  .message-bubble { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  .message.long-pressed .message-bubble { outline: 2px solid #8b7bff; outline-offset: 2px; box-shadow: 0 0 0 5px #8b7bff24; }
  .message.long-pressed .message-more { opacity: 1; }
}

/* v2.10.4: unread counters in the conversation list and jump-to-unread button. */
.contact-avatar-wrap{position:relative;display:inline-flex;flex-shrink:0}
.unread-badge,.unread-avatar-badge{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:#7565f4;color:#fff;font-size:10px;font-weight:800;line-height:1;box-shadow:0 2px 7px #0004}
.contact-copy strong{display:flex;align-items:center;gap:7px;min-width:0}
.unread-avatar-badge{display:none;position:absolute;right:-5px;top:-5px;min-width:17px;height:17px;padding:0 4px;border:2px solid var(--panel);font-size:9px}
.scroll-bottom-button.has-unread{width:auto;min-width:44px;padding:0 9px;border-radius:22px;gap:5px;background:var(--accent);color:#fff;border-color:transparent;font-size:22px}
.scroll-unread-count{display:inline-flex;align-items:center;justify-content:center;min-width:19px;height:19px;padding:0 5px;border-radius:10px;background:#fff;color:#5c4bd2;font-size:10px;font-weight:800;line-height:1}
@media(max-width:720px){.unread-avatar-badge{display:inline-flex}.unread-badge{display:none}}


/* Reply-to-message UI */
.composer { flex-wrap: wrap; }
.reply-composer-banner { order: -1; flex: 0 0 100%; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid color-mix(in srgb, #9384ff 38%, var(--line)); border-left: 3px solid #9384ff; border-radius: 10px; background: color-mix(in srgb, #9384ff 9%, var(--panel)); }
.reply-composer-banner.hidden { display: none !important; }
.reply-composer-copy { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 4px; }
.reply-composer-copy strong { color: #aaa0ff; font-size: 10px; }
.reply-composer-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11px; }
#cancelReplyButton { flex: 0 0 28px; width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 21px; }
#cancelReplyButton:hover { background: var(--panel2); color: var(--text); }
.message-reply-quote { max-width: 100%; display: flex; flex-direction: column; gap: 3px; margin: 0 3px 1px; padding: 7px 10px; border-left: 3px solid #9384ff; border-radius: 4px 8px 8px 4px; background: color-mix(in srgb, #9384ff 10%, transparent); opacity: .82; }
.message-reply-quote strong { font-size: 10px; color: #aaa0ff; }
.message-reply-quote span { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; color: var(--text); font-size: 11px; line-height: 1.45; }
.light .reply-composer-banner { background: #f0edff; }
.light .message-reply-quote { background: #eeebfa; }
@media (max-width: 720px) { .reply-composer-banner { padding: 8px; } .message-reply-quote { padding: 6px 8px; } }


/* v2.10.6: native in-app emoji picker and expressive emoji-only messages. */
.emoji-picker-wrap { position: relative; flex: 0 0 32px; height: 36px; display: flex; align-items: center; justify-content: center; }
.emoji-picker-wrap > .emoji-button { width: 32px; height: 34px; }
.emoji-picker { position: absolute; z-index: 80; left: -8px; bottom: calc(100% + 10px); width: min(296px, calc(100vw - 28px)); padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); box-shadow: 0 16px 48px #0005; transform-origin: bottom left; animation: emojiPickerIn .16s ease-out both; }
.emoji-picker.hidden { display: none !important; }
.emoji-picker-title { margin: 0 0 9px 2px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .25px; }
.emoji-picker-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
.emoji-option { display: grid; place-items: center; min-width: 0; aspect-ratio: 1; padding: 0; border: 1px solid transparent; border-radius: 10px; background: transparent; font-size: 25px; line-height: 1; }
.emoji-option:hover, .emoji-option:focus-visible { border-color: color-mix(in srgb, #9384ff 40%, var(--line)); background: color-mix(in srgb, #9384ff 13%, var(--panel)); transform: scale(1.07); }
@keyframes emojiPickerIn { from { opacity: 0; transform: translateY(5px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
/* Emoji-only bubbles are larger; four or more retain a generous but normal text scale. */
.message.emoji-message-1 .message-bubble { padding: 2px 5px; border-color: transparent; background: transparent; font-size: 48px; line-height: 1.25; }
.message.mine.emoji-message-1 .message-bubble { border-color: transparent; background: transparent; }
.message.emoji-message-2 .message-bubble { padding: 3px 6px; border-color: transparent; background: transparent; font-size: 39px; line-height: 1.25; }
.message.mine.emoji-message-2 .message-bubble { border-color: transparent; background: transparent; }
.message.emoji-message-3 .message-bubble { padding: 4px 7px; border-color: transparent; background: transparent; font-size: 33px; line-height: 1.25; }
.message.mine.emoji-message-3 .message-bubble { border-color: transparent; background: transparent; }
.message.emoji-message-4 .message-bubble { font-size: 19px; line-height: 1.5; }
.message.emoji-motion-heart.emoji-message-1 .message-bubble { display: inline-block; transform-origin: center; animation: emojiHeartBeat 1.35s ease-in-out infinite; }
.message.emoji-motion-laugh.emoji-message-1 .message-bubble { display: inline-block; transform-origin: center; animation: emojiLaugh 1.8s ease-in-out infinite; }
.message.emoji-motion-like.emoji-message-1 .message-bubble { display: inline-block; animation: emojiLikePop .55s cubic-bezier(.2,.8,.25,1.2) 1 both; }
.message.emoji-motion-celebrate.emoji-message-1 .message-bubble { display: inline-block; animation: emojiCelebrate 1.8s ease-in-out infinite; }
.message.emoji-motion-soft.emoji-message-1 .message-bubble { display: inline-block; animation: emojiSoftFloat 2.3s ease-in-out infinite; }
@keyframes emojiHeartBeat { 0%, 100% { transform: scale(1); } 14% { transform: scale(1.08); } 28% { transform: scale(1); } 42% { transform: scale(1.13); } 58% { transform: scale(1); } }
@keyframes emojiLaugh { 0%, 100% { transform: rotate(0) translateY(0); } 20% { transform: rotate(-4deg) translateY(-1px); } 40% { transform: rotate(4deg) translateY(0); } 60% { transform: rotate(-2deg) translateY(-1px); } 80% { transform: rotate(0) translateY(0); } }
@keyframes emojiLikePop { 0% { opacity: .4; transform: translateY(-13px) scale(.78); } 72% { opacity: 1; transform: translateY(2px) scale(1.08); } 100% { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes emojiCelebrate { 0%, 100% { transform: rotate(0) translateY(0); } 25% { transform: rotate(-5deg) translateY(-2px); } 50% { transform: rotate(4deg) translateY(0); } 75% { transform: rotate(-2deg) translateY(-1px); } }
@keyframes emojiSoftFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@media (max-width: 720px) {
  .emoji-picker { left: auto; right: -7px; bottom: calc(100% + 9px); width: min(296px, calc(100vw - 24px)); }
  .message.emoji-message-1 .message-bubble { font-size: 45px; }
  .message.emoji-message-2 .message-bubble { font-size: 37px; }
  .message.emoji-message-3 .message-bubble { font-size: 31px; }
}
@media (prefers-reduced-motion: reduce) {
  .message.emoji-motion-heart .message-bubble, .message.emoji-motion-laugh .message-bubble, .message.emoji-motion-like .message-bubble, .message.emoji-motion-celebrate .message-bubble, .message.emoji-motion-soft .message-bubble { animation: none !important; }
}

/* v2.10.7: mobile emoji panel behaves like an in-app keyboard and stays open while selecting. */
@media (max-width: 720px) {
  .emoji-picker-wrap { position: static; }
  .emoji-picker {
    position: fixed;
    z-index: 120;
    left: 8px;
    right: 8px;
    bottom: calc(70px + env(safe-area-inset-bottom));
    width: auto;
    max-width: none;
    height: min(230px, 39dvh);
    max-height: min(230px, 39dvh);
    overflow-y: auto;
    padding: 10px;
    border-radius: 16px 16px 12px 12px;
    transform-origin: bottom center;
  }
  .emoji-picker-title { margin-bottom: 7px; }
  .emoji-picker-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; }
  .emoji-option { min-height: 36px; font-size: 25px; }
}

/* v2.10.9: prioritize requested mobile emojis and use platform emoji fonts. */
.emoji-option { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }

/* v2.10.10: mobile attachment chooser; desktop attachment behavior stays unchanged. */
.attachment-chooser { display: none; }
.attachment-chooser.hidden { display: none !important; }
.attachment-choice { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel2); color: var(--text); text-align: left; }
.attachment-choice:active { transform: scale(.985); }
.attachment-choice > span:last-child { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.attachment-choice strong { font-size: 13px; }
.attachment-choice small { color: var(--muted); font-size: 10px; }
.attachment-choice-icon { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 42px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 15%, var(--panel)); color: var(--accent); font-size: 24px; }
.message-video-preview { display: block; width: min(100%, 360px); max-height: 320px; border-radius: 10px; background: #000; }
@media (max-width: 720px) {
  .attachment-chooser:not(.hidden) { display: block; position: fixed; z-index: 1300; inset: 0; }
  .attachment-chooser-backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: #0008; animation: fadeIn .15s ease-out both; }
  .attachment-chooser-sheet { position: absolute; left: 0; right: 0; bottom: 0; padding: 9px 16px calc(18px + env(safe-area-inset-bottom)); border: 1px solid var(--line); border-bottom: 0; border-radius: 20px 20px 0 0; background: var(--panel); box-shadow: 0 -14px 42px #0004; animation: attachmentSheetIn .2s cubic-bezier(.2,.8,.2,1) both; }
  .attachment-chooser-handle { width: 36px; height: 4px; margin: 0 auto 12px; border-radius: 9px; background: var(--muted); opacity: .45; }
  .attachment-chooser-title { padding: 0 2px 12px; font-size: 14px; font-weight: 700; color: var(--text); }
  .attachment-chooser-options { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
  .attachment-choice { min-height: 92px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 8px; padding: 11px; }
  .attachment-choice-icon { width: 34px; height: 34px; flex-basis: 34px; border-radius: 10px; font-size: 20px; }
  .attachment-choice small { line-height: 1.35; }
  .message-video-preview { width: min(100%, 280px); max-height: 260px; }
}
@keyframes attachmentSheetIn { from { opacity: .65; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .attachment-chooser-backdrop, .attachment-chooser-sheet { animation: none !important; } }

/* v2.10.12: replaced unsupported emoji with a widely supported smiley. */


/* v2.10.13: messenger-styled draggable mobile media sheet. */
.mobile-media-sheet { display:none; }
.mobile-media-sheet.hidden { display:none !important; }
.mobile-media-sheet-open { overflow:hidden; }
.mobile-media-open-button { display:flex; align-items:center; justify-content:center; gap:9px; width:100%; min-height:46px; margin-top:20px; border:0; border-radius:13px; background:var(--accent); color:#fff; font:inherit; font-size:13px; font-weight:700; cursor:pointer; }
@media (max-width:720px) {
  .mobile-media-sheet:not(.hidden) { display:block; position:fixed; z-index:1400; inset:0; }
  .mobile-media-backdrop { position:absolute; inset:0; width:100%; border:0; background:#0008; animation:fadeIn .16s ease-out both; }
  .mobile-media-panel { position:absolute; left:0; right:0; bottom:0; height: min(52vh, 470px); padding:0 18px calc(16px + env(safe-area-inset-bottom)); overflow:hidden; border:1px solid var(--line); border-bottom:0; border-radius:22px 22px 0 0; background:var(--panel); color:var(--text); box-shadow:0 -14px 42px #0005; display:flex; flex-direction:column; animation:attachmentSheetIn .2s cubic-bezier(.2,.8,.2,1) both; transition:height .22s cubic-bezier(.2,.8,.2,1); }
  .mobile-media-sheet.expanded .mobile-media-panel { height:100dvh; height:100vh; border-radius:0; padding-top:env(safe-area-inset-top); }
  .mobile-media-handle-area { height:30px; flex:0 0 30px; display:flex; justify-content:center; align-items:center; touch-action:pan-y; cursor:grab; }
  .mobile-media-handle { display:block; width:38px; height:4px; border-radius:99px; background:var(--muted); opacity:.58; }
  .mobile-media-header { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:5px 0 16px; border-bottom:1px solid var(--line); }
  .mobile-media-header>div { display:flex; flex-direction:column; gap:4px; }
  .mobile-media-header strong { font-size:16px; }
  .mobile-media-header small { color:var(--muted); font-size:11px; }
  .mobile-media-header button { width:34px; height:34px; border:1px solid var(--line); border-radius:50%; background:var(--panel2); color:var(--text); font-size:23px; line-height:1; }
  .mobile-media-content { flex:1; min-height:0; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; padding:18px 2px; }
  .mobile-media-empty-icon { width:58px; height:58px; display:grid; place-items:center; margin-bottom:14px; border-radius:18px; background:color-mix(in srgb,var(--accent) 16%,var(--panel)); color:var(--accent); font-size:30px; }
  .mobile-media-content>strong { font-size:14px; }
  .mobile-media-content p { max-width:290px; margin:8px 0 0; color:var(--muted); font-size:11px; line-height:1.5; }
  .mobile-media-open-button { max-width:340px; padding:0 16px; }
}
@media (prefers-reduced-motion:reduce) { .mobile-media-backdrop,.mobile-media-panel { animation:none!important; transition:none!important; } }


/* iOS Safari: keep the web interface scale stable and prevent automatic text enlargement. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
input, textarea, select, button { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@supports (-webkit-touch-callout: none) {
  input, textarea, select { font-size: 16px !important; }
  .auth-form input, .composer textarea, .profile-card input:not([type=color]), .profile-card textarea { font-size: 16px !important; }
}
