.sm-widget{position:fixed;right:15px;bottom:15px;z-index:99999;font-family:Arial,Helvetica,sans-serif;color:#172026}
.sm-launcher{width:148px;height:44px;border:0;border-radius:8px;background:#1264a3;color:#fff;font-weight:700;box-shadow:0 8px 24px rgba(0,0,0,.22);cursor:pointer}
.sm-launcher-dot{position:absolute;width:10px;height:10px;border-radius:50%;background:#d92d20;margin-left:116px;margin-top:-4px}
.sm-panel{width:380px;height:560px;max-height:calc(100vh - 30px);background:#fff;border:1px solid #d8dee8;border-radius:8px;box-shadow:0 16px 44px rgba(15,23,42,.24);overflow:hidden;display:flex;flex-direction:column}
.sm-header{height:48px;background:#f7f9fc;border-bottom:1px solid #e3e8ef;display:flex;align-items:center;justify-content:space-between;padding:0 12px}
.sm-header-actions{display:flex;align-items:center;gap:6px}
.sm-close,.sm-icon-button{border:0;background:transparent;line-height:1;cursor:pointer;color:#475569}
.sm-close{font-size:24px}
.sm-icon-button{width:30px;height:30px;border-radius:6px;font-size:16px}
.sm-icon-button:hover,.sm-close:hover{background:#eef3f8}
.sm-global-search{display:flex;gap:8px;padding:10px;border-bottom:1px solid #edf1f5;background:#fff}
.sm-global-search input{flex:1;border:1px solid #cbd5e1;border-radius:8px;padding:8px;font:inherit}
.sm-global-search button,.sm-compose button,.sm-group-create button,[data-save-settings]{border:0;background:#1264a3;color:#fff;border-radius:8px;padding:8px 12px;cursor:pointer}
.sm-search-results{flex:0 0 auto;max-height:180px;min-height:48px;overflow-y:auto;border-bottom:1px solid #e3e8ef;background:#fff}
.sm-body{flex:1;min-height:0;display:flex;flex-direction:column}
.sm-pane{display:none;height:100%;min-height:0}
.sm-pane.is-active{display:flex;flex-direction:column}
.sm-pane-title{padding:10px 12px 8px;border-bottom:1px solid #edf1f5;background:#fbfcfe;color:#475569;font-size:12px;font-weight:700;text-transform:uppercase}
.sm-list{overflow:auto;min-height:0;flex:1}
.sm-item{display:flex;align-items:flex-start;gap:10px;padding:10px 12px;border-bottom:1px solid #edf1f5;cursor:pointer;background:#fff}
.sm-item:hover{background:#f8fafc}
.sm-item-search{cursor:default}
.sm-item-search:hover{background:#fff}
.sm-actions button[disabled]{opacity:.7;cursor:wait}
.sm-avatar{width:38px;height:38px;border-radius:50%;background:#dbe4ee;object-fit:cover;flex:0 0 38px}
.sm-avatar-fallback{display:flex;align-items:center;justify-content:center;font-weight:700;color:#41546b}
.sm-main{min-width:0;flex:1}
.sm-title{font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sm-preview{font-size:12px;color:#64748b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:2px}
.sm-meta{font-size:11px;color:#94a3b8;text-align:right;min-width:54px}
.sm-badge{display:inline-block;min-width:18px;height:18px;border-radius:9px;background:#d92d20;color:#fff;font-size:11px;line-height:18px;text-align:center;margin-top:4px}
.sm-thread{display:flex;flex-direction:column;height:100%;min-height:0}
.sm-thread-head{height:42px;border-bottom:1px solid #e3e8ef;display:flex;align-items:center;gap:8px;padding:0 10px;background:#fff}
.sm-thread-head button{border:0;background:#eef3f8;border-radius:6px;width:30px;height:30px;font-size:22px;cursor:pointer}
.sm-messages{flex:1;overflow:auto;padding:12px;background:#f8fafc}
.sm-msg{max-width:78%;margin:0 0 8px;padding:8px 10px;border-radius:8px;background:#fff;border:1px solid #e3e8ef}
.sm-msg.me{margin-left:auto;background:#dff0ff;border-color:#b9dcff}
.sm-msg-text{white-space:pre-wrap;word-break:break-word}
.sm-msg-time{font-size:10px;color:#64748b;margin-top:4px}
.sm-compose{display:flex;gap:8px;padding:10px;border-top:1px solid #e3e8ef;background:#fff}
.sm-compose textarea{flex:1;resize:none;border:1px solid #cbd5e1;border-radius:8px;padding:8px;font:inherit}
.sm-secondary{display:grid;grid-template-columns:repeat(4,1fr);border-top:1px solid #d8dee8;background:#fff}
.sm-secondary button{border:0;background:#fff;padding:10px 4px;cursor:pointer;font-size:12px;color:#475569}
.sm-secondary button.is-active{color:#1264a3;font-weight:700;box-shadow:inset 0 2px 0 #1264a3}
.sm-secondary span{font-weight:700;color:#d92d20}
.sm-group-create{display:grid;grid-template-columns:1fr 1fr auto;gap:8px;padding:10px;border-bottom:1px solid #edf1f5;background:#fff}
.sm-group-create input{min-width:0;border:1px solid #cbd5e1;border-radius:8px;padding:8px;font:inherit}
.sm-subtabs{display:grid;grid-template-columns:repeat(4,1fr);border-bottom:1px solid #edf1f5;background:#fff}
.sm-subtabs button{border:0;background:#fff;padding:10px 6px;cursor:pointer;font-size:12px;color:#475569}
.sm-subtabs button.is-active{color:#1264a3;font-weight:700;border-bottom:2px solid #1264a3}
.sm-pane[data-pane=settings]{padding:14px;gap:12px}
.sm-pane[data-pane=settings] label{display:flex;gap:8px;align-items:center}
.sm-empty{padding:18px;color:#64748b;text-align:center}
.sm-section-title{padding:9px 12px 7px;border-bottom:1px solid #edf1f5;background:#f8fafc;color:#475569;font-size:12px;font-weight:700}
.sm-invite-list{flex:1 1 0;min-height:82px}
.sm-actions{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.sm-actions button{border:1px solid #cbd5e1;background:#fff;border-radius:6px;padding:5px 8px;cursor:pointer;font-size:12px;color:#172026}
.sm-actions button:hover{background:#f8fafc}
@media(max-width:640px){
  .sm-widget{inset:auto 0 0 0}
  .sm-launcher{position:fixed;right:12px;bottom:12px}
  .sm-panel{position:fixed;inset:0;width:auto;height:auto;max-height:none;border-radius:0;border:0}
  .sm-secondary button,.sm-subtabs button{font-size:11px;padding:10px 3px}
  .sm-item{padding:12px}
  .sm-compose{padding-bottom:calc(10px + env(safe-area-inset-bottom))}
}
