
  #tsp-msg-btn { position:relative; }
  #tsp-msg-btn .mg-badge { display:none; position:absolute; top:-7px; right:-9px; min-width:17px; height:17px; padding:0 5px; border-radius:9px; background:#e11d48; color:#fff; font:800 10px/17px var(--tsp-ff, Inter, sans-serif); text-align:center; box-shadow:0 0 0 2px #fff; pointer-events:none; z-index:2; }
  #tsp-msg-btn .mg-badge.on { display:block; }
  #tsp-msg-fab { display:none; position:fixed; left:14px; bottom:calc(env(safe-area-inset-bottom) + 16px); z-index:2147480000; width:50px; height:50px; border-radius:50%; border:0; background:#0f172a; color:#fff; box-shadow:0 6px 18px rgba(15,23,42,.35); align-items:center; justify-content:center; cursor:pointer; padding:0; }
  #tsp-msg-fab.on { display:flex; }
  #tsp-msg-fab { transition:opacity .18s ease, transform .18s ease; }
  #tsp-msg-fab.on.at-end { opacity:0; transform:translateY(14px); pointer-events:none; }   
  #tsp-msg-fab svg, .tm-ic svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
  #tsp-msg-fab .mg-badge { position:absolute; top:-3px; right:-3px; min-width:18px; height:18px; padding:0 5px; border-radius:9px; background:#e11d48; color:#fff; font:800 10.5px/18px var(--tsp-ff, Inter, sans-serif); box-shadow:0 0 0 2px #fff; display:none; }
  #tsp-msg-fab .mg-badge.on { display:block; }
  #tsp-msg { display:none; position:fixed; right:20px; top:76px; bottom:20px; width:640px; max-width:calc(100vw - 24px); z-index:2147481500; background:#fff; border-radius:16px; box-shadow:0 18px 48px rgba(15,23,42,.3); overflow:hidden; font-family:var(--tsp-ff, Inter, sans-serif); color:#0f172a; }
  #tsp-msg.open { display:flex; }
  #tsp-msg .tm-side { width:210px; flex:none; background:#ffffff; border-right:1px solid #e2e8f0;    display:flex; flex-direction:column; min-height:0; }
  #tsp-msg .tm-sh { padding:16px 16px 10px; font-weight:800; font-size:16px; white-space:nowrap; }
  #tsp-msg .tm-list { flex:1; overflow:auto; min-height:0; }
  #tsp-msg .tm-list { padding-top:0 !important; margin-top:0 !important; }
  #tsp-msg .tm-hd { height:60px !important; min-height:60px !important; }
  #tsp-msg .tm-list > .tm-p:first-child { height:60px; box-sizing:border-box; border-bottom:1px solid #eef2f7; }
  #tsp-msg .tm-side { padding-top:0 !important; }
  #tsp-msg .tm-p { display:flex; gap:10px; align-items:center; padding:10px 14px; cursor:pointer; border:0; background:none; width:100%; text-align:left; font:inherit; color:inherit; }
  #tsp-msg .tm-p:hover { background:#f1f5f9; } #tsp-msg .tm-p.on { background:#eef2f7; box-shadow:inset 3px 0 0 #1e2a44; }
  #tsp-msg .tm-p .nm { font-weight:700; font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  #tsp-msg .tm-p .sb { font-weight:500; font-size:11.5px; color:#64748b; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:120px; }
  #tsp-msg .tm-p .ct { margin-left:auto; background:#e11d48; color:#fff; border-radius:999px; font-weight:800; font-size:10px; padding:2px 6px; flex:none; }
  .tm-av { width:32px; height:32px; border-radius:50%; flex:none; display:flex; align-items:center; justify-content:center; font-weight:800; font-size:11.5px; color:#fff; letter-spacing:.2px; }
  #tsp-msg .tm-main { flex:1; display:flex; flex-direction:column; min-width:0; background:#eef1f5; }
  #tsp-msg .tm-del { margin-left:auto; width:34px; height:34px; border:1px solid #e2e8f0; border-radius:10px; background:#fff; color:#64748b; display:none; align-items:center; justify-content:center; cursor:pointer; flex:none; } #tsp-msg .tm-del svg { width:17px; height:17px; fill:currentColor; } #tsp-msg .tm-del:hover { color:#dc2626; border-color:#fecaca; background:#fef2f2; } #tsp-msg .tm-del.on { display:inline-flex; } #tsp-msg .tm-del.on + .tm-x { margin-left:8px !important; }
  #tsp-msg .tm-hd { display:flex; align-items:center; gap:10px; padding:12px 14px 12px 16px; background:#fff; border-bottom:1px solid #eef2f7; min-height:56px; box-sizing:border-box; }
  #tsp-msg .tm-hd .tt { font-weight:800; font-size:14.5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  #tsp-msg .tm-hd .st { font-weight:600; font-size:11px; color:#64748b; white-space:nowrap; }
  #tsp-msg .tm-back { display:none; border:0; background:none; font-size:22px; line-height:1; padding:0 6px 0 0; cursor:pointer; color:#0f172a; }
  #tsp-msg .tm-x { margin-left:auto; border:0; background:none; color:#64748b; font:700 12.5px var(--tsp-ff, Inter, sans-serif); cursor:pointer; white-space:nowrap; padding:6px 4px; }
  #tsp-msg .tm-body { flex:1; overflow:auto; padding:16px; display:flex; flex-direction:column; gap:10px; min-height:0; }
  #tsp-msg .tm-day { align-self:center; font-weight:700; font-size:11px; color:#94a3b8; margin:6px 0 2px; }
  #tsp-msg .tm-r { display:flex; gap:8px; align-items:flex-end; max-width:82%; }
  #tsp-msg .tm-r.me { align-self:flex-end; flex-direction:row-reverse; }
  #tsp-msg .tm-col { display:flex; flex-direction:column; min-width:0; }
  #tsp-msg .tm-r.me .tm-col { align-items:flex-end; }
  #tsp-msg .tm-b { padding:9px 12px; border-radius:14px; font-size:13.5px; line-height:1.4; white-space:pre-wrap; word-break:break-word; background:#fff; box-shadow:0 1px 2px rgba(0,0,0,.06); border-bottom-left-radius:4px; }
  #tsp-msg .tm-r.me .tm-b { background:#0f172a; color:#fff; border-bottom-left-radius:14px; border-bottom-right-radius:4px; box-shadow:none; }
  #tsp-msg .tm-im { display:block; width:220px; max-width:100%; border-radius:12px; cursor:zoom-in; background:#e2e8f0; min-height:80px; object-fit:cover; }
  #tsp-msg .tm-t { font-weight:600; font-size:10.5px; color:#94a3b8; margin-top:3px; white-space:nowrap; }
  #tsp-msg .tm-rd { display:inline-flex; vertical-align:-3px; margin-left:4px; } #tsp-msg .tm-rd svg { width:14px; height:14px; display:block; }
  html[data-theme="dark"] #tsp-msg .tm-rd:not(.on) circle, html[data-theme="dark"] #tsp-msg .tm-rd:not(.on) path { stroke:#64748b; }
  .tm-ok { display:inline-flex; align-items:center; gap:4px; font-weight:800; font-size:11px; color:#059669; background:#ecfdf5; border-radius:999px; padding:3px 9px; margin-top:4px; white-space:nowrap; }
  #tsp-msg .tm-col > .tm-ok { align-self:flex-start; } #tsp-msg .tm-r.me .tm-col > .tm-ok { align-self:flex-end; }
  #tsp-msg .tm-x2 { display:none !important; }   
  html body #tsp-msg .tm-sh .tsp-gear { margin:0 0 0 auto; width:32px; padding:0; }   
  html body #tsp-msg .tm-sh .tsp-gear .tsp-rtl { display:none; }
  html body #tsp-msg .tm-sh .tsp-gear + .tsp-cx { margin-left:8px; }
  #tsp-msg .tm-sh { display:flex !important; align-items:center; height:60px; box-sizing:border-box; padding:0 16px; border-bottom:1px solid #e2e8f0; font:800 17.5px/1.2 'Inter', sans-serif; letter-spacing:-.2px; color:#0f172a; }
  #tsp-msg .tm-sh .tm-shi { display:inline-flex; align-items:center; gap:8px; } #tsp-msg .tm-sh .tm-shic { width:19px; height:19px; flex:none; }
  #tsp-msg .tm-list { padding-top:4px; }
  #tsp-msg .tm-av.tm-all svg { width:58%; height:58%; color:#fff; }   
  .tm-hc { min-width:240px; max-width:340px; white-space:normal !important; }
  .tm-hc .hc-t { display:flex; align-items:center; gap:7px; font-weight:800; font-size:11.5px; letter-spacing:.08em; color:#db2777; margin-bottom:7px; }
  .tm-hc .hc-t svg { width:16px; height:16px; fill:currentColor; flex:0 0 auto; }
  .tm-hc .hc-n { font-weight:700; font-size:15px; margin-bottom:3px; }
  .tm-hc .hc-a { display:block; font-size:13.5px; line-height:1.35; opacity:.8; }
  .tm-hc.hc-done { min-width:0 !important; max-width:340px; padding:7px 12px !important; opacity:.7; }
  .tm-hc .hc-dn { display:flex; align-items:center; gap:6px; font-size:12.5px; font-weight:600; white-space:nowrap; min-width:0; }
  .tm-hc .hc-dn svg { width:14px !important; height:14px !important; flex:0 0 14px; fill:currentColor; opacity:.8; }
  .tm-hc .hc-dn b { font-weight:800; letter-spacing:.06em; font-size:10.5px; flex:none; }
  .tm-hc .hc-dn span { overflow:hidden; text-overflow:ellipsis; min-width:0; }
  .tm-hc .hc-dn i { font-style:normal; flex:none; padding:1px 7px; border-radius:999px; font-size:10.5px; font-weight:800; background:rgba(148,163,184,.25); }
  .tm-hc .hc-w { display:flex; align-items:center; gap:6px; font-size:13px; margin-top:8px; }
  .tm-hc .hc-w svg { width:15px; height:15px; fill:currentColor; flex:0 0 auto; opacity:.75; }
  .tm-hc .hc-bt { display:flex; gap:8px; margin-top:11px; }
  .tm-hc .hc-tk { display:inline-flex; align-items:center; border-radius:10px; padding:8px 10px; font-weight:700; font-size:12px; background:rgba(15,23,42,.07); white-space:nowrap; }
  .tm-hc .hc-mp { flex:1; display:inline-flex; align-items:center; justify-content:center; gap:6px; border:0; border-radius:10px; padding:8px; font:700 13px var(--tsp-ff, Inter, sans-serif); cursor:pointer; background:#0f172a; color:#fff; white-space:nowrap; }
  .tm-hc .hc-mp svg { width:15px; height:15px; fill:currentColor; }
  .tm-hc .hc-f { margin-top:9px; font-size:11.5px; opacity:.6; }
  #tsp-msg .tm-r.me .tm-hc .hc-t { color:#f9a8d4; } #tsp-msg .tm-r.me .tm-hc .hc-mp { background:#fff; color:#0f172a; } #tsp-msg .tm-r.me .tm-hc .hc-tk { background:rgba(255,255,255,.12); }
  html[data-theme="dark"] #tsp-msg .tm-hc .hc-t, html[data-theme="dark"] #tsp-msg-pop .tm-hc .hc-t { color:#f9a8d4; } html[data-theme="dark"] #tsp-msg .tm-hc .hc-mp, html[data-theme="dark"] #tsp-msg-pop .tm-hc .hc-mp { background:#fff; color:#0f172a; } html[data-theme="dark"] #tsp-msg .tm-hc .hc-tk, html[data-theme="dark"] #tsp-msg-pop .tm-hc .hc-tk { background:rgba(255,255,255,.12); }
  html[data-theme="dark"] #tsp-msg .tm-r.me .tm-hc .hc-t { color:#db2777; } html[data-theme="dark"] #tsp-msg .tm-r.me .tm-hc .hc-mp { background:#0f172a; color:#fff; } html[data-theme="dark"] #tsp-msg .tm-r.me .tm-hc .hc-tk { background:rgba(15,23,42,.07); }
  #tsp-msg-pop .tm-hc { max-width:none; margin-top:6px; }
  #tsp-msg .tm-x.tsp-cx { margin-left:auto; }
  #tsp-msg .tm-qr button:disabled { opacity:.4; cursor:default; }
  #tsp-msg .tm-empty { margin:auto; color:#94a3b8; font-weight:600; font-size:13px; text-align:center; white-space:nowrap; }
  #tsp-msg .tm-qr { display:none; gap:8px; padding:8px 12px 0; background:#fff; border-top:1px solid #eef2f7; overflow-x:auto; }
  #tsp-msg.tech .tm-qr { display:flex; }
  #tsp-msg .tm-qr button { flex:none; height:32px; border:1px solid #e2e8f0; border-radius:999px; padding:0 13px; background:#fff; color:#0f172a; font:700 12px var(--tsp-ff, Inter, sans-serif); cursor:pointer; white-space:nowrap; }
  #tsp-msg .tm-qr button.ok { background:#059669; border-color:#059669; color:#fff; }
  #tsp-msg .tm-pv { display:none; padding:8px 12px 0; background:#fff; gap:8px; align-items:center; }
  #tsp-msg .tm-pv.on { display:flex; }
  #tsp-msg .tm-pv img { width:54px; height:54px; border-radius:9px; object-fit:cover; }
  #tsp-msg .tm-pv button { border:0; background:#f1f5f9; border-radius:8px; width:28px; height:28px; cursor:pointer; color:#475569; font-size:16px; }
  #tsp-msg .tm-in { display:flex; align-items:flex-end; gap:8px; padding:10px 12px; background:#fff; border-top:1px solid #eef2f7; }
  #tsp-msg.tech .tm-in, #tsp-msg .tm-pv.on + .tm-in { border-top:0; }
  #tsp-msg .tm-in textarea { flex:1; min-height:40px; max-height:120px; resize:none; border:0; outline:0; border-radius:10px; background:#f1f5f9; padding:10px 12px; font:500 13.5px/1.4 var(--tsp-ff, Inter, sans-serif); color:#0f172a; box-sizing:border-box; }
  #tsp-msg .tm-ic { width:40px; height:40px; flex:none; border:0; border-radius:10px; background:#f1f5f9; color:#334155; display:flex; align-items:center; justify-content:center; cursor:pointer; padding:0; }
  #tsp-msg .tm-ic.snd { background:#0f172a; color:#fff; }
  #tsp-msg .tm-ic:disabled { opacity:.45; cursor:default; }
  #tsp-msg.drag .tm-main { outline:2px dashed #334155; outline-offset:-6px; }
  #tsp-msg.solo .tm-side { display:none; }
  @media (min-width:761px) {
    #tsp-msg { top:var(--tm-top, 56px); right:0; bottom:0; width:620px; max-width:none; border-radius:0; border-left:1px solid #e9edf2; box-shadow:-10px 0 30px rgba(2,6,23,.10); z-index:9993; }
    #tsp-msg.tm-anim { animation:tspDockSlide var(--tsp-slide) ease-out; }
    html[data-theme="dark"] #tsp-msg { border-left-color:rgba(255,255,255,.08); }
  }
  @media (min-width:861px) {
    html.tsp-msg-open #split-layout-container, html.tsp-msg-open #admin-cal-wrapper { margin-right:620px !important; width:auto !important; max-width:calc(100% - 620px) !important; }
    html.tsp-msg-open.tsp-mail-open #tsp-msg { right:var(--mp-pw, 440px) !important; border-right:0 !important; }
    html.tsp-msg-open.tsp-mail-open:has(#mail-fly.on) #tsp-msg { right:calc(var(--mp-pw, 440px) + var(--mp-fw, 760px)) !important; }
    html.tsp-msg-open.tsp-mail-open #mail-fly { right:var(--mp-pw, 440px) !important; width:var(--mp-fw, 760px) !important; max-width:calc(100vw - var(--mp-pw, 440px) - 620px) !important; box-shadow:none !important; border-radius:0 !important; border-left:1px solid #e2e8f0 !important; border-right:0 !important; }
    html.tsp-msg-open.tsp-mail-open #mail-panel { box-shadow:none !important; border-left:1px solid #e2e8f0 !important; }
    html.tsp-msg-open.tsp-mail-open #split-layout-container, html.tsp-msg-open.tsp-mail-open #admin-cal-wrapper { margin-right:calc(620px + var(--mp-pw, 440px)) !important; max-width:calc(100% - 620px - var(--mp-pw, 440px)) !important; }
  }
  #tsp-msg-btn.tsp-on { }
  #tsp-msg-pop { display:none; position:fixed; left:50%; top:70px; transform:translateX(-50%); width:440px; max-width:calc(100vw - 20px); z-index:2147482500; background:#fff; border-radius:16px; box-shadow:0 18px 44px rgba(15,23,42,.32); overflow:hidden; font-family:var(--tsp-ff, Inter, sans-serif); color:#0f172a; animation:tmIn .22s ease; }
  #tsp-msg-pop.on { display:block; }
  @keyframes tmIn { from { opacity:0; transform:translate(-50%, -10px); } to { opacity:1; transform:translate(-50%, 0); } }
  #tsp-msg-pop .pp-a { display:flex; gap:12px; padding:16px 16px 12px; }
  #tsp-msg-pop .pp-a .tm-av { width:40px; height:40px; font-size:13px; }
  #tsp-msg-pop .pp-n { display:flex; justify-content:space-between; gap:10px; font-weight:800; font-size:14px; white-space:nowrap; }
  #tsp-msg-pop .pp-n span { font-weight:600; font-size:11px; color:#94a3b8; }
  #tsp-msg-pop .pp-t { font-size:13.5px; line-height:1.4; margin-top:4px; white-space:pre-wrap; word-break:break-word; max-height:130px; overflow:auto; }
  #tsp-msg-pop .pp-i { display:block; width:100%; max-height:170px; object-fit:cover; border-radius:10px; margin-top:10px; background:#e2e8f0; }
  #tsp-msg-pop .pp-more { font-weight:700; font-size:11.5px; color:#64748b; margin-top:6px; }
  #tsp-msg-pop .pp-b { display:flex; gap:8px; padding:0 16px 16px; }
  #tsp-msg-pop .pp-b button { flex:1; height:42px; border-radius:10px; font:800 13px var(--tsp-ff, Inter, sans-serif); cursor:pointer; white-space:nowrap; border:1px solid #e2e8f0; background:#fff; color:#0f172a; }
  #tsp-msg-pop .pp-b .ok { background:#059669; border-color:#059669; color:#fff; }
  #tsp-msg-pop .pp-b .lt { flex:0 0 84px; background:#f1f5f9; border-color:#f1f5f9; color:#475569; font-weight:700; }
  #tsp-msg-big { display:none; position:fixed; inset:0; z-index:2147483000; background:rgba(15,23,42,.88); align-items:center; justify-content:center; cursor:zoom-out; }
  #tsp-msg-big.on { display:flex; } #tsp-msg-big img { max-width:94vw; max-height:92vh; border-radius:8px; }
  html[data-theme="dark"] #tsp-msg, html[data-theme="dark"] #tsp-msg-pop { background:#1d222b; color:#eef2f7; }
  html[data-theme="dark"] #tsp-msg .tm-side { background:#161a21; border-color:rgba(255,255,255,.06); }
  html[data-theme="dark"] #tsp-msg .tm-main { background:#12161c; }
  html[data-theme="dark"] #tsp-msg .tm-hd, html[data-theme="dark"] #tsp-msg .tm-in, html[data-theme="dark"] #tsp-msg .tm-qr, html[data-theme="dark"] #tsp-msg .tm-pv { background:#1d222b; border-color:rgba(255,255,255,.06); }
  html[data-theme="dark"] #tsp-msg .tm-b { background:#262c37; color:#eef2f7; }
  html[data-theme="dark"] #tsp-msg .tm-r.me .tm-b { background:#e2e8f0; color:#0f172a; }
  html[data-theme="dark"] #tsp-msg .tm-in textarea, html[data-theme="dark"] #tsp-msg .tm-ic:not(.snd) { background:#262c37; color:#eef2f7; }
  html[data-theme="dark"] #tsp-msg .tm-p:hover, html[data-theme="dark"] #tsp-msg .tm-p.on { background:#262c37; }
  html[data-theme="dark"] #tsp-msg .tm-hd .tt, html[data-theme="dark"] #tsp-msg .tm-back { color:#eef2f7; }
  html[data-theme="dark"] #tsp-msg .tm-qr button:not(.ok), html[data-theme="dark"] #tsp-msg-pop .pp-b button:not(.ok) { background:#262c37; color:#eef2f7; border-color:rgba(255,255,255,.1); }
  @media (max-width:760px) {
    #tsp-msg { inset:0; width:auto; max-width:none; border-radius:0; top:0; right:0; bottom:0; left:0; }
    #tsp-msg .tm-side { width:100%; border-right:0; }
    #tsp-msg.thread .tm-side { display:none; }
    #tsp-msg:not(.thread):not(.solo) .tm-main { display:none; }
    #tsp-msg .tm-back { display:block; }
    #tsp-msg .tm-x2 { display:inline-flex !important; margin-left:auto; }
    #tsp-msg.solo .tm-back { display:none; }
    #tsp-msg .tm-hd { padding-top:calc(env(safe-area-inset-top) + 12px); }
    #tsp-msg .tm-sh { padding-top:calc(env(safe-area-inset-top) + 16px); display:flex; justify-content:space-between; align-items:center; height:auto; padding-bottom:10px; }
    #tsp-msg .tm-in { padding-bottom:calc(env(safe-area-inset-bottom) + 10px); }
    #tsp-msg .tm-r { max-width:88%; }
    #tsp-msg .tm-im { width:200px; }
    #tsp-msg-pop { top:calc(env(safe-area-inset-top) + 10px); }
  }
