:root{color-scheme:light;--blue:#285cc4;--ink:#1c2b44;--muted:#6c7890;--border:#e2e8f0;--bg:#f5f7fb;--white:#fff;--shadow:0 5px 24px #0e2c5d0a}*{box-sizing:border-box}html,body{margin:0;min-height:100%;font-family:system-ui,-apple-system,"Segoe UI",sans-serif;color:var(--ink);background:var(--bg);font-size:14px}button,input,textarea{font:inherit}button{cursor:pointer}a{color:var(--blue);text-decoration:none}a:hover{text-decoration:underline}button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible{outline:3px solid #8fb6f0;outline-offset:2px}button:disabled{opacity:.55;cursor:not-allowed}[hidden]{display:none!important}.topbar{background:#fff;border-bottom:1px solid var(--border)}.top-inner{max-width:1180px;margin:auto;display:flex;align-items:center;justify-content:space-between;padding:12px 18px;gap:12px;min-height:65px}.brand{display:flex;align-items:center;gap:6px;font-size:21px;font-weight:800;color:#182b59;white-space:nowrap}.brand strong{color:#2e64c9}.brand-icon{display:grid;place-items:center;width:32px;height:32px;border-radius:11px;background:#315fd2;color:#fff}.top-actions{display:flex;gap:14px;align-items:center;flex-wrap:wrap;font-size:12px;font-weight:600}.chat-layout{height:calc(100vh - 66px);height:calc(100dvh - 66px);max-width:1180px;margin:0 auto;display:grid;grid-template-columns:minmax(270px,330px) minmax(0,1fr);border:1px solid var(--border);border-top:0;background:#fff}.chat-sidebar{min-height:0;border-right:1px solid var(--border);display:flex;flex-direction:column}.sidebar-head{display:flex;justify-content:space-between;gap:10px;padding:20px 17px 14px;border-bottom:1px solid var(--border)}h1{font-size:20px;margin:0 0 4px}h2{font-size:18px;margin:0 0 10px}.sidebar-head p,.helper,.note{color:var(--muted);font-size:12px;line-height:1.6;margin:0}.badge{display:inline-block;vertical-align:middle;border-radius:999px;padding:2px 8px;background:#dc3e5b;color:#fff;font-size:12px}.small-button{width:38px;height:38px;flex:none;background:#eaf1ff;border:0;border-radius:10px;color:var(--blue);font-weight:800;font-size:25px}.member-search{padding:13px;border-bottom:1px solid var(--border);background:#f8fbff}.member-search label{display:block;font-weight:700;margin-bottom:7px}.search-row{display:flex;gap:7px}.search-row input,.admin-filter input{width:100%;min-width:0;border:1px solid #cbd8eb;border-radius:10px;padding:10px}.search-row button,.admin-filter button{border:0;background:#2d61c8;color:#fff;border-radius:10px;padding:9px 12px;font-weight:700}.member-search .helper{margin-top:7px}.thread-list{overflow-y:auto;min-height:0;flex:1}.thread-row{display:flex;align-items:center;gap:10px;padding:15px;border:0;border-bottom:1px solid #f1f4f8;width:100%;background:#fff;text-align:left}.thread-row:hover,.thread-row.active{background:#f0f5ff}.thread-avatar{width:44px;height:44px;flex:none;display:grid;place-items:center;border-radius:50%;background:#e0eafa;color:#2855ad;font-weight:800;font-size:19px}.thread-info{min-width:0;flex:1}.thread-name{display:flex;align-items:center;justify-content:space-between;gap:5px;font-weight:750}.thread-preview{color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:4px;font-size:12px}.unread-mini{border-radius:40px;background:#315fd2;color:white;padding:2px 7px;font-weight:800;font-size:11px}.padded{padding:18px}.conversation{min-height:0;display:flex;flex-direction:column;position:relative}.empty-state{margin:auto;text-align:center;color:#64738f;padding:25px}.empty-state h2{color:#1a2c4c}.empty-icon{display:grid;place-items:center;background:#ecf2ff;color:#285cc4;border-radius:50%;width:75px;height:75px;font-size:34px;margin:0 auto 20px}.active-conversation{height:100%;min-height:0;display:flex;flex-direction:column}.conversation-top{padding:12px 17px;border-bottom:1px solid var(--border);display:flex;align-items:center;gap:12px;min-height:69px}.conv-user{flex:1;min-width:0}.conv-user strong{display:block;font-size:15px}.conv-user small{color:var(--muted);font-size:11px}.back-chat{display:none}.more-button{border:1px solid #dbe4f2;border-radius:10px;background:#fff;color:#64748b;font-size:22px;width:36px;height:36px}.thread-options{display:flex;gap:6px;justify-content:flex-end;flex-wrap:wrap;padding:8px 15px;border-bottom:1px solid var(--border);background:#f8faff}.thread-options button{background:white;color:#42587d;border:1px solid #dbe4f2;padding:8px 10px;border-radius:8px;font-size:12px}.messages{overflow-y:auto;flex:1;min-height:0;padding:14px 19px;background:#fcfdff;overscroll-behavior:contain}.load-older{margin:0 auto 15px;display:block;border:1px solid var(--border);color:#5373ac;background:#fff;padding:8px 13px;border-radius:30px;font-size:12px}.bubble-list{display:flex;flex-direction:column;gap:9px}.bubble{max-width:min(85%,490px);border-radius:16px;padding:10px 13px;background:#edf2f9;align-self:flex-start;overflow-wrap:anywhere;white-space:pre-wrap;line-height:1.55}.bubble.mine{align-self:flex-end;background:#2e61c8;color:#fff}.bubble small{display:block;opacity:.72;font-size:10px;text-align:right;margin-top:3px}.bubble .read-state{margin-left:5px}.composer{display:flex;gap:10px;padding:12px 15px 7px;border-top:1px solid var(--border);align-items:flex-end}.composer textarea{border:1px solid #d7e0eb;border-radius:17px;background:#f7faff;min-height:43px;max-height:125px;resize:vertical;padding:11px 13px;flex:1;min-width:0;outline-color:#5988df;line-height:1.45}.composer .send{border:0;background:#2e61c8;color:#fff;padding:10px 16px;border-radius:13px;min-height:43px;font-weight:750}.composer-hint{padding:0 19px 9px;font-size:10px;color:#92a0b6}.overlay{position:fixed;inset:0;z-index:20;background:#121f37b8;display:flex;align-items:center;justify-content:center;padding:18px}.panel{background:#fff;border:1px solid #e0e7f1;border-radius:17px;box-shadow:var(--shadow);padding:22px}.modal{max-width:590px;width:100%;max-height:91dvh;overflow-y:auto}.modal p{line-height:1.7}.privacy-text{background:#f6f8fd;border:1px solid #e4eaf5;padding:13px 15px;border-radius:12px;line-height:1.7}.privacy-text p{font-size:13px;margin:7px 0}.consent-check{display:flex;gap:10px;align-items:flex-start;font-weight:650;margin:17px 0}.consent-check input{width:18px;height:18px;flex:none}.primary,.primary-link{background:#2e61c8;color:#fff;border:0;border-radius:10px;padding:12px 18px;font-weight:700;display:inline-block}.toast{position:fixed;z-index:50;bottom:20px;left:50%;transform:translateX(-50%);background:#182e57;color:white;padding:12px 18px;border-radius:12px;box-shadow:0 5px 25px #1117;max-width:90vw}.welcome,.install-wrap{max-width:700px;margin:55px auto;padding:20px}.install-wrap .panel{padding:32px}.error{color:#bd334c}.success{color:#0b8f54}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}.admin-wrap{max-width:1080px;padding:18px 14px;margin:0 auto}.admin-intro{margin-bottom:14px}.admin-intro p{line-height:1.7;color:#58667e}.admin-tabs{display:flex;gap:8px;margin-bottom:12px}.admin-tabs button{border:1px solid #dbe4f0;background:#fff;padding:11px 16px;border-radius:10px;font-weight:650}.admin-tabs button.active{background:#2e61c8;color:white}.admin-filter{display:flex;gap:9px;align-items:center;margin-bottom:10px}.admin-filter input{width:180px}.admin-thread-list{margin-top:15px}.admin-thread{display:flex;justify-content:space-between;align-items:center;gap:10px;width:100%;padding:13px 9px;border:0;border-bottom:1px solid #eef1f6;background:#fff;text-align:left}.admin-thread:hover{background:#f3f7ff}.admin-thread small{color:var(--muted)}.admin-chat-view{margin-top:16px;border:1px solid var(--border);border-radius:12px;overflow:hidden}.admin-chat-head{display:flex;justify-content:space-between;align-items:center;padding:13px;background:#f4f8ff}.admin-chat-head button{border:1px solid var(--border);background:white;border-radius:8px;padding:7px 12px}.admin-messages{max-height:500px;overflow:auto;padding:13px;display:flex;flex-direction:column;gap:9px}.admin-message{padding:9px 12px;background:#f5f7fb;border-radius:10px;white-space:pre-wrap;overflow-wrap:anywhere}.admin-message strong{display:block;font-size:12px}.admin-message small{display:block;margin-top:4px;color:var(--muted)}.admin-data-row{padding:10px;border-bottom:1px solid #edf1f6;line-height:1.65;overflow-wrap:anywhere}.admin-data-row button{border:1px solid var(--border);border-radius:8px;background:#eef3fd;padding:7px;margin-top:6px}
@media(max-width:700px){.top-inner{min-height:57px;padding:10px 12px}.brand{font-size:17px}.brand-icon{width:26px;height:26px;font-size:13px}.top-actions{gap:9px;font-size:10px}.chat-layout{display:block;height:calc(100dvh - 58px);border:none;position:relative}.chat-sidebar{height:100%;border:0}.conversation{height:100%;display:none}.chat-layout.show-conversation .chat-sidebar{display:none}.chat-layout.show-conversation .conversation{display:flex}.empty-state{display:none}.back-chat{display:grid;place-items:center;width:35px;height:35px;border:0;border-radius:10px;background:#f2f5fa;font-size:27px;color:#27467e}.messages{padding:12px 10px}.bubble{max-width:87%}.conversation-top{padding:10px}.composer{padding:9px 9px 5px;gap:7px}.composer-hint{padding-bottom:7px}.admin-tabs{overflow-x:auto}.admin-tabs button{white-space:nowrap;padding:10px 12px}.admin-filter{flex-wrap:wrap}.admin-filter label{width:100%}.admin-filter input{flex:1}.panel{padding:15px}.welcome,.install-wrap{margin:20px auto;padding:10px}}

/* RoiKib Chat Avatar v1.0.3 */
.thread-avatar{position:relative;overflow:hidden;isolation:isolate}
.thread-avatar>.rk-chat-avatar-img{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:cover;border-radius:50%;background:#e0eafa}
.chat-header-avatar{width:42px;height:42px;font-size:18px;flex:none}
.rk-chat-message-row{display:flex;align-items:flex-end;gap:8px;max-width:96%;align-self:flex-start;min-width:0}
.rk-chat-message-row>.bubble{max-width:min(490px,calc(100% - 40px));align-self:auto}
.rk-chat-message-avatar{width:32px;height:32px;font-size:13px;flex:none}
.rk-chat-search-avatar{display:inline-grid;vertical-align:middle;width:28px;height:28px;font-size:12px;margin-right:7px}
@media(max-width:700px){.chat-header-avatar{width:38px;height:38px}.rk-chat-message-avatar{width:27px;height:27px}.rk-chat-message-row{gap:6px}}

/* RoiKib Chat Images v1.0: only chat photo UI, no changes to keyboard dock/nav */
.rk-chat-attach{flex:none;width:43px;height:43px;display:grid;place-items:center;border:1px solid #c5d6ee;border-radius:12px;background:#eef4ff;color:#285cc4;font-size:24px;line-height:1}
.rk-chat-attach:hover{background:#e0eaff}
.rk-chat-image-draft{display:flex;align-items:center;gap:10px;padding:8px 14px;background:#f8fbff;border-top:1px solid #e4eaf4;min-width:0}
.rk-chat-image-draft>img{width:58px;height:58px;object-fit:cover;border-radius:8px;background:#e7effa;flex:none}
.rk-chat-image-draft-info{display:flex;flex:1;min-width:0;flex-direction:column;gap:3px;font-size:12px}
.rk-chat-image-draft-info strong{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.rk-chat-image-draft-info span{color:#6c7890;font-size:11px}
.rk-chat-image-draft>button{border:0;background:#e7edfa;border-radius:9px;color:#485c80;width:31px;height:31px;flex:none}
.bubble .rk-chat-image-link,.bubble .rk-chat-image-link:is(:link,:visited,:hover,:active,:focus){display:block;max-width:100%;text-decoration:none!important;text-decoration-line:none!important;border:0!important;box-shadow:none!important}
.bubble .rk-chat-image{display:block;width:auto;height:auto;max-width:100%;max-height:300px;border-radius:10px;object-fit:contain;cursor:zoom-in}
.bubble .rk-chat-image-caption{margin-top:7px;white-space:pre-wrap;overflow-wrap:anywhere}
.bubble.rk-chat-image-bubble{padding:7px 7px 6px;min-width:105px;max-width:min(85%,360px)}
.bubble.rk-chat-image-bubble small{padding:0 4px}
.admin-message .rk-chat-image{max-width:min(100%,300px);max-height:300px;border-radius:9px;display:block;margin:8px 0;object-fit:contain}
@media(max-width:700px){.rk-chat-image-draft{padding:7px 10px}.rk-chat-attach{width:42px;height:43px}.bubble.rk-chat-image-bubble{max-width:min(87%,300px)}}

/* RK-IP-V1 — chat message images only; no effect on avatar/draft, keyboard or navigation */
.rk-chat-image-bubble .rk-chat-image{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;-webkit-user-drag:none;user-drag:none}
