:root { --blue:#2563eb; --ink:#111827; --muted:#94a3b8; --line:#e5e7eb; --bg:#f8fafc; --amber:#f59e0b; }
:root { --blue:#16865f; }
* { box-sizing:border-box; }
html,body { width:100%; min-height:100%; margin:0; overscroll-behavior:none; background:#f1f5f9; color:var(--ink); font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif; }
button,input,textarea { font:inherit; }.agent-root { width:min(100%,520px); min-height:100dvh; margin:auto; position:relative; overflow:hidden; background:#fff; box-shadow:0 0 28px rgba(15,23,42,.08); }
.agent-loading { min-height:100dvh; display:grid; place-items:center; color:#94a3b8; font-size:14px; }
.agent-login { min-height:100dvh; padding:48px 16px 20px; display:flex; align-items:flex-start; justify-content:center; background:#f8fafc; }
.agent-login form { width:100%; max-width:384px; padding:22px 20px; border:1px solid #e5e7eb; border-radius:16px; background:#fff; box-shadow:0 8px 28px rgba(15,23,42,.05); }
.agent-login h1 { margin:0; color:#1f2937; font-size:19px; }.agent-login p { margin:6px 0 20px; color:#6b7280; font-size:12px; line-height:1.55; }
.agent-login input { width:100%; height:45px; margin:0 0 9px; padding:0 12px; border:1px solid #e5e7eb; border-radius:8px; outline:0; font-size:14px; }.agent-login input:focus { border-color:#3b82f6; }
.agent-login button { width:100%; height:44px; margin-top:7px; border:0; border-radius:8px; color:#fff; background:var(--blue); font-size:14px; }.agent-login small { min-height:20px; margin-top:9px; display:block; color:#dc2626; }.agent-login .tip { margin-top:12px; color:#9ca3af; font-size:11px; }
.notify-banner { margin:0 8px; min-height:40px; padding:7px 8px; display:flex; align-items:center; gap:8px; color:#a35400; border:1px solid #fde2a4; border-radius:8px; background:#fff9e8; font-size:11px; }
.notify-banner span { flex:1; }.notify-banner button { padding:6px 13px; border:0; border-radius:6px; color:white; background:#e98a00; font-size:11px; }.notify-banner .close-notify { width:23px; padding:0; color:#f59e0b; background:transparent; font-size:18px; }
.agent-head { height:45px; padding:0 12px; display:flex; align-items:center; border-bottom:1px solid #f1f5f9; background:#fafafa; }.agent-head h1 { margin:0; font-size:16px; }.head-action { margin-left:auto; border:0; color:#64748b; background:transparent; font-size:13px; }
.conversation-list { height:calc(100dvh - 142px - env(safe-area-inset-bottom)); overflow-y:auto; background:#fff; }
.conversation-row { width:100%; min-height:59px; padding:9px 11px; display:grid; grid-template-columns:34px 1fr auto; gap:8px; align-items:center; border:0; border-bottom:1px solid #f0f2f5; color:inherit; background:#fff; text-align:left; }.conversation-row.active { box-shadow:inset 2px 0 #facc15; background:#fffdf5; }
.conv-avatar { width:30px; height:30px; display:grid; place-items:center; border-radius:50%; color:#94a3b8; background:#f1f5f9; font-size:11px; }.active .conv-avatar { color:#d97706; background:#fef3c7; }
.conv-body { min-width:0; }.conv-name { display:flex; align-items:center; gap:6px; color:#1f2937; font-size:14px; }.unread { min-width:17px; height:17px; padding:0 5px; display:grid; place-items:center; border-radius:9px; color:#fff; background:#ef4444; font-size:10px; }.conv-preview { margin-top:4px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#94a3b8; font-size:11px; }.conv-time { align-self:start; padding-top:3px; color:#94a3b8; font-size:10px; }
.agent-tabs { position:absolute; z-index:20; left:0; right:0; bottom:0; height:calc(50px + env(safe-area-inset-bottom)); padding-bottom:env(safe-area-inset-bottom); display:grid; grid-template-columns:repeat(3,1fr); border-top:1px solid #dfe3e8; background:rgba(255,255,255,.98); }.agent-tabs button { border:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:1px; color:#111827; background:transparent; font-size:12px; }.agent-tabs span { font-size:21px; line-height:20px; }.agent-tabs button.active { color:#0867ff; }
.filter-sheet { position:absolute; z-index:30; left:0; right:0; bottom:calc(50px + env(safe-area-inset-bottom)); max-height:55vh; padding:14px; border-top:1px solid var(--line); background:#fff; box-shadow:0 -12px 32px rgba(15,23,42,.09); }.filter-title { display:flex; justify-content:space-between; font-size:14px; }.filter-title button { border:0; background:none; font-size:20px; }.filter-chip { width:100%; margin-top:8px; padding:10px; display:flex; justify-content:space-between; border:1px solid var(--line); border-radius:8px; background:#fff; }
.chat-screen { height:100dvh; display:flex; flex-direction:column; background:#f8fafc; }.chat-head { min-height:52px; padding:env(safe-area-inset-top) 10px 0; display:flex; align-items:center; gap:8px; border-bottom:1px solid var(--line); background:#fff; }.chat-head button { width:34px; border:0; color:#334155; background:none; font-size:26px; }.chat-title { min-width:0; flex:1; }.chat-title strong,.chat-title small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }.chat-title strong { font-size:14px; }.chat-title small { margin-top:2px; color:#94a3b8; font-size:10px; }.chat-more { font-size:20px !important; }
.message-list { flex:1; min-height:0; padding:12px; overflow-y:auto; }.msg { max-width:78%; margin:7px 0; display:flex; gap:6px; align-items:flex-end; }.msg.service { margin-left:auto; flex-direction:row-reverse; }.msg-bubble { padding:9px 11px; border:1px solid #e5e7eb; border-radius:12px 12px 12px 3px; background:#fff; font-size:13px; line-height:1.5; word-break:break-word; }.service .msg-bubble { color:#fff; border-color:#2563eb; border-radius:12px 12px 3px 12px; background:#2563eb; }.msg-time { color:#94a3b8; font-size:9px; white-space:nowrap; }
.quick-strip { padding:7px 9px; display:flex; gap:6px; overflow-x:auto; border-top:1px solid #f1f5f9; background:#fff; }.quick-strip button { flex:0 0 auto; padding:5px 9px; border:1px solid #e2e8f0; border-radius:14px; color:#64748b; background:#fff; font-size:11px; }
.compose { padding:8px 8px calc(8px + env(safe-area-inset-bottom)); display:flex; gap:7px; border-top:1px solid #e5e7eb; background:#fff; }.compose textarea { min-height:39px; max-height:100px; flex:1; padding:9px 11px; resize:none; border:1px solid #dfe3e8; border-radius:9px; outline:0; font-size:13px; }.compose button { width:60px; border:0; border-radius:8px; color:white; background:#2563eb; font-size:13px; }
.tool-page { height:calc(100dvh - 50px - env(safe-area-inset-bottom)); overflow:auto; background:#f8fafc; }.tool-grid { padding:12px; display:grid; grid-template-columns:repeat(2,1fr); gap:10px; }.tool-card { min-height:96px; padding:14px; border:1px solid #e5e7eb; border-radius:12px; color:inherit; background:#fff; box-shadow:0 1px 2px rgba(15,23,42,.03); text-align:left; }.tool-card b { display:block; font-size:14px; }.tool-card span { margin-top:7px; display:block; color:#94a3b8; font-size:11px; line-height:1.45; }.tool-icon { margin-bottom:9px; font-size:24px; }
.tool-sheet{max-height:72vh;overflow:auto}.tool-sheet-body{padding-top:8px}.tool-result{margin-top:7px;padding:9px;display:grid;grid-template-columns:1fr auto;gap:4px 8px;border:1px solid var(--line);border-radius:8px}.tool-result b{font-size:12px}.tool-result span{grid-column:1;color:#94a3b8;font-size:10px}.tool-result button{grid-column:2;grid-row:1/3;padding:4px 8px;border:0;border-radius:6px;color:#2563eb;background:#eff6ff}.tool-result i{width:9px;height:9px;align-self:center;border-radius:50%}.sheet-primary{width:100%;margin-top:9px;padding:10px;border:0;border-radius:8px;color:#fff;background:#2563eb}.danger-text{color:#dc2626}
.mine-page { height:calc(100dvh - 50px - env(safe-area-inset-bottom)); overflow:auto; background:#f8fafc; }.profile { padding:24px 16px; display:flex; gap:12px; align-items:center; background:#fff; }.profile-avatar { width:48px;height:48px;display:grid;place-items:center;border-radius:50%;color:white;background:#111827;font-weight:700; }.profile strong,.profile small { display:block; }.profile small { margin-top:5px; color:#94a3b8; font-size:11px; }.setting-list { margin-top:10px; background:#fff; }.setting-row { min-height:49px; padding:0 15px; display:flex; align-items:center; border-bottom:1px solid #f1f5f9; font-size:13px; }.setting-row span { margin-left:auto; color:#94a3b8; }.logout-agent { width:calc(100% - 24px); height:44px; margin:18px 12px; border:1px solid #fecaca; border-radius:9px; color:#dc2626; background:#fff; }
.empty { padding:60px 20px; text-align:center; color:#94a3b8; font-size:12px; }.agent-toast { position:absolute; z-index:100; left:50%; bottom:70px; transform:translateX(-50%); padding:8px 13px; border-radius:20px; color:white; background:rgba(15,23,42,.9); font-size:12px; white-space:nowrap; }
.retention-note{padding:7px 10px;color:#667085;border-bottom:1px solid #eef2f6;background:#f8fafc;font-size:10px;text-align:center}.chat-retention{border-top:1px solid #eef2f6}.retention-menu-note{margin:12px 0 2px;padding:9px;border-radius:8px;color:#667085;background:#f8fafc;font-size:11px;line-height:1.55}.workspace-root .conversation-list{height:calc(100dvh - 171px - env(safe-area-inset-bottom))}.workspace-root.no-notify .conversation-list{height:calc(100dvh - 131px - env(safe-area-inset-bottom))}

/* Rich media composer */
.msg-bubble p{margin:5px 0 0}.msg-bubble a{display:block}.agent-media{display:block;max-width:100%;border-radius:8px}.agent-media.image{max-height:280px;object-fit:contain}.agent-media.video{width:min(100%,340px);max-height:300px;background:#111}.agent-audio{min-width:220px;display:grid;gap:6px}.agent-audio span{font-size:11px}.agent-audio audio{width:220px;max-width:100%;height:34px}.agent-compose-tools{height:38px;padding:4px 8px;display:flex;align-items:center;gap:5px;border-top:1px solid #eef2f6;background:#fff}.agent-compose-tools button,.agent-compose-tools label{width:31px;height:29px;padding:0;display:grid;place-items:center;border:0;border-radius:7px;color:#475467;background:#f2f4f7;font-size:18px}.agent-compose-tools label input{display:none}.agent-compose-tools span{margin-left:3px;color:#667085;font-size:10px}.agent-compose-tools button.recording{color:#fff;background:#ef4444;animation:agentVoicePulse 1s infinite}.agent-emoji-panel{padding:7px 9px;display:flex;flex-wrap:wrap;gap:5px;border-top:1px solid #eef2f6;background:#f8fafc}.agent-emoji-panel[hidden]{display:none}.agent-emoji-panel button{width:31px;height:31px;border:1px solid #e4e7ec;border-radius:7px;background:#fff;font-size:17px}.compose{padding-top:6px}.message-list{padding-bottom:8px}@keyframes agentVoicePulse{50%{transform:scale(.9);opacity:.72}}@media(max-width:380px){.agent-audio{min-width:185px}.agent-audio audio{width:185px}}

.chat-call{width:34px!important;height:34px!important;padding:0;display:grid;place-items:center;border-radius:50%!important;color:#15803d!important;background:#f0fdf4!important;font-size:18px!important}.msg{position:relative}.msg-delete{width:18px;height:18px;padding:0;display:grid;place-items:center;align-self:center;border:0;border-radius:50%;color:#98a2b3;background:#eef2f6;font-size:13px;cursor:pointer}.service .msg-delete{order:-1}.msg-delete:hover{color:#fff;background:#ef4444}
.agent-call-overlay{position:fixed;z-index:300;inset:0;padding:18px;display:grid;place-items:center;background:rgba(5,35,18,.62);backdrop-filter:blur(5px)}.agent-call-overlay[hidden]{display:none}.agent-call-card{width:min(100%,330px);min-height:390px;padding:42px 24px 32px;display:flex;flex-direction:column;align-items:center;border-radius:18px;color:#fff;background:linear-gradient(180deg,#166534,#052e16);box-shadow:0 24px 70px rgba(0,0,0,.4)}.agent-call-avatar{width:82px;height:82px;margin-bottom:25px;display:grid;place-items:center;border:2px solid rgba(255,255,255,.75);border-radius:50%;background:#22c55e;box-shadow:0 0 0 10px rgba(134,239,172,.12);font-size:30px;font-weight:800}.agent-call-card>b{font-size:20px}.agent-call-card>span{margin-top:8px;color:#dcfce7;font-size:13px}.agent-call-card>time{min-height:18px;margin-top:12px;color:#bbf7d0;font-size:12px}.agent-call-actions{width:100%;margin-top:auto;display:flex;align-items:center;justify-content:center;gap:26px}.agent-call-actions button{width:55px;height:55px;border:0;border-radius:50%;color:#fff;font-size:25px}.agent-call-accept{background:#22c55e}.agent-call-mute{background:rgba(255,255,255,.18)}.agent-call-mute.is-muted{background:#f59e0b}.agent-call-end{background:#ef4444}.agent-call-actions button[hidden]{display:none}
/* Customer inbox: desktop split layout with a dedicated mobile conversation view. */
[hidden]{display:none!important}button{cursor:pointer}button:disabled{opacity:.5;cursor:not-allowed}
.agent-root{width:100%;max-width:1500px}.workspace-root{display:grid;grid-template-columns:330px minmax(0,1fr);height:100dvh;min-height:0;background:#f4f8f6;box-shadow:none}.agent-inbox{display:flex;min-width:0;min-height:0;flex-direction:column;border-right:1px solid #dee9e3;background:#fff}.inbox-head{display:flex;align-items:center;gap:11px;padding:23px 19px 18px}.workbench-brand{display:grid;place-items:center;width:39px;height:39px;border-radius:12px;background:#16865f;color:#fff;font-size:21px;font-weight:700}.inbox-head h1{margin:0;font-size:18px;letter-spacing:.4px}.inbox-head h1 span{margin-left:5px;padding:2px 6px;border-radius:5px;background:#eef5f1;color:#537265;font-size:11px;vertical-align:middle}.inbox-head small{display:block;margin-top:4px;color:#8d9f96;font-size:11px}.inbox-controls{padding:0 17px 12px;border-bottom:1px solid #edf1ef}.inbox-state,.inbox-unread{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px}.inbox-state>span{color:#16865f;white-space:nowrap}.inbox-state button,.inbox-unread button{border:0;border-radius:6px;background:#eef7f2;color:#467760;padding:7px 9px;font-size:11px}.inbox-unread{margin:11px 0;color:#788c81}.inbox-unread b{color:#e45656;margin-right:auto}.inbox-unread button{background:none;color:#648873;padding:4px 0}.inbox-controls input{width:100%;height:38px;padding:8px 11px;border:1px solid #dce6e0;border-radius:8px;outline:none;font-size:12px;background:#fafcfb}.inbox-controls input:focus{border-color:#41a47e;box-shadow:0 0 0 3px #16865f12}.inbox-filters{display:flex;gap:5px;margin-top:11px;align-items:center}.inbox-filters select{min-width:0;flex:1;border:0;background:#f2f6f4;border-radius:6px;padding:6px;color:#52695c;font-size:11px}.inbox-filters button{border:0;background:transparent;padding:6px;color:#52695c;font-size:11px}.workspace-root .conversation-list,.workspace-root.no-notify .conversation-list{height:auto;min-height:0;flex:1;overflow:auto;overscroll-behavior:contain}.conversation-item{display:flex;align-items:center;border-bottom:1px solid #f0f4f2;padding:0 5px}.conversation-item>input{margin-left:8px;accent-color:#16865f}.conversation-row{min-height:82px;padding:13px 10px;border:0;grid-template-columns:35px minmax(0,1fr) auto;gap:9px;border-radius:8px;margin:3px 0}.conversation-row.active{background:#edf7f1;box-shadow:inset 3px 0 #16865f}.conversation-row:hover{background:#f4f8f6}.conv-avatar{width:34px;height:34px;background:#edf5f0;color:#5a8b71}.active .conv-avatar{background:#d7efdf;color:#16865f}.conv-name{font-size:13px;font-weight:600;overflow-wrap:anywhere}.conv-preview{color:#85948b;font-size:11px}.conv-meta{display:block;margin-top:6px;color:#99a79e;font-size:10px}.conv-time{font-size:9px}.inbox-footer{min-height:55px;border-top:1px solid #e7eee9;display:flex;align-items:center;gap:6px;padding:10px 16px;font-size:11px;color:#5d7768}.inbox-footer>span{margin-right:auto;max-width:100px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.inbox-footer button{padding:6px;border:0;color:#63796c;background:none;font-size:11px}.bulk-actions{padding:8px 12px;display:flex;gap:10px;align-items:center;background:#f5f9f6;font-size:11px}.bulk-actions button{padding:5px 7px;border:1px solid #dce8e0;border-radius:6px;background:#fff;font-size:11px}.bulk-actions span{margin-right:auto}.agent-chat-panel{min-height:0;min-width:0;height:100%}.workspace-empty{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:25px;text-align:center}.empty-chat-icon{width:80px;height:80px;border-radius:24px;background:#e2f1e9;color:#16865f;font-size:46px;display:grid;place-items:center}.workspace-empty h2{margin:25px 0 8px;font-size:21px;font-weight:600;color:#4d6b5b}.workspace-empty p{color:#8a9f92;font-size:13px}.workspace-empty small{color:#a6b5ac;font-size:11px}.workspace-root .chat-screen{height:100%;background:#f5f9f6}.chat-head{min-height:78px;padding:15px 24px;border-bottom-color:#e4ece6;gap:12px}.chat-title strong{font-size:16px}.chat-title small{font-size:11px;margin-top:7px;color:#87988d}.chat-head .chat-call{width:auto!important;height:34px!important;padding:0 12px;border-radius:8px!important;background:#edf7f1!important;color:#16865f!important;font-size:13px!important}.chat-head .chat-more{border:1px solid #dfe9e2;border-radius:8px}.chat-screen #back-chat{display:none}.message-list{padding:22px 25px}.msg{max-width:85%;margin:16px 0}.msg-bubble{padding:11px 14px;font-size:14px;border-color:#e2ebe5;box-shadow:0 2px 4px #123b2410}.service .msg-bubble{background:#16865f;border-color:#16865f}.msg-time{color:#91a197}.chat-retention{background:#f5f9f6;color:#92a298;font-size:10px}.quick-strip{padding:10px 20px;border-top:1px solid #e6eee8}.quick-strip button{border-color:#dce9e0;color:#688773}.agent-compose-tools{height:46px;padding:5px 20px;border-top:none}.agent-compose-tools button,.agent-compose-tools label{background:#f1f6f3;width:34px;height:32px}.compose{padding:8px 20px 20px;border-top:0;align-items:flex-end}.compose textarea{min-height:76px;max-height:180px;border-color:#dce7df;border-radius:9px;font-size:13px;padding:12px}.compose button{width:85px;height:36px;background:#16865f}.agent-toast{position:fixed;bottom:35px;max-width:min(90vw,620px);white-space:normal;text-align:center;line-height:1.5}.filter-sheet{position:fixed;left:50%;right:auto;bottom:30px;transform:translateX(-50%);width:min(94vw,490px);max-height:78vh;overflow:auto;border-radius:14px;border:1px solid #dfe8e2;box-shadow:0 10px 60px #0f34252b}.tool-grid{grid-template-columns:repeat(auto-fit,minmax(180px,1fr));max-width:1000px;margin:auto}.agent-tabs button.active{color:#16865f}.agent-login{align-items:center;background:radial-gradient(ellipse at 30% 20%,#e0f1e7,transparent 60%),#f4f8f6}.agent-login form{padding:30px;max-width:420px;border-color:#dfe9e2}.agent-login h1{font-size:23px;color:#315543}.agent-login p{font-size:13px}.agent-login input:focus{border-color:#16865f}.agent-login button{background:#16865f}
@media(min-width:1501px){.workspace-root{border-left:1px solid #e1ebe5;border-right:1px solid #e1ebe5}}
@media(max-width:850px) and (min-width:701px){.workspace-root{grid-template-columns:285px minmax(0,1fr)}.chat-head{padding:12px}.message-list{padding:12px}.chat-head .chat-call span{display:none}}
@media(max-width:700px){.workspace-root{display:block;width:100%;height:100dvh}.agent-inbox{height:100%;border:0}.agent-chat-panel{display:none}.workspace-root.chat-open .agent-inbox{display:none}.workspace-root.chat-open .agent-chat-panel{display:block}.chat-screen #back-chat{display:block}.chat-head{min-height:64px;padding:8px}.chat-title strong{font-size:14px}.chat-head .chat-call{padding:0 9px;font-size:12px!important}.chat-title small{font-size:10px}.message-list{padding:14px 10px}.msg{max-width:91%}.msg-bubble{font-size:13px}.compose{padding:8px 10px calc(10px + env(safe-area-inset-bottom))}.compose textarea{min-height:44px}.compose button{width:67px;height:39px}.quick-strip{padding:8px 10px}.agent-compose-tools{padding-left:10px}.inbox-head{padding-top:20px}.filter-sheet{bottom:20px}.tool-grid{grid-template-columns:repeat(2,1fr)}.inbox-footer{padding-bottom:calc(10px + env(safe-area-inset-bottom))}.agent-toast{bottom:90px}}

.presence-dot{display:inline-block;width:7px;height:7px;margin:0 4px 1px 0;border-radius:50%;background:#98a2b3}.presence-dot.online{background:#12b76a;box-shadow:0 0 0 3px rgba(18,183,106,.12)}.presence-dot.offline{background:#98a2b3}
