                                                                                  
:root {
  color-scheme: light; --primary:#3390ec; --primary-hover:#247fd7; --primary-soft:#eaf3fd;
  --surface:#fff; --surface-soft:#f4f5f7; --text:#17212b; --muted:#85919c; --line:#edf0f3;
  --green:#4eaa75; --danger:#e45454; --danger-soft:#fff0f0; --bubble-in:#fff; --bubble-out:#e3ffc8;
  --chat-background:#dbe7d6; --shadow:0 7px 30px #21374412; --sidebar:330px; --profile:310px;
  --font: -apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",Arial,sans-serif;
  font-family:var(--font); font-size:14px; -webkit-font-smoothing:antialiased;
}
* { box-sizing:border-box; }
body { margin:0; color:var(--text); background:var(--surface-soft); }
button,input,textarea,select { font:inherit; }
button,a,input,textarea,select { -webkit-tap-highlight-color:transparent; }
button { cursor:pointer; border:0; background:none; color:inherit; }
button:disabled { cursor:not-allowed; opacity:.45; }
a { color:var(--primary); text-decoration:none; }
button:focus-visible,a:focus-visible { outline:3px solid #3390ec77; outline-offset:3px; }
input,textarea,select { color:var(--text); background:var(--surface); }
input:focus,textarea:focus,select:focus { outline:0; border-color:var(--primary)!important; box-shadow:0 0 0 3px #3390ec12; }
textarea { resize:none; }
::selection { background:#3390ec33; }
[hidden] { display:none!important; }
h1,h2,h3,h4,p { margin:0; }
.icon { width:22px; height:22px; flex-shrink:0; vertical-align:middle; }
.icon.tiny { width:16px; height:16px; color:var(--muted); }
.icon-button { display:inline-flex; align-items:center; justify-content:center; width:42px; height:42px; border-radius:50%; color:#77848f; flex-shrink:0; transition:background .15s,color .15s; }
.icon-button:hover { background:var(--surface-soft); color:var(--primary); }
.muted { color:var(--muted); line-height:1.8; }
.button { display:inline-flex; align-items:center; justify-content:center; gap:9px; min-height:44px; padding:11px 20px; border-radius:11px; font-weight:600; line-height:1.4; border:1px solid transparent; transition:background .15s,transform .15s; }
.button:active:not(:disabled) { transform:translateY(1px); }
.button.primary { color:#fff; background:var(--primary); }
.button.primary:hover { background:var(--primary-hover); }
.button.secondary { color:var(--text); background:var(--surface-soft); }
.button.danger { color:white; background:var(--danger); }
.button.full { width:100%; }
.button.compact { min-height:37px; padding:8px 15px; font-size:12px; }
.button-row { display:flex; gap:12px; }
.button-row>* { flex:1; }
.text-button { color:var(--primary); font-size:12px; padding:8px 10px; border-radius:7px; }
.text-button:hover { background:var(--primary-soft); }
.input { width:100%; min-height:44px; padding:11px 13px; border:1px solid #dce2e8; border-radius:10px; transition:border-color .15s,box-shadow .15s; }
.input::placeholder { color:#a5aeb7; }
.input[readonly] { background:var(--surface-soft); }
.form-error { color:var(--danger); font-size:12px; line-height:1.7; }
.form-error:empty { display:none; }
.online-text { color:var(--primary)!important; }
.status-dot { display:inline-block; width:7px; height:7px; background:var(--green); border-radius:50%; }
.boot { height:100dvh; display:flex; align-items:center; justify-content:center; flex-direction:column; gap:20px; color:var(--muted); }
.loader { width:30px; height:30px; border:3px solid var(--line); border-top-color:var(--primary); border-radius:50%; animation:spin .8s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
@keyframes appear { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
                                      
.app-layout { position:relative; width:100%; height:100dvh; display:grid; grid-template-columns:var(--sidebar) minmax(0,1fr); overflow:hidden; background:var(--surface); }
.app-layout.has-room { grid-template-columns:var(--sidebar) minmax(0,1fr) var(--profile); }
.sidebar { display:flex; flex-direction:column; min-height:0; border-right:1px solid var(--line); background:var(--surface); position:relative; z-index:3; }
.sidebar-head { height:82px; padding:24px 20px 14px 24px; display:flex; justify-content:space-between; align-items:center; }
.brand { display:flex; align-items:center; gap:11px; }
.brand-mark { width:42px; height:42px; display:grid; place-items:center; border-radius:14px; color:white; background:linear-gradient(145deg,#5baeff,#2583de); box-shadow:0 4px 10px #3390ec25; }
.brand-mark>.icon { width:25px; height:25px; }
.brand>div { display:flex; flex-direction:column; gap:3px; }
.brand strong { font-size:20px; letter-spacing:1px; line-height:1.2; }
.brand-sub { color:#99a5b0; font-size:9px; letter-spacing:2.8px; font-weight:600; }
.sidebar-search { display:flex; align-items:center; gap:9px; margin:12px 20px 18px; background:var(--surface-soft); border-radius:24px; padding:0 15px; height:43px; color:#9aa4ae; }
.sidebar-search>.icon { width:19px; height:19px; }
.sidebar-search input { width:100%; background:none; border:0; outline:none; height:100%; font-size:13px; padding:0; box-shadow:none; }
.sidebar-search input::placeholder { color:#98a3ad; }
.sidebar-section-heading { display:flex; align-items:center; justify-content:space-between; padding:0 21px 13px; }
.sidebar-section-heading>span { font-size:13px; font-weight:650; color:#8a96a1; }
.new-chat-button { display:flex; align-items:center; gap:4px; background:var(--primary-soft); color:var(--primary); padding:7px 10px; border-radius:8px; font-size:12px; font-weight:600; }
.new-chat-button .icon { width:16px; height:16px; }
.folder-tabs { display:flex; gap:18px; padding:0 20px; border-bottom:1px solid var(--line); }
.folder-tab { display:flex; align-items:center; gap:6px; padding:10px 0 15px; color:#8b97a1; font-weight:600; font-size:12px; position:relative; white-space:nowrap; }
.folder-tab .icon { width:16px; height:16px; }
.folder-tab.active { color:var(--primary); }
.folder-tab.active::after { position:absolute; bottom:0; left:0; right:0; height:3px; border-radius:3px 3px 0 0; background:var(--primary); content:''; }
.tab-count { font-size:10px; min-width:18px; padding:2px 5px; background:var(--surface-soft); border-radius:6px; }
.active .tab-count { color:var(--primary); background:var(--primary-soft); }
.chat-list { overflow-y:auto; padding:9px 9px 20px; flex:1; }
.chat-row { display:flex; width:100%; align-items:center; gap:12px; padding:14px 12px; border-radius:12px; text-align:left; margin:2px 0; }
.chat-row:hover { background:var(--surface-soft); }
.chat-row.selected { background:var(--primary); color:#fff; }
.avatar { width:48px; height:48px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; color:#fff; font-size:20px; font-weight:600; flex-shrink:0; }
.avatar.large { width:86px; height:86px; font-size:32px; }
.tone-0 { background:linear-gradient(145deg,#75b8f8,#4086d1); }
.tone-1 { background:linear-gradient(145deg,#85c9a6,#4b9f7a); }
.tone-2 { background:linear-gradient(145deg,#c0a0ea,#9774c4); }
.tone-3 { background:linear-gradient(145deg,#f3b786,#df8d5f); }
.tone-4 { background:linear-gradient(145deg,#84cbd1,#4ba5b0); }
.tone-5 { background:linear-gradient(145deg,#ec9bae,#cc758f); }
.avatar-wrap { position:relative; flex-shrink:0; }
.online-dot { position:absolute; bottom:2px; right:2px; width:12px; height:12px; border:2px solid var(--surface); border-radius:50%; background:#56bd7b; }
.chat-row.selected .online-dot { border-color:var(--primary); }
.chat-row-body { flex:1; min-width:0; }
.chat-row-top,.chat-row-bottom { display:flex; align-items:center; gap:7px; }
.chat-row-top { margin-bottom:8px; }
.chat-row-top strong { font-size:14px; flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:600; }
.chat-row-top time { font-size:10px; color:#9aa4ad; }
.chat-preview { color:#8996a2; font-size:12px; flex:1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; line-height:1.5; }
.chat-row.selected .chat-preview,.chat-row.selected time { color:#e2f0ff; }
.unread-count { min-width:19px; height:19px; padding:0 5px; border-radius:10px; font-size:10px; background:var(--primary); color:white; display:grid; place-items:center; font-weight:600; }
.selected .unread-count { background:#fff; color:var(--primary); }
.sidebar-footer { display:flex; align-items:center; gap:11px; padding:15px 17px; border-top:1px solid var(--line); }
.admin-avatar { width:39px; height:39px; border-radius:50%; background:var(--primary-soft); color:var(--primary); display:grid; place-items:center; font-size:15px; font-weight:700; }
.admin-summary { flex:1; display:flex; flex-direction:column; gap:7px; }
.admin-summary strong { font-size:12px; font-weight:600; }
.connection-line { display:flex; align-items:center; gap:6px; font-size:10px; color:#8c98a1; }
.connection-line .status-dot { width:6px; height:6px; }
.offline .status-dot { background:#e9ab57; }
.list-empty { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:14px; min-height:260px; padding:35px 15px; text-align:center; }
.list-empty>.icon { width:40px; height:40px; color:#b7c8d7; }
.list-empty strong { font-size:13px; color:#6d7f8f; }
.list-empty p { font-size:11px; line-height:1.8; color:#a3adb6; }
               
.conversation { min-width:0; height:100%; min-height:0; display:flex; flex-direction:column; position:relative; background:var(--surface); }
.conversation-header { height:76px; flex-shrink:0; display:flex; align-items:center; padding:0 23px; gap:9px; border-bottom:1px solid var(--line); z-index:2; background:var(--surface); }
.conversation-person { display:flex; flex:1; min-width:0; align-items:center; gap:12px; text-align:left; padding:0; }
.conversation-person .avatar { width:43px; height:43px; font-size:18px; }
.conversation-heading { display:flex; flex-direction:column; gap:6px; overflow:hidden; }
.conversation-name { font-size:15px; font-weight:650; white-space:nowrap; text-overflow:ellipsis; overflow:hidden; }
.conversation-subtitle { font-size:11px; color:var(--muted); white-space:nowrap; text-overflow:ellipsis; overflow:hidden; }
.conversation-actions { display:flex; gap:2px; }
.conversation-actions .icon-button { width:37px; height:37px; }
.conversation-actions .icon-button[aria-disabled="true"] { opacity:.45; }
.mobile-back { display:none; }
.conversation-body { min-height:0; flex:1; display:flex; flex-direction:column; position:relative; background:var(--chat-background); isolation:isolate; }
.conversation-body::before { content:''; position:absolute; inset:0; z-index:-1; opacity:.22; background-image:radial-gradient(ellipse at 20% 30%,#f9f9de 0,transparent 55%),radial-gradient(ellipse at 85% 75%,#95bfab 0,transparent 55%), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150' viewBox='0 0 150 150' fill='none' stroke='%238aab91' stroke-width='1.2' opacity='.4'%3E%3Cpath d='m23 23 8-4 7 3-1 9-9 5-7-5zm70 45 16-7-5 17-4-7-7-3zm-40 47 3-8 3 8 8 3-8 3-3 8-3-8-8-3zm62-90c7-8 20 5 11 11l-10 7-9-9c-4-6 3-14 8-9zM17 80c7-9 20-1 17 8l-5 9-11-6c-5-3-6-7-1-11zM100 123h20v13h-9l-6 5v-5h-5z'/%3E%3Ccircle cx='61' cy='56' r='6'/%3E%3Cpath d='M61 47v-4m0 26v-4m9-9h4m-27 0h5M129 91l4 4m-4 0 4-4M71 14l4 4m-4 0 4-4'/%3E%3C/svg%3E"); }
.thread-scroll { flex:1; min-height:0; overflow-y:auto; overscroll-behavior:contain; padding:20px 34px 12px; scrollbar-width:thin; scrollbar-color:#6f8c6b50 transparent; }
.message-list { max-width:800px; width:100%; margin:0 auto; min-height:100%; display:flex; flex-direction:column; justify-content:flex-end; gap:8px; }
.day-divider { display:flex; justify-content:center; margin:13px 0 18px; }
.day-divider span { background:#7c997b77; color:#fff; font-size:10px; padding:5px 13px; border-radius:12px; line-height:1.5; backdrop-filter:blur(3px); }
.message-row { display:flex; position:relative; align-items:center; gap:8px; width:100%; flex-shrink:0; }
.message-row.outgoing { flex-direction:row-reverse; }
.message-row.has-guest-deletion { flex-wrap:wrap; row-gap:2px; }
.guest-deletion-note { flex:0 0 100%; min-width:0; font-size:11px; line-height:1.5; user-select:none; }
.outgoing .guest-deletion-note { text-align:end; }
.guest-deletion-note>span { display:inline-block; max-width:100%; padding:1px 5px; border-radius:4px;
  color:color-mix(in srgb,var(--text) 74%,var(--surface)); background:color-mix(in srgb,var(--surface) 88%,transparent); }
.message-row.local-message { flex-direction:row; justify-content:flex-end; }
.local-message .message-images { max-width:100%; }
.outgoing-pending { margin-inline-start:2px; }
.outgoing-retry, .outgoing-failures { display:inline-flex; align-items:center; justify-content:center; gap:5px; flex:none;
  min-height:32px; padding:4px 8px; border:1px solid #e6c2c3; border-radius:9px;
  color:#a5323a; background:#fff7f6; font-size:12px; line-height:1.35; font-weight:500; }
.outgoing-retry { max-width:50%; }
.outgoing-failures { align-self:flex-end; margin:4px 14px 0; padding-inline:12px; border-radius:16px; }
.outgoing-retry:hover, .outgoing-failures:hover { text-decoration:underline; }
.outgoing-retry:focus-visible, .outgoing-failures:focus-visible { outline:2px solid currentColor; outline-offset:2px; }
.outgoing-error-icon { display:grid; place-items:center; flex:none; width:15px; height:15px; border-radius:50%;
  background:#ba3841; color:white; font:700 11px/1 var(--font); }
.dark .outgoing-retry, .dark .outgoing-failures { background:#402a30; border-color:#765055; color:#ffc3c3; }
@media (pointer:coarse) { .outgoing-retry, .outgoing-failures { min-height:44px; } }
.message-bubble { max-width:min(78%,540px); min-width:80px; background:var(--bubble-in); padding:11px 13px 6px; border-radius:13px 13px 13px 4px; box-shadow:0 1px 2px #253a3012; position:relative; }
.outgoing .message-bubble { background:var(--bubble-out); border-radius:13px 13px 4px 13px; }
.message-text { line-height:1.85; font-size:13px; white-space:pre-wrap; overflow-wrap:anywhere; }
.message-meta { display:flex; justify-content:flex-end; align-items:center; gap:4px; font-size:9px; color:#8b9a8e; margin-top:3px; line-height:1.4; }
.message-meta.is-read { color:#65a94c; }
.message-meta>.icon { width:17px; height:13px; }
.bubble-tools { display:flex; opacity:0; pointer-events:none; transition:opacity .15s; }
.bubble-tools .icon-button { width:28px; height:28px; color:#718b74; }
.bubble-tools .icon { width:16px; height:16px; }
.message-row:hover .bubble-tools,.message-row:focus-within .bubble-tools { opacity:1; pointer-events:auto; }
.bubble-tools .icon-button:hover { background:#fff9; }
.bubble-tools .delete-message:hover { color:var(--danger); }
mark { background:#ffe393; color:#473d1d; border-radius:2px; }
.composer-wrap { position:relative; flex-shrink:0; padding:12px 34px 10px; max-width:868px; width:100%; align-self:center; }
.composer { display:flex; align-items:flex-end; gap:7px; background:var(--surface); padding:8px 9px; border-radius:14px; box-shadow:0 2px 6px #183f2610; }
.composer>.icon-button { width:38px; height:38px; }
.composer textarea { flex:1; min-width:0; min-height:38px; max-height:130px; padding:8px 6px; border:0; background:none; line-height:22px; font-size:13px; box-shadow:none; }
.composer textarea::placeholder { color:#a2adb6; }
.send-button { width:39px; height:39px; background:var(--primary); border-radius:11px; color:white; display:grid; place-items:center; flex-shrink:0; }
.send-button .icon { width:20px; height:20px; }
.send-button:hover { background:var(--primary-hover); }
.composer-hint { display:flex; justify-content:space-between; font-size:9px; padding:9px 4px 0; color:#83947f; }
.composer-hint>span { display:flex; align-items:center; gap:3px; }
.composer-hint .icon { width:10px; height:10px; }
.emoji-picker { position:absolute; bottom:100%; left:34px; width:280px; background:var(--surface); padding:12px; border-radius:14px; box-shadow:var(--shadow); display:grid; grid-template-columns:repeat(6,1fr); z-index:5; }
.emoji-picker button { height:38px; font-size:23px; border-radius:8px; }
.emoji-picker button:hover { background:var(--surface-soft); }
.message-search { height:57px; padding:8px 24px; gap:12px; display:flex; align-items:center; border-bottom:1px solid var(--line); background:var(--surface); z-index:2; }
.message-search>.icon { color:var(--primary); width:19px; height:19px; }
.message-search input { flex:1; min-width:0; border:0; font-size:13px; box-shadow:none; }
.search-count { color:var(--muted); font-size:11px; white-space:nowrap; }
.network-banner { padding:9px 15px; background:#fff3dd; color:#a87d36; font-size:11px; text-align:center; }
.invite-banner { display:flex; align-items:center; flex-shrink:0; gap:12px; margin:16px 24px 0; padding:12px 15px; border-radius:11px; background:#fff9; text-align:left; color:#486950; }
.invite-banner-icon { color:var(--primary); width:33px; height:33px; background:#ffffffa8; border-radius:10px; display:grid; place-items:center; }
.invite-banner>span:nth-child(2) { flex:1; display:flex; flex-direction:column; gap:5px; }
.invite-banner strong { font-size:12px; }
.invite-banner small { font-size:10px; opacity:.65; }
.invite-banner>.icon { width:17px; height:17px; }
.conversation-empty { align-self:center; text-align:center; margin:auto; padding:35px 20px; color:#658069; display:flex; align-items:center; flex-direction:column; gap:13px; }
.conversation-empty strong { font-size:16px; }
.conversation-empty p { font-size:12px; line-height:1.8; }
.empty-chat-icon { width:70px; height:70px; background:#fff7; border-radius:25px; display:grid; place-items:center; margin-bottom:5px; }
.empty-chat-icon .icon { width:34px; height:34px; }
.load-history { align-self:center; display:flex; gap:7px; align-items:center; border-radius:18px; padding:8px 14px; font-size:11px; color:#5c7c60; background:#ffffff90; margin-bottom:12px; }
.load-history .icon { width:13px; height:13px; }
                     
.profile-panel { min-height:0; display:flex; flex-direction:column; border-left:1px solid var(--line); background:var(--surface); z-index:4; }
.profile-header { min-height:76px; padding:0 19px 0 23px; display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid var(--line); }
.profile-header h2 { font-size:14px; font-weight:650; }
.profile-header>.icon-button { display:none; }
.profile-scroll { overflow-y:auto; flex:1; padding:0 24px 22px; scrollbar-width:thin; scrollbar-color:#b5c3ce55 transparent; }
.profile-identity { display:flex; flex-direction:column; align-items:center; padding:28px 0 23px; }
.profile-identity h3 { font-size:18px; margin-top:14px; max-width:100%; overflow-wrap:anywhere; }
.profile-status { font-size:10px; color:var(--muted); margin-top:7px; }
.visitor-id { font-size:9px; letter-spacing:.7px; color:#a4afb8; margin-top:12px; }
.profile-form { display:flex; flex-direction:column; gap:14px; }
.profile-form label { display:flex; flex-direction:column; gap:8px; }
.field-label { display:flex; justify-content:space-between; font-size:11px; font-weight:600; color:#657585; }
.field-label small { font-size:9px; color:#a6afb7; font-weight:400; }
.profile-input { min-height:39px; font-size:12px; padding:9px 11px; }
.notes-input { min-height:84px; font-size:11px; line-height:1.8; padding:10px 11px; }
.profile-form .button:disabled { opacity:1; background:var(--surface-soft); color:#adb6be; }
.section-rule { height:1px; background:var(--line); margin:23px 0; }
.profile-section-title { text-transform:uppercase; font-size:11px; letter-spacing:.5px; color:#96a1ac; font-weight:600; margin-bottom:19px; }
.profile-facts { display:flex; flex-direction:column; gap:18px; }
.profile-fact { display:flex; align-items:flex-start; gap:13px; }
.profile-fact>.icon { width:18px; height:18px; color:#9aa7b2; margin-top:1px; }
.profile-fact>div { display:flex; flex-direction:column; gap:5px; min-width:0; }
.profile-fact span { font-size:10px; color:#97a3ae; }
.profile-fact strong { font-size:11px; font-weight:500; line-height:1.6; overflow-wrap:anywhere; }
.profile-fact small { font-size:9px; line-height:1.6; color:#adb5bd; }
.metadata-note { display:flex; gap:6px; font-size:9px; color:#a4afb8; line-height:1.8; margin-top:21px; }
.metadata-note>.icon { width:12px; height:12px; margin-top:3px; }
.profile-action-list { display:flex; flex-direction:column; gap:4px; }
.profile-action { padding:12px 0; display:flex; gap:13px; align-items:center; font-size:12px; color:#758593; text-align:left; border-radius:8px; }
.profile-action:hover { color:var(--primary); }
.profile-action .icon { width:19px; height:19px; }
.profile-action.destructive { color:var(--danger); }
.profile-scrim { display:none; }
                     
.workspace-welcome { flex:1; min-height:0; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; background:radial-gradient(ellipse at 45% 35%,#edf7ff 0,transparent 60%),#f8fafc; padding:30px; }
.welcome-label { display:flex; align-items:center; gap:7px; background:#fff; padding:8px 13px; border:1px solid #e8f0f6; border-radius:20px; font-size:10px; letter-spacing:.3px; color:#8999a8; }
.welcome-label .status-dot { width:6px; height:6px; }
.welcome-art { position:relative; width:220px; height:200px; display:grid; place-items:center; margin:25px 0 5px; }
.welcome-symbol { display:grid; place-items:center; width:100px; height:100px; border-radius:31px; color:white; background:linear-gradient(145deg,#64b5ff,#2d8eea); box-shadow:0 18px 45px #3390ec2b; transform:rotate(-7deg); z-index:1; }
.welcome-symbol .icon { width:49px; height:49px; }
.welcome-orbit { position:absolute; border:1px solid #3390ec18; border-radius:50%; width:190px; height:190px; }
.welcome-orbit.two { width:140px; height:140px; border-color:#3390ec25; transform:rotate(25deg); }
.welcome-art::before,.welcome-art::after { content:''; width:10px; height:10px; border-radius:50%; background:#b0d6f7; position:absolute; top:30px; right:35px; }
.welcome-art::after { top:auto; right:auto; bottom:37px; left:24px; width:6px; height:6px; background:#9cd3bb; }
.workspace-welcome h1 { font-size:29px; font-weight:650; letter-spacing:1px; color:#31495e; margin-bottom:17px; }
.workspace-welcome>p { color:#94a1ad; font-size:13px; line-height:2; }
.welcome-cta { margin:27px 0 25px; min-width:200px; box-shadow:0 6px 16px #3390ec22; }
.welcome-features { display:flex; gap:23px; color:#9aa8b4; font-size:10px; }
.welcome-features>span { display:flex; gap:5px; align-items:center; }
.welcome-features .icon { width:15px; height:15px; }
.welcome-disclaimer { margin-top:55px; font-size:10px; color:#b5bfc8; }
                         
.modal { width:min(470px,calc(100vw - 28px)); max-height:calc(100dvh - 40px); border:0; border-radius:20px; padding:0; color:var(--text); background:var(--surface); box-shadow:0 25px 100px #0c233940; overflow:hidden; }
.modal[open] { display:flex; flex-direction:column; animation:appear .18s ease-out; }
.modal.wide { width:min(850px,calc(100vw - 28px)); }
.modal::backdrop { background:#23364866; backdrop-filter:blur(4px); }
.modal-header { display:flex; align-items:center; justify-content:space-between; padding:16px 19px 13px 25px; border-bottom:1px solid var(--line); flex-shrink:0; }
.modal-header h2 { font-size:17px; font-weight:650; }
.modal-content { overflow-y:auto; padding:23px 25px 26px; }
.modal-footer { padding:16px 25px 22px; display:flex; justify-content:flex-end; gap:12px; }
.modal-footer .button { min-width:92px; }
.stack-form { display:flex; flex-direction:column; gap:20px; }
.stack-form label { display:flex; flex-direction:column; gap:9px; font-size:12px; font-weight:600; }
.stack-form label small { font-size:10px; font-weight:400; }
.dialog-intro { display:flex; gap:14px; align-items:center; }
.dialog-feature-icon { width:53px; height:53px; border-radius:15px; background:var(--primary-soft); color:var(--primary); flex-shrink:0; display:grid; place-items:center; }
.dialog-intro p { font-size:12px; color:var(--muted); line-height:1.9; }
.callout { display:flex; align-items:flex-start; gap:9px; font-size:11px; color:#72899b; background:var(--surface-soft); border-radius:10px; padding:13px; line-height:1.8; }
.callout>.icon { width:17px; height:17px; margin-top:2px; }
.confirm-content { display:flex; flex-direction:column; gap:20px; }
.confirm-content p { color:#7d8b98; font-size:13px; line-height:1.9; }
.invite-dialog { display:flex; flex-direction:column; align-items:center; gap:13px; }
.qr-frame { padding:8px; border:1px solid var(--line); border-radius:16px; background:#fff; }
.qr-code { display:block; width:220px; height:220px; }
.invite-dialog h3 { font-size:17px; margin-top:4px; }
.invite-dialog>.muted { font-size:12px; margin-bottom:6px; }
.invite-domain-label { width:100%; font-size:11px; color:var(--muted); display:flex; flex-direction:column; gap:7px; }
.invite-domain-label select { font-size:12px; }
.invite-link-wrap { width:100%; }
.invite-url { font-size:11px; font-family:ui-monospace,SFMono-Regular,monospace; }
.invite-dialog .button-row { width:100%; }
.invite-dialog .button { font-size:12px; }
.privacy-footnote { display:flex; align-items:flex-start; gap:7px; font-size:10px; color:#a2adb7; line-height:1.8; margin-top:5px; }
.privacy-footnote>.icon { width:13px; height:13px; margin-top:2px; }
.domain-layout { display:grid; grid-template-columns:minmax(0,1.35fr) minmax(240px,1fr); gap:25px; margin-top:24px; }
.domain-mode { font-size:10px; display:flex; align-items:center; gap:7px; color:#8596a6; margin-bottom:14px; line-height:1.7; }
.domain-mode>.icon { width:16px; height:16px; }
.domain-list { min-width:0; }
.domain-card { border:1px solid var(--line); border-radius:13px; margin-bottom:12px; padding:15px; }
.domain-card-header { display:flex; align-items:center; gap:9px; }
.domain-icon { display:grid; place-items:center; width:33px; height:33px; flex-shrink:0; background:var(--primary-soft); color:var(--primary); border-radius:10px; }
.domain-icon>.icon { width:18px; height:18px; }
.domain-card-header>div { flex:1; min-width:0; }
.domain-card-header strong { font-size:12px; }
.domain-address { display:block; font-size:10px; color:var(--muted); overflow-wrap:anywhere; margin-top:5px; }
.state-pill { font-size:9px; color:#9ba6b0; border-radius:5px; padding:4px 6px; background:var(--surface-soft); white-space:nowrap; }
.state-pill.enabled { background:#eaf7ef; color:#58a579; }
.domain-card-meta { display:flex; justify-content:space-between; gap:6px; padding:12px 0; font-size:10px; color:#9ba8b3; }
.domain-card-meta>span { display:flex; gap:5px; align-items:center; }
.domain-card-meta .icon { width:13px; height:13px; }
.domain-card-actions { border-top:1px solid var(--line); padding-top:5px; display:flex; align-items:center; }
.domain-card-actions>.icon-button { margin-left:auto; width:30px; height:30px; }
.domain-card-actions>.icon-button>.icon { width:15px; height:15px; }
.domain-form { gap:14px; border-left:1px solid var(--line); padding-left:24px; }
.domain-form h3 { font-size:13px; margin-bottom:4px; }
.domain-form .input { font-size:12px; min-height:40px; }
.setting-row { display:flex; justify-content:space-between; align-items:center; gap:20px; padding:16px 0; border-bottom:1px solid var(--line); cursor:pointer; }
.setting-row>span:first-child { display:flex; flex-direction:column; gap:7px; }
.setting-row strong { font-size:13px; font-weight:600; }
.setting-row small { font-size:10px; line-height:1.7; color:var(--muted); }
.switch { display:block; width:36px; height:21px; flex-shrink:0; position:relative; }
.switch input { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; z-index:1; margin:0; }
.switch-track { display:block; border-radius:12px; background:#dce2e8; height:100%; transition:background .2s; }
.switch-track::after { content:''; width:17px; height:17px; top:2px; left:2px; position:absolute; background:white; border-radius:50%; box-shadow:0 1px 3px #0002; transition:transform .2s; }
.switch input:checked+.switch-track { background:var(--primary); }
.switch input:checked+.switch-track::after { transform:translateX(15px); }
.switch input:focus-visible+.switch-track { outline:3px solid #3390ec55; }
.settings-about { display:flex; gap:11px; margin:24px 0; }
.settings-about>.icon { color:var(--primary); width:20px; height:20px; }
.settings-about strong { font-size:12px; }
.settings-about p { color:#99a5af; font-size:10px; line-height:1.9; margin-top:8px; }
.logout-button { color:var(--danger)!important; }
.toasts { position:fixed; bottom:26px; left:50%; transform:translateX(-50%); display:flex; flex-direction:column; gap:8px; align-items:center; z-index:1000; pointer-events:none; max-width:calc(100vw - 40px); }
.toast { background:#263d50ee; color:white; border-radius:11px; padding:12px 19px; box-shadow:0 4px 20px #172c3326; font-size:12px; line-height:1.7; animation:appear .2s; text-align:center; max-width:550px; }
.toast.error { background:#a74646ee; }
.clipboard-helper { position:fixed; left:-10000px; top:0; }
                                 
.auth-page { min-height:100dvh; display:grid; grid-template-columns:1fr 1fr; background:var(--surface); }
.auth-intro { background:linear-gradient(145deg,#eaf5ff,#f5fafb 65%,#f2f7f3); padding:48px max(40px,8vw); display:flex; flex-direction:column; justify-content:center; position:relative; }
.hero-brand { position:absolute; top:45px; left:max(40px,8vw); }
.eyebrow { font-size:11px; letter-spacing:2px; font-weight:600; color:#6b9bbd; margin-bottom:20px; }
.auth-intro h1 { font-size:clamp(30px,3.1vw,48px); line-height:1.5; letter-spacing:2px; font-weight:650; color:#30506c; }
.intro-copy { color:#94a7b7; font-size:13px; line-height:2; margin-top:23px; }
.auth-illustration { position:relative; width:360px; max-width:100%; height:240px; margin-top:35px; display:flex; flex-direction:column; justify-content:center; gap:20px; }
.illustration-orbit { position:absolute; width:230px; height:230px; border:1px solid #3390ec1c; border-radius:50%; left:50px; top:0; }
.sample-message { position:relative; z-index:1; display:flex; align-items:center; gap:12px; border-radius:17px; padding:17px 18px; box-shadow:0 9px 25px #42658012; font-size:12px; }
.sample-message.inbound { background:#fff; align-self:flex-start; transform:rotate(-3deg); }
.sample-message .avatar { width:36px; height:36px; font-size:15px; }
.sample-message small { display:block; font-size:9px; color:#a6b3bf; margin-bottom:6px; }
.sample-message strong { font-size:12px; color:#687c8e; font-weight:500; }
.sample-message.outbound { align-self:flex-end; background:#e3f8da; color:#608559; transform:rotate(3deg); }
.sample-message.outbound .icon { width:17px; height:17px; color:#7ba971; }
.illustration-chip { position:relative; font-size:9px; display:flex; gap:6px; align-items:center; justify-content:center; color:#92aab9; margin-top:8px; }
.illustration-chip>.icon { width:14px; height:14px; }
.auth-footnote { color:#acb9c4; font-size:10px; line-height:1.8; }
.auth-intro>.auth-footnote { position:absolute; bottom:35px; left:max(40px,8vw); }
.auth-card-wrap { display:grid; place-items:center; padding:45px; }
.auth-card { width:360px; max-width:100%; }
.auth-symbol { width:56px; height:56px; border-radius:17px; background:var(--primary-soft); color:var(--primary); display:grid; place-items:center; margin-bottom:27px; }
.auth-symbol .icon { width:26px; height:26px; }
.auth-card h2 { font-size:26px; font-weight:650; margin-bottom:12px; }
.auth-card>.muted { font-size:12px; }
.auth-form { display:flex; flex-direction:column; gap:20px; margin-top:33px; }
.auth-form label { font-size:12px; font-weight:600; display:flex; flex-direction:column; gap:10px; }
.auth-form .input { min-height:49px; font-size:13px; }
.auth-form .button { min-height:48px; margin-top:7px; }
.local-help { margin-top:25px; display:flex; gap:8px; font-size:10px; line-height:1.9; color:#a2aeb9; }
.local-help .icon { width:15px; height:15px; margin-top:2px; }
.guest-gate { min-height:100dvh; background:radial-gradient(ellipse at 50% 20%,#eaf5ff,transparent 65%),var(--surface-soft); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:30px; padding:40px 18px; }
.gate-card { width:min(510px,100%); background:var(--surface); border:1px solid var(--line); border-radius:23px; padding:34px; box-shadow:0 10px 40px #476b8c09; text-align:center; }
.gate-symbol { width:67px; height:67px; display:grid; place-items:center; background:var(--primary-soft); color:var(--primary); border-radius:22px; margin:0 auto 24px; }
.gate-symbol .icon { width:32px; height:32px; }
.gate-card .eyebrow { display:block; margin-bottom:13px; font-size:9px; }
.gate-card h1 { font-size:23px; font-weight:650; margin-bottom:13px; }
.gate-card>.muted { font-size:11px; }
.guest-consent { margin-top:25px; display:flex; flex-direction:column; gap:19px; text-align:left; }
.privacy-card { display:flex; align-items:flex-start; gap:11px; padding:17px; background:var(--surface-soft); border-radius:12px; font-size:11px; color:#7c8e9d; line-height:1.9; }
.privacy-card>.icon { width:18px; height:18px; color:#83a2bc; margin-top:2px; }
.privacy-card strong { color:#5c788f; font-size:11px; }
.privacy-card p { margin-top:9px; font-size:10px; }
.check-label { display:flex; align-items:flex-start; gap:8px; color:#8595a3; font-size:10px; cursor:pointer; line-height:1.8; }
.check-label input { margin:3px 0 0; accent-color:var(--primary); }
.gone-card .privacy-card { margin-top:25px; }
.danger-soft { background:var(--danger-soft); color:var(--danger); }
.guest-layout { display:flex; background:#c7d9cc; }
.guest-layout .conversation { max-width:1000px; width:100%; margin:0 auto; box-shadow:0 0 60px #29443c12; }
.guest-brand-mark { width:36px; height:36px; display:grid; place-items:center; border-radius:12px; color:var(--primary); background:var(--primary-soft); margin-right:6px; }
                             
.call-overlay { position:fixed; inset:0; z-index:900; display:grid; place-items:center; padding:25px; background:#14232ebf; backdrop-filter:blur(14px); }
.call-card { width:min(660px,100%); max-height:calc(100dvh - 50px); border-radius:25px; background:linear-gradient(150deg,#2d4b62,#1b3041 70%); color:white; overflow:hidden; box-shadow:0 30px 100px #0005; display:flex; flex-direction:column; }
.call-security { display:flex; gap:6px; align-items:center; justify-content:center; color:#a3bdcf; font-size:10px; padding:21px; }
.call-security .icon { width:13px; height:13px; }
.call-stage { min-height:300px; height:380px; position:relative; display:grid; place-items:center; flex-shrink:1; overflow:hidden; }
.call-identity { display:flex; flex-direction:column; align-items:center; position:relative; z-index:2; pointer-events:none; }
.call-avatar { width:105px; height:105px; border-radius:50%; background:linear-gradient(150deg,#6ca3cc,#49799f); box-shadow:0 0 0 13px #ffffff07,0 0 0 28px #ffffff03; display:grid; place-items:center; font-size:39px; margin-bottom:28px; }
.call-identity h2 { font-size:23px; font-weight:500; }
.call-status { font-size:12px; color:#a1bacb; margin-top:15px; min-height:19px; }
.remote-media { position:absolute; width:100%; height:100%; inset:0; object-fit:cover; display:none; }
.local-media { position:absolute; z-index:4; right:18px; bottom:15px; width:130px; height:95px; object-fit:cover; border-radius:12px; border:1px solid #ffffff44; background:#152735; transform:scaleX(-1); display:none; }
.video-call .local-media { display:block; }
.video-call.call-connected .remote-media { display:block; }
.video-call.call-connected .call-identity { align-self:start; justify-self:start; align-items:flex-start; margin:18px 22px; padding:10px 13px; background:#172d4670; border-radius:12px; }
.video-call.call-connected .call-avatar { display:none; }
.video-call.call-connected .call-identity h2 { font-size:15px; }
.video-call.call-connected .call-status { margin-top:6px; font-size:10px; color:#d7e5ef; }
.call-controls { display:flex; justify-content:center; gap:25px; padding:25px 25px 15px; }
.call-control { display:flex; flex-direction:column; align-items:center; gap:11px; font-size:10px; color:#bccedb; }
.call-control>.icon { width:55px; height:55px; padding:17px; border-radius:50%; background:#ffffff15; color:white; }
.call-control.accept-call>.icon { background:#51b976; }
.call-control.end-call>.icon { background:#ec5c60; }
.call-control.control-off>.icon { background:#f8faff; color:#2f4a60; }
.call-control:hover>.icon { filter:brightness(1.12); }
.call-privacy { font-size:9px; color:#7d9ab0; text-align:center; padding:9px 22px 23px; line-height:1.8; }
.tap-audio { position:absolute; z-index:5; bottom:15px; left:20px; font-size:11px; }
                     
.dark { color-scheme:dark; --primary:#63a9ef; --primary-hover:#4d99e6; --primary-soft:#253e56; --surface:#202c38; --surface-soft:#293746; --text:#e0e8ee; --muted:#8a9cad; --line:#2c3b49; --green:#70b98b; --danger:#ef7b7b; --danger-soft:#4e343d; --bubble-in:#273b4b; --bubble-out:#35594b; --chat-background:#192c2b; }
.dark .workspace-welcome { background:radial-gradient(ellipse at 45% 35%,#243b4e,transparent 65%),#1b2a36; }
.dark .workspace-welcome h1 { color:#b7ccdd; }
.dark .welcome-label { background:#263a4b; border-color:#334b5e; }
.dark .input { border-color:#3b4d5d; }
.dark .auth-intro { background:linear-gradient(140deg,#223e51,#202f38); }
.dark .auth-intro h1 { color:#a5c7e1; }
.dark .sample-message.inbound { background:#2b4052; }
.dark .sample-message strong { color:#b8cedf; }
.dark .sample-message.outbound { background:#365c4b; color:#b0d8ba; }
.dark .guest-gate { background:radial-gradient(ellipse at 50% 20%,#254157,transparent 65%),#192b39; }
.dark .network-banner { background:#51442f; color:#d6b378; }
.dark .invite-banner { background:#293f3ad9; color:#a3c7a9; }
.dark .invite-banner-icon { background:#254538; }
.dark .message-meta { color:#8cab9e; }
.dark .message-meta.is-read { color:#9bcfa7; }
.dark .day-divider span { background:#41604d99; }
.dark .guest-layout { background:#17252a; }
.dark .qr-frame { border-color:#fff; }
.dark .state-pill.enabled { background:#2d493b; color:#8abc9d; }
.dark .message-bubble { box-shadow:0 1px 2px #0002; }
                        
@media (min-width:1600px) { :root { --sidebar:360px; --profile:335px; } .thread-scroll { padding-left:45px; padding-right:45px; } }
@media (max-width:1199px) {
  :root { --sidebar:300px; --profile:300px; }
  .app-layout.has-room { grid-template-columns:var(--sidebar) minmax(0,1fr); }
  .profile-panel { position:absolute; right:0; top:0; bottom:0; width:320px; visibility:hidden; transform:translateX(100%); transition:transform .2s,visibility .2s; box-shadow:-10px 0 50px #14312c20; }
  .profile-header>.icon-button { display:inline-flex; }
  .profile-open .profile-panel { visibility:visible; transform:translateX(0); }
  .profile-open .profile-scrim { display:block; position:fixed; inset:0; background:#182c3b44; z-index:3; }
  .thread-scroll { padding-left:25px; padding-right:25px; }
  .composer-wrap { padding-left:25px; padding-right:25px; }
  .conversation-header { padding:0 17px; }
}
@media (max-width:767px) {
  :root { font-size:14px; }
  .app-layout,.app-layout.has-room { display:flex; }
  .admin-layout>.sidebar { width:100%; flex-shrink:0; border:0; }
  .admin-layout>.conversation { display:none; }
  .admin-layout.mobile-chat>.sidebar { display:none; }
  .admin-layout.mobile-chat>.conversation { display:flex; width:100%; }
  .sidebar-head { height:80px; }
  .sidebar-search { margin-bottom:20px; }
  .chat-row { padding:15px 14px; }
  .chat-row-top strong { font-size:15px; }
  .chat-preview { font-size:13px; }
  .avatar { width:52px; height:52px; }
  .mobile-back { display:inline-flex; width:32px; height:36px; }
  .conversation-header { height:68px; padding:0 10px; gap:5px; }
  .conversation-person { gap:9px; }
  .conversation-person .avatar { width:38px; height:38px; font-size:16px; }
  .conversation-name { font-size:14px; }
  .conversation-subtitle { font-size:10px; }
  .conversation-actions { gap:0; }
  .conversation-actions>.icon-button { width:31px; height:36px; }
  .conversation-actions>.icon-button>.icon { width:20px; height:20px; }
  .thread-scroll { padding:15px 14px 8px; }
  .message-bubble { max-width:82%; }
  .message-text { font-size:14px; }
  .message-meta { font-size:10px; }
  .composer-wrap { padding:10px 12px max(8px,env(safe-area-inset-bottom)); }
  .composer-hint { display:none; }
  .composer textarea { font-size:16px; }
  .bubble-tools { flex-direction:column; opacity:.4; pointer-events:auto; gap:1px; }
  .bubble-tools .icon-button { width:25px; height:25px; }
  .bubble-tools .icon { width:13px; height:13px; }
  .message-row { gap:4px; }
  .profile-panel { width:min(340px,92vw); }
  .profile-fact strong { font-size:12px; }
  .profile-action { font-size:13px; }
  .message-search { padding:8px 14px; }
  .message-search input { font-size:16px; }
  .search-count { font-size:9px; }
  .invite-banner { margin:12px 12px 0; padding:10px; }
  .invite-banner strong { font-size:11px; }
  .invite-banner small { font-size:9px; }
  .domain-layout { grid-template-columns:1fr; }
  .domain-form { border-left:0; padding:20px 0 0; border-top:1px solid var(--line); }
  .auth-page { display:flex; flex-direction:column; }
  .auth-intro { padding:25px 28px 20px; min-height:auto; display:block; }
  .hero-brand { position:static; margin-bottom:35px; }
  .auth-intro .eyebrow,.auth-intro h1,.intro-copy,.auth-illustration,.auth-intro>.auth-footnote { display:none; }
  .auth-card-wrap { padding:25px 28px 45px; }
  .auth-card { width:100%; max-width:390px; }
  .auth-symbol { margin-bottom:22px; }
  .auth-card h2 { font-size:24px; }
  .auth-form .input { font-size:16px; }
  .guest-gate { padding:25px 14px; gap:22px; }
  .gate-card { padding:27px 22px; }
  .gate-card h1 { font-size:22px; }
  .guest-brand-mark { display:none; }
  .guest-layout .conversation-header { padding:0 15px; }
  .modal-content { padding:20px; }
  .modal-header { padding-left:20px; }
  .modal-footer { padding:14px 20px 20px; }
  .stack-form .input { font-size:16px; }
  .emoji-picker { left:12px; }
  .toasts { bottom:85px; width:90%; }
  .toast { padding:11px 15px; font-size:12px; }
  .call-overlay { padding:12px; }
  .call-card { border-radius:20px; max-height:calc(100dvh - 24px); }
  .call-stage { height:380px; min-height:240px; }
  .local-media { width:100px; height:76px; right:12px; }
  .call-controls { gap:22px; }
  .call-control>.icon { width:52px; height:52px; padding:16px; }
}
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { animation:none!important; transition:none!important; scroll-behavior:auto!important; } }

.modal-toast { position:absolute; bottom:18px; left:18px; right:18px; z-index:10; max-width:none; }

.admin-layout .conversation-heading { flex:1; min-width:0; }
.visitor-name-line { display:flex; align-items:baseline; gap:clamp(8px,1.2vw,16px); min-width:0; }
.visitor-name-line .conversation-name { min-width:0; max-width:44%; }
.visitor-name-line:not(:has(.visitor-access-item:not(:empty))) .conversation-name { max-width:100%; }
.visitor-access-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); flex:1; max-width:13.5em; min-width:0; color:var(--muted); font-size:12px; font-weight:400; }
.visitor-access-item { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
@media (max-width:600px) {
  .admin-layout .conversation-header { flex-wrap:wrap; height:auto; min-height:68px; padding-block:5px; row-gap:0; }
  .admin-layout .conversation-person { flex:1 1 min(226px,calc(100% - 44px)); }
  .admin-layout .conversation-actions { margin-inline-start:auto; }
  .visitor-access-summary { font-size:11px; }
}

                                                                   
.admin-layout.has-room { grid-template-columns:var(--sidebar) minmax(0,1fr); }
@media (min-width:1200px) {
  .admin-layout.has-room.profile-open { grid-template-columns:var(--sidebar) minmax(0,1fr) var(--profile); }
  .profile-header>.icon-button { display:inline-flex; }
}
.send-button { min-width:70px; width:auto; height:40px; border-radius:11px; padding:0 15px; font-size:14px; font-weight:650; flex-shrink:0; }
.guest-brand-mark { display:grid; place-items:center; color:var(--primary); padding-right:8px; }
.avatar-image { object-fit:cover; }
.avatar img { width:100%; height:100%; object-fit:cover; border-radius:inherit; }
.account-avatar-button { padding:0; border-radius:50%; flex-shrink:0; }
.account-avatar-button .avatar { width:42px; height:42px; }
.admin-summary { min-width:0; }
.admin-summary strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:190px; }
.context-menu { position:fixed; z-index:1000; min-width:220px; max-width:calc(100vw - 16px); padding:6px; border:1px solid var(--line); border-radius:12px; background:var(--surface); box-shadow:0 10px 40px #172d3c33; }
.context-item { display:flex; width:100%; align-items:center; gap:12px; padding:11px 12px; border-radius:7px; text-align:left; font-size:13px; }
.context-item .icon { width:19px; height:19px; color:var(--muted); }
.context-item>span { flex:1; }
.context-item:hover,.context-item:focus-visible { background:var(--surface-soft); outline:none; }
.context-item kbd { font-family:inherit; font-size:11px; color:var(--muted); }
.context-divider { height:1px; margin:5px 2px; background:var(--line); }
.danger-text,.context-item.danger-text .icon { color:var(--danger); }
.selection-bar { display:flex; align-items:center; gap:8px; padding:7px 18px; border-bottom:1px solid var(--line); background:var(--surface); flex-shrink:0; }
.selection-bar>strong { flex:1; font-size:13px; }
.selection-bar .text-button { display:flex; align-items:center; gap:5px; font-size:12px; }
.selection-bar .icon { width:19px; height:19px; }
.selection-check { display:none; width:22px; height:22px; border:2px solid #8ca8a1; background:var(--surface); border-radius:50%; flex-shrink:0; align-items:center; justify-content:center; margin:10px 5px; }
.selection-check .icon { width:17px; height:17px; opacity:0; }
.selecting .selection-check { display:flex; }
.selecting .message-row { cursor:pointer; border-radius:12px; }
.message-selected { background:#3390ec20; }
.message-selected .selection-check { background:var(--primary); color:white; border-color:var(--primary); }
.message-selected .selection-check .icon { opacity:1; }
.edit-mark { font-size:9px; opacity:.8; }
.message-bubble:focus-visible { outline:2px solid var(--primary); outline-offset:3px; }
.quoted-message { display:flex; flex-direction:column; gap:4px; border-left:3px solid var(--primary); padding:7px 10px; border-radius:4px; background:#3390ec12; margin-bottom:7px; max-width:100%; width:100%; text-align:left; min-width:130px; }
.quoted-message>strong { font-size:11px; color:var(--primary); }
.quoted-message>span { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; font-size:12px; line-height:1.5; overflow-wrap:anywhere; }
.invalid-message { border:1px dashed var(--danger); }
.jump-highlight .message-bubble { animation:message-jump 1.8s ease-out; }
@keyframes message-jump { 0%,40% { box-shadow:0 0 0 5px #3390ec66; } 100% { box-shadow:0 0 0 0 #3390ec00; } }
.composer-context { display:flex; align-items:center; gap:10px; padding:10px 13px; background:var(--surface); border-radius:12px 12px 0 0; border-bottom:1px solid var(--line); }
.composer-context-text { border-left:3px solid var(--primary); padding-left:10px; flex:1; min-width:0; display:flex; flex-direction:column; gap:3px; }
.composer-context-text>strong { color:var(--primary); font-size:12px; }
.composer-context-text>span { font-size:12px; white-space:nowrap; text-overflow:ellipsis; overflow:hidden; max-height:36px; }
.composer-context:not([hidden])~.composer,.attachment-tray:not([hidden])~.composer { border-top-left-radius:0; border-top-right-radius:0; }
.attachment-tray { display:flex; gap:9px; overflow-x:auto; padding:12px; background:var(--surface); border-radius:12px 12px 0 0; border-bottom:1px solid var(--line); }
.attachment-preview { position:relative; width:100px; height:90px; border-radius:9px; overflow:hidden; flex-shrink:0; background:var(--surface-soft); }
.attachment-preview>img { width:100%; height:100%; object-fit:cover; }
.attachment-preview>.icon-button { position:absolute; top:3px; right:3px; width:24px; height:24px; color:white; background:#152c3cb8; }
.attachment-preview>.icon-button>.icon { width:17px; height:17px; }
.attachment-number { position:absolute; left:5px; bottom:5px; border-radius:5px; background:#152c3caa; color:white; padding:2px 5px; font-size:10px; }
.composer-wrap.drag-over .composer { outline:3px dashed var(--primary); }
.message-images { display:grid; grid-template-columns:1fr 1fr; gap:4px; width:min(390px,60vw); margin-bottom:5px; border-radius:8px; overflow:hidden; }
.message-images.count-1 { grid-template-columns:1fr; }
.message-images.count-3>.message-image:first-child { grid-column:span 2; }
.message-image { display:block; position:relative; padding:0; overflow:hidden; min-height:100px; background:#172d3c0c; }
.message-image>img { width:100%; height:100%; max-height:290px; object-fit:cover; display:block; }
.message-images.count-1 .message-image>img { object-fit:contain; max-height:400px; }
.image-loading { display:grid; place-items:center; position:absolute; inset:0; padding:10px; color:var(--muted); font-size:11px; }
.image-modal { max-width:min(960px,96vw); }
.lightbox-stage { position:relative; display:grid; grid-template:minmax(0,1fr) / minmax(0,1fr); place-items:center; height:60vh; height:min(60dvh,640px); overflow:hidden; touch-action:none; user-select:none; background:var(--surface-soft); border-radius:10px; }
.lightbox-image { display:block; grid-area:1/1; max-width:100%; max-height:100%; object-fit:contain; -webkit-user-drag:none; }
.lightbox-image:not([src]) { display:none; }
.lightbox-stage.can-pan { cursor:grab; }
.lightbox-stage.can-pan.dragging { cursor:grabbing; }
.lightbox-zoom-tools { display:none; }
@media (hover:hover) and (pointer:fine) {
  .lightbox-zoom-tools:not([hidden]) { position:absolute; display:flex; align-items:center; padding:3px; border-radius:12px; background:rgb(23 34 45 / 86%); color:white; box-shadow:0 2px 8px #0b172636; opacity:0; transition:opacity .18s; cursor:auto; }
  .lightbox-zoom-tools::before { content:""; position:absolute; inset:-8px; }
  .lightbox-zoom-tools:is(.introduced,:hover,:has(:focus-visible)) { opacity:1; }
  .lightbox-zoom-tools .icon-button { position:relative; width:36px; height:36px; border-radius:9px; color:inherit; }
  .lightbox-zoom-tools .icon-button:disabled { opacity:.48; }
  .lightbox-zoom-tools .icon-button:enabled:hover { background:rgb(255 255 255 / 18%); }
  .lightbox-zoom-tools .icon-button:focus-visible { outline:2px solid white; outline-offset:-2px; }
}
@media (prefers-reduced-motion:reduce) { .lightbox-zoom-tools:not([hidden]) { transition:none; } }
.lightbox-footer { display:flex; align-items:center; gap:10px; padding-top:14px; }
.lightbox-status { flex:1; font-size:12px; color:var(--muted); text-align:center; }
.avatar-full { display:block; width:100%; max-height:65dvh; object-fit:contain; border-radius:12px; }
.account-form { display:flex; flex-direction:column; gap:14px; padding-bottom:22px; border-bottom:1px solid var(--line); margin-bottom:20px; }
.account-form>h3 { font-size:15px; }
.avatar-editor { display:flex; align-items:center; gap:20px; }
.settings-avatar { width:74px; height:74px; flex-shrink:0; border-radius:50%; overflow:hidden; background:var(--primary-soft); color:var(--primary); display:grid; place-items:center; font-size:26px; }
.settings-avatar img { width:100%; height:100%; object-fit:cover; }
.settings-name { display:flex; flex-direction:column; gap:9px; font-size:12px; color:var(--muted); }
.sound-selector { display:flex; gap:10px; align-items:center; padding:12px 0; }
.sound-selector select { flex:1; }
.volume-row { display:flex; align-items:center; gap:12px; padding:0 0 20px; }
.volume-row input { flex:1; accent-color:var(--primary); }
.volume-row span { font-size:12px; color:var(--muted); min-width:35px; }
.vault-note { color:var(--muted); font-size:12px; line-height:1.8; margin:18px 0 9px; }
.gate-card .stack-form { text-align:left; margin-top:20px; }
@media (max-width:767px) {
  .send-button { min-width:62px; padding:0 10px; }
  .composer { gap:2px; }
  .composer>.icon-button { width:32px; }
  .message-images { width:min(310px,62vw); }
  .selection-bar { padding:6px 8px; gap:2px; }
  .selection-bar .text-button { font-size:11px; padding:7px; }
  .context-menu { min-width:200px; }
}

.sound-selector>label { display:flex; align-items:center; gap:10px; flex:1; }
.settings-tools { display:flex; flex-wrap:wrap; gap:10px; margin:20px 0 15px; }

                                                                                   
:root { --chat-background:#fff; }
.sidebar-group-row { display:flex; align-items:center; gap:9px; padding:9px 21px; border-bottom:1px solid var(--line); color:var(--muted); }
.sidebar-group-row>.icon { width:18px; height:18px; }
.group-filter { border:0; min-width:0; width:100%; padding:5px 0; font-size:12px; background:transparent; cursor:pointer; }
.sidebar-footer { gap:9px; padding:12px; }
.sidebar-footer>.icon-button { width:34px; height:36px; }
.admin-summary strong { max-width:100%; }
.latency-wifi { color:var(--green); width:15px; height:15px; }
.offline .latency-wifi { color:var(--muted); }
.connection-label { white-space:nowrap; font-variant-numeric:tabular-nums; }
.sidebar-splitter { position:absolute; left:calc(var(--sidebar) - 4px); top:0; bottom:0; width:8px; z-index:10; cursor:col-resize; touch-action:none; }
.sidebar-splitter::after { content:''; display:block; width:2px; height:100%; margin:auto; background:transparent; transition:background .15s; }
.sidebar-splitter:hover::after,.sidebar-splitter:focus-visible::after,.sidebar-splitter.dragging::after { background:var(--primary); }
.sidebar-splitter:focus-visible { outline:none; }
.resizing-sidebar,.resizing-sidebar * { cursor:col-resize!important; user-select:none!important; }
.workspace-placeholder { flex:1; display:grid; place-items:center; background:var(--surface); color:var(--muted); font-size:16px; font-weight:400; }
.conversation-body { background:#fff; }
.thread-area { position:relative; isolation:isolate; flex:1; min-width:0; min-height:0; display:flex; flex-direction:column; }
.conversation-wallpaper { position:absolute; inset:0; width:100%; height:100%; object-fit:scale-down; object-position:center; pointer-events:none; z-index:-1; }
.conversation-body::before { display:none; }
.chat-background-text { position:absolute; inset:20% 10%; display:flex; align-items:center; justify-content:center; color:#50677a40; text-align:center; font-size:clamp(24px,4vw,60px); font-weight:650; line-height:1.6; overflow-wrap:anywhere; pointer-events:none; z-index:-1; white-space:pre-wrap; }
.chat-marquee { flex-shrink:0; overflow:hidden; height:34px; border-bottom:1px solid var(--line); background:var(--surface-soft); color:var(--primary); font-size:16px; white-space:nowrap; position:relative; }
.marquee-text { display:inline-block; min-width:100%; padding-left:100%; line-height:22px; animation:banner-scroll 24s linear infinite; }
.chat-marquee:hover .marquee-text { animation-play-state:paused; }
@keyframes banner-scroll { from { transform:translateX(0); } to { transform:translateX(-100%); } }
.guest-layout,.dark .guest-layout { background:#fff; --surface:#fff; --surface-soft:#f4f5f7; --text:#17212b; --muted:#85919c; --line:#edf0f3; --bubble-in:#fff; --bubble-out:#e3ffc8; color:var(--text); color-scheme:light; }
.guest-layout .conversation { max-width:1100px; box-shadow:none; }
.guest-layout .conversation-person { cursor:default; }
.guest-layout .composer-wrap { padding-bottom:max(16px,env(safe-area-inset-bottom)); }
.message-bubble { border:1px solid #17212b0a; }
.search-section-title { padding:12px 10px 7px; font-size:11px; color:var(--muted); font-weight:650; }
.search-progress { padding:24px 12px; color:var(--muted); line-height:1.7; font-size:12px; }
.search-message-result { width:100%; display:flex; flex-direction:column; gap:8px; padding:13px 12px; text-align:left; border-radius:10px; }
.search-message-result:hover { background:var(--surface-soft); }
.search-result-top { display:flex; justify-content:space-between; align-items:center; gap:8px; width:100%; }
.search-result-top strong { font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.search-result-top time { font-size:10px; color:var(--muted); flex-shrink:0; }
.search-result-snippet { font-size:12px; line-height:1.7; overflow-wrap:anywhere; }
.search-message-result small { font-size:10px; }
.message-image>video { display:block; width:100%; height:100%; min-height:120px; max-height:360px; background:#111; }
.attachment-preview>video { width:100%; height:100%; object-fit:cover; pointer-events:none; }
.composer-quick { color:var(--primary); }
.settings-heading-row { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:18px; }
.inline-form { display:flex; gap:10px; margin:18px 0; }
.inline-form>.input { flex:1; min-width:0; }
.check-label { display:flex!important; flex-direction:row!important; align-items:center; gap:10px; color:var(--text)!important; line-height:1.7; font-size:13px; }
.check-label input { width:17px; height:17px; accent-color:var(--primary); flex-shrink:0; }
.settings-list,.template-list { display:flex; flex-direction:column; gap:9px; }
.editable-list-row { display:flex; align-items:center; gap:5px; padding:8px 0; border-bottom:1px solid var(--line); }
.editable-list-row>.icon { width:18px; color:var(--muted); margin-right:3px; }
.editable-list-row .input { flex:1; min-width:65px; }
.editable-list-row .icon-button { width:32px; height:34px; }
.template-row { display:flex; align-items:center; gap:12px; padding:15px; border:1px solid var(--line); border-radius:12px; background:var(--surface); }
.template-row>.icon { color:var(--muted); cursor:grab; width:18px; }
.template-row.dragging { opacity:.45; }
.template-summary { flex:1; min-width:0; display:flex; flex-direction:column; gap:5px; }
.template-summary strong { font-size:14px; }
.template-summary p { font-size:12px; line-height:1.6; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.template-summary small { font-size:10px; }
.template-tools { display:flex; align-items:center; }
.template-tools .icon-button { width:32px; height:34px; }
.template-media-tray { display:grid; grid-template-columns:repeat(auto-fill,minmax(120px,1fr)); gap:12px; }
.template-media-tray:empty { display:none; }
.template-media-item { position:relative; aspect-ratio:4/3; border-radius:10px; background:var(--surface-soft); overflow:hidden; }
.template-media-item>img,.template-media-item>video { width:100%; height:100%; object-fit:contain; }
.template-media-item>.icon-button { position:absolute; top:4px; right:4px; width:27px; height:27px; background:#17212bb3; color:white; }
.quick-picker { display:flex; flex-direction:column; gap:9px; }
.quick-reply-choice { display:flex; flex-direction:column; gap:7px; padding:15px; text-align:left; border:1px solid var(--line); border-radius:12px; }
.quick-reply-choice:hover { background:var(--surface-soft); }
.quick-reply-choice>span { font-size:12px; line-height:1.7; white-space:pre-wrap; overflow-wrap:anywhere; }
.quick-reply-choice small { font-size:10px; }
.background-preview { width:100%; max-height:200px; object-fit:cover; border-radius:12px; background:var(--surface-soft); }
.callout { border:1px solid #3390ec30; border-radius:10px; background:var(--primary-soft); color:var(--text); padding:13px 15px; font-size:12px; line-height:1.85; }
.domain-layout.readonly { display:block; }
.super-shell { display:grid; grid-template-columns:250px minmax(0,1fr); min-height:100dvh; background:var(--surface-soft); }
.super-sidebar { display:flex; flex-direction:column; gap:24px; padding:28px 18px; border-right:1px solid var(--line); background:var(--surface); position:sticky; top:0; height:100dvh; }
.super-brand { display:flex; align-items:center; gap:10px; padding:0 10px; font-size:17px; font-weight:700; }
.super-brand .icon { color:var(--primary); }
.super-nav { display:flex; flex-direction:column; gap:6px; }
.super-nav>button { display:flex; align-items:center; gap:12px; padding:13px 14px; border-radius:10px; text-align:left; font-size:13px; }
.super-nav>button:hover,.super-nav>button.active { background:var(--primary-soft); color:var(--primary); }
.super-bottom { margin-top:auto; display:flex; flex-direction:column; gap:10px; }
.super-bottom .muted { font-size:11px; text-align:center; }
.super-content { padding:36px 40px; min-width:0; }
.super-content-header { display:flex; gap:20px; align-items:center; justify-content:space-between; margin-bottom:28px; }
.super-content-header h1 { font-size:26px; margin-bottom:8px; }
.super-content-header p { font-size:12px; }
.super-search { max-width:400px; margin-bottom:20px; }
.table-scroll { width:100%; overflow:auto; border:1px solid var(--line); border-radius:14px; background:var(--surface); margin-bottom:20px; }
.super-table { border-collapse:collapse; width:100%; white-space:nowrap; }
.super-table th { text-align:left; font-size:11px; font-weight:600; padding:16px; color:var(--muted); background:var(--surface); border-bottom:1px solid var(--line); }
.super-table td { padding:16px; font-size:12px; border-bottom:1px solid var(--line); }
.super-table tr:last-child td { border-bottom:0; }
.table-actions { display:flex; gap:8px; }
.monospace { font-family:ui-monospace,SFMono-Regular,Consolas,monospace; }
.account-state { display:inline-block; padding:5px 9px; font-size:11px; background:#e9f6ee; color:#328157; border-radius:6px; }
.account-state.warning { background:#fff3e7; color:#a36b23; }
.super-room-list { display:flex; flex-direction:column; }
.super-room-row { display:flex; align-items:center; justify-content:space-between; gap:14px; border-bottom:1px solid var(--line); padding:15px 0; }
.super-room-row>div { display:flex; flex-direction:column; gap:7px; min-width:0; }
.super-room-row strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.super-room-row small { font-size:11px; }
.dark .admin-layout .conversation-body { background-color:var(--surface); }
@media (max-width:1000px) {
  .super-shell { grid-template-columns:205px minmax(0,1fr); }
  .super-content { padding:25px 20px; }
  .super-brand { font-size:15px; }
}
@media (max-width:767px) {
  .sidebar-splitter { display:none; }
  .workspace-placeholder { display:none; }
  .super-shell { display:flex; flex-direction:column; }
  .super-sidebar { position:relative; width:100%; height:auto; padding:18px; gap:15px; }
  .super-nav { display:flex; flex-direction:row; flex-wrap:wrap; gap:6px; }
  .super-nav>button { padding:10px; font-size:12px; }
  .super-bottom { display:flex; flex-direction:row; flex-wrap:wrap; gap:7px; }
  .super-bottom>* { flex:1; }
  .super-bottom .muted { width:100%; flex-basis:100%; text-align:left; }
  .super-content { padding:22px 14px; }
  .super-content-header { align-items:flex-start; gap:12px; margin-bottom:20px; }
  .super-content-header h1 { font-size:21px; }
  .super-content-header>.button { flex-shrink:0; }
  .template-row { padding:11px; gap:8px; flex-wrap:wrap; }
  .template-tools { margin-left:auto; }
  .template-summary { min-width:120px; }
  .editable-list-row { gap:2px; }
  .editable-list-row>.icon { display:none; }
  .editable-list-row .icon-button { width:29px; }
  .template-media-tray { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (prefers-reduced-motion:reduce) {
  .marquee-text { animation:none; padding-left:12px; min-width:0; }
  .chat-marquee { overflow-x:auto; }
}

.super-key-status { color:var(--muted); font-size:11px; line-height:1.7; text-align:center; }
.super-brand strong { display:flex; flex-direction:column; gap:5px; }
.super-brand small { font-size:11px; color:var(--muted); font-weight:400; letter-spacing:3px; }
.super-login { min-height:100dvh; display:grid; place-items:center; padding:24px; background:var(--surface-soft); }
.super-login-card { width:min(440px,100%); padding:34px; background:var(--surface); border:1px solid var(--line); border-radius:18px; box-shadow:var(--shadow); }
.super-login-card>.icon { color:var(--primary); width:32px; height:32px; margin-bottom:18px; }
.super-login-card h1 { font-size:24px; margin-bottom:8px; }
.super-login-card .stack-form { margin:24px 0; }
.super-login-card>small { display:block; font-size:11px; }

.background-preview { overflow:hidden; display:grid; place-items:center; min-height:90px; }
.background-preview img { max-width:100%; max-height:200px; object-fit:contain; }

                                                                                    
:root { --rail: 86px; }
.admin-layout,.admin-layout.has-room { grid-template-columns:var(--rail) var(--sidebar) minmax(0,1fr); }
.admin-layout.has-room.profile-open { grid-template-columns:var(--rail) var(--sidebar) minmax(0,1fr) var(--profile); }
.admin-layout>.sidebar { grid-column:2; grid-row:1; }
.admin-layout>.conversation,.admin-layout>.dashboard { grid-column:3; grid-row:1; min-width:0; }
.admin-layout>.profile-panel { grid-column:4; grid-row:1; }
.admin-layout:not(.profile-open)>.profile-panel { display:none; }
.admin-layout .sidebar-search { margin-top:16px; }
.navigation-rail { display:flex; flex-direction:column; align-items:center; grid-column:1; grid-row:1; width:var(--rail); min-height:0; background:var(--surface-soft); border-right:1px solid var(--line); z-index:13; position:relative; }
.rail-identity { display:flex; flex-direction:column; align-items:center; width:100%; gap:10px; padding:23px 6px 18px; }
.rail-avatar { display:flex; border-radius:50%; padding:0; }
.rail-avatar .avatar { width:44px; height:44px; font-size:19px; }
.rail-name { width:100%; max-height:38px; overflow:hidden; text-align:center; font-size:11px; line-height:1.6; overflow-wrap:anywhere; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.rail-main,.rail-bottom { display:flex; flex-direction:column; align-items:center; gap:9px; width:100%; }
.rail-bottom { margin-top:auto; padding-bottom:max(20px,env(safe-area-inset-bottom)); padding-top:15px; }
.rail-button { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px; width:58px; min-height:56px; border-radius:14px; color:var(--muted); transition:background .15s,color .15s; }
.rail-button>.icon { width:23px; height:23px; }
.rail-button>span { font-size:10px; }
.rail-button:hover,.rail-button.active,.rail-button[aria-expanded=true] { background:var(--primary-soft); color:var(--primary); }
.rail-button.rail-create { min-height:46px; width:46px; margin-bottom:9px; background:var(--primary); color:white; border-radius:15px; box-shadow:0 5px 15px #3390ec20; }
.rail-latency { display:flex; flex-direction:column; align-items:center; gap:7px; color:var(--muted); font-size:10px; padding:8px 0; }
.rail-latency .latency-wifi { width:19px; height:19px; }
.rail-settings-panel { position:absolute; left:calc(100% + 1px); bottom:18px; width:248px; max-height:calc(100dvh - 36px); overflow-y:auto; padding:16px 10px 10px; border:1px solid var(--line); border-radius:0 18px 18px 0; background:var(--surface); box-shadow:8px 8px 36px #102a431f; }
.rail-settings-panel>header { display:flex; align-items:center; justify-content:space-between; padding:0 8px 10px; }
.rail-settings-panel>header strong { font-size:16px; }
.rail-settings-item { display:flex; align-items:center; gap:12px; width:100%; padding:14px 12px; border-radius:9px; text-align:left; font-size:13px; }
.rail-settings-item:hover { background:var(--surface-soft); }
.rail-settings-item.danger-item { color:var(--danger); margin-top:4px; border-top:1px solid var(--line); border-radius:0 0 9px 9px; }
.rail-settings-item.danger-item>.icon { color:inherit; }
.rail-settings-item>.icon { width:19px; height:19px; color:var(--muted); }
.rail-settings-item>.icon:last-child { width:14px; height:14px; margin-left:auto; }
.admin-layout>.sidebar-splitter { left:calc(var(--rail) + var(--sidebar) - 4px); }
.modal.side-modal { position:fixed; inset:0 auto 0 var(--rail); margin:0; width:min(560px,calc(100vw - var(--rail))); max-width:none; height:100dvh; max-height:none; border-radius:0 18px 18px 0; }
.modal.side-modal::backdrop { background:#182c3b18; backdrop-filter:none; }
.modal.side-modal .modal-content { flex:1; padding:22px; }
.guest-loading { min-height:100dvh; display:flex; align-items:center; justify-content:center; padding:30px; background:#fff; color:#556675; }
.guest-error { text-align:center; line-height:1.8; }
.dashboard-open>.conversation,.dashboard-open>.profile-panel { display:none!important; }
.dashboard { background:var(--surface-soft); min-height:0; overflow:auto; }
.dashboard-header { display:flex; align-items:center; padding:34px 36px 25px; gap:15px; }
.dashboard-header>div:first-child { flex:1; }
.dashboard-header h1 { font-size:27px; margin-top:6px; font-weight:650; }
.dashboard-eyebrow { color:var(--muted); font-size:12px; }
.dashboard-content { padding:0 36px 32px; }
.metric-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; }
.metric-day { background:var(--surface); border:1px solid var(--line); border-radius:17px; padding:24px; }
.metric-day>header { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:30px; }
.metric-day h2 { font-size:17px; }
.metric-day time { color:var(--muted); font-size:11px; }
.metric-values { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.metric-values>div { display:flex; flex-direction:column; gap:10px; }
.metric-values span { font-size:12px; color:var(--muted); }
.metric-number { font-size:35px; font-weight:650; font-variant-numeric:tabular-nums; letter-spacing:-1px; }
.metric-values small { color:var(--muted); font-size:10px; line-height:1.6; }
.hourly-card { background:var(--surface); border:1px solid var(--line); border-radius:17px; margin:24px 0; padding:25px; }
.hourly-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:30px; }
.hourly-header h2 { font-size:15px; }
.chart-legend { display:flex; gap:15px; font-size:10px; color:var(--muted); }
.chart-legend span::before { content:''; display:inline-block; width:7px; height:7px; border-radius:50%; margin-right:6px; background:var(--primary); }
.chart-legend .yesterday::before { background:#bcd4e8; }
.hourly-bars { display:flex; gap:6px; height:190px; border-bottom:1px solid var(--line); margin-bottom:25px; }
.hour-column { flex:1; min-width:0; display:flex; align-items:flex-end; justify-content:center; gap:2px; position:relative; }
.hour-bar { width:40%; background:var(--primary); border-radius:3px 3px 0 0; min-height:0; }
.hour-bar.yesterday { background:#bcd4e8; }
.hour-label { position:absolute; top:calc(100% + 10px); font-size:9px; color:var(--muted); }
.invite-editor { display:grid; grid-template-columns:1fr 1fr; gap:28px; }
.invite-preview { min-width:0; display:flex; flex-direction:column; align-items:center; gap:16px; align-self:start; }
.qr-card-canvas { display:block; width:100%; max-width:340px; height:auto; border:1px solid #e9edf2; border-radius:12px; background:white; }
.invite-preview .button-row { flex-wrap:wrap; justify-content:center; }
.invite-preview .button { font-size:12px; padding:10px 14px; white-space:nowrap; flex:0 0 auto; }
.invite-version { font-size:11px; color:var(--muted); }
.invite-options { gap:16px; }
.invite-options h3 { font-size:15px; margin-bottom:2px; }
.invite-options .invite-url { font-size:10px; }
@media (max-width:1199px) {
  .admin-layout.has-room.profile-open { grid-template-columns:var(--rail) var(--sidebar) minmax(0,1fr); }
  .admin-layout>.profile-panel { grid-column:auto; }
  .metric-grid { grid-template-columns:1fr; }
  .dashboard-header { padding:24px; }
  .dashboard-content { padding:0 24px 24px; }
}
@media (max-width:767px) {
  :root { --rail:68px; }
  .admin-layout,.admin-layout.has-room,.admin-layout.has-room.profile-open { display:grid; grid-template-columns:var(--rail) minmax(0,1fr); }
  .admin-layout>.sidebar { width:auto; grid-column:2; }
  .admin-layout>.conversation { grid-column:2; width:auto; }
  .admin-layout:not(.mobile-chat)>.conversation { display:none; }
  .admin-layout.mobile-chat>.sidebar { display:none; }
  .admin-layout.dashboard-open>.sidebar { display:none; }
  .admin-layout>.dashboard { grid-column:2; }
  .rail-identity { padding:18px 4px 15px; }
  .rail-avatar .avatar { width:37px; height:37px; }
  .rail-button { width:49px; min-height:51px; border-radius:12px; }
  .rail-name { font-size:10px; }
  .rail-settings-panel { bottom:12px; width:min(248px,calc(100vw - var(--rail) - 10px)); }
  .modal.side-modal { border-radius:0; }
  .admin-layout .sidebar-search { padding-left:12px; padding-right:12px; }
  .dashboard-header { padding:22px 16px; flex-wrap:wrap; }
  .dashboard-header h1 { font-size:22px; }
  .dashboard-header .button { font-size:10px; padding:9px; }
  .dashboard-content { padding:0 16px 22px; }
  .metric-day { padding:18px; }
  .metric-number { font-size:29px; }
  .hourly-card { padding:18px 12px; }
  .hourly-bars { gap:3px; height:140px; }
  .invite-editor { grid-template-columns:1fr; }
  .qr-card-canvas { max-width:285px; }
  .guest-layout { display:flex; }
}
@media (max-height:650px) {
  .rail-identity { padding-top:12px; padding-bottom:10px; gap:4px; }
  .rail-main,.rail-bottom { gap:4px; }
  .rail-button { min-height:43px; }
  .rail-bottom { padding-bottom:8px; padding-top:8px; }
}

                                                                                            
.folder-tabs { gap: 14px; padding-inline: 14px; overflow-x: auto; scrollbar-width: thin; flex-shrink: 0; }
.folder-tab { flex-shrink: 0; gap: 5px; }
.folder-tab .tab-count:empty { display: none; }
.chat-preview.has-draft { color: var(--text); }
.draft-label { color: var(--danger); font-weight: 600; }
.chat-marquee, .dark .chat-marquee { background: #ffe16a; color: #000; border-bottom-color: #e9cc55; }
.destroyed-notice { padding: 10px 20px; text-align: center; font-size: 12px; color: var(--muted); background: var(--surface-soft); border-bottom: 1px solid var(--line); }
.preset-previews { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 5px; width: 100%; }
.preset-preview { position: relative; width: 82px; height: 66px; border-radius: 8px; overflow: hidden; background: var(--surface-soft); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; flex: none; }
.preset-preview > img, .preset-preview > video { width: 100%; height: 100%; object-fit: cover; display: block; }
.preset-preview.loading > .icon { color: var(--muted); width: 22px; height: 22px; }
.preset-preview > small { font-size: 10px; color: var(--muted); }
.preset-video-badge { position: absolute; bottom: 3px; right: 3px; border-radius: 4px; background: #000a; color: #fff; font-size: 9px; padding: 2px 4px; display: flex; align-items: center; gap: 2px; pointer-events: none; }
.preset-video-badge .icon { width: 10px; height: 10px; }
.template-row { align-items: flex-start; }
.template-tools { flex-shrink: 0; }
.settings-subpage { justify-content: flex-start; gap: 12px; }
.settings-subpage > .icon:last-child { margin-left: auto; }
.active-sessions { display: flex; flex-direction: column; gap: 16px; }
.active-sessions > .muted { line-height: 1.7; font-size: 12px; }
.device-session-list { display: flex; flex-direction: column; gap: 12px; }
.device-session { display: flex; align-items: flex-start; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.device-session > .icon { width: 26px; height: 26px; color: var(--muted); flex-shrink: 0; }
.device-session.current-device { border-color: var(--primary); background: var(--primary-soft); }
.device-session-details { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.device-session-title { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.device-session-title > strong { font-size: 13px; line-height: 1.5; }
.device-session-details p { font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.device-session-details > small { color: var(--muted); font-size: 10px; line-height: 1.5; }
.current-device-badge { color: var(--primary); font-size: 10px; font-weight: 600; }
.device-session > button { white-space: nowrap; font-size: 12px; padding: 2px 0; }
@media (max-width: 600px) {
  .folder-tabs { gap: 13px; padding-inline: 12px; }
  .preset-preview { width: 72px; height: 62px; }
  .device-session { padding: 13px; gap: 10px; }
}

                                                            
.confirmation-check { display:flex; align-items:center; gap:10px; padding-top:16px; cursor:pointer; }
.confirmation-check input { width:18px; height:18px; accent-color:var(--primary); }
.auth-form label[hidden] { display:none; }
.admin-layout>.link-panel { grid-column:3; grid-row:1; min-width:0; min-height:0; overflow:auto; background:var(--surface-soft); }
.link-panel[hidden] { display:none; }
.links-open>.conversation,.links-open>.profile-panel { display:none!important; }
.link-header { display:flex; align-items:center; gap:16px; padding:30px 32px 20px; }
.link-header h1 { margin:0; flex:1; font-size:26px; font-weight:650; }
.link-toolbar { padding:0 32px 24px; }
.link-room-select { max-width:440px; }
.link-content { padding:0 32px 32px; }
.link-content .invite-editor { padding:26px; border:1px solid var(--line); border-radius:18px; background:var(--surface); grid-template-columns:minmax(220px,1fr) minmax(220px,1fr); gap:30px; }
.link-content .invite-options { min-width:0; }
.link-content .invite-url { font-size:12px; }
.link-content .invite-preview { position:sticky; top:20px; }
.link-error { display:grid; gap:16px; justify-items:start; padding:24px; }
@media (max-width:1100px) {
  .link-content .invite-editor { grid-template-columns:1fr; }
  .link-content .invite-preview { position:static; }
}
@media (max-width:767px) {
  .admin-layout>.link-panel { grid-column:2; }
  .admin-layout.links-open>.sidebar { display:none; }
  .link-header { padding:20px 16px; gap:8px; }
  .link-header h1 { font-size:22px; }
  .link-toolbar { padding:0 16px 18px; }
  .link-content { padding:0 12px 24px; }
  .link-content .invite-editor { padding:16px 12px; gap:24px; grid-template-columns:minmax(0,1fr); }
  .link-content .invite-preview .button { padding:9px; }
}

                                                                             
.security-settings { display:flex; flex-direction:column; gap:28px; min-width:0; }
.security-settings > .active-sessions { border-top:1px solid var(--line); padding-top:24px; }
.active-sessions { display:flex; flex-direction:column; gap:16px; min-width:0; }
.active-sessions h3 { margin:0; }
.background-settings .background-editor { display:flex; flex-direction:column; gap:18px; min-width:0; }
.background-settings .background-preview { position:relative; height:clamp(150px,28vh,260px); max-height:none; padding:0; border:1px solid var(--line); }
.background-settings .background-preview img { position:absolute; inset:0; width:100%; height:100%; max-height:none; object-fit:scale-down; object-position:center; }
.background-settings .background-preview[data-swatch] { background:var(--theme-paper); }
.background-settings .background-preview[data-swatch="white"] { background:white; }
.background-settings .background-actions { display:flex; flex-wrap:wrap; gap:12px; }
.background-settings .background-actions > button { flex:1 1 140px; min-width:0; }
.background-settings > p { margin:0; line-height:1.8; overflow-wrap:anywhere; }
.rail-button { position:relative; }
.rail-button > .rail-unread { position:absolute; top:2px; right:0; min-width:20px; height:20px; padding:0 5px; border-radius:10px; background:var(--danger, #d83a49); color:#fff; font-size:11px; font-weight:700; line-height:20px; text-align:center; box-shadow:0 0 0 2px var(--surface); }
.rail-unread[hidden] { display:none; }
.welcome-settings { display:flex; flex-direction:column; gap:20px; min-width:0; }
.welcome-settings > p { margin:0; line-height:1.8; }
.welcome-settings .template-list { display:flex; flex-direction:column; gap:14px; }
.welcome-settings .welcome-number { flex:none; width:26px; height:26px; display:grid; place-items:center; border-radius:50%; background:var(--primary-soft); color:var(--primary); font-weight:700; }
.welcome-settings .template-summary { min-width:0; overflow-wrap:anywhere; }
.welcome-settings .template-tools { flex-wrap:wrap; }
.welcome-settings .welcome-actions { display:flex; flex-wrap:wrap; gap:12px; }
.welcome-settings .welcome-actions > button { flex:1 1 150px; }
@media (max-width:480px) {
  .security-settings .device-session { flex-wrap:wrap; }
  .security-settings .device-session-details { flex-basis:calc(100% - 40px); }
  .security-settings .device-session > button { margin-left:36px; }
  .welcome-settings .template-row { flex-wrap:wrap; }
  .welcome-settings .template-summary { flex-basis:calc(100% - 44px); }
  .welcome-settings .template-tools { margin-left:36px; }
}

.card-only-auth.auth-page{display:flex;align-items:center;justify-content:center;min-height:100dvh;background:var(--surface);padding:24px}
.card-only-auth .auth-card-wrap{width:100%;max-width:440px;padding:0;background:transparent}
.card-only-auth .auth-card{width:100%;padding:32px;border:1px solid #e5e7eb;border-radius:20px;box-shadow:0 8px 35px #162b4410}
.card-only-auth .auth-card h2{margin:0 0 28px;text-align:center}
.auth-secondary-actions {
  display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-top:12px;
}
.auth-secondary-actions .button {
  min-height:48px; padding-inline:8px; gap:7px; background:var(--primary-soft); color:var(--text);
  color:color-mix(in srgb,var(--primary) 35%,var(--text));
}
.auth-secondary-actions .icon { width:17px; height:17px; }
.auth-secondary-actions .button:hover { border-color:currentColor; }
.card-only-auth .input{width:100%;min-width:0;font-size:14px}
.chat-marquee{background:#fff4ba!important;color:#695014!important;border-top:1px solid #f0da83;border-bottom:1px solid #e8d27d;height:calc(44px * 2 / 3);min-height:calc(44px * 2 / 3);padding:calc(4px * 2 / 3) 18px;box-shadow:inset 0 -1px 0 #fff8d4;font-weight:500}
.conversation-header>.button{flex-shrink:0;max-width:128px;white-space:normal;margin-left:auto;font-size:12px}
.invite-options>.button-row{display:flex;flex-wrap:wrap;gap:10px}
.policy-fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:18px;align-items:start}
.policy-fields label{display:grid;gap:7px}
.policy-form{display:grid;gap:22px;max-width:1100px}
.domain-lifecycle{min-width:130px}
@media(max-width:520px){.card-only-auth.auth-page{padding:18px}.card-only-auth .auth-card{padding:26px 18px}.conversation-header{gap:6px}.conversation-header>.button{max-width:104px;padding:7px}.chat-marquee{padding:calc(4px * 2 / 3) 12px}}

                                                                        
.invite-editor.invite-revoked .invite-url { color: var(--muted); text-decoration: line-through; }
.invite-editor.invite-revoked .qr-card-canvas { opacity: .45; }

                                                                      
.sales-plan-row { display:grid; grid-template-columns:minmax(80px,1fr) minmax(120px,2fr) auto; gap:12px; align-items:end; }
.sales-plan-row .input { min-width:0; width:100%; }
.unread-divider { color:#286eac; font-weight:600; }
@media(max-width:480px){ .sales-plan-row { gap:8px; } .sales-plan-row .button { padding:10px; } }

                                                                                      
.app-layout.with-data-credit { height:calc(100dvh - 22px); }
.workspace-data-credit { height:22px; padding:2px 12px; font-size:11px; line-height:18px; color:var(--muted); text-align:right; background:var(--surface); }
.call-quality { margin:16px 12px 0; text-align:center; color:var(--muted); font-size:12px; line-height:1.6; }

.message-video .media-download { display:block; position:relative; padding:8px 10px; color:var(--primary); font-size:12px; text-decoration:underline; overflow-wrap:anywhere; }
.message-video .media-download[hidden] { display:none; }
.message-video .image-loading { max-width:100%; white-space:normal; font-size:12px; padding:8px; }

                                                                        
.link-slot-tabs{display:flex;gap:12px;padding:12px 18px;flex-wrap:wrap}
.link-slot-tabs [aria-selected="true"]{border:2px solid var(--accent,#2563eb);font-weight:700}
.invite-slot-heading{margin:0 0 8px;text-align:center}
.invite-lifetime{max-width:440px;line-height:1.5;text-align:center;margin:0 0 12px;font-size:14px;overflow-wrap:anywhere}

.code-status-strip { display:flex; align-items:center; flex-wrap:wrap; gap:4px 9px; width:100%; max-width:340px; padding:7px 11px; border:1px solid var(--line); border-radius:10px; background:var(--surface-soft); font-size:12px; }
.code-status-strip strong { font-weight:600; }
.code-status-count,.code-status-range { color:var(--muted); font-variant-numeric:tabular-nums; }
.code-status-strip .text-button { margin-inline-start:auto; }
.code-status-detail { display:grid; gap:16px; min-width:0; }
.code-status-form { display:grid; grid-template-columns:minmax(0,1fr) minmax(100px,135px) auto; gap:10px 14px; align-items:end; }
.code-status-form label { display:grid; gap:7px; font-size:13px; }
.code-status-form .input { font-size:14px; }
.code-username-field { display:grid; align-items:center; min-width:0; }
.code-username-field>* { grid-area:1/1; }
.code-username-field .input { min-width:0; width:100%; min-height:44px; height:100%; }
.code-username-field .input::placeholder { color:transparent; }
.code-username-hint { padding:6px 11px; color:var(--muted); font-size:12px; line-height:1.45; overflow-wrap:anywhere; pointer-events:none; }
.code-username-field .input:not(:placeholder-shown)+.code-username-hint { visibility:hidden; }
.code-status-form .button { min-height:44px; }
.code-recipient { grid-column:1/-1; }
.code-recipient:empty,.code-status-detail>.form-error:empty { display:none; }
.code-recipient-link { color:var(--primary); font-size:13px; text-underline-offset:3px; }
.code-attempts-scroll { overflow:auto; max-width:100%; max-height:40vh; border:1px solid var(--line); border-radius:9px; }
.code-attempts { width:100%; border-collapse:separate; border-spacing:0; font-size:13px; text-align:left; }
.code-attempts th,.code-attempts td { padding:9px 11px; border-bottom:1px solid var(--line); }
.code-attempts th { position:sticky; top:0; white-space:nowrap; color:var(--muted); font-size:12px; font-weight:600; background:var(--surface-soft); }
.code-attempts td { overflow-wrap:anywhere; }
.code-attempts td:first-child { white-space:nowrap; }
.code-attempts tbody tr:last-child td { border-bottom:0; }
.code-attempts-empty { color:var(--muted); text-align:center; }
.code-visit-ok { color:var(--green); }
.code-visit-failed { color:var(--danger); }
.code-reason-action { color:var(--primary); text-decoration:underline dotted; text-underline-offset:3px; padding:4px 0; font:inherit; }
.code-status-nav { display:flex; align-items:center; justify-content:flex-end; gap:6px; font-size:12px; }
.code-status-range { margin-inline-end:auto; }
@media (max-width:600px) {
  .code-status-form { grid-template-columns:minmax(0,1fr) auto; }
  .code-status-form label:first-child { grid-column:1/-1; }
  .code-status-strip { max-width:285px; }
  .code-attempts th,.code-attempts td { padding:8px 6px; }
  .code-attempts td:nth-child(2) { min-width:8ch; font-variant-numeric:tabular-nums; }
}

                                                                                          
.folder-toolbar{display:flex;align-items:center;gap:8px;min-height:52px;padding:6px 12px;border-bottom:1px solid var(--line);flex-shrink:0}
.folder-toolbar .folder-tab{padding:8px 10px;border:0;border-radius:9px;flex-shrink:0}
.folder-toolbar .folder-tab.active{background:var(--surface-soft);color:var(--primary)}
.folder-disclosure-toggle {
  margin-inline-start:auto; flex:none; display:inline-flex; align-items:center; gap:7px;
  min-height:36px; padding:4px 9px; border:1px solid var(--line); border-radius:12px;
  border-color:color-mix(in srgb,var(--primary) 22%,var(--surface));
  background:linear-gradient(120deg,var(--primary-soft),var(--surface));
  color:var(--primary); font-size:11px; font-weight:600;
}
.folder-disclosure-mark { position:relative; flex:none; width:21px; height:20px; }
.folder-disclosure-mark::before,.folder-disclosure-mark::after {
  content:""; position:absolute; border-radius:3px;
}
.folder-disclosure-mark::before {
  inset:2px 1px 2px 0; background:currentColor;
  clip-path:polygon(0 0,41% 0,55% 20%,100% 20%,100% 100%,0 100%);
}
.folder-disclosure-mark::after {
  inset:7px 0 2px 1px; border:1px solid currentColor; background:var(--primary-soft);
  background:color-mix(in srgb,var(--primary) 24%,var(--primary-soft)); transform:skewX(-8deg);
}
.folder-disclosure-label { display:flex; flex-direction:column; align-items:center; line-height:13px; white-space:nowrap; }
.folder-disclosure-chevron { width:13px; height:13px; transition:transform .16s; }
.folder-disclosure-toggle:hover,.folder-disclosure-toggle[aria-expanded="true"] {
  background:var(--primary-soft); border-color:var(--primary);
}
.folder-disclosure-toggle[aria-expanded="true"] .folder-disclosure-chevron { transform:rotate(180deg); }
.folder-disclosure-toggle:focus-visible,.folder-option:focus-visible { outline:2px solid var(--primary); outline-offset:2px; }
@media (prefers-reduced-motion:reduce) { .folder-disclosure-chevron { transition:none; } }
.current-folder-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted);font-size:12px}
.folder-disclosure-panel {
  margin:8px 12px 10px; padding:6px; border:1px solid var(--line); border-radius:14px;
  border-color:color-mix(in srgb,var(--primary) 16%,var(--surface));
  background:linear-gradient(135deg,var(--surface-soft),var(--surface) 80%);
  flex-shrink:0; max-height:260px; overflow-y:auto;
}
.folder-disclosure-panel[hidden],.folder-custom-list[hidden],.history-search-panel[hidden]{display:none}
.folder-custom-list{border-top:1px solid var(--line);margin-top:5px;padding-top:5px}
.folder-option{display:flex;align-items:center;gap:9px;width:100%;padding:10px;border:0;border-radius:8px;background:transparent;color:var(--text);text-align:left;font:inherit;font-size:13px;cursor:pointer;min-height:40px}
.folder-option>.icon { width:25px; height:25px; padding:4px; border-radius:7px; background:var(--primary-soft); color:var(--primary); }
.folder-option-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.folder-option:hover{background:var(--surface-soft)}
.folder-option.active{background:var(--primary-soft,#eaf3ff);color:var(--primary)}
.folder-option .tab-count { min-width:23px; border-radius:12px; text-align:center; font-size:11px; font-variant-numeric:tabular-nums; }
.history-search-panel{flex-shrink:0;display:grid;gap:12px;padding:16px 20px;background:var(--surface);border-bottom:1px solid var(--line);box-shadow:0 3px 12px #182b4106}
.history-search-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}
.history-search-heading strong{font-size:14px;line-height:1.5}
.history-search-heading small{display:block;margin-top:2px;font-size:11px;color:var(--muted)}
.history-search-input{display:flex;align-items:center;gap:9px;padding:0 12px;border:1px solid var(--line);border-radius:10px;background:var(--surface-soft);min-height:42px}
.history-search-input:focus-within{border-color:var(--primary);box-shadow:0 0 0 3px #3390ec15}
.history-search-input>.icon{width:18px;height:18px;color:var(--muted);flex-shrink:0}
.history-search-input input{min-width:0;flex:1;width:100%;height:40px;border:0;background:transparent;color:var(--text);font:inherit;font-size:13px;outline:none}
.history-filter-row{display:flex;align-items:stretch;gap:10px;flex-wrap:wrap}
.history-date-field{display:flex;align-items:center;gap:10px;flex:1 1 250px;min-width:0;border:1px solid var(--line);border-radius:10px;padding:8px 10px;min-height:48px}
.history-date-field>.icon{color:var(--primary);width:18px;height:18px;flex-shrink:0}
.history-date-caption{font-size:12px;line-height:1.4;white-space:nowrap}
.history-date-caption small{display:block;color:var(--muted);font-size:10px}
.history-date-field input[type=date]{min-width:130px;max-width:170px;width:100%;margin-left:auto;border:0;color:var(--text);background:transparent;font:inherit;font-size:12px;padding:5px 0;outline-offset:2px}
.history-photo-chip{display:flex;cursor:pointer;position:relative;flex:0 0 auto}
.history-photo-input{position:absolute;opacity:0;width:1px;height:1px;overflow:hidden}
.history-photo-visual{display:flex;align-items:center;justify-content:center;gap:8px;min-height:48px;padding:10px 12px;border:1px solid var(--line);border-radius:10px;font-size:12px;color:var(--text)}
.history-photo-visual>.icon{width:18px;height:18px}
.history-photo-check{display:flex;align-items:center;justify-content:center;border:1px solid var(--line);width:15px;height:15px;border-radius:4px}
.history-photo-check>.icon{width:11px;height:11px;visibility:hidden}
.history-photo-input:checked+.history-photo-visual{border-color:var(--primary);color:var(--primary);background:var(--primary-soft,#eaf3ff)}
.history-photo-input:checked+.history-photo-visual .history-photo-check{background:var(--primary);border-color:var(--primary);color:white}
.history-photo-input:checked+.history-photo-visual .history-photo-check>.icon{visibility:visible}
.history-photo-input:focus-visible+.history-photo-visual{outline:2px solid var(--primary);outline-offset:2px}
.history-search-footer{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:11px;color:var(--muted)}
.history-reset{border:0;padding:3px 0;background:transparent;color:var(--primary);cursor:pointer;font-size:12px;white-space:nowrap}
.profile-region-hint{display:block;font-size:11px;color:var(--muted);line-height:1.5;margin-top:4px;overflow-wrap:anywhere}
@media(max-width:540px){.history-search-panel{padding:12px;gap:10px}.history-date-field{flex-basis:100%}.history-photo-chip{flex:1}.history-photo-visual{flex:1;min-height:40px}.history-search-heading small{display:none}}

                                                                                 
:root { --theme-ink:#326f9d; --theme-tint:#ebf4fa; --theme-paper:#f8fbfd; --theme-bubble:#dceef8; }
:root[data-theme="sage"], [data-swatch="sage"] { --theme-ink:#426c5b; --theme-tint:#e5f0e9; --theme-paper:#f6faf6; --theme-bubble:#daeee0; }
:root[data-theme="apricot"], [data-swatch="apricot"] { --theme-ink:#92582d; --theme-tint:#f9ebdc; --theme-paper:#fffaf4; --theme-bubble:#fae3cd; }
:root[data-theme="lilac"], [data-swatch="lilac"] { --theme-ink:#745a91; --theme-tint:#f0eaf6; --theme-paper:#fbf9fd; --theme-bubble:#eae1f3; }
:root[data-theme="mist"], [data-swatch="mist"] { --theme-ink:#356e76; --theme-tint:#e2f1f1; --theme-paper:#f5fafb; --theme-bubble:#d8eded; }
[data-swatch="classic"] { --theme-ink:#326f9d; --theme-tint:#ebf4fa; }
:root[data-theme]:not(.dark):not([data-theme="classic"]) {
  --primary:var(--theme-ink); --primary-hover:var(--theme-ink); --primary-soft:var(--theme-tint);
  --bubble-out:var(--theme-bubble); --surface-soft:var(--theme-paper); --chat-background:var(--theme-paper);
}
:root[data-theme]:not([data-theme="classic"]) .guest-layout { --bubble-out:var(--theme-bubble); --surface-soft:var(--theme-paper); }
:root[data-theme]:not(.dark) .conversation-body { background-color:var(--theme-paper); }
:root[data-theme] .conversation-body:not(.custom-background)::before {
  display:block; pointer-events:none; opacity:.37; background-image:
    radial-gradient(ellipse at 100% 0%,var(--theme-tint),transparent 58%),
    repeating-radial-gradient(ellipse at -9% 112%,transparent 0 32px,var(--theme-tint) 33px 34px,transparent 35px 50px);
}
@supports (color:color-mix(in srgb, white, black)) {
  :root.dark[data-theme]:not([data-theme="classic"]) {
    --primary:color-mix(in srgb,var(--theme-tint) 70%,var(--theme-ink));
    --primary-soft:color-mix(in srgb,var(--surface) 80%,var(--theme-ink));
    --bubble-out:color-mix(in srgb,#26323b 66%,var(--theme-ink));
  }
}
:root.dark[data-theme] .conversation-body:not(.custom-background)::before { opacity:.045; }
:root[data-theme]:not(.dark) .conversation-header { border-bottom:1px solid var(--theme-tint); }
.theme-options { display:grid; grid-template-columns:repeat(auto-fit,minmax(105px,1fr)); gap:10px; }
.theme-option { display:flex; align-items:center; gap:10px; padding:12px; border-radius:12px; border:1px solid var(--line); background:var(--surface); color:var(--text); }
.theme-option[aria-pressed="true"], .theme-option:focus-visible { outline:2px solid var(--theme-ink); outline-offset:1px; }
.theme-chip { width:22px; height:22px; border-radius:50%; background:linear-gradient(135deg,var(--theme-tint) 52%,var(--theme-ink) 53%); }

:root[data-theme="classic"]:not(.dark) .admin-layout > .navigation-rail {
  --primary:#315f77;
  --primary-soft:#d8e8ef;
  --muted:#4d6776;
  background:linear-gradient(175deg,#e8f1f7,#eef6f4);
  border-color:#d6e4e9;
}
:root[data-theme="classic"]:not(.dark) .admin-layout > .sidebar {
  --primary:#356680;
  --surface-soft:#eaf2f5;
  --selected-room:#dfedf3;
  background:#fbfdfe;
}
:root[data-theme="classic"]:not(.dark) .admin-layout .sidebar-search input::placeholder { color:#536977; }
:root[data-theme="classic"]:not(.dark) .admin-layout .chat-row.selected {
  color:#203d4c;
  background:var(--selected-room);
  box-shadow:inset 3px 0 #7299ad;
}
:root[data-theme="classic"]:not(.dark) .admin-layout .chat-row.selected :is(.chat-preview,time) { color:#4c6472; }
:root[data-theme="classic"]:not(.dark) .admin-layout .chat-row.selected .online-dot { border-color:var(--selected-room); }
:root[data-theme="classic"]:not(.dark) .admin-layout .chat-row.selected .unread-count { color:white; background:var(--primary); }
:root[data-theme="classic"]:not(.dark) .admin-layout .conversation-header {
  background:linear-gradient(110deg,#f7fbfd,#edf5f4);
  border-bottom-color:#d6e5e8;
}

:is(.admin-layout,.guest-layout) .outgoing .message-bubble {
  --bubble-out:#95ec69;
  --sent-text:#1a321d;
  --sent-detail:#3b513b;
  --sent-accent:#194c35;
  color:var(--sent-text);
}
.dark .admin-layout .outgoing .message-bubble {
  --bubble-out:#315b47;
  --sent-text:#eefaf0;
  --sent-detail:#c2d9cb;
  --sent-accent:#c5f1cf;
}
:is(.admin-layout,.guest-layout) .outgoing .message-meta { color:var(--sent-detail); }
:is(.admin-layout,.guest-layout) .outgoing .message-meta.is-read,
:is(.admin-layout,.guest-layout) .outgoing .message-bubble :is(a,.quoted-message > strong) { color:var(--sent-accent); }
:is(.admin-layout,.guest-layout) .outgoing .quoted-message { border-left-color:var(--sent-accent); }
