/* SaleGuide Inbox v2 — design language in docs/DESIGN.md (Miro canvas + panels, ClickUp rail, sidebar, composer). */
:root{
  --ink:#0b0d17;--ink-2:#23263a;--text:#0b0d17;--muted:#5b6072;--subtle:#8b90a0;
  --line:#e9e9ec;--line-2:#dcdde2;--surface:#fff;--canvas:#f2f2f0;--sunken:#f4f4f2;--hover:#f7f7f5;
  --accent:#6b4eff;--accent-hover:#5a3df0;--accent-soft:#efeaff;--accent-ink:#3b22c9;--spark:#ffd02f;
  --wash:linear-gradient(180deg,#f6e9f5 0%,#f1ecff 45%,#fff 100%);
  --brand-grad:linear-gradient(135deg,#7b5cff 0%,#4f8bff 100%);
  --rail:#1c1650;--rail-2:#30258c;--rail-tx:#b9b5d8;
  --green:#12b76a;--amber:#f79009;--red:#f04438;--blue:#2e90fa;
  --green-soft:#e3f8ee;--amber-soft:#fff3dc;--red-soft:#fee9e7;--grey-soft:#eeeef0;
  --note:#fff7df;--note-line:#f6e2a4;--note-tx:#5c4500;
  --bubble:#0b0d17;--bubble-tx:#fff;--btn:#0b0d17;--btn-tx:#fff;--btn-h:#23263a;
  --r-xs:6px;--r-sm:8px;--r:10px;--r-md:12px;--r-lg:16px;--r-xl:20px;
  --sh-sm:0 1px 2px rgba(11,13,23,.05);
  --sh-md:0 8px 24px -8px rgba(11,13,23,.12),0 2px 6px rgba(11,13,23,.04);
  --sh-lg:0 24px 60px -16px rgba(11,13,23,.22),0 4px 12px rgba(11,13,23,.06);
  --ring:0 0 0 3px rgba(107,78,255,.22);
  --font:"Inter",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  --e:cubic-bezier(.2,.8,.2,1);
  color-scheme:light;
}
:root[data-theme=dark]{
  --ink:#f2f3f7;--ink-2:#fff;--text:#f2f3f7;--muted:#a0a5b5;--subtle:#767b8c;
  --line:#2e3142;--line-2:#3d4157;--surface:#181a24;--canvas:#0c0d13;--sunken:#242735;--hover:#1e212d;
  --accent:#8b74ff;--accent-hover:#9d89ff;--accent-soft:#2f2860;--accent-ink:#cfc5ff;
  --wash:linear-gradient(180deg,#1f1a3a 0%,#16171f 100%);
  --rail:#120e33;--rail-2:#221a5e;
  --green-soft:#11301f;--amber-soft:#3a2a0b;--red-soft:#3b1614;--grey-soft:#262835;
  --note:#2e2710;--note-line:#57481a;--note-tx:#f6e2a4;
  --bubble:#f2f3f7;--bubble-tx:#0b0d17;--btn:#f2f3f7;--btn-tx:#0b0d17;--btn-h:#fff;
  --sh-sm:0 1px 2px rgba(0,0,0,.4);--sh-md:0 8px 24px -8px rgba(0,0,0,.6);--sh-lg:0 24px 60px -16px rgba(0,0,0,.7),0 0 0 1px #262835;
  color-scheme:dark;
}
@media (prefers-color-scheme:dark){:root:not([data-theme=light]){
  --ink:#f2f3f7;--ink-2:#fff;--text:#f2f3f7;--muted:#a0a5b5;--subtle:#767b8c;
  --line:#2e3142;--line-2:#3d4157;--surface:#181a24;--canvas:#0c0d13;--sunken:#242735;--hover:#1e212d;
  --accent:#8b74ff;--accent-hover:#9d89ff;--accent-soft:#2f2860;--accent-ink:#cfc5ff;
  --wash:linear-gradient(180deg,#1f1a3a 0%,#16171f 100%);
  --rail:#120e33;--rail-2:#221a5e;
  --green-soft:#11301f;--amber-soft:#3a2a0b;--red-soft:#3b1614;--grey-soft:#262835;
  --note:#2e2710;--note-line:#57481a;--note-tx:#f6e2a4;
  --bubble:#f2f3f7;--bubble-tx:#0b0d17;--btn:#f2f3f7;--btn-tx:#0b0d17;--btn-h:#fff;
  --sh-sm:0 1px 2px rgba(0,0,0,.4);--sh-md:0 8px 24px -8px rgba(0,0,0,.6);--sh-lg:0 24px 60px -16px rgba(0,0,0,.7),0 0 0 1px #262835;
  color-scheme:dark;
}}

*{box-sizing:border-box}
html,body{height:100%;margin:0}
body{font:13.5px/1.45 var(--font);color:var(--text);background:var(--canvas);-webkit-font-smoothing:antialiased;overflow:hidden;font-feature-settings:"cv11","ss01"}
button,input,textarea{font:inherit;color:inherit}
button{cursor:pointer;background:none;border:0;padding:0;text-align:inherit}
a{color:var(--accent-ink);text-decoration:none}a:hover{text-decoration:underline}
h1,h2{margin:0;letter-spacing:-.025em}
small{color:var(--muted)}
em{font-style:normal}
:focus{outline:none}:focus-visible{box-shadow:var(--ring);border-radius:var(--r-sm)}
::selection{background:var(--accent-soft)}
#app{height:100%}
.sg-hide{display:none!important}.sg-sp{flex:1}
.sg-boot{display:grid;place-items:center}
.sg-boot__mark,.sg-mark{width:32px;height:32px;border-radius:10px;background:var(--brand-grad);display:grid;place-items:center;flex:none;box-shadow:inset 0 1px 0 rgba(255,255,255,.25)}
.sg-boot__mark{animation:sg-pulse 1.2s ease-in-out infinite}
.sg-mark--lg{width:44px;height:44px;border-radius:14px}.sg-mark--lg svg{width:22px;height:22px}
@keyframes sg-pulse{50%{transform:scale(.9);opacity:.6}}
@keyframes sg-in{from{opacity:0;transform:translateY(4px)}}
@keyframes sg-pop{from{opacity:0;transform:translateY(6px) scale(.98)}}
@keyframes sg-shim{to{background-position:-200% 0}}

/* avatars: initials on a soft tint */
.sg-av{position:relative;width:32px;height:32px;border-radius:50%;display:inline-grid;place-items:center;flex:none;font-size:12px;font-weight:650;letter-spacing:-.01em;background:var(--accent-soft);color:var(--accent-ink)}
.sg-av--xs{width:20px;height:20px;font-size:9px}.sg-av--sm{width:28px;height:28px;font-size:10.5px}.sg-av--md{width:36px;height:36px;font-size:12.5px}.sg-av--lg{width:64px;height:64px;font-size:21px}
.sg-h0{background:#efeaff;color:#4a2fd6}.sg-h1{background:#e2f1ff;color:#1265b8}.sg-h2{background:#e3f8ee;color:#0a7d48}.sg-h3{background:#fff0df;color:#a85b00}
.sg-h4{background:#ffe8f1;color:#b41a5c}.sg-h5{background:#e6f6f6;color:#0b6f73}.sg-h6{background:#fdf3c8;color:#7a5a00}.sg-h7{background:#eceef3;color:#3d4357}
.sg-av--bot{background:var(--brand-grad);color:#fff}
.sg-av__on{position:absolute;right:-1px;bottom:-1px;width:10px;height:10px;border-radius:50%;background:var(--green);border:2px solid var(--surface)}
.sg-av--lg .sg-av__on{width:14px;height:14px;right:2px;bottom:2px;border-width:3px}.sg-av--xs .sg-av__on{width:8px;height:8px;right:-2px;bottom:-2px}
.sg-av__on.is-away{background:var(--amber)}

/* buttons & inputs */
.sg-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:36px;padding:0 14px;border-radius:var(--r);border:1px solid var(--line-2);background:var(--surface);font-weight:600;font-size:13px;white-space:nowrap;transition:background .16s var(--e),border-color .16s var(--e),transform .1s}
.sg-btn:hover{background:var(--sunken)}.sg-btn:active{transform:scale(.98)}
.sg-btn:disabled{opacity:.45;cursor:not-allowed;transform:none}
.sg-btn--primary{background:var(--btn);border-color:var(--btn);color:var(--btn-tx)}.sg-btn--primary:hover{background:var(--btn-h);border-color:var(--btn-h)}
.sg-btn--accent{background:var(--accent);border-color:var(--accent);color:#fff}.sg-btn--accent:hover{background:var(--accent-hover);border-color:var(--accent-hover)}
.sg-btn--ghost{border-color:transparent;background:none;color:var(--muted)}.sg-btn--ghost:hover{color:var(--text)}
.sg-btn--sm{height:32px;padding:0 11px;font-size:12.5px;border-radius:9px}.sg-btn--lg{height:42px;font-size:14px;border-radius:var(--r-md)}
.sg-ib{width:32px;height:32px;border-radius:9px;display:inline-grid;place-items:center;color:var(--muted);flex:none;transition:background .16s,color .16s}
.sg-ib:hover,.sg-ib.is-on{background:var(--sunken);color:var(--text)}
.sg-input{width:100%;height:40px;padding:0 12px;border:1px solid var(--line-2);border-radius:var(--r);background:var(--surface);transition:border-color .16s,box-shadow .16s}
.sg-input::placeholder,textarea::placeholder,input::placeholder{color:var(--subtle)}
.sg-input:focus{border-color:var(--accent);box-shadow:var(--ring)}
.sg-field{display:grid;gap:6px;font-size:12.5px;font-weight:600;text-align:left}
.sg-err{padding:10px 12px;border-radius:var(--r);background:var(--red-soft);color:var(--red);font-weight:550;font-size:13px}
.sg-switch{appearance:none;width:32px;height:18px;border-radius:99px;background:var(--line-2);position:relative;cursor:pointer;flex:none;margin:0;transition:background .16s}
.sg-switch::after{content:"";position:absolute;top:2px;left:2px;width:14px;height:14px;border-radius:50%;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.25);transition:transform .18s var(--e)}
.sg-switch:checked{background:var(--accent)}.sg-switch:checked::after{transform:translateX(14px)}
.sg-seg{display:inline-flex;padding:2px;border-radius:9px;background:var(--sunken);gap:1px}
.sg-seg button{height:24px;padding:0 9px;border-radius:7px;font-size:12px;font-weight:550;color:var(--muted)}
.sg-seg button.is-on{background:var(--surface);color:var(--text);box-shadow:var(--sh-sm)}
kbd{font:600 11px/1 var(--font);padding:4px 6px;border-radius:6px;background:var(--sunken);border:1px solid var(--line);color:var(--muted);white-space:nowrap}
code{font:600 12px ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.04em}

/* pills, dots, counts */
.sg-pill{display:inline-flex;align-items:center;gap:5px;height:20px;padding:0 8px;border-radius:99px;font-size:11.5px;font-weight:600;white-space:nowrap;background:var(--grey-soft);color:var(--muted)}
.sg-pill i{width:6px;height:6px;border-radius:50%;background:currentColor}
.sg-pill--open{background:var(--green-soft);color:#0a7d48}.sg-pill--bot{background:var(--accent-soft);color:var(--accent-ink)}.sg-pill--pending{background:var(--amber-soft);color:#a85b00}
:root[data-theme=dark] .sg-pill--open{color:#4ade95}:root[data-theme=dark] .sg-pill--pending{color:#fbbf5a}
@media (prefers-color-scheme:dark){:root:not([data-theme=light]) .sg-pill--open{color:#4ade95}:root:not([data-theme=light]) .sg-pill--pending{color:#fbbf5a}}
.sg-dot{width:8px;height:8px;border-radius:50%;background:var(--subtle);flex:none;display:inline-block}
.sg-dot--green{background:var(--green)}.sg-dot--amber{background:var(--amber)}.sg-dot--violet{background:var(--accent)}.sg-dot--grey{background:var(--line-2)}
.sg-dot--pulse{box-shadow:0 0 0 0 rgba(18,183,106,.5);animation:sg-ring 2s infinite}
@keyframes sg-ring{70%{box-shadow:0 0 0 6px rgba(18,183,106,0)}100%{box-shadow:0 0 0 0 rgba(18,183,106,0)}}
.sg-badge{margin-left:auto;display:inline-flex;align-items:center;height:20px;padding:0 8px;border-radius:99px;background:var(--sunken);color:var(--muted);font-size:11px;font-weight:600;text-transform:capitalize;white-space:nowrap}
.sg-badge--accent{background:var(--accent-soft);color:var(--accent-ink);text-transform:none}
.sg-count{min-width:18px;height:18px;padding:0 5px;border-radius:99px;background:var(--accent);color:#fff;font-size:10.5px;font-weight:700;display:inline-grid;place-items:center;margin-left:auto}
.sg-hint{color:var(--subtle);font-size:12px;white-space:nowrap}
.sg-mute{display:flex;align-items:center;gap:8px;color:var(--subtle);font-size:13px;padding:2px 0}
.sg-dim{color:var(--subtle);font-style:normal}
.sg-stars{color:var(--amber);letter-spacing:1px}.sg-stars i{color:var(--line-2);font-style:normal}
.sg-on{color:var(--green);font-weight:600}.sg-sep{margin:0 6px;color:var(--line-2);font-style:normal}
.sg-toast{position:fixed;left:50%;bottom:28px;transform:translateX(-50%);z-index:90;background:#0b0d17;color:#fff;padding:10px 16px;border-radius:var(--r-md);font-weight:550;box-shadow:var(--sh-lg);animation:sg-pop .2s var(--e)}

/* empty + skeleton */
.sg-empty{display:grid;justify-items:center;gap:6px;text-align:center;padding:44px 24px;color:var(--muted);max-width:360px;margin:0 auto}
.sg-empty b{font-size:15px;font-weight:650;color:var(--text);letter-spacing:-.015em}.sg-empty .sg-btn{margin-top:10px}
.sg-empty__art{width:48px;height:48px;border-radius:14px;background:var(--accent-soft);color:var(--accent);display:grid;place-items:center;margin-bottom:6px}
.sg-blank{height:100%;display:grid;align-content:center;justify-items:center;padding:24px}
.sg-tips{list-style:none;margin:8px 0 0;padding:0;display:grid;gap:8px;width:min(340px,100%)}
.sg-tips li{display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:var(--r-md);background:var(--sunken);color:var(--muted);font-weight:500}
.sg-tips li>:first-child{flex:none;min-width:22px;text-align:center;color:var(--text)}
.sg-skel{display:flex;gap:12px;padding:14px 16px;align-items:center}
.sg-skel i,.sg-skel b,.sg-mskel{background:linear-gradient(90deg,var(--sunken) 25%,var(--line) 37%,var(--sunken) 63%);background-size:200% 100%;animation:sg-shim 1.3s linear infinite}
.sg-skel i{width:36px;height:36px;border-radius:50%;flex:none}.sg-skel span{flex:1;display:grid;gap:8px}
.sg-skel b{height:10px;border-radius:6px;width:55%}.sg-skel b+b{width:85%}
.sg-mskel{height:44px;width:48%;border-radius:18px;margin:8px 0}.sg-mskel--r{margin-left:auto;width:40%}

/* login */
.sg-login{min-height:100%;display:grid;align-content:center;justify-items:center;gap:20px;padding:24px;background:var(--wash),var(--surface);background-repeat:no-repeat;background-size:100% 46%,auto;overflow:auto;height:100%}
.sg-login__card{width:min(400px,100%);display:grid;gap:14px;justify-items:stretch;text-align:center}
.sg-login__card .sg-mark{justify-self:center;margin-bottom:6px}
.sg-login__card h1{font-size:26px;font-weight:700;letter-spacing:-.03em}
.sg-login__card p{margin:-8px 0 8px;color:var(--muted);font-size:14px}
.sg-login__card .sg-btn{margin-top:4px}
.sg-login__foot{margin-top:6px;padding:12px 14px;border-radius:var(--r-md);background:var(--sunken);color:var(--muted);font-size:12.5px;text-align:left}
.sg-login__help{color:var(--subtle);font-size:12px}

/* app frame */
.sg-app{height:100%;display:flex;background:linear-gradient(180deg,var(--rail-2) 0%,var(--rail) 70%)}
.sg-rail{width:64px;flex:none;display:flex;flex-direction:column;align-items:center;gap:4px;padding:12px 0 calc(12px + env(safe-area-inset-bottom));color:var(--rail-tx)}
.sg-rail .sg-mark{margin-bottom:12px}
.sg-rail__btn{width:56px;display:grid;justify-items:center;gap:4px;padding:4px 0;font-size:10.5px;font-weight:550;color:var(--rail-tx);border-radius:10px}
.sg-rail__ic{position:relative;width:36px;height:36px;border-radius:10px;display:grid;place-items:center;transition:background .16s,color .16s}
.sg-rail__btn:hover .sg-rail__ic{background:rgba(255,255,255,.1);color:#fff}
.sg-rail__btn.is-on{color:#fff}.sg-rail__btn.is-on .sg-rail__ic{background:#fff;color:#1c1650}
.sg-rail__n{position:absolute;top:-4px;right:-6px;min-width:17px;height:17px;padding:0 4px;border-radius:99px;background:var(--accent);color:#fff;font:700 10px/17px var(--font);text-align:center;font-style:normal;box-shadow:0 0 0 2px var(--rail)}
.sg-rail__sp{flex:1}
.sg-me{margin-top:6px;border-radius:50%;padding:2px;border:2px solid transparent;transition:border-color .16s}.sg-me:hover{border-color:rgba(255,255,255,.25)}
.sg-me .sg-av__on{border-color:var(--rail)}
.sg-work{flex:1;min-width:0;display:flex;position:relative;margin:8px 8px 8px 0;background:var(--surface);border-radius:var(--r-lg);overflow:hidden;box-shadow:0 0 0 1px rgba(255,255,255,.06)}

/* sidebar */
.sg-side{width:248px;flex:none;display:flex;flex-direction:column;border-right:1px solid var(--line);background:var(--surface)}
.sg-side__head{display:flex;align-items:center;gap:8px;height:56px;padding:0 10px 0 18px;flex:none}
.sg-side__head h1{font-size:17px;font-weight:700}
.sg-live{display:inline-flex;align-items:center;gap:5px;font-size:11.5px;font-weight:600;color:var(--subtle)}
.sg-live i{width:7px;height:7px;border-radius:50%;background:var(--amber)}
.sg-live.is-on{color:var(--green)}.sg-live.is-on i{background:var(--green)}
.sg-side__scroll{flex:1;overflow-y:auto;padding:0 10px 12px}
.sg-side__sec{padding:8px 0}.sg-side__sec+.sg-side__sec{border-top:1px solid var(--line)}
.sg-side__lbl,.sg-menu__sec{padding:8px 8px 6px;font-size:12px;font-weight:550;color:var(--subtle)}
.sg-nav{width:100%;display:flex;align-items:center;gap:10px;min-height:32px;padding:5px 8px;border-radius:var(--r-sm);color:var(--muted);font-weight:500;transition:background .14s,color .14s}
button.sg-nav:hover{background:var(--hover);color:var(--text)}
.sg-nav.is-on{background:var(--sunken);color:var(--text);font-weight:600}
.sg-nav__ic{width:20px;display:grid;place-items:center;flex:none}
.sg-nav__t{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sg-nav__t em,.sg-opt__l em{margin-left:4px;font-size:11px;color:var(--subtle);font-weight:500}
.sg-nav__n{font-size:12px;color:var(--subtle);font-variant-numeric:tabular-nums;font-weight:500}
.sg-nav.is-on .sg-nav__n{color:var(--text)}
.sg-nav--static{cursor:default}.sg-nav--mute{color:var(--subtle)}
.sg-side__foot{display:flex;align-items:center;gap:8px;padding:12px 18px;border-top:1px solid var(--line);font-size:12.5px;color:var(--muted);font-weight:550}
.sg-side__shop{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sg-plan{padding:2px 8px;border-radius:99px;background:var(--accent-soft);color:var(--accent-ink);font-size:11px;font-weight:650}

/* conversation list */
.sg-list{width:340px;flex:none;display:flex;flex-direction:column;border-right:1px solid var(--line);min-width:0}
.sg-list__head{display:flex;align-items:center;gap:6px;height:56px;padding:0 10px 0 16px;flex:none}
.sg-list__title{display:inline-flex;align-items:center;gap:6px;height:32px;padding:0 6px;margin-left:-6px;border-radius:var(--r-sm);font-size:15px;letter-spacing:-.015em}
.sg-list__title b{font-weight:650}.sg-list__title svg{color:var(--subtle);display:none}
.sg-search{display:flex;align-items:center;gap:8px;height:36px;margin:0 12px 8px;padding:0 11px;border-radius:var(--r);background:var(--sunken);color:var(--subtle);border:1px solid transparent;flex:none;transition:border-color .16s,box-shadow .16s,background .16s}
.sg-search:focus-within{background:var(--surface);border-color:var(--accent);box-shadow:var(--ring)}
.sg-search input{flex:1;min-width:0;border:0;background:none;height:100%;color:var(--text)}
.sg-search input::-webkit-search-cancel-button{display:none}
.sg-convs{flex:1;overflow-y:auto;padding:0 8px 8px}
.sg-conv{position:relative;width:100%;display:flex;gap:11px;padding:12px 10px;border-radius:var(--r-md);transition:background .14s}
.sg-conv:hover{background:var(--hover)}
.sg-conv.is-on{background:var(--sunken)}
.sg-conv.is-on::before{content:"";position:absolute;left:0;top:12px;bottom:12px;width:2px;border-radius:2px;background:var(--accent)}
.sg-conv__body{flex:1;min-width:0;display:grid;gap:3px}
.sg-conv__top{display:flex;align-items:baseline;gap:6px}
.sg-conv__name{font-weight:550;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sg-conv__flag{font-size:12px}
.sg-conv__time{margin-left:auto;font-size:11.5px;color:var(--subtle);flex:none}
.sg-conv__msg{color:var(--muted);font-size:13px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;line-height:1.4}
.sg-conv.is-unread .sg-conv__name{font-weight:700}.sg-conv.is-unread .sg-conv__msg{color:var(--text)}.sg-conv.is-unread .sg-conv__time{color:var(--accent);font-weight:600}
.sg-conv__meta{display:flex;align-items:center;gap:8px;margin-top:3px;min-width:0}
.sg-conv__page{display:inline-flex;align-items:center;gap:4px;font-size:11.5px;color:var(--subtle);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.sg-typing-t{color:var(--accent);font-weight:550}

/* thread */
.sg-thread{flex:1;min-width:0;display:flex;flex-direction:column;background:var(--surface);container-type:inline-size}
@container (max-width:620px){.sg-thead .sg-cq{display:none}}
.sg-thead{display:flex;align-items:center;gap:10px;height:56px;padding:0 12px 0 18px;border-bottom:1px solid var(--line);flex:none}
.sg-back{display:none}
.sg-thead__who{display:flex;align-items:center;gap:11px;min-width:0;flex:1}
.sg-thead__who>div{min-width:0;display:grid}
.sg-thead__who b{font-size:14.5px;font-weight:650;letter-spacing:-.015em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sg-thead__who small{font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sg-thead__act{display:flex;align-items:center;gap:8px;flex:none}
.sg-msgs{flex:1;overflow-y:auto;padding:8px 20px 12px;overscroll-behavior:contain}
.sg-msgs__in{max-width:760px;margin:0 auto;display:flex;flex-direction:column}
.sg-day{display:flex;align-items:center;gap:12px;margin:18px 0 8px;color:var(--subtle);font-size:12px;font-weight:550}
.sg-day::before,.sg-day::after{content:"";flex:1;height:1px;background:var(--line)}
.sg-sys{align-self:center;margin:8px 0;padding:5px 12px;border-radius:99px;background:var(--sunken);color:var(--muted);font-size:12px;font-weight:500;text-align:center;max-width:90%}
.sg-m{display:flex;gap:10px;align-items:flex-end;margin-top:3px;max-width:86%;animation:sg-in .2s var(--e)}
.sg-m--grp{margin-top:14px}
.sg-m--out{align-self:flex-end;flex-direction:row-reverse}
.sg-m__gap{width:28px;flex:none}
.sg-m__col{display:flex;flex-direction:column;gap:4px;min-width:0;align-items:flex-start}
.sg-m--out .sg-m__col{align-items:flex-end}
.sg-m__who{font-size:12px;font-weight:600;color:var(--muted);margin:0 4px}
.sg-m__time{font-size:11px;color:var(--subtle);margin:0 4px}
.sg-m__fail{color:var(--red);font-weight:600;font-size:11.5px}.sg-m__fail:hover{text-decoration:underline}
.sg-m.is-pending .sg-b{opacity:.6}.sg-m.is-failed .sg-b{box-shadow:0 0 0 1.5px var(--red)}
.sg-b{padding:9px 14px;border-radius:18px;font-size:14px;line-height:1.5;overflow-wrap:anywhere;max-width:100%}
.sg-b a{color:inherit;text-decoration:underline}
.sg-m--in .sg-b{background:var(--surface);border:1px solid var(--line-2)}
.sg-m--in.sg-m--end .sg-b:last-of-type{border-bottom-left-radius:6px}
.sg-m--agent .sg-b{background:var(--bubble);color:var(--bubble-tx)}
.sg-m--bot .sg-b{background:var(--accent-soft);color:var(--text)}
.sg-m--note .sg-b{background:var(--note);color:var(--note-tx);border:1px solid var(--note-line)}
.sg-m--note .sg-m__who{color:#a87b00}
.sg-m--out.sg-m--end .sg-b:last-of-type{border-bottom-right-radius:6px}
.sg-typing{display:flex;gap:4px;padding:13px 14px;border-radius:18px 18px 18px 6px;border:1px solid var(--line-2)}
.sg-typing i{width:6px;height:6px;border-radius:50%;background:var(--subtle);animation:sg-bounce 1.1s infinite}
.sg-typing i:nth-child(2){animation-delay:.15s}.sg-typing i:nth-child(3){animation-delay:.3s}
@keyframes sg-bounce{30%{transform:translateY(-4px);opacity:.5}}

/* rich cards */
.sg-cards{display:flex;gap:8px;max-width:100%;overflow-x:auto;padding:2px;scrollbar-width:thin}
.sg-pc{width:148px;flex:none;border:1px solid var(--line);border-radius:var(--r-lg);overflow:hidden;background:var(--surface);color:var(--text);transition:box-shadow .16s,transform .16s}
.sg-pc:hover{text-decoration:none;box-shadow:var(--sh-md);transform:translateY(-1px)}
.sg-pc__img{display:grid;place-items:center;aspect-ratio:1;background:var(--sunken) center/cover no-repeat;color:var(--line-2)}
.sg-pc__b{display:grid;gap:3px;padding:10px 11px 11px}
.sg-pc__t{font-size:12.5px;font-weight:600;line-height:1.3;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.sg-pc__p{font-size:12.5px;font-weight:650}.sg-pc__p s{margin-left:6px;color:var(--subtle);font-weight:450}
.sg-pc__v{font-size:11px;color:var(--subtle)}
.sg-card{width:300px;max-width:100%;border:1px solid var(--line);border-radius:var(--r-lg);background:var(--surface);padding:12px 14px;display:grid;gap:8px;font-size:13px;text-align:left;color:var(--text)}
.sg-card__h{display:flex;align-items:center;gap:9px}.sg-card__h b{font-weight:650;letter-spacing:-.01em}
.sg-card__ic,.sg-opt__ic{width:28px;height:28px;border-radius:9px;background:var(--sunken);color:var(--muted);display:grid;place-items:center;flex:none}
.sg-card__row{display:flex;justify-content:space-between;align-items:center;gap:12px;color:var(--muted);min-height:22px}
.sg-card__row b{color:var(--text);font-weight:600;text-align:right;overflow-wrap:anywhere}
.sg-card__link{display:inline-flex;align-items:center;gap:4px;font-weight:600;font-size:12.5px}
.sg-card__fields{display:flex;flex-wrap:wrap;gap:6px}
.sg-card__fields span{padding:4px 10px;border-radius:8px;border:1px dashed var(--line-2);color:var(--muted);font-size:12px}
.sg-card .sg-cards{margin:0 -2px}.sg-card .sg-pc{width:124px}
.sg-steps{display:flex;gap:4px}.sg-steps i{flex:1;height:4px;border-radius:4px;background:var(--line)}.sg-steps i.is-on{background:var(--accent)}
.sg-ticket{width:300px;max-width:100%;display:flex;border:1px solid var(--line);border-radius:var(--r-lg);background:var(--surface);color:var(--text);text-align:left;overflow:hidden}
.sg-ticket__t{flex:1;min-width:0;display:grid;gap:2px;padding:12px 14px}.sg-ticket__t b{font-weight:650}.sg-ticket__t span{font-size:12px;color:var(--muted)}
.sg-ticket__c{display:grid;place-items:center;padding:0 14px;border-left:1.5px dashed var(--line-2);background:var(--sunken)}
.sg-qr{display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-end}
.sg-qr span{padding:5px 12px;border-radius:99px;border:1px solid var(--line-2);font-size:12.5px;font-weight:550;color:var(--muted);background:var(--surface)}
.sg-tbl{width:100%;border-collapse:collapse;font-size:12px}
.sg-tbl th{text-align:left;color:var(--subtle);font-weight:550;padding:4px 6px}.sg-tbl td{padding:5px 6px;border-top:1px solid var(--line)}
.sg-tbl tr.is-rec td{background:var(--accent-soft);font-weight:650}

/* composer (ClickUp card) */
.sg-compw{padding:0 20px 16px;flex:none}
.sg-comp{position:relative;max-width:760px;margin:0 auto;border:1px solid var(--line-2);border-radius:var(--r-lg);background:var(--surface);box-shadow:var(--sh-sm);transition:border-color .16s,box-shadow .16s}
.sg-comp:focus-within{border-color:var(--accent);box-shadow:var(--ring)}
.sg-comp.is-note{background:var(--note);border-color:var(--note-line)}.sg-comp.is-note:focus-within{box-shadow:0 0 0 3px rgba(247,144,9,.18)}
.sg-comp__tabs{display:flex;gap:2px;padding:8px 8px 0}
.sg-ctab{display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 10px;border-radius:8px;font-size:12.5px;font-weight:600;color:var(--subtle)}
.sg-ctab:hover{color:var(--text)}.sg-ctab.is-on{background:var(--sunken);color:var(--text)}
.sg-comp.is-note .sg-ctab.is-on{background:rgba(247,144,9,.16);color:var(--note-tx)}
.sg-comp textarea{display:block;width:100%;border:0;background:none;resize:none;padding:10px 16px 4px;font-size:14px;line-height:1.5;min-height:44px;max-height:180px;box-shadow:none}
.sg-comp__bar{display:flex;align-items:center;gap:2px;padding:6px 8px 8px}
.sg-send{margin-left:10px;border-radius:9px}
.sg-closed{max-width:760px;margin:0 auto;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px 12px 16px;border-radius:var(--r-lg);background:var(--sunken);color:var(--muted);font-weight:500}
.sg-closed span{display:flex;align-items:center;gap:8px}

/* popovers & menus (Miro) */
.sg-menu,.sg-pop{background:var(--surface);border-radius:var(--r-md);box-shadow:var(--sh-lg);padding:6px;z-index:60;animation:sg-pop .16s var(--e)}
.sg-menu{position:fixed;min-width:232px;max-width:320px;max-height:calc(100vh - 16px);overflow-y:auto}
.sg-menu--sheet{left:8px!important;right:8px;bottom:calc(8px + env(safe-area-inset-bottom));top:auto!important;max-width:none}
.sg-menu hr{border:0;border-top:1px solid var(--line);margin:6px 4px}
.sg-menu__h{display:flex;align-items:center;gap:11px;padding:8px}.sg-menu__h div{display:grid;min-width:0}.sg-menu__h b{font-weight:650}
.sg-menu__tip{display:flex;gap:10px;margin:4px;padding:11px 12px;border-radius:var(--r);background:#0b0d17;color:#e6e7ee;font-size:12.5px;line-height:1.45}
.sg-menu__tip svg{flex:none;color:var(--spark);margin-top:1px}
.sg-menu .sg-side__sec{padding:2px 0}.sg-menu .sg-side__sec+.sg-side__sec{margin-top:4px;padding-top:6px}
.sg-opt{width:100%;display:flex;align-items:center;gap:10px;min-height:34px;padding:6px 8px;border-radius:var(--r-sm);color:var(--text);font-weight:500;cursor:pointer}
.sg-opt>svg{color:var(--muted);flex:none}
.sg-opt:hover,.sg-opt.is-act{background:var(--sunken)}
.sg-opt--static{cursor:default}.sg-opt--static:hover{background:none}
.sg-opt__l{flex:1;min-width:0;display:grid;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sg-opt__l b{font-weight:600;overflow:hidden;text-overflow:ellipsis}.sg-opt__l small{font-size:12px;overflow:hidden;text-overflow:ellipsis}
.sg-opt__l--mute{color:var(--muted);font-weight:450}
.sg-opt__img{width:36px;height:36px;border-radius:9px;background:var(--sunken) center/cover no-repeat;flex:none}
.sg-opt__chk{width:18px;height:18px;border-radius:6px;border:1.5px solid var(--line-2);display:grid;place-items:center;flex:none;color:#fff}
.sg-opt.is-sel .sg-opt__chk{background:var(--accent);border-color:var(--accent)}
.sg-pop{position:absolute;left:0;bottom:calc(100% + 8px);width:min(400px,100%);max-height:min(400px,60vh);display:flex;flex-direction:column}
.sg-pop__list{overflow-y:auto;min-height:0}
.sg-pop__f{display:flex;align-items:center;gap:8px;padding:8px 4px 2px 8px;margin-top:4px;border-top:1px solid var(--line)}
.sg-pop__none{padding:16px 12px;color:var(--muted);text-align:center;font-size:13px}
.sg-search--pop{margin:2px 2px 6px}

/* details panel */
.sg-det{width:320px;flex:none;display:none;flex-direction:column;border-left:1px solid var(--line);background:var(--surface);min-width:0}
.sg-det.is-open{display:flex}
.sg-det__top{display:flex;align-items:center;justify-content:space-between;height:56px;padding:0 10px 0 18px;flex:none;font-size:14.5px}
.sg-det__top b{font-weight:650;letter-spacing:-.015em}
.sg-det__scroll{flex:1;overflow-y:auto;padding:0 18px 20px}
.sg-det__hero{display:grid;justify-items:center;gap:3px;text-align:center;padding:10px 0 20px}
.sg-det__hero b{margin-top:10px;font-size:17px;font-weight:700;letter-spacing:-.02em;overflow-wrap:anywhere}
.sg-det__st{display:inline-flex;align-items:center;gap:6px;margin-top:8px;height:24px;padding:0 10px;border-radius:99px;background:var(--sunken);color:var(--muted);font-size:12px;font-weight:550}
.sg-det__st i{width:7px;height:7px;border-radius:50%;background:var(--subtle)}
.sg-det__st.is-on{background:var(--green-soft);color:#0a7d48}.sg-det__st.is-on i{background:var(--green)}
.sg-sec{border-top:1px solid var(--line)}
.sg-sec summary{display:flex;align-items:center;justify-content:space-between;height:44px;cursor:pointer;list-style:none;font-weight:600;font-size:13px;border-radius:var(--r-sm)}
.sg-sec summary::-webkit-details-marker{display:none}
.sg-sec summary svg{color:var(--subtle);transition:transform .18s var(--e)}
.sg-sec:not([open]) summary svg{transform:rotate(-90deg)}
.sg-sec summary em{margin-left:6px;padding:1px 7px;border-radius:99px;background:var(--sunken);color:var(--muted);font-size:11px}
.sg-sec__b{display:grid;gap:10px;padding:0 0 16px}
.sg-kv{display:flex;gap:11px;align-items:flex-start;min-width:0}
.sg-kv__ic{color:var(--subtle);margin-top:2px;flex:none}
.sg-kv>span:last-child{display:grid;min-width:0;overflow-wrap:anywhere}.sg-kv small{font-size:12px}
.sg-li{display:flex;align-items:center;gap:10px;font-weight:550}.sg-li>span:last-child{flex:none}
.sg-total{display:flex;justify-content:space-between;padding-top:10px;border-top:1px dashed var(--line-2);color:var(--muted)}.sg-total b{color:var(--text)}
.sg-tags{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.sg-tag{display:inline-flex;align-items:center;gap:4px;height:26px;padding:0 4px 0 10px;border-radius:99px;border:1px solid var(--line-2);font-size:12.5px;font-weight:550}
.sg-tag button{width:18px;height:18px;border-radius:50%;display:grid;place-items:center;color:var(--subtle)}.sg-tag button:hover{background:var(--sunken);color:var(--text)}
.sg-tags input{flex:1;min-width:90px;height:26px;border:0;background:none;padding:0 4px;font-size:12.5px;border-radius:6px}

/* pages: visitors + saved replies */
.sg-page{flex:1;min-width:0;overflow-y:auto;padding:28px 32px 40px}
.sg-page__head{display:flex;align-items:flex-end;gap:12px;margin-bottom:22px;flex-wrap:wrap}
.sg-page__head>div{flex:1;min-width:200px}
.sg-page__head h1{font-size:26px;font-weight:700;letter-spacing:-.03em}
.sg-page__head p{margin:4px 0 0;color:var(--muted);font-size:14px}
.sg-table{border:1px solid var(--line);border-radius:var(--r-lg);overflow:hidden}
.sg-tr{display:grid;grid-template-columns:minmax(180px,1.5fr) minmax(120px,1fr) minmax(120px,1fr) minmax(150px,1.6fr) 90px 100px;gap:14px;align-items:center;padding:11px 16px;border-top:1px solid var(--line);min-width:0;transition:background .14s}
.sg-tr>*{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sg-tr:hover{background:var(--hover)}
.sg-tr--h{border-top:0;padding-top:10px;padding-bottom:10px;font-size:12px;color:var(--subtle);font-weight:550;background:var(--sunken)!important}
.sg-td--who{display:flex;align-items:center;gap:11px;overflow:visible}.sg-td--who>span:last-child{display:grid;min-width:0}
.sg-td--who b{font-weight:600;overflow:hidden;text-overflow:ellipsis}.sg-td--who small{font-size:12px;overflow:hidden;text-overflow:ellipsis}
.sg-td--page a{font-weight:550;color:var(--text)}
.sg-cartv{display:inline-flex;align-items:center;gap:5px;font-weight:650}
.sg-replies{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:12px}
.sg-reply{border:1px solid var(--line);border-radius:var(--r-lg);padding:14px 16px;display:grid;gap:10px;align-content:start;transition:box-shadow .16s}
.sg-reply:hover{box-shadow:var(--sh-md)}
.sg-reply__h{display:flex;align-items:center;gap:6px}
.sg-reply p{margin:0;color:var(--muted);line-height:1.55}

/* responsive */
@media (max-width:1279px){
  .sg-det{position:absolute;top:0;right:0;bottom:0;z-index:65;box-shadow:var(--sh-lg);animation:sg-pop .2s var(--e)}
}
@media (max-width:1099px){
  .sg-side{display:none}
  .sg-list__title svg{display:block}.sg-list__title:hover{background:var(--sunken)}
}
@media (min-width:1100px){.sg-list__title{pointer-events:none}}
@media (max-width:980px){.sg-list{width:300px}.sg-hide-sm{display:none!important}}
@media (max-width:820px){
  .sg-app{flex-direction:column-reverse}
  .sg-rail{width:100%;flex-direction:row;justify-content:space-around;padding:6px 8px calc(6px + env(safe-area-inset-bottom));gap:0}
  .sg-rail .sg-mark,.sg-rail__sp{display:none}
  .sg-rail__ic{width:44px;height:30px}.sg-me{margin:0;align-self:center}
  .sg-work{margin:0;border-radius:0 0 var(--r-lg) var(--r-lg)}
  .sg-list{width:100%;border-right:0}
  .sg-thread{display:none}
  .is-thread .sg-list,.is-thread .sg-rail{display:none}
  .is-thread .sg-thread{display:flex}.is-thread .sg-work{border-radius:0}
  .sg-back{display:inline-grid;margin-left:-8px}
  .sg-thead{padding:0 8px 0 12px;gap:6px}.sg-thead__act{gap:6px}
  .sg-msgs{padding:4px 12px 10px}.sg-m{max-width:94%}
  .sg-compw{padding:0 10px calc(10px + env(safe-area-inset-bottom))}
  .sg-hint{display:none}
  .sg-det{width:100%;border-left:0}
  .sg-page{padding:20px 14px 28px}.sg-page__head h1{font-size:22px}
  .sg-table{border:0;border-radius:0;display:grid;gap:10px;overflow:visible}
  .sg-tr--h{display:none}
  .sg-tr{grid-template-columns:1fr 1fr;gap:8px 14px;border:1px solid var(--line);border-radius:var(--r-lg);padding:14px}
  .sg-td--who{grid-column:1/-1}
  .sg-tr>[data-l]{display:grid;font-size:13px}.sg-tr>[data-l]::before{content:attr(data-l);font-size:11.5px;color:var(--subtle)}
  .sg-pop{width:100%}
}
.sg-embed .sg-work{margin:6px 6px 6px 0}
@media (max-width:820px){.sg-embed .sg-work{margin:0}}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}
.sg-mark--img{background:none;box-shadow:none;object-fit:cover;padding:0}
