:root{font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei","Helvetica Neue",Arial,sans-serif;font-size:13px;color:#20374e;background:#f3f6fa}
*{box-sizing:border-box}[hidden]{display:none!important}
.tag.claimed{background:#fde8e8;color:#b42318}.info .claim.warn{color:#b42318}table.claims{width:100%;border-collapse:collapse;font-size:12px}table.claims td{padding:4px 6px;border-bottom:1px solid #eef1f5;vertical-align:top}html,body{height:100%;margin:0}body{display:flex;flex-direction:column}
button{font:inherit;cursor:pointer;border:1px solid #cedce9;background:#fff;color:#355776;border-radius:6px;padding:6px 10px}button:hover{background:#f0f6fd}button.primary{background:#2379da;border-color:#2379da;color:#fff;white-space:nowrap}button.primary:hover{background:#1967bf}button.danger{color:#b4443f}button.text{border:0;background:transparent;color:#3b6fa0;padding:4px 6px}button.text:hover{background:transparent;color:#1968be}button:disabled{opacity:.45;cursor:not-allowed}
input,textarea,select{font:inherit;border:1px solid #cfdae5;border-radius:7px;padding:8px 10px;width:100%;background:#fafcfe;color:inherit}textarea{resize:vertical}
.muted{color:#7d8d9e;font-size:12px}.error{color:#b4443f;min-height:1em;font-size:12px}
dialog{border:0;border-radius:14px;padding:28px 30px;width:380px;box-shadow:0 20px 60px #0004}dialog::backdrop{background:#0f2746aa}dialog h1{margin:0 0 6px;font-size:22px}dialog h1 span{color:#2379da}dialog label{display:block;margin:12px 0 0}dialog label span{display:block;font-size:12px;color:#60778f;margin-bottom:4px}dialog .primary{width:100%;margin-top:14px;padding:10px}
header.top{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:0 16px;height:52px;background:#102b45;color:#fff;flex:0 0 auto}
.brand{font-size:19px;font-weight:850}.brand>span{color:#63d6df}.brand small{font-size:12px;font-weight:500;color:#d4e1ed;margin-left:9px}
nav .tab{background:transparent;border:0;color:#c7d9e9;padding:8px 14px;border-radius:8px}nav .tab.active{background:#ffffff1f;color:#fff}
.me{display:flex;align-items:center;gap:10px}.me .text{color:#c7d9e9}.pill{font-size:11px;background:#ffffff1f;padding:3px 9px;border-radius:999px}
.me #soundToggle.off,.me #jumpToggle.off{opacity:.55}
.list-tools{padding:6px 10px;border-bottom:1px solid #e1e8ef;background:#fff}.list-tools .text{color:#b23b3b}#delConv{color:#b23b3b}
.pill.auto{cursor:pointer;border:0;color:#fff;font-weight:600}.pill.auto.on{background:#2e9e5b}.pill.auto.off{background:#8a6d3b}.pill.auto:hover{filter:brightness(1.1)}
.view{flex:1;min-height:0}
#view-chat{display:grid;grid-template-columns:var(--left,300px) 6px 1fr 6px var(--right,280px)}
.gutter{cursor:col-resize;background:#eef2f6;position:relative;z-index:1;touch-action:none}.gutter:hover,.gutter.active{background:#9fc1e8}body.resizing{user-select:none;cursor:col-resize}
.list{border-right:1px solid #e1e8ef;background:#fff;display:flex;flex-direction:column;min-height:0}
.filters{display:flex;gap:4px;padding:10px}.filters .f{flex:1;padding:6px 4px;font-size:12px;border-radius:999px}.filters .f.active{background:#2379da;border-color:#2379da;color:#fff}
.conv-list{overflow-y:auto;flex:1}.conv{padding:10px 12px;border-bottom:1px solid #eef2f6;cursor:pointer;display:flex;flex-direction:column;gap:3px}.conv:hover{background:#f6f9fc}.conv.active{background:#eaf3ff}
.conv .l1{display:flex;justify-content:space-between;gap:8px}.conv .l1 strong{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.conv .l1 time{font-size:11px;color:#8a97a5;flex:0 0 auto}
.conv .l2{display:flex;justify-content:space-between;gap:8px;font-size:12px;color:#60778f}.conv .l2 span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.badge{background:#e5484d;color:#fff;font-size:10px;font-weight:700;border-radius:999px;padding:1px 6px;flex:0 0 auto}
.tag{font-size:10px;padding:1px 6px;border-radius:4px;background:#eef2f6;color:#60778f}.tag.waiting{background:#fff1e0;color:#9a5b00}.tag.active{background:#e6f6ee;color:#1d7a4c}.tag.bot{background:#eaf3ff;color:#2666b4}
.thread{display:flex;flex-direction:column;min-height:0;background:#f7f9fb}
.thread-head{display:flex;align-items:center;justify-content:space-between;padding:10px 16px;background:#fff;border-bottom:1px solid #e1e8ef}.thread-head .who{display:flex;flex-direction:column;gap:2px}.thread-head .acts{display:flex;gap:6px}
.messages{flex:1;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:10px}.empty{color:#8a97a5;text-align:center;margin-top:40px}
.m{max-width:70%;display:flex;flex-direction:column;gap:3px}.m.visitor{align-self:flex-start}.m.agent,.m.bot{align-self:flex-end;align-items:flex-end}.m.system{align-self:center}
.m .b{padding:9px 12px;border-radius:14px;background:#fff;border:1px solid #e1e8ef;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.55}.m.agent .b{background:#2379da;color:#fff;border-color:#2379da}.m.bot .b{background:#e8f1fd;border-color:#cfe0f7}.m.system .b{background:transparent;border:0;color:#8a97a5;font-size:12px}
.m .b img{max-width:260px;max-height:260px;border-radius:10px;display:block}.m .t{font-size:10px;color:#8a97a5;padding:0 4px}
.composer{background:#fff;border-top:1px solid #e1e8ef;padding:8px 12px 12px}.composer .row{display:flex;gap:8px;align-items:flex-end}.attach{cursor:pointer;font-size:20px;padding:6px 4px}
.quick-row{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:8px}.quick-row button{display:flex;align-items:center;gap:6px;padding:4px 8px;font-size:12px;border-radius:999px}.quick-row img{width:22px;height:22px;object-fit:cover;border-radius:4px}.quick-row .n{background:#eef2f6;border-radius:999px;padding:0 6px;font-size:10px}
.assist{border-left:1px solid #e1e8ef;background:#fff;padding:12px 14px;overflow-y:auto;min-height:0}.assist h2{font-size:12px;color:#60778f;margin:14px 0 8px;text-transform:none}.assist .row{display:flex;align-items:center;justify-content:space-between}.assist .row h2{margin:0}
.decision{margin:6px 0 10px;padding:8px 10px;border-radius:8px;font-size:12px;line-height:1.5;background:#fff4e5;color:#8a5a2b;border:1px solid #f3dcbf}.decision.auto,.decision.would,.decision.siteoff{background:#e6f6ee;color:#1d7a4c;border-color:#bfe6cf}.decision.human{background:#fde8e8;color:#a33;border-color:#f3c5c5}.decision.ai{background:#eaf3ff;color:#2666b4;border-color:#cfe0f7}
.sug{border:1px solid #dde6ef;border-radius:10px;padding:10px;margin-bottom:10px}.sug h3{font-size:12px;color:#60778f;margin:0 0 6px;font-weight:600}.sug .txt{white-space:pre-wrap;line-height:1.55;margin:0 0 8px}.sug .f{font-size:11px;color:#8a97a5;margin:0 0 8px}.sug .acts{display:flex;gap:6px;justify-content:flex-end}.sug .acts button{font-size:12px;padding:5px 10px}.sug.ref{opacity:.85}
.info{font-size:11.5px;line-height:1.5;color:#4a5e73}.info b{color:#20374e}.info>div{margin:2px 0;overflow-wrap:anywhere}
.info details.more{margin-top:6px;border-top:1px dashed #e1e8ef;padding-top:4px}.info details.more summary{cursor:pointer;color:#60778f;font-size:11px;list-style:none}.info details.more summary::before{content:'▸ '}.info details.more[open] summary::before{content:'▾ '}
#view-admin{overflow:auto;padding:16px}.admin-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;max-width:1200px;margin:0 auto}.card{background:#fff;border:1px solid #e1e8ef;border-radius:12px;padding:16px 18px}.card h2{margin:0 0 10px;font-size:14px}
.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}.stat{background:#f6f9fc;border-radius:10px;padding:10px 12px}.stat b{display:block;font-size:22px;color:#2379da}.stat span{font-size:11px;color:#60778f}
.site{border:1px solid #e1e8ef;border-radius:10px;padding:10px 12px;margin-bottom:10px}.site .l1{display:flex;justify-content:space-between;align-items:center}.site code{display:block;background:#f3f6fa;padding:8px;border-radius:6px;font-size:11px;white-space:pre-wrap;overflow-wrap:anywhere;margin:6px 0}
fieldset.tg{border:1px solid #dde6ef;border-radius:10px;padding:8px 12px 10px;margin:12px 0}fieldset.tg legend{font-size:12px;color:#60778f;padding:0 4px}.m .push{font-size:10px;color:#3b6fa0;cursor:pointer;margin-left:6px}.m .push.done{color:#1d7a4c;cursor:default}
#siteForm label{display:block;margin:8px 0}#siteForm label>span{display:block;font-size:12px;color:#60778f;margin-bottom:3px}.two{display:grid;grid-template-columns:1fr 1fr;gap:10px}.check{display:flex;align-items:center;gap:6px}.check input{width:auto}.acts{display:flex;gap:8px;margin-top:10px}
.toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);background:#102b45;color:#fff;padding:10px 16px;border-radius:10px;font-size:13px;box-shadow:0 10px 30px #0004;margin:0}
#view-history{overflow:auto;padding:16px}.history-wrap{max-width:1400px;margin:0 auto;background:#fff;border:1px solid #e1e8ef;border-radius:12px;padding:16px 18px}.history-wrap .row{display:flex;justify-content:space-between;align-items:center}.history-wrap h2{margin:0;font-size:15px}.history-wrap select{width:auto;display:inline-block;padding:5px 8px}.table-wrap{overflow:auto;margin-top:10px}
#histTable{width:100%;border-collapse:collapse;font-size:12px}#histTable th,#histTable td{border-bottom:1px solid #eef2f6;padding:8px 8px;text-align:left;vertical-align:top}#histTable th{background:#f6f9fc;color:#60778f;font-weight:600;white-space:nowrap}#histTable td small{display:block;color:#8a97a5}#histTable tr:hover td{background:#f9fbfd}#histTable .open-conv{color:#2379da;cursor:pointer;text-decoration:underline}
.info .trail{margin:2px 0 0 0;padding-left:14px;max-height:90px;overflow:auto}.info .trail li{overflow-wrap:anywhere}.info a{color:#2379da;overflow-wrap:anywhere}
@media(max-width:1000px){#view-chat{grid-template-columns:240px 6px 1fr}.assist,.gutter[data-side=right]{display:none}.admin-grid{grid-template-columns:1fr}}
/* recall / edit of the agent's own lines */
.m .act{font-size:10px;color:#3b6fa0;cursor:pointer;margin-left:8px;opacity:.35}.m:hover .act,.m .act:focus{opacity:1}.m .act:hover{text-decoration:underline}.m .t .edited{color:#9aa6b3}
.m.recalled .b{background:transparent;border:0;color:#8a97a5;font-size:12px;padding:2px 8px;text-align:center}.m.recalled .b .orig{font-size:11px;color:#a3aeb9;margin-top:2px;max-width:420px;white-space:pre-wrap}.m.recalled .b .orig img{max-width:120px;max-height:120px;border-radius:8px;display:block;margin:4px auto 0;opacity:.7}
.m textarea.editbox{width:min(520px,60vw);min-height:64px;padding:9px 12px;border-radius:14px;border:1px solid #2379da;font:inherit;line-height:1.55;resize:vertical}.m .editrow{display:flex;gap:6px;justify-content:flex-end}.m .editrow button{font-size:12px;padding:4px 10px;border-radius:8px;border:1px solid #cfd8e3;background:#fff;cursor:pointer}.m .editrow button.primary{background:#2379da;color:#fff;border-color:#2379da}
/* unread conversations stand out like a chat app: tinted row, red bar, bold name, larger red count; read but unanswered = orange tag */
.conv.unread{background:#fff1f1;box-shadow:inset 4px 0 0 #e5484d}.conv.unread:hover{background:#ffe6e6}.conv.unread .l1 strong{font-weight:800;color:#1f2d3d}.conv.unread .l2>span:first-child{color:#1f2d3d;font-weight:600}
.conv .badge{font-size:12px;min-width:20px;height:20px;line-height:20px;padding:0 6px;text-align:center;box-shadow:0 0 0 2px #fff}
.conv.wait{box-shadow:inset 4px 0 0 #f5a524}.tag.waitreply{background:#fff1e0;color:#9a5b00;font-weight:600}

