/* SERGDATA_CHAT_VERSION=16.5.46 */
*{box-sizing:border-box}html,body{margin:0;height:100%;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:#0e141b;color:#f5f7fa}.app{height:100%;display:flex;flex-direction:column;max-width:900px;margin:auto;background:#111820;position:relative}.chat-head{height:58px;display:flex;align-items:center;gap:8px;padding:8px 10px;background:#151e28;border-bottom:1px solid #283340;position:relative;z-index:10}.back{font-size:28px;text-decoration:none;color:#fff;padding:0 6px}.room-title{border:0;background:transparent;color:#fff;text-align:left;flex:1;min-width:0}.room-title strong{display:block;font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.room-title span{display:block;font-size:11px;color:#91a0ad;margin-top:2px}.head-btn,.icon-btn,.send{border:0;background:#202b36;color:#fff;border-radius:12px;min-width:40px;height:40px;font-size:20px}.messages{flex:1;overflow:auto;padding:14px 12px 110px;scroll-behavior:smooth}.msg{width:max-content;max-width:min(78%,600px);margin:5px 0;padding:7px 9px;background:#202a35;border-radius:14px 14px 14px 4px;position:relative;word-break:break-word}.msg.mine{margin-left:auto;background:#28465d;border-radius:14px 14px 4px 14px}.msg img,.msg video{display:block;max-width:100%;max-height:55vh;border-radius:10px;margin:-1px 0 5px}.caption{white-space:pre-wrap}.time{font-size:10px;color:#9eabb6;text-align:right;margin-top:3px}.edited{font-style:italic}.empty{text-align:center;color:#8896a3;margin-top:25vh;line-height:1.6}.composer{position:absolute;bottom:0;left:0;right:0;display:flex;align-items:flex-end;gap:6px;padding:8px;padding-bottom:max(8px,env(safe-area-inset-bottom));background:linear-gradient(transparent,#111820 20%);z-index:25}.composer input[type=text],#text{min-width:0;flex:1;border:1px solid #303c48;border-radius:14px;background:#1a232d;color:#fff;padding:10px 12px;font-size:16px;line-height:1.35;outline:none}.composer #text{resize:none;min-height:42px;max-height:120px;overflow-y:auto;font-family:inherit}.composer #text:focus{border-color:#4a5b6d}.emoji-panel{position:absolute;bottom:62px;left:8px;right:8px;background:#19232d;border:1px solid #303c48;border-radius:14px;padding:8px;z-index:20;box-shadow:0 10px 35px #0008}.emoji-tabs{display:flex;gap:4px;margin-bottom:6px}.emoji-tabs button,.emoji-grid button{border:0;background:transparent;color:#fff}.emoji-tabs button{font-size:20px;padding:6px}.emoji-grid{display:grid;grid-template-columns:repeat(8,1fr);max-height:210px;overflow:auto}.emoji-grid button{font-size:27px;padding:7px;border-radius:8px}.emoji-grid button:active{background:#2b3a48}.media-panel,.side-panel{position:absolute;z-index:30;inset:58px 0 0;background:#101820;display:none;overflow:auto}.media-panel.open,.side-panel.open{display:block}.panel-head{display:flex;justify-content:space-between;align-items:center;padding:12px 14px;border-bottom:1px solid #2a3540;position:sticky;top:0;background:#101820;z-index:2}.panel-head button{border:0;background:transparent;color:#fff;font-size:28px}.media-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:4px;padding:4px}.media-grid img,.media-grid video{width:100%;aspect-ratio:1;object-fit:cover;background:#000}.panel-action{margin:14px;width:calc(100% - 28px);padding:13px;border:0;border-radius:12px;background:#28465d;color:#fff;font-size:16px}.room-help{margin:14px;color:#9eabb6;line-height:1.45}.room-current{display:block;margin:1px 0 0;color:#9eabb6;font-size:10px;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.reply-bar{position:absolute;left:8px;right:8px;bottom:62px;display:flex;align-items:center;gap:8px;padding:7px 8px;background:#202b36;border:1px solid #394754;border-radius:11px;box-shadow:0 8px 25px #0006;z-index:26;min-height:40px}.reply-bar[hidden]{display:none}.reply-bar-main{display:flex;align-items:center;gap:7px;min-width:0;flex:1}.reply-bar-icon{font-size:19px;line-height:1}.reply-bar-content{min-width:0;display:flex;flex-direction:column;line-height:1.2}.reply-bar-name{font-size:11px;font-weight:600;color:#9fc2df;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.reply-bar-text{font-size:12px;color:#dce4ea;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.reply-bar button{flex:0 0 28px;width:28px;height:28px;border:0;border-radius:8px;background:transparent;color:#fff;font-size:22px;line-height:1;padding:0}.reply-quote{display:flex;align-items:stretch;gap:7px;margin:0 0 6px;padding:5px 7px;border-left:3px solid #6d91aa;border-radius:6px;background:rgba(255,255,255,.055);cursor:pointer;max-width:100%}.reply-quote-content{min-width:0;overflow:hidden}.reply-quote-name{display:block;font-size:11px;font-weight:600;color:#9fc2df;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.reply-quote-text{display:block;font-size:12px;color:#cbd5dc;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.msg.reply-highlight{outline:2px solid #6d91aa;outline-offset:2px}.message-menu{position:fixed;z-index:50;background:#202b36;border:1px solid #394754;border-radius:12px;box-shadow:0 10px 30px #0008;overflow:hidden}.message-menu button{display:block;width:210px;text-align:left;padding:12px;border:0;background:transparent;color:#fff;font-size:15px}.message-menu button+button{border-top:1px solid #394754}
.attach-menu{position:fixed;left:8px;bottom:62px;z-index:60;background:#202b36;border:1px solid #394754;border-radius:14px;box-shadow:0 10px 30px #0008;overflow:hidden}
.attach-menu button{display:block;width:240px;text-align:left;padding:13px 14px;border:0;background:transparent;color:#fff;font-size:16px}
.attach-menu button+button{border-top:1px solid #394754}
.attach-menu button:active{background:#2b3a48}
.attach-menu[hidden]{display:none}
body[data-theme="light"] .attach-menu{background:#fff;border-color:#dbe2e8}
body[data-theme="light"] .attach-menu button{color:#18222b}
body[data-theme="soft"] .attach-menu{background:rgba(255,255,255,.97);border-color:#dbe2e8}
body[data-theme="soft"] .attach-menu button{color:#1f2923}
.upload-status{position:absolute;bottom:70px;left:50%;transform:translateX(-50%);background:#202b36;color:#fff;padding:8px 12px;border-radius:10px;font-size:13px;z-index:40}@media(min-width:700px){.app{min-height:100vh}.messages{padding-left:30px;padding-right:30px}.composer{left:50%;right:auto;width:100%;max-width:900px;transform:translateX(-50%)}}

.author{font-weight:700;font-size:12px;margin-bottom:2px;color:#dce7f0}.panel-action.secondary{background:#202b36;margin-top:0}

.room-chooser{position:absolute;inset:0;z-index:100;background:#111820;overflow:auto}
.chooser-inner{width:min(100%,560px);margin:0 auto;padding:clamp(28px,8vh,70px) 18px 32px}
.chooser-logo{font-size:42px;text-align:center;margin-bottom:8px}
.chooser-inner h1{text-align:center;margin:0;font-size:28px}
.chooser-inner>p{text-align:center;color:#91a0ad;margin:8px 0 24px}
.room-list{display:flex;flex-direction:column;gap:8px}
.room-item{display:flex;align-items:center;gap:12px;width:100%;padding:14px 15px;border:1px solid #303c48;border-radius:14px;background:#1a232d;color:#fff;text-align:left;cursor:pointer}
.room-item:active{background:#24313d}
.room-icon{width:38px;height:38px;display:grid;place-items:center;border-radius:11px;background:#202b36;font-size:21px;flex:none}
.room-item-main{min-width:0;flex:1}
.room-item-name{font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.room-item-sub{font-size:12px;color:#91a0ad;margin-top:3px}
.room-arrow{font-size:22px;color:#91a0ad}
.panel-room-list{padding:10px 14px 0}
.panel-room-list .room-item{border-radius:12px}
@media(max-width:480px){
 .chooser-inner{padding-top:40px}
 .room-item{padding:13px}
 .room-item-name{font-size:15px}
}

.room-list{display:flex;flex-direction:column;gap:8px;padding:0 14px 8px}
.room-item{display:flex;align-items:center;gap:10px;width:100%;padding:12px;border:1px solid #2b3845;border-radius:12px;background:#1a2530;color:#fff;text-align:left;cursor:pointer}
.room-item:active{transform:scale(.99)}
.room-icon{font-size:22px;flex:0 0 28px;text-align:center}
.room-item-main{min-width:0;flex:1}
.room-item-name{display:block;font-size:15px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.room-item-sub{display:block;font-size:11px;color:#91a0ad;margin-top:2px}
.room-arrow{font-size:25px;color:#91a0ad}
.room-pin{
  flex:0 0 30px;
  width:30px;
  text-align:center;
  font-size:21px;
  line-height:1;
  opacity:.28;
  cursor:pointer;
  user-select:none;
  -webkit-tap-highlight-color:transparent;
}
.room-item-pinned .room-pin{
  opacity:1;
  color:#ff3b30;
}

.chooser-inner{width:min(100% - 24px,620px);margin:auto;padding:24px 0}
.chooser-inner h1{margin:8px 0 6px}
.chooser-inner p{color:#9eabb6;line-height:1.45;margin:0 0 18px}
@media(max-width:520px){.chooser-inner{padding:18px 0}.room-item{padding:13px 12px}.panel-action{margin-top:10px;margin-bottom:10px}}

.panel-action.danger{border:1px solid rgba(255,90,90,.35);color:#ff9a9a}
.panel-action.danger:hover{background:rgba(255,70,70,.10)}

@media (max-width:700px){
  .composer{padding-left:7px;padding-right:7px}
  .composer .icon-btn,.composer .send{flex:0 0 42px;width:42px;height:42px}
  .composer #text{font-size:16px;max-height:110px}
}

.msg-status{margin-left:5px;font-size:12px;white-space:nowrap}.msg-status.delivered{opacity:.8}.msg-status.read{font-weight:700;letter-spacing:-1px}.msg-status.pending{opacity:.65}

.file-card{padding:10px;border:1px solid #3a4754;border-radius:10px;min-width:190px}.file-name{font-weight:600;word-break:break-word}.file-size{font-size:11px;color:#9eabb6;margin:4px 0 8px}.file-download{display:inline-block;color:#fff;text-decoration:none;background:#31465a;border-radius:8px;padding:6px 9px;font-size:12px}.admin-toggle{display:flex;align-items:center;justify-content:space-between;padding:12px 10px;border-bottom:1px solid #283340}.admin-toggle input{width:22px;height:22px}.chat-locked{opacity:.75}.composer .send:disabled,.composer .icon-btn:disabled{opacity:.45}

.voice-btn{
  position:relative;
  overflow:visible;
}

.voice-btn::before{
  content:"";
  position:absolute;
  top:-4px;
  right:5px;
  width:10px;
  height:7px;
  box-sizing:border-box;
  border:1.5px solid currentColor;
  border-radius:2px;
  pointer-events:none;
  animation:voiceCameraHint 2.4s ease-in-out infinite;
}

.voice-btn::after{
  content:"";
  position:absolute;
  top:-2px;
  right:8px;
  width:3px;
  height:3px;
  box-sizing:border-box;
  border:1px solid currentColor;
  border-radius:50%;
  pointer-events:none;
  animation:voiceCameraHint 2.4s ease-in-out infinite;
}

@keyframes voiceCameraHint{
  0%,70%,100%{transform:translateY(0);opacity:.8}
  80%,90%{transform:translateY(-2px);opacity:1}
}

.voice-btn.recording{background:#7b3030}.voice-status{position:absolute;bottom:70px;left:50%;transform:translateX(-50%);background:#202b36;color:#fff;padding:8px 12px;border-radius:10px;font-size:13px;z-index:40}.voice-card{min-width:min(280px,72vw);padding:8px;border:1px solid #3a4754;border-radius:10px}.voice-card audio{display:block;width:100%;margin:6px 0 8px}.voice-title{font-size:13px;font-weight:600;margin-bottom:4px}

/* v16.4 navigation/panel robustness */
.side-panel,.media-panel{overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.panel-head button{min-width:40px;min-height:40px;border-radius:10px}
.panel-head button:active{background:#202b36}


.admin-field{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 10px;border-bottom:1px solid #283340}.admin-field span{font-size:14px}.admin-field select{min-width:150px;max-width:52%;padding:8px 10px;border:1px solid #303c48;border-radius:10px;background:#1a232d;color:#fff;font:inherit}.admin-members-details{margin:0}.admin-members-details>summary{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px;cursor:pointer;list-style:none;font-weight:700}.admin-members-details>summary::-webkit-details-marker{display:none}.admin-members-details>summary strong{font-size:13px;color:#c9d5df}.admin-members-list{border-top:1px solid #2d3945}.admin-member-row{display:flex;align-items:center;gap:8px;padding:10px 8px;border-bottom:1px solid #283340}.admin-member-row:last-child{border-bottom:0}.admin-member-row .admin-item-main{flex:1;min-width:0}.admin-you{font-size:11px;color:#8ea1b2;font-weight:400}.admin-remove-member{flex:0 0 40px;width:40px;height:40px;border:0;border-radius:10px;background:#35272b;color:#ffb0b0;font-size:17px;cursor:pointer}.admin-remove-member:disabled{opacity:.45}.admin-remove-member:active{transform:scale(.96)}.admin-section{margin:12px 10px 0;border:1px solid #2d3945;border-radius:12px;overflow:hidden;background:#151e28}.admin-section-title{padding:11px 12px;font-weight:700;font-size:14px;border-bottom:1px solid #2d3945}.admin-list{padding:4px}.admin-empty{padding:10px 8px;color:#8896a3;font-size:13px}.admin-item{padding:9px 8px;border-bottom:1px solid #283340}.admin-item:last-child{border-bottom:0}.admin-item-main{display:flex;flex-direction:column;gap:3px}.admin-item-main strong{font-size:14px}.admin-item-main span{font-size:11px;color:#8896a3}.admin-room{border-bottom:1px solid #283340}.admin-room:last-child{border-bottom:0}.admin-room summary{cursor:pointer;list-style:none;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 8px}.admin-room summary::-webkit-details-marker{display:none}.admin-room-name{font-weight:600;min-width:0;overflow:hidden;text-overflow:ellipsis}.admin-room-count{font-size:11px;color:#9eabb6;white-space:nowrap}.admin-room-meta{padding:0 8px 8px;color:#8896a3;font-size:11px;line-height:1.5}.admin-room-members{display:flex;flex-wrap:wrap;gap:5px;padding:0 8px 10px}.admin-room-members span{padding:5px 8px;border-radius:9px;background:#202b36;font-size:12px}
@media(max-width:520px){.admin-field{align-items:flex-start;flex-direction:column}.admin-field select{width:100%;max-width:none}}

/* v16.5.5 — Android composer/socket-safe layout */
@media(max-width:700px){
  .app{height:100dvh;min-height:100dvh;}
  .composer{position:fixed;left:0;right:0;bottom:0;width:100%;max-width:900px;margin:0 auto;box-sizing:border-box;}
}

/* v16.4.3 — mobile layout safe override, based on known-good v16.4.1 */
html,body{width:100%;max-width:100%;overflow:hidden}
.app{width:100%;max-width:900px;height:100dvh;min-height:100dvh;overflow:hidden}

/* iPhone Dynamic Island / safe-area */
.chat-head{height:calc(58px + env(safe-area-inset-top));min-height:calc(58px + env(safe-area-inset-top));padding-top:max(8px,env(safe-area-inset-top))}
.media-panel,.side-panel{inset:calc(58px + env(safe-area-inset-top)) 0 0}

/* Keep header/composer from forcing horizontal overflow */
.chat-head>*{min-width:0}
.composer{max-width:100%;box-sizing:border-box;min-width:0}
.composer #text{min-width:0;width:0}

@media(max-width:480px){
  .messages{padding-left:8px;padding-right:8px;padding-bottom:100px}
  .msg{max-width:88%}
  .composer{gap:4px;padding:6px;padding-bottom:max(6px,env(safe-area-inset-bottom))}
  .composer .icon-btn,.composer .send{width:34px;min-width:34px;height:38px;padding:0;font-size:18px;border-radius:10px;flex:0 0 34px}
  .composer #text{min-height:38px;padding:8px 9px;font-size:16px;border-radius:12px}
}

@media(max-width:360px){
  .composer{gap:3px;padding-left:4px;padding-right:4px}
  .composer .icon-btn,.composer .send{width:32px;min-width:32px;height:36px;flex-basis:32px;font-size:17px}
  .composer #text{min-height:36px;padding:7px 8px}
}

/* Unread counter — compact red badge */
.room-unread{flex:0 0 auto;min-width:24px;height:24px;padding:0 7px;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;border-radius:12px;background:#d94b4b;color:#fff;font-size:12px;font-weight:700;line-height:1;white-space:nowrap}

.back-label{font-size:16px;vertical-align:2px;margin-left:4px;font-weight:500}

/* v16.5.7 — composer visibility hard fix */
@media (min-width: 1px) {
  body:has(#roomChooser[hidden]) #composer {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  body:has(#roomChooser:not([hidden])) #composer {
    display: none !important;
  }
}

@media (max-width: 699px) {
  body:has(#roomChooser[hidden]) #composer {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: 900px !important;
    margin: 0 auto !important;
    z-index: 50 !important;
  }
}


/* === v16.5.15 room themes: visual-only, layout untouched === */
body[data-theme="light"]{background:#eef2f5;color:#18222b}
body[data-theme="light"] .app{background:#f8fafb;color:#18222b}
body[data-theme="light"] .chat-head{background:#ffffff;border-bottom-color:#dbe2e8}
body[data-theme="light"] .back,.app body[data-theme="light"] .back{color:#18222b}
body[data-theme="light"] .room-title{color:#18222b}
body[data-theme="light"] .room-title span{color:#6f7d89}
body[data-theme="light"] .head-btn,body[data-theme="light"] .icon-btn,body[data-theme="light"] .send{background:#e8edf1;color:#18222b}
body[data-theme="light"] .messages{background:#f8fafb}
body[data-theme="light"] .msg{background:#e7edf2;color:#18222b}
body[data-theme="light"] .msg.mine{background:#d8e9f6;color:#18222b}
body[data-theme="light"] .time{color:#71808c}
body[data-theme="light"] .composer{background:linear-gradient(transparent,#f8fafb 20%)}
body[data-theme="light"] .composer input[type=text],body[data-theme="light"] #text{background:#ffffff;color:#18222b;border-color:#ccd7df}
body[data-theme="light"] .composer #text:focus{border-color:#8ea6b8}
body[data-theme="light"] .emoji-panel,body[data-theme="light"] .media-panel,body[data-theme="light"] .side-panel{background:#ffffff;border-color:#dbe2e8;color:#18222b}
body[data-theme="light"] .panel-head{background:#ffffff;border-bottom-color:#dbe2e8}
body[data-theme="light"] .panel-action,body[data-theme="light"] .admin-toggle,body[data-theme="light"] .admin-field{color:#18222b}
body[data-theme="light"] .emoji-tabs button,body[data-theme="light"] .emoji-grid button{color:#18222b}
body[data-theme="light"] .room-help,body[data-theme="light"] .empty{color:#6f7d89}
body[data-theme="light"] .file-card,body[data-theme="light"] .voice-card{background:#eef3f6;border-color:#d5e0e7;color:#18222b}
body[data-theme="light"] .file-download{color:#245a82}
body[data-theme="light"] .day-separator{color:#6f7d89}
body[data-theme="light"] .day-separator span{background:rgba(110,130,145,.10)}
body[data-theme="light"] .message-menu{background:#ffffff;border-color:#dbe2e8;color:#18222b}
body[data-theme="light"] .message-menu button{color:#18222b}
body[data-theme="soft"] .app{background:#f7f8f4;color:#1f2923}
body[data-theme="soft"] .messages{
  background-color:#f7f8f4;
  background-image:
    radial-gradient(circle at 14% 22%, rgba(92,116,103,.07) 0 2px, transparent 3px),
    radial-gradient(circle at 78% 68%, rgba(92,116,103,.06) 0 2px, transparent 3px),
    radial-gradient(circle at 34% 84%, rgba(92,116,103,.05) 0 1.5px, transparent 2.5px);
  background-size:220px 220px,280px 280px,190px 190px;
}
body[data-theme="soft"] .chat-head{background:rgba(255,255,255,.94);border-bottom-color:#dde3df}
body[data-theme="soft"] .composer{background:linear-gradient(transparent,#f7f8f4 20%)}
body[data-theme="soft"] .msg{background:rgba(229,236,232,.94);color:#1f2923}
body[data-theme="soft"] .msg.mine{background:rgba(215,232,226,.96);color:#1f2923}
body[data-theme="soft"] .room-title{color:#1f2923}
body[data-theme="soft"] .room-title span,body[data-theme="soft"] .time{color:#6d7b72}
body[data-theme="soft"] .head-btn,body[data-theme="soft"] .icon-btn,body[data-theme="soft"] .send{background:#e7ede9;color:#1f2923}
body[data-theme="soft"] .composer input[type=text],body[data-theme="soft"] #text{background:rgba(255,255,255,.95);color:#1f2923;border-color:#ccd8d0}
body[data-theme="soft"] .emoji-panel,body[data-theme="soft"] .media-panel,body[data-theme="soft"] .side-panel{background:rgba(255,255,255,.97);color:#1f2923}
body[data-theme="soft"] .panel-head{background:rgba(255,255,255,.97);border-bottom-color:#dde3df}
body[data-theme="soft"] .room-help,body[data-theme="soft"] .empty{color:#718078}
body[data-theme="soft"] .file-card,body[data-theme="soft"] .voice-card{background:#edf2ee;border-color:#d6e0d9;color:#1f2923}
body[data-theme="soft"] .file-download{color:#35634b}\n\n/* v16.5.16 — light theme contrast + subtle pattern */
body[data-theme="light"] .chat-head .back,
body[data-theme="soft"] .chat-head .back{color:#18222b !important}
body[data-theme="light"] .author,
body[data-theme="soft"] .author{color:#38505f}
body[data-theme="light"] .msg .caption,
body[data-theme="soft"] .msg .caption{color:inherit}
body[data-theme="light"] .messages,
body[data-theme="soft"] .messages{
  background-repeat:repeat;
  background-size:260px 220px;
  background-position:0 0;
}
body[data-theme="light"] .messages{
  background-color:#f8fafb;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='220' viewBox='0 0 260 220'%3E%3Cg fill='none' stroke='%23a7b6c0' stroke-opacity='.12' stroke-width='1.6'%3E%3Cpath d='M34 42h46a10 10 0 0 1 10 10v18a10 10 0 0 1-10 10H58l-9 9v-9H34a10 10 0 0 1-10-10V52a10 10 0 0 1 10-10Z'/%3E%3Cpath d='M173 25h28a8 8 0 0 1 8 8v12a8 8 0 0 1-8 8h-7l-6 6v-6h-15a8 8 0 0 1-8-8V33a8 8 0 0 1 8-8Z'/%3E%3Cpath d='M188 151c-9-8-23-2-23 10 0 15 23 27 23 27s23-12 23-27c0-12-14-18-23-10Z'/%3E%3Ccircle cx='72' cy='168' r='3'/%3E%3Ccircle cx='86' cy='168' r='3'/%3E%3Ccircle cx='100' cy='168' r='3'/%3E%3C/g%3E%3C/svg%3E");
}
body[data-theme="soft"] .messages{
  background-color:#f7f8f4;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='220' viewBox='0 0 260 220'%3E%3Cg fill='none' stroke='%23869a8c' stroke-opacity='.11' stroke-width='1.6'%3E%3Cpath d='M34 42h46a10 10 0 0 1 10 10v18a10 10 0 0 1-10 10H58l-9 9v-9H34a10 10 0 0 1-10-10V52a10 10 0 0 1 10-10Z'/%3E%3Cpath d='M173 25h28a8 8 0 0 1 8 8v12a8 8 0 0 1-8 8h-7l-6 6v-6h-15a8 8 0 0 1-8-8V33a8 8 0 0 1 8-8Z'/%3E%3Cpath d='M188 151c-9-8-23-2-23 10 0 15 23 27 23 27s23-12 23-27c0-12-14-18-23-10Z'/%3E%3Ccircle cx='72' cy='168' r='3'/%3E%3Ccircle cx='86' cy='168' r='3'/%3E%3Ccircle cx='100' cy='168' r='3'/%3E%3C/g%3E%3C/svg%3E");
}


/* v16.5.17 — light/soft room management contrast only */
body[data-theme="light"] .panel-action,
body[data-theme="soft"] .panel-action{
  background:#e5ebef !important;
  color:#17232c !important;
  border:1px solid #c4d0d7 !important;
  box-shadow:none;
}
body[data-theme="light"] .panel-action.secondary,
body[data-theme="soft"] .panel-action.secondary{
  background:#eef2f4 !important;
  color:#17232c !important;
  border-color:#cbd5db !important;
}
body[data-theme="light"] .panel-action.danger,
body[data-theme="soft"] .panel-action.danger{
  background:#f3e8e8 !important;
  color:#8b2f2f !important;
  border-color:#d8aaaa !important;
}
body[data-theme="light"] .panel-action:hover,
body[data-theme="soft"] .panel-action:hover{
  background:#dbe3e8 !important;
}
body[data-theme="light"] .panel-action.danger:hover,
body[data-theme="soft"] .panel-action.danger:hover{
  background:#ecdcdc !important;
}
body[data-theme="light"] #roomChooser .panel-action,
body[data-theme="soft"] #roomChooser .panel-action{
  font-weight:600;
}
body[data-theme="light"] .admin-field,
body[data-theme="soft"] .admin-field,
body[data-theme="light"] .room-settings-title,
body[data-theme="soft"] .room-settings-title{
  color:#17232c !important;
}
body[data-theme="light"] .admin-field select,
body[data-theme="soft"] .admin-field select{
  background:#eef2f4 !important;
  color:#17232c !important;
  border-color:#c4d0d7 !important;
}

/* v16.5.20 — voice recording timer contrast */
body[data-theme="light"] .voice-status,body[data-theme="soft"] .voice-status{color:#fff;background:#202b36}

/* v16.5.23 — upload toast cleanup + theme contrast */
.media-grid{grid-template-columns:repeat(3,1fr)}
.media-tile{position:relative;min-width:0;background:#000;border-radius:6px;overflow:hidden;aspect-ratio:1}
.media-tile>img,.media-tile>video{display:block;width:100%;height:100%;object-fit:cover;background:#000;cursor:pointer}
.media-tile>audio{position:absolute;left:6px;right:6px;bottom:6px;width:calc(100% - 12px);height:36px}
.media-tile .media-tile-menu{position:absolute;right:5px;top:5px;width:34px;height:34px;border:0;border-radius:10px;background:rgba(20,28,36,.82);color:#fff;font-size:22px;line-height:1;z-index:2;backdrop-filter:blur(5px)}
.media-upload-queue{display:flex;flex-direction:column;gap:4px;margin:0 8px 8px;font-size:12px}
.media-viewer{position:fixed;inset:0;z-index:120;background:rgba(0,0,0,.96);display:flex;align-items:center;justify-content:center;padding:calc(12px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom));touch-action:none}
.media-viewer[hidden]{display:none}
.media-viewer-stage{width:100%;height:100%;display:flex;align-items:center;justify-content:center;min-width:0;min-height:0}
.media-viewer-stage img,.media-viewer-stage video{display:block;max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;border-radius:4px;touch-action:none;will-change:transform}.media-viewer-stage img{user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}.message-link{color:inherit;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:2px}
.media-viewer-stage audio{width:min(680px,90vw)}
.media-viewer-btn{position:absolute;width:46px;height:46px;border:0;border-radius:14px;background:rgba(30,38,46,.78);color:#fff;font-size:30px;line-height:1;z-index:2;backdrop-filter:blur(5px)}
.media-viewer-close{top:calc(10px + env(safe-area-inset-top));left:10px}
.media-viewer-menu{top:calc(10px + env(safe-area-inset-top));right:10px}
.media-viewer-prev{left:10px;top:50%;transform:translateY(-50%)}
.media-viewer-next{right:10px;top:50%;transform:translateY(-50%)}
.media-viewer-info{position:absolute;left:50%;bottom:calc(10px + env(safe-area-inset-bottom));transform:translateX(-50%);color:#fff;background:rgba(20,28,36,.72);padding:6px 10px;border-radius:999px;font-size:12px;z-index:2;white-space:nowrap}
.media-context-menu{position:fixed;z-index:130;background:#202b36;border:1px solid #394754;border-radius:12px;box-shadow:0 10px 30px #0008;overflow:hidden;min-width:210px}
.media-context-menu button{display:block;width:100%;text-align:left;padding:12px;border:0;background:transparent;color:#fff;font-size:15px}
.media-context-menu button+button{border-top:1px solid #394754}
.media-context-menu .danger{color:#ff9a9a}
body[data-theme="light"] .media-context-menu,body[data-theme="soft"] .media-context-menu{background:#fff;border-color:#dbe2e8}
body[data-theme="light"] .media-context-menu button,body[data-theme="soft"] .media-context-menu button{color:#18222b}
body[data-theme="light"] .media-context-menu .danger,body[data-theme="soft"] .media-context-menu .danger{color:#8b2f2f}
@media(max-width:480px){
  .media-viewer-btn{width:42px;height:42px;font-size:28px;border-radius:12px}
  .media-viewer-prev{left:7px}.media-viewer-next{right:7px}
}



/* v16.5.24 — multi-select media actions */
.media-head-actions{display:flex;align-items:center;gap:5px}
.media-head-actions button{min-width:40px;min-height:40px;border:0;border-radius:10px;background:transparent;color:#fff;font-size:15px}
.media-head-actions button+button{font-size:28px}
.media-select-toggle{padding:0 9px}
.media-selection-bar{position:sticky;top:58px;z-index:3;display:flex;align-items:center;gap:7px;padding:8px 10px;background:#151e28;border-bottom:1px solid #2a3540}
.media-selection-bar[hidden]{display:none}
.media-selection-bar span{flex:1;font-size:13px;color:#dce7f0;min-width:0}
.media-selection-bar button{border:0;border-radius:9px;padding:8px 10px;background:#202b36;color:#fff;font-size:13px;white-space:nowrap}
.media-selection-bar button.danger{background:#6e3030;color:#ffd4d4}
.media-tile.selected{outline:3px solid #fff;outline-offset:-3px}
.media-select-check{position:absolute;left:7px;top:7px;width:32px;height:32px;border:2px solid #fff;border-radius:50%;background:rgba(20,28,36,.72);color:#fff;font-size:19px;font-weight:700;z-index:3;backdrop-filter:blur(5px)}
body[data-theme="light"] .media-head-actions button,body[data-theme="soft"] .media-head-actions button{color:#18222b}
body[data-theme="light"] .media-selection-bar,body[data-theme="soft"] .media-selection-bar{background:#fff;border-bottom-color:#dbe2e8}
body[data-theme="light"] .media-selection-bar span,body[data-theme="soft"] .media-selection-bar span{color:#18222b}
body[data-theme="light"] .media-selection-bar button,body[data-theme="soft"] .media-selection-bar button{background:#eef2f4;color:#18222b}
body[data-theme="light"] .media-selection-bar button.danger,body[data-theme="soft"] .media-selection-bar button.danger{background:#f8dddd;color:#8b2f2f}
@media(max-width:520px){.media-selection-bar{overflow:auto}.media-selection-bar button{padding:8px 9px}}

/* v16.5.25 — media upload completion/status finalization */

/* v16.5.26-p1 — presence/typing UI, layout-neutral */
.presence-panel{
  position:absolute;
  top:58px;
  left:8px;
  right:8px;
  z-index:80;
  max-height:min(70vh,420px);
  overflow:auto;
  background:#151e28;
  border:1px solid #2d3945;
  border-radius:14px;
  box-shadow:0 12px 35px #0009;
}
.presence-panel[hidden]{display:none}
.presence-panel-head{
  position:sticky;
  top:0;
  z-index:1;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:11px 13px;
  background:#151e28;
  border-bottom:1px solid #2a3540;
}
.presence-panel-head button{
  border:0;
  background:transparent;
  color:#fff;
  width:40px;
  height:40px;
  border-radius:10px;
  font-size:28px;
  line-height:1;
}
.presence-list{padding:4px 0 6px}
.presence-row{
  display:flex;
  align-items:center;
  gap:9px;
  min-height:44px;
  padding:7px 13px;
}
.presence-dot{
  flex:0 0 auto;
  width:9px;
  height:9px;
  border-radius:50%;
  background:#7d8892;
}
.presence-row.online .presence-dot{background:#55b878}
.presence-name{
  min-width:0;
  flex:1;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.presence-state{
  flex:0 0 auto;
  font-size:11px;
  color:#8f9da9;
}
.presence-row.online .presence-state{color:#6fbd8d}
body[data-theme="light"] .presence-panel,
body[data-theme="soft"] .presence-panel{
  background:#fff;
  border-color:#dbe2e8;
}
body[data-theme="light"] .presence-panel-head,
body[data-theme="soft"] .presence-panel-head{
  background:#fff;
  border-bottom-color:#dbe2e8;
}
body[data-theme="light"] .presence-panel-head button,
body[data-theme="soft"] .presence-panel-head button{color:#18222b}
body[data-theme="light"] .presence-name,
body[data-theme="soft"] .presence-name{color:#18222b}
body[data-theme="light"] .presence-state,
body[data-theme="soft"] .presence-state{color:#7a8792}
body[data-theme="light"] .presence-row.online .presence-state,
body[data-theme="soft"] .presence-row.online .presence-state{color:#4c9669}

body[data-theme="light"] .admin-section,
body[data-theme="soft"] .admin-section{
  background:#ffffff;
  border-color:#cfd8df;
  color:#18222b;
}

body[data-theme="light"] .admin-members-list,
body[data-theme="soft"] .admin-members-list{
  border-color:#dbe2e8;
}

body[data-theme="light"] .admin-item,
body[data-theme="soft"] .admin-item,
body[data-theme="light"] .admin-member-row,
body[data-theme="soft"] .admin-member-row{
  border-color:#dbe2e8;
}

body[data-theme="light"] .admin-item-main strong,
body[data-theme="soft"] .admin-item-main strong{
  color:#18222b;
}

body[data-theme="light"] .admin-item-main span,
body[data-theme="soft"] .admin-item-main span,
body[data-theme="light"] .admin-room-meta,
body[data-theme="soft"] .admin-room-meta,
body[data-theme="light"] .admin-empty,
body[data-theme="soft"] .admin-empty{
  color:#60707c;
}

body[data-theme="light"] .admin-members-details>summary,
body[data-theme="soft"] .admin-members-details>summary{
  color:#18222b;
}

body[data-theme="light"] .admin-members-details>summary strong,
body[data-theme="soft"] .admin-members-details>summary strong{
  color:#425461;
}

body[data-theme="light"] .admin-room,
body[data-theme="soft"] .admin-room{
  border-color:#dbe2e8;
}

body[data-theme="light"] .admin-room-name,
body[data-theme="soft"] .admin-room-name{
  color:#18222b;
}

body[data-theme="light"] .admin-room-count,
body[data-theme="soft"] .admin-room-count{
  color:#526573;
}

body[data-theme="light"] .admin-room-members span,
body[data-theme="soft"] .admin-room-members span{
  background:#edf2f5;
  color:#24313a;
}

body[data-theme="light"] .admin-you,
body[data-theme="soft"] .admin-you{
  color:#71818d;
}

body[data-theme="light"] .admin-remove-member,
body[data-theme="soft"] .admin-remove-member{
  background:#fff0f0;
  color:#b42323;
}

.admin-remove-room{display:block;width:calc(100% - 16px);margin:0 8px 10px;padding:9px 10px;border:1px solid rgba(255,90,90,.35);border-radius:9px;background:#35272b;color:#ffb0b0;font:inherit;font-size:13px;cursor:pointer}.admin-remove-room:disabled{opacity:.45}.admin-remove-room:active{transform:scale(.99)}
body[data-theme="light"] .admin-remove-room,body[data-theme="soft"] .admin-remove-room{background:#fff0f0;color:#b42323;border-color:#f0caca}

/* v16.5.26 — search panel */
.search-panel{
  overflow:hidden;
}

.search-box{
  display:flex;
  align-items:center;
  gap:6px;
  padding:10px 12px;
  border-bottom:1px solid #2a3540;
}

.search-box input{
  flex:1;
  min-width:0;
  height:42px;
  padding:9px 12px;
  border:1px solid #303c48;
  border-radius:12px;
  background:#1a232d;
  color:#fff;
  font:inherit;
  font-size:16px;
  outline:none;
}

.search-box input:focus{
  border-color:#4a5b6d;
}

.search-box button{
  flex:0 0 40px;
  width:40px;
  height:40px;
  border:0;
  border-radius:10px;
  background:#202b36;
  color:#fff;
  font-size:20px;
  cursor:pointer;
}

.search-results{
  height:calc(100% - 63px);
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  padding:4px 0;
}

.search-result{
  display:block;
  width:100%;
  padding:10px 12px;
  border:0;
  border-bottom:1px solid #283340;
  background:transparent;
  color:#fff;
  text-align:left;
  cursor:pointer;
}

.search-result:active{
  background:#202b36;
}

.search-result-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:3px;
}

.search-result-author{
  font-size:12px;
  font-weight:700;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.search-result-date{
  flex:0 0 auto;
  font-size:10px;
  color:#8896a3;
}

.search-result-text{
  font-size:14px;
  line-height:1.4;
  white-space:pre-wrap;
  word-break:break-word;
}

.search-result-empty{
  padding:18px 14px;
  text-align:center;
  color:#8896a3;
  font-size:13px;
}

/* Search panel — light themes */
body[data-theme="light"] .search-box,
body[data-theme="soft"] .search-box{
  border-bottom-color:#dbe2e8;
}

body[data-theme="light"] .search-box input,
body[data-theme="soft"] .search-box input{
  background:#ffffff;
  color:#18222b;
  border-color:#ccd7df;
}

body[data-theme="light"] .search-box button,
body[data-theme="soft"] .search-box button{
  background:#e8edf1;
  color:#18222b;
}

body[data-theme="light"] .search-result,
body[data-theme="soft"] .search-result{
  color:#18222b;
  border-bottom-color:#dbe2e8;
}

body[data-theme="light"] .search-result:active{
  background:#eef2f4;
}

body[data-theme="soft"] .search-result:active{
  background:#edf2ee;
}

body[data-theme="light"] .search-result-date,
body[data-theme="soft"] .search-result-date,
body[data-theme="light"] .search-result-empty,
body[data-theme="soft"] .search-result-empty{
  color:#6f7d89;
}

@media(max-width:480px){
  .search-box{
    padding:8px;
  }

  .search-result{
    padding:10px;
  }
}

/* v16.5.26 — search close button visibility */
body[data-theme="light"] .search-panel .panel-head button,
body[data-theme="soft"] .search-panel .panel-head button{
  color:#18222b !important;
}


/* v16.5.26 — highlighted search target */
.msg.search-target{
  outline:2px solid #6aa7d8;
  outline-offset:2px;
  box-shadow:0 0 0 4px rgba(106,167,216,.16);
  transition:outline-color .2s,box-shadow .2s;
}


/* v16.5.26 — floating search navigation restore */
.search-floating-nav{
  position:absolute;
  top:calc(58px + env(safe-area-inset-top) + 8px);
  right:8px;
  z-index:1000;
  display:flex;
  align-items:center;
  gap:8px;
  padding:6px 8px 6px 10px;
  border:1px solid #394754;
  border-radius:12px;
  background:#202b36;
  color:#fff;
  box-shadow:0 8px 25px #0006;
}

.search-floating-nav[hidden]{
  display:none;
}

.search-floating-nav>span{
  font-size:12px;
  white-space:nowrap;
}

.search-nav-buttons{
  display:flex;
  align-items:center;
  gap:3px;
}

.search-nav-buttons button{
  width:38px;
  min-width:38px;
  height:38px;
  border:0;
  border-radius:9px;
  background:#2b3947;
  color:#fff;
  font-size:20px;
  line-height:1;
  cursor:pointer;
}

.search-nav-buttons button:disabled{
  opacity:.4;
}

.search-nav-buttons button:active{
  transform:scale(.96);
}

body[data-theme="light"] .search-floating-nav{
  background:#fff;
  color:#18222b;
  border-color:#dbe2e8;
  box-shadow:0 8px 25px rgba(0,0,0,.14);
}

body[data-theme="light"] .search-nav-buttons button{
  background:#e8edf1;
  color:#18222b;
}

body[data-theme="soft"] .search-floating-nav{
  background:rgba(255,255,255,.97);
  color:#1f2923;
  border-color:#dbe2e8;
  box-shadow:0 8px 25px rgba(0,0,0,.12);
}

body[data-theme="soft"] .search-nav-buttons button{
  background:#e7ede9;
  color:#1f2923;
}

@media(max-width:700px){
  .search-floating-nav{
    position:fixed;
    top:calc(58px + env(safe-area-inset-top) + 6px);
    left:50%;
    right:auto;
    transform:translateX(-50%);
    max-width:calc(100vw - 16px);
  }

  .search-nav-buttons button{
    width:40px;
    min-width:40px;
    height:40px;
  }
}

.msg.search-target{
  outline:2px solid #4d9bd3 !important;
  outline-offset:2px;
  box-shadow:
    0 0 0 4px rgba(77,155,211,.20),
    0 0 18px rgba(77,155,211,.22);
  transition:outline-color .2s,box-shadow .2s;
}


/* v16.5.26 — persistent search target highlight */
.msg.search-target{
  position:relative;
  outline:2px solid #1683d8 !important;
  outline-offset:2px;
  background:#d8ecfb !important;
  box-shadow:
    0 0 0 4px rgba(22,131,216,.22),
    0 0 20px rgba(22,131,216,.22) !important;
  z-index:3;
}

body[data-theme="dark"] .msg.search-target{
  background:#294b63 !important;
}



/* === v16.5.27 — video messages + room search === */
.room-search-box{display:flex;align-items:center;gap:7px;margin:0 14px 10px;padding:0 10px;height:42px;border:1px solid #303c48;border-radius:12px;background:#1a232d;color:#91a0ad}
.room-search-box input{min-width:0;flex:1;border:0;outline:0;background:transparent;color:#fff;font:inherit;font-size:15px}
.room-search-box input::placeholder{color:#7f8d99}
.room-search-box button{width:30px;height:30px;padding:0;border:0;border-radius:9px;background:transparent;color:#aeb9c2;font-size:22px;line-height:1}
.room-search-box button:active{background:#263440}
.room-search-box-panel{margin-top:10px}
.room-search-empty{padding:18px 10px;text-align:center;color:#8896a3;font-size:14px}
.voice-mode-menu{position:absolute;left:8px;bottom:60px;z-index:45;display:flex;flex-direction:column;min-width:190px;overflow:hidden;border:1px solid #394754;border-radius:12px;background:#202b36;box-shadow:0 12px 35px #0009}
.voice-mode-menu[hidden]{display:none}
.voice-mode-menu button{padding:13px 15px;border:0;border-bottom:1px solid #394754;background:transparent;color:#fff;text-align:left;font-size:15px}
.voice-mode-menu button:last-child{border-bottom:0}
.voice-mode-menu button:active{background:#2b3a48}
.video-recorder-panel{position:absolute;inset:58px 0 0;z-index:60;display:flex;flex-direction:column;background:#101820}
.video-recorder-panel[hidden]{display:none}
.video-recorder-head{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;border-bottom:1px solid #2a3540;background:#101820;flex:0 0 auto}
.video-recorder-head button{width:38px;height:38px;border:0;border-radius:10px;background:#202b36;color:#fff;font-size:26px}
.video-recorder-stage{position:relative;display:flex;align-items:center;justify-content:center;flex:1;min-height:0;background:#000;overflow:hidden}
.video-recorder-stage>video{display:block;width:100%;height:100%;object-fit:cover;background:#000}
.video-recorder-timer{position:absolute;top:12px;left:50%;transform:translateX(-50%);padding:6px 10px;border-radius:999px;background:#000b;color:#fff;font-variant-numeric:tabular-nums;font-size:14px}
.video-recorder-timer.recording::before{content:'';display:inline-block;width:8px;height:8px;margin-right:6px;border-radius:50%;background:#ff4c4c;vertical-align:1px}
.video-recorder-switch{position:absolute;right:14px;bottom:14px;width:46px;height:46px;border:1px solid #ffffff38;border-radius:50%;background:#000b;color:#fff;font-size:24px}
.video-review{position:absolute;inset:58px 0 80px;z-index:2;display:flex;align-items:center;justify-content:center;background:#000}
.video-review[hidden]{display:none}
.video-review video{width:100%;height:100%;object-fit:contain;background:#000}
.video-recorder-actions{display:flex;gap:8px;align-items:center;padding:10px 12px;padding-bottom:max(10px,env(safe-area-inset-bottom));background:#151e28;flex:0 0 auto}
.video-recorder-actions button{flex:1;min-height:42px;padding:9px 12px;border:0;border-radius:12px;background:#28465d;color:#fff;font:inherit;font-weight:600}
.video-recorder-actions button.secondary{background:#202b36}
.video-recorder-actions button.record{background:#7b3030}
.video-recorder-actions button.primary{background:#2c5f7f}
.video-recorder-actions button:disabled{opacity:.45}
.video-recorder-hint{padding:0 12px 8px;text-align:center;color:#91a0ad;font-size:12px;background:#151e28}
.video-message{position:relative;width:210px;max-width:64vw;aspect-ratio:1;border-radius:50%!important;overflow:hidden;background:#000;cursor:pointer;margin:0 0 5px}
.video-message video{display:block!important;width:100%;height:100%;max-height:none!important;max-width:none!important;object-fit:cover;border-radius:0!important;margin:0!important}
.video-message-play{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:radial-gradient(circle,#0006 0 27%,transparent 28%);color:#fff;font-size:46px;text-shadow:0 2px 10px #000;pointer-events:none}
.video-message.playing .video-message-play{opacity:0}
@media(max-width:520px){
  .video-message{width:min(210px,64vw)}
  .voice-mode-menu{left:4px;bottom:58px}
}
@media(max-width:700px){
  .video-recorder-panel{inset:58px 0 0}
  .video-recorder-actions{gap:6px;padding-left:7px;padding-right:7px}
}
body[data-theme="light"] .room-search-box,body[data-theme="soft"] .room-search-box{background:#fff;color:#6f7d89;border-color:#ccd7df}
body[data-theme="light"] .room-search-box input,body[data-theme="soft"] .room-search-box input{color:#18222b}
body[data-theme="light"] .room-search-box input::placeholder,body[data-theme="soft"] .room-search-box input::placeholder{color:#7a8791}
body[data-theme="light"] .room-search-box button,body[data-theme="soft"] .room-search-box button{color:#6f7d89}
body[data-theme="light"] .video-recorder-panel,body[data-theme="soft"] .video-recorder-panel{background:#f8fafb;color:#18222b}
body[data-theme="light"] .video-recorder-head,body[data-theme="soft"] .video-recorder-head,body[data-theme="light"] .video-recorder-actions,body[data-theme="soft"] .video-recorder-actions,body[data-theme="light"] .video-recorder-hint,body[data-theme="soft"] .video-recorder-hint{background:#fff;color:#18222b}

/* Video thumbnails in media gallery */
.media-video-placeholder.has-thumbnail{position:relative;padding:0;overflow:hidden}
.media-video-placeholder.has-thumbnail img{display:block;width:100%;height:100%;object-fit:cover}
.media-video-placeholder.has-thumbnail .media-video-placeholder-icon{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%)}

/* Private room avatar — chamfered square */
.room-avatar{
  width:34px;
  height:34px;
  flex:0 0 34px;
  display:block;
  object-fit:cover;
  clip-path:polygon(
    12% 0,
    88% 0,
    100% 12%,
    100% 88%,
    88% 100%,
    12% 100%,
    0 88%,
    0 12%
  );
}

.room-icon:has(.room-avatar){
  width:34px;
  height:34px;
  display:flex;
  align-items:center;
  justify-content:center;
}


body[data-theme="light"] .reply-bar{background:#ffffff;border-color:#dbe2e8;color:#18222b}
body[data-theme="light"] .reply-bar-name{color:#496d8b}
body[data-theme="light"] .reply-bar-text{color:#4d5b66}
body[data-theme="light"] .reply-bar button{color:#18222b}
body[data-theme="light"] .reply-quote{background:rgba(0,0,0,.045);border-left-color:#7192aa}
body[data-theme="light"] .reply-quote-name{color:#496d8b}
body[data-theme="light"] .reply-quote-text{color:#52616c}

body[data-theme="soft"] .reply-bar{background:#ffffff;border-color:#d6e0d9;color:#1f2923}
body[data-theme="soft"] .reply-bar-name{color:#52715d}
body[data-theme="soft"] .reply-bar-text{color:#52615a}
body[data-theme="soft"] .reply-bar button{color:#1f2923}
body[data-theme="soft"] .reply-quote{background:rgba(0,0,0,.035);border-left-color:#71907a}
body[data-theme="soft"] .reply-quote-name{color:#52715d}
body[data-theme="soft"] .reply-quote-text{color:#52615a}

@media(max-width:700px){
  .reply-bar{left:5px;right:5px;bottom:58px}
}


/* Newline button — small floating control above the message field */
.newline-btn{
  position:absolute;
  right:78px;
  bottom:calc(100% - 22px);
  width:26px;
  height:22px;
  padding:0;
  border:1px solid #394754;
  border-radius:8px;
  background:#202b36;
  color:#b9c5ce;
  font-size:15px;
  line-height:20px;
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:27;
  opacity:.88;
}
.newline-btn:active{
  opacity:1;
  transform:translateY(1px);
}
body[data-theme="light"] .newline-btn{
  background:#eef2f5;
  border-color:#ccd7df;
  color:#52616d;
}
body[data-theme="soft"] .newline-btn{
  background:#edf2ee;
  border-color:#ccd8d0;
  color:#56665d;
}
@media(max-width:480px){
  .newline-btn{
    right:72px;
    bottom:calc(100% - 13px);
    width:25px;
    height:21px;
    font-size:14px;
  }
}
@media(max-width:360px){
  .newline-btn{
    right:68px;
    bottom:calc(100% - 12px);
    width:23px;
    height:20px;
    font-size:13px;
  }
}

/* 16.5.44 — компактная кнопка удаления участника */
.presence-remove{
  width:32px !important;
  height:32px !important;
  min-width:32px !important;
  min-height:32px !important;
  padding:0 !important;
  margin-left:6px;
  display:grid !important;
  place-items:center !important;
  font-size:16px !important;
  line-height:1 !important;
  border-radius:8px !important;
}



/* v16.5.45 — compact participant removal button */
.presence-remove,
.member-remove{
  width:32px !important;
  height:32px !important;
  min-width:32px !important;
  min-height:32px !important;
  padding:0 !important;
  margin-left:6px;
  display:grid !important;
  place-items:center !important;
  font-size:16px !important;
  line-height:1 !important;
  border-radius:8px !important;
  flex:none !important;
}

/* v16.5.45-ui-fix — compact trash buttons */
.presence-remove,
.member-remove{
  width:28px !important;
  height:28px !important;
  min-width:28px !important;
  min-height:28px !important;
  padding:0 !important;
  margin-left:6px !important;
  display:grid !important;
  place-items:center !important;
  font-size:14px !important;
  line-height:1 !important;
  border-radius:7px !important;
  flex:none !important;
}


/* v16.5.45 — emoji-only messages */
.msg.emoji-only{
  background:transparent !important;
  padding:2px 4px 0 !important;
  border-radius:0 !important;
  max-width:min(90%,700px);
  box-shadow:none !important;
}

.msg.emoji-only .caption{
  font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif;
  font-size:128px;
  line-height:1.05;
  white-space:normal;
  background:transparent;
  padding:0;
}

.msg.emoji-only .time{
  font-size:9px;
  margin-top:0;
  opacity:.75;
}

@media (max-width:600px){
  .msg.emoji-only .caption{
    font-size:130px;
  }
}


/* v16.5.45 — local pending outbox messages */
.pending-outbox{
  opacity:.92;
  border-style:dashed!important;
  padding:8px 12px!important;
  min-height:0!important;
}
.pending-outbox .author{
  margin-bottom:3px;
}
.pending-outbox .pending-outbox-text{
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  margin:0;
}
.pending-outbox-media{
  display:flex;
  align-items:center;
  gap:7px;
  min-height:24px;
  font-size:15px;
  font-weight:600;
}
.pending-outbox-status{
  margin-top:4px;
  font-size:12px;
  line-height:1.2;
  opacity:.8;
}
.pending-outbox-actions{
  display:flex;
  gap:6px;
  margin-top:6px;
}
.pending-outbox-actions button{
  border:1px solid currentColor;
  border-radius:7px;
  padding:3px 8px;
  background:transparent;
  cursor:pointer;
  font:inherit;
  font-size:12px;
  line-height:1.2;
}
.pending-outbox-actions .pending-delete{
  opacity:.75;
}
.pending-outbox.pending-error{
  border-color:currentColor!important;
}


/* SERGDATA_JUMP_TO_LAST_CSS_V1 */
.jump-to-last{
  position:absolute;
  right:14px;
  bottom:92px;
  z-index:24;
  border:1px solid #394754;
  border-radius:20px;
  background:#202b36;
  color:#fff;
  padding:9px 13px;
  font-size:13px;
  line-height:1;
  box-shadow:0 6px 20px #0006;
  cursor:pointer;
}

.jump-to-last[hidden]{
  display:none;
}

.jump-to-last:active{
  transform:scale(.97);
}

body[data-theme="light"] .jump-to-last{
  background:#fff;
  color:#18222b;
  border-color:#dbe2e8;
  box-shadow:0 6px 20px rgba(0,0,0,.14);
}

body[data-theme="soft"] .jump-to-last{
  background:rgba(255,255,255,.97);
  color:#1f2923;
  border-color:#dbe2e8;
  box-shadow:0 6px 20px rgba(0,0,0,.12);
}

@media(max-width:480px){
  .jump-to-last{
    right:10px;
    bottom:88px;
    padding:8px 11px;
    font-size:12px;
  }
}

/* v16.5.45 — iPhone jump-to-last visibility */
@media(max-width:700px){
  .jump-to-last{
    position:fixed;
    right:10px;
    bottom:calc(88px + env(safe-area-inset-bottom));
    z-index:1001;
  }
}
