
*{box-sizing:border-box}body{margin:0;font:15px/1.45 system-ui,-apple-system,Segoe UI,Roboto,sans-serif;background:#f5f6f8;color:#1c1e21}
a{color:#0a58ca;text-decoration:none}.top{display:flex;gap:12px;align-items:baseline;padding:12px 16px;background:#fff;border-bottom:1px solid #e3e5e8}
.brand{font-weight:700;color:#1c1e21}.sub{color:#65676b;font-size:13px}main{max-width:860px;margin:0 auto;padding:16px}
.conversations{list-style:none;margin:0;padding:0}.conversations li a{display:block;background:#fff;border:1px solid #e3e5e8;border-radius:8px;padding:10px 12px;margin-bottom:8px;color:inherit}
.conversations li.unread a{border-color:#0a58ca}.row{display:flex;justify-content:space-between;gap:8px;align-items:center}.snippet{color:#444;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
time{color:#65676b;font-size:12px;white-space:nowrap}.badges{display:flex;gap:4px;flex-wrap:wrap}.badge{font-size:12px;border-radius:10px;padding:1px 8px;white-space:nowrap}
.badge.ai{background:#e7f0ff;color:#0a58ca}.badge.staff{background:#fff1d6;color:#8a5a00}.badge.lead{background:#e3f6e8;color:#1e7b34}.badge.unread{background:#0a58ca;color:#fff}
.badge.closed{background:#eee;color:#555}.badge.open{background:#eef7ee;color:#2d6a2d}.head{display:flex;flex-wrap:wrap;gap:8px;align-items:center;justify-content:space-between}
.head h1{font-size:20px;margin:0}.reason{color:#8a5a00;margin:4px 0 0}#messages{margin:16px 0;display:flex;flex-direction:column;gap:8px}
.msg{max-width:80%;border-radius:12px;padding:8px 12px;background:#fff;border:1px solid #e3e5e8}.msg.customer{align-self:flex-start}
.msg.ai{align-self:flex-end;background:#e7f0ff;border-color:#c9dcff}.msg.staff{align-self:flex-end;background:#fff1d6;border-color:#f2d9a6}
.msg.failed{border-color:#d33}.msg .meta{font-size:12px;color:#65676b}.msg .text{white-space:pre-wrap;word-wrap:break-word}.error{color:#b00020;font-size:12px}
.note{align-self:center;font-size:12px;color:#65676b;background:#eceef1;border-radius:8px;padding:2px 10px}.reply{display:flex;flex-direction:column;gap:6px;background:#fff;border:1px solid #e3e5e8;border-radius:8px;padding:12px}
textarea{width:100%;font:inherit;padding:8px;border:1px solid #ccd0d5;border-radius:6px}button{font:inherit;padding:8px 14px;border-radius:6px;border:0;background:#0a58ca;color:#fff;cursor:pointer;align-self:flex-start}
button.secondary{background:#fff;color:#1c1e21;border:1px solid #ccd0d5}button:disabled{background:#c8ccd1;cursor:not-allowed}.flash{color:#b00020}.empty{color:#65676b}
.login{max-width:360px;margin:48px auto;background:#fff;border:1px solid #e3e5e8;border-radius:8px;padding:20px;display:flex;flex-direction:column;gap:8px}
.login input{font:inherit;padding:8px;border:1px solid #ccd0d5;border-radius:6px}
