:root{--bg: #ffffff;--subtle: #f8fafc;--surface: #f1f3f5;--border: #e5e7eb;--border-light: #f0f2f5;--text: #111827;--text-2: #374151;--muted: #6b7280;--primary: #2563eb;--primary-soft: #dbeafe;--tg-out-bg: #dceeff;--tg-out-meta: #3b82f6;--tg-in-bg: #ffffff;--tg-chat-bg: #f1f4f8;--note-bg: #fef3c7;--note-border: #fde68a;--note-text: #78350f;--unread-green: #10b981;--danger: #dc2626}[data-theme=dark]{--bg: #0f172a;--subtle: #111827;--surface: #1e293b;--border: #263244;--border-light: #1e293b;--text: #f1f5f9;--text-2: #cbd5e1;--muted: #94a3b8;--primary: #3b82f6;--tg-out-bg: #1e3a5f;--tg-out-meta: #93c5fd;--tg-in-bg: #1e293b;--tg-chat-bg: #0b1120;--note-bg: #422006;--note-border: #854d0e;--note-text: #fef3c7}[data-theme=dark] .workspace,[data-theme=dark] .col-left,[data-theme=dark] .col-center,[data-theme=dark] .col-right,[data-theme=dark] .composer-wrap,[data-theme=dark] .composer-card,[data-theme=dark] .acc-card,[data-theme=dark] .modal,[data-theme=dark] .menu-pop,[data-theme=dark] .status-pop,[data-theme=dark] .emoji-pop{background:var(--bg);color:var(--text)}[data-theme=dark] .conv-card:hover{background:#162033}[data-theme=dark] .conv-card.active{background:#1e293b}[data-theme=dark] .acc-head{background:#162033;color:var(--text-2)}[data-theme=dark] .status-chip,[data-theme=dark] .header-status-btn,[data-theme=dark] .acc-select,[data-theme=dark] .btn-outline{background:#162033;color:var(--text);border-color:var(--border)}[data-theme=dark] .product-card{background:#162033;border-color:#1e3a5f}[data-theme=dark] .date-pill{background:#1e293be6;color:#cbd5e1}[data-theme=dark] .composer-card.note-mode{background:#2d1b06;border-color:#854d0e}*{box-sizing:border-box}html,body,#root{height:100%;margin:0}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,PingFang SC,Microsoft YaHei,sans-serif;background:var(--bg);color:var(--text);font-size:13.5px;-webkit-font-smoothing:antialiased}.login-wrap{height:100%;display:flex;align-items:center;justify-content:center;background:#f8fafc;padding:20px}.login-card{width:368px;background:#fff;border:1px solid var(--border);border-radius:14px;padding:30px;box-shadow:0 10px 30px #0f172a0f}.login-card h1{margin:0 0 6px;font-size:20px;font-weight:700}.login-card p{margin:0 0 22px;color:var(--muted);font-size:13px}.field{margin-bottom:14px}.field label{display:block;font-size:12.5px;color:var(--muted);margin-bottom:5px}.field input,.field select{width:100%;padding:9px 11px;border:1px solid #d1d5db;border-radius:9px;font-size:14px;outline:none}.field input:focus{border-color:var(--primary);box-shadow:0 0 0 3px #2563eb1a}.btn{background:var(--primary);color:#fff;border:0;border-radius:8px;padding:8px 14px;cursor:pointer;font-weight:500;font-size:13px;transition:background .15s}.btn:hover{background:#1d4ed8}.btn:disabled{opacity:.45;cursor:not-allowed}.btn-note{background:#d97706}.btn-note:hover{background:#b45309}.btn-outline{background:#fff;color:var(--text-2);border:1px solid var(--border);border-radius:8px;padding:6px 12px;cursor:pointer;font-size:12.5px;font-weight:500;display:inline-flex;align-items:center;gap:6px;transition:background .12s}.btn-outline:hover{background:#f9fafb}.icon-btn{width:30px;height:30px;border-radius:7px;border:0;background:transparent;color:#6b7280;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;transition:background .12s,color .12s}.icon-btn:hover{background:var(--surface);color:var(--text)}.icon-btn svg{width:16px;height:16px;display:block}.left-tools .icon-btn{width:28px;height:28px}.left-tools .icon-btn svg{width:15px;height:15px}.status-chip{height:24px;padding:0 8px;border-radius:99px;border:1px solid var(--border);background:#fff;color:var(--text-2);font-size:11.5px;font-weight:500;cursor:pointer;display:inline-flex;align-items:center;gap:5px}.status-chip:hover{background:#f9fafb}.status-dropdown{position:relative}.header-status-btn{height:32px;padding:0 10px 0 11px;border-radius:8px;border:1px solid var(--border);background:#fff;color:var(--text-2);font-size:12.5px;font-weight:500;cursor:pointer;display:inline-flex;align-items:center;gap:6px;transition:background .12s,border-color .12s}.header-status-btn:hover{background:#f9fafb}.header-status-btn svg{color:var(--muted);flex-shrink:0}.status-pop{position:absolute;top:36px;right:0;z-index:40;min-width:124px;background:#fff;border:1px solid var(--border);border-radius:10px;padding:4px;box-shadow:0 12px 32px #0f172a24;display:flex;flex-direction:column;gap:2px}.status-opt{width:100%;border:0;background:transparent;color:var(--text-2);padding:7px 10px;border-radius:7px;font-size:12.5px;text-align:left;cursor:pointer;display:flex;align-items:center;gap:8px}.status-opt:hover{background:var(--surface);color:var(--text)}.status-opt.active{background:var(--surface);color:var(--text);font-weight:600}.status-dot-sm{width:7px;height:7px;border-radius:50%;flex-shrink:0}.status-dot-sm.open{background:#10b981}.status-dot-sm.pending{background:#f59e0b}.status-dot-sm.snoozed{background:#6366f1}.status-dot-sm.resolved{background:#9ca3af}.flag-svg-wrap{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;border-radius:3px;overflow:hidden;box-shadow:0 0 0 1px #0f172a1f}.flag-svg-wrap svg{display:block}.panel-toggle-btn{width:32px;height:32px;border-radius:8px}.panel-toggle-btn.active{background:var(--surface);color:var(--primary)}.name-edit-btn{border:0;background:transparent;color:var(--muted);cursor:pointer;padding:2px 4px;border-radius:5px;display:inline-flex;align-items:center;opacity:.75;transition:opacity .12s,background .12s}.name-edit-btn:hover{opacity:1;background:var(--surface);color:var(--text)}.name-edit-input{font-size:14px;font-weight:600;color:var(--text);background:var(--bg);border:1px solid var(--primary);border-radius:6px;padding:2px 7px;outline:none;width:150px}.avatar-wrap{position:relative;flex-shrink:0;display:inline-flex}.online-badge{position:absolute;right:-1px;bottom:-1px;width:10px;height:10px;border-radius:50%;background:#10b981;border:2px solid #fff}.presence-tag{font-size:11.5px;font-weight:500;display:inline-flex;align-items:center;gap:4px}.presence-tag.on{color:#059669}.presence-tag.off{color:#9ca3af}.err{color:var(--danger);font-size:12.5px;margin-bottom:10px}.workspace{height:100%;display:grid;grid-template-columns:316px 1fr 296px;background:#fff;overflow:hidden}.workspace.no-right{grid-template-columns:316px 1fr}.avatar{border-radius:50%;color:#fff;font-weight:600;flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;-webkit-user-select:none;user-select:none}.avatar-sm{width:26px;height:26px;font-size:11px}.avatar-md{width:40px;height:40px;font-size:14.5px}.avatar-lg{width:52px;height:52px;font-size:19px}.col-left{border-right:1px solid var(--border);display:flex;flex-direction:column;min-height:0;background:#fff}.left-head{padding:13px 14px 8px;display:flex;align-items:center;justify-content:space-between;gap:8px}.left-title-wrap{display:flex;align-items:center;gap:8px}.left-title{font-size:16px;font-weight:700;color:var(--text)}.status-select{border:0;background:var(--surface);color:var(--text-2);font-size:12px;font-weight:500;padding:4px 8px;border-radius:6px;cursor:pointer;outline:none}.left-tools{position:relative;display:flex;align-items:center;gap:2px}.menu-pop{position:absolute;top:34px;right:0;z-index:40;width:168px;background:#fff;border:1px solid var(--border);border-radius:10px;padding:5px;box-shadow:0 12px 32px #0f172a24;display:flex;flex-direction:column;gap:2px}.menu-item{width:100%;border:0;background:transparent;color:var(--text-2);padding:8px 10px;border-radius:7px;font-size:13px;text-align:left;cursor:pointer;display:flex;align-items:center;justify-content:space-between}.menu-item:hover{background:var(--surface);color:var(--text)}.menu-item.danger{color:var(--danger)}.menu-item.danger:hover{background:#dc262614}.menu-sep{height:1px;background:var(--border-light);margin:4px 6px}.menu-sub{font-size:11px;color:var(--muted)}.status-dot{width:8px;height:8px;border-radius:50%;display:inline-block}.status-dot.online{background:#10b981}.status-dot.away{background:#f59e0b}.left-tabs{display:flex;align-items:center;justify-content:space-between;gap:4px;padding:0 10px;border-bottom:1px solid var(--border)}.tab-item{border:0;background:transparent;padding:8px 2px 10px;cursor:pointer;font-size:12.5px;font-weight:500;color:var(--muted);position:relative;display:inline-flex;align-items:center;gap:4px;white-space:nowrap}.tab-item.active{color:var(--primary);font-weight:600}.tab-item.active:after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:2px;background:var(--primary);border-radius:2px}.tab-count{font-size:10.5px;padding:1px 5px;border-radius:99px;background:var(--surface);color:var(--muted);font-weight:600}.tab-item.active .tab-count{background:#eff6ff;color:var(--primary)}.conv-list{flex:1;overflow-y:auto}.conv-card{padding:11px 14px;border-bottom:1px solid var(--border-light);cursor:pointer;display:flex;gap:12px;align-items:center;transition:background .12s}.conv-card:hover{background:#f9fafb}.conv-card.active{background:#f1f5f9}.conv-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}.conv-head-row{display:flex;justify-content:space-between;align-items:baseline;gap:8px}.conv-name{font-size:14px;font-weight:600;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.conv-time{font-size:11.5px;color:var(--muted);flex-shrink:0}.conv-body-row{display:flex;align-items:center;justify-content:space-between;gap:10px}.conv-body-left{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}.conv-body-right{display:flex;align-items:center;gap:6px;flex-shrink:0}.conv-preview{font-size:12.5px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.conv-source{font-size:11px;color:#9ca3af;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.unread-badge{min-width:18px;height:18px;padding:0 5px;border-radius:99px;background:var(--unread-green);color:#fff;font-size:11px;font-weight:600;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.col-center{display:flex;flex-direction:column;min-height:0;background:#fff}.chat-header{height:60px;padding:0 18px;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;flex-shrink:0}.chat-header-left{display:flex;align-items:center;gap:11px;min-width:0}.chat-contact-name{font-size:14.5px;font-weight:600;color:var(--text);display:flex;align-items:center;gap:6px}.chat-contact-sub{font-size:12px;color:var(--muted);display:flex;align-items:center;gap:8px;margin-top:1px}.link-btn{border:0;background:transparent;color:var(--primary);font-size:12px;cursor:pointer;padding:0}.link-btn:hover{text-decoration:underline}.chat-header-right{display:flex;align-items:center;gap:8px}.chat-scroll{flex:1;overflow-y:auto;padding:14px 18px;display:flex;flex-direction:column;background:var(--tg-chat-bg)}.date-pill{align-self:center;font-size:12px;font-weight:500;color:#475569;background:#ffffffe0;border:1px solid rgba(15,23,42,.06);padding:3px 12px;border-radius:99px;margin:10px 0 8px;box-shadow:0 1px 2px #0f172a0a}.tg-row{display:flex;flex-direction:column;max-width:72%;margin-top:3px}.tg-row.gap{margin-top:10px}.tg-row.in{align-self:flex-start}.tg-row.out{align-self:flex-end}.tg-bubble{position:relative;padding:7px 11px;border-radius:14px;word-break:break-word;line-height:1.45;font-size:14px;box-shadow:0 1px 2px #0f172a12}.tg-bubble.in{background:var(--tg-in-bg);color:var(--text)}.tg-bubble.out{background:var(--tg-out-bg);color:var(--text)}.tg-bubble.private{background:var(--note-bg);border:1px solid var(--note-border);color:var(--note-text)}.tg-bubble.in.tail{border-bottom-left-radius:4px}.tg-bubble.in.tail:before{content:"";position:absolute;left:-6px;bottom:0;width:10px;height:12px;background:var(--tg-in-bg);clip-path:polygon(100% 0,100% 100%,0 100%)}.tg-bubble.out.tail{border-bottom-right-radius:4px}.tg-bubble.out.tail:after{content:"";position:absolute;right:-6px;bottom:0;width:10px;height:12px;background:var(--tg-out-bg);clip-path:polygon(0 0,100% 100%,0 100%)}.tg-bubble{position:relative;padding:6px 10px 7px;border-radius:14px;word-break:break-word;line-height:20px;font-size:14px;box-shadow:0 1px 2px #0f172a12}.tg-text{white-space:pre-wrap}.tg-meta{float:right;margin:5px 0 -2px 7px;font-size:11px;line-height:15px;display:inline-flex;align-items:center;gap:3px;-webkit-user-select:none;user-select:none;white-space:nowrap}.tg-bubble.in .tg-meta{color:#94a3b8}.tg-bubble.out .tg-meta{color:var(--tg-out-meta)}.tg-bubble.private .tg-meta{color:#92400e}.tg-tick{display:inline-flex;align-items:center;transform:translateY(-.5px)}.tg-tick.delivered{color:#60a5fa}.tg-tick.read{color:#2563eb}.file-card{display:flex;align-items:center;gap:10px;min-width:210px;max-width:290px;padding:6px 8px 6px 6px;margin-bottom:4px;border-radius:10px;background:#0f172a0a;text-decoration:none;color:inherit;transition:background .12s}.file-card:hover{background:#0f172a14}.file-badge{width:40px;height:40px;border-radius:10px;flex-shrink:0;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#fff;font-weight:700;font-size:10px;letter-spacing:.02em}.file-info{flex:1;min-width:0}.file-name{font-size:13px;font-weight:600;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.file-size{font-size:11.5px;color:var(--muted);margin-top:2px}.file-dl{color:var(--muted);flex-shrink:0;display:inline-flex}.tg-bubble.media-only{padding:3px;overflow:hidden}.tg-img-wrap{position:relative;display:block;line-height:0}.tg-img{max-width:340px;max-height:300px;border-radius:11px;display:block;cursor:zoom-in}.tg-bubble.media-only .tg-meta{position:absolute;right:7px;bottom:7px;float:none;margin:0;background:#0f172a8a;color:#fff;padding:2px 7px;border-radius:99px}.tg-bubble.media-only .tg-tick.delivered{color:#ffffffd1}.tg-bubble.media-only .tg-tick.read{color:#86efac}.emoji-pop{position:absolute;bottom:48px;left:10px;z-index:30;width:280px;background:#fff;border:1px solid var(--border);border-radius:12px;padding:8px;box-shadow:0 12px 32px #0f172a26;display:grid;grid-template-columns:repeat(8,1fr);gap:2px}.emoji-btn{border:0;background:transparent;font-size:19px;padding:4px;border-radius:6px;cursor:pointer}.emoji-btn:hover{background:var(--surface)}.pending-bar{padding:8px 12px 0;display:flex;gap:8px;flex-wrap:wrap;align-items:center}.pending-thumb{position:relative;display:inline-flex;align-items:center;gap:6px;border:1px solid var(--border);border-radius:8px;padding:4px;background:#f8fafc}.pending-thumb img{width:52px;height:52px;object-fit:cover;border-radius:6px;display:block}.pending-x{position:absolute;top:-6px;right:-6px;width:18px;height:18px;border-radius:50%;border:0;background:#334155;color:#fff;font-size:11px;cursor:pointer;line-height:1}.lightbox{position:fixed;top:0;right:0;bottom:0;left:0;z-index:100;background:#0f172ad1;display:flex;align-items:center;justify-content:center;padding:24px;cursor:zoom-out}.lightbox img{max-width:92vw;max-height:92vh;border-radius:10px;box-shadow:0 20px 60px #00000073}.product-card{margin:12px 12px 0;padding:10px;border:1px solid #dbeafe;background:#f8fbff;border-radius:10px;display:flex;gap:10px;align-items:flex-start}.product-thumb{width:48px;height:48px;border-radius:8px;object-fit:cover;flex-shrink:0;border:1px solid #e5e7eb;background:#fff}.product-title{font-size:13px;font-weight:600;color:var(--text);line-height:1.35}.product-price{font-size:13px;font-weight:700;color:#dc2626;margin-top:2px}.product-sub{font-size:11.5px;color:var(--muted);margin-top:2px}.page-box{margin:10px 12px 0;padding:10px;border:1px solid var(--border);background:#fafafa;border-radius:10px;font-size:12px;display:flex;flex-direction:column;gap:4px}.page-box-title{font-weight:600;color:var(--text-2)}.page-box-url{color:var(--primary);word-break:break-all;text-decoration:none}.page-box-url:hover{text-decoration:underline}.att-img{max-width:240px;max-height:200px;border-radius:8px;display:block;margin-top:6px;border:1px solid rgba(0,0,0,.06)}.att-link{display:inline-block;margin-top:6px;color:var(--primary);text-decoration:underline;font-size:12.5px}.typing-pill{align-self:flex-start;background:var(--surface);color:var(--muted);font-size:12px;padding:6px 12px;border-radius:99px;display:inline-flex;align-items:center;gap:7px}.dots{display:inline-flex;gap:3px}.dots i{width:5px;height:5px;border-radius:50%;background:#6b7280;animation:dotBounce 1.2s infinite ease-in-out}.dots i:nth-child(2){animation-delay:.18s}.dots i:nth-child(3){animation-delay:.36s}@keyframes dotBounce{0%,80%,to{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}.composer-wrap{position:relative;padding:8px 16px 14px;background:#fff;border-top:1px solid var(--border)}.composer-card{border:1px solid var(--border);border-radius:12px;background:#fff;box-shadow:0 2px 8px #0f172a0a;overflow:hidden;transition:border-color .15s,background .15s}.composer-card.note-mode{background:#fffbeb;border-color:#fde68a}.composer-tabs{padding:8px 12px 4px;display:flex;align-items:center;gap:6px}.mode-pill{border:0;background:transparent;color:var(--muted);padding:4px 10px;border-radius:7px;font-size:12.5px;font-weight:500;cursor:pointer}.mode-pill.active{background:var(--surface);color:var(--text);font-weight:600}.mode-pill.note-active{background:#fef3c7;color:#92400e;font-weight:600}.composer-textarea{width:100%;border:0;background:transparent;resize:none;height:64px;padding:8px 14px;font-family:inherit;font-size:13.5px;color:var(--text);outline:none}.composer-textarea::placeholder{color:#9ca3af}.composer-foot{padding:6px 10px 9px;display:flex;align-items:center;justify-content:space-between}.composer-tools{display:flex;align-items:center;gap:4px}.col-right{border-left:1px solid var(--border);background:#fff;display:flex;flex-direction:column;overflow-y:auto;min-height:0}.right-head{height:60px;padding:0 16px;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;flex-shrink:0}.right-head-title{font-size:13.5px;font-weight:600;color:var(--primary)}.contact-hero{padding:18px 16px 14px;border-bottom:1px solid var(--border-light)}.contact-hero-name{font-size:15.5px;font-weight:700;margin:10px 0 4px;color:var(--text)}.contact-meta-row{display:flex;align-items:center;gap:7px;font-size:12.5px;color:var(--muted);margin-top:6px;word-break:break-all}.copy-btn{border:0;background:transparent;color:var(--muted);cursor:pointer;padding:2px 4px;font-size:12px}.copy-btn:hover{color:var(--primary)}.acc-list{padding:12px;display:flex;flex-direction:column;gap:8px}.acc-card{border:1px solid var(--border);border-radius:10px;overflow:hidden;background:#fff}.acc-head{width:100%;border:0;background:#fafafa;padding:10px 12px;cursor:pointer;display:flex;align-items:center;justify-content:space-between;font-size:13px;font-weight:600;color:var(--text-2)}.acc-head:hover{background:#f3f4f6}.acc-body{padding:12px;border-top:1px solid var(--border-light);display:flex;flex-direction:column;gap:10px}.acc-label{font-size:11.5px;color:var(--muted);margin-bottom:4px;display:block}.acc-select{width:100%;padding:7px 9px;border:1px solid #d1d5db;border-radius:8px;font-size:13px;background:#fff}.kv{font-size:12.5px;color:var(--text-2);word-break:break-all}.kv span{color:var(--muted)}.modal-bg{position:fixed;top:0;right:0;bottom:0;left:0;background:#0f172a6b;display:flex;align-items:center;justify-content:center;padding:20px;z-index:60}.modal{width:640px;max-width:100%;max-height:86vh;overflow-y:auto;background:#fff;border-radius:14px;padding:22px;box-shadow:0 20px 50px #0f172a33}.code-box{background:#0f172a;color:#e2e8f0;padding:10px 12px;border-radius:8px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;overflow-x:auto;white-space:pre-wrap;word-break:break-all}.empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;color:var(--muted);gap:6px}.tg-guide{background:var(--surface);border:1px solid var(--border);border-radius:9px;padding:8px 11px;font-size:12px;color:var(--text-2)}.tg-guide summary{cursor:pointer;font-weight:600;color:var(--text);-webkit-user-select:none;user-select:none}.tg-guide-body{margin-top:8px;display:flex;flex-direction:column;gap:8px;line-height:1.55}.tg-guide-body ol{margin:4px 0 0;padding-left:18px;display:flex;flex-direction:column;gap:3px}.tg-guide-body code{background:#0f172a0f;padding:1px 4px;border-radius:4px;font-size:11.5px;word-break:break-all}.tg-guide-body a{color:var(--primary);font-weight:500;text-decoration:none}.tg-guide-body a:hover{text-decoration:underline}
