.whatsapp-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 48px;
    height: 48px;
    border-radius: 13px;
    background: linear-gradient(145deg, #39df78, #20b85a);
    color: #fff;
    font-size: 22px;
    box-shadow: 0 7px 16px #25d3662b;
}
.whatsapp-icon svg { width: 25px; height: 29px; display: block; }
.whatsapp-connect-button { width: auto; white-space: nowrap; }
.conversation .avatar.whatsapp-avatar { background: #25d366; }
.conversation .avatar.whatsapp-avatar svg { width: 19px; height: 22px; color: #fff; }
.whatsapp-dialog[hidden] { display: none; }
.whatsapp-dialog { position: fixed; inset: 0; z-index: 1200; display: grid; place-items: center; padding: 20px; }
.whatsapp-dialog-backdrop { position: absolute; inset: 0; background: rgba(8,18,39,.58); backdrop-filter: blur(4px); }
.whatsapp-dialog > section { position: relative; width: min(500px,100%); padding: 25px; border-radius: 17px; background: #fff; box-shadow: 0 28px 80px rgba(8,22,52,.28); }
.whatsapp-dialog-head,.whatsapp-dialog-brand { display: flex; align-items: center; }
.whatsapp-dialog-head { justify-content: space-between; gap: 18px; }
.whatsapp-dialog-brand { gap: 12px; }
.whatsapp-dialog-brand small { color: #16834b; font-size: 9px; font-weight: 800; letter-spacing: 1.3px; }
.whatsapp-dialog-brand h2 { margin: 2px 0 0; font-size: 20px; }
.whatsapp-dialog-head > button { width: 34px; padding: 2px; border: 0; background: #eef2f7; color: #66738a; box-shadow: none; font-size: 22px; }
.whatsapp-dialog-intro { margin: 18px 0; color: #6f7c91; font-size: 12px; line-height: 1.6; }
.whatsapp-dialog form label { display: block; margin: 14px 0 6px; font-size: 11px; font-weight: 800; }
.whatsapp-dialog form label em { color: #df4050; font-style: normal; }
.whatsapp-dialog form input { width: 100%; }
.whatsapp-dialog .field-help { display: block; margin-top: 5px; color: #8a96a8; font-size: 10px; }
.whatsapp-dialog-actions { display: grid; grid-template-columns: 1fr 1.35fr; gap: 10px; margin-top: 22px; }
.human-reply-alert { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-bottom: 1px solid #f2dca9; background: #fff8e7; color: #7c5a12; font-size: 11px; }
.human-reply-alert strong { white-space: nowrap; }
.human-reply-alert span { color: #8c733d; }
.whatsapp-dialog-actions button { width: 100%; }
body.dialog-open { overflow: hidden; }
.customer-insights { padding-bottom: 20px; }
.profile-card { display: flex; align-items: center; gap: 11px; margin: 0 17px 14px; padding: 13px; border: 1px solid #e2e8f1; border-radius: 12px; background: #fff; }
.insight-avatar { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 12px; background: #2aabee; color: #fff; font-size: 16px; font-weight: 800; }
.insight-avatar.whatsapp-profile { background: #25d366; }
.profile-card > div { min-width: 0; }
.profile-card b,.profile-card small,.profile-card em { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-card b { font-size: 13px; }
.profile-card small { margin-top: 2px; color: #65758d; font-size: 10px; }
.profile-card em { margin-top: 4px; color: #8b97aa; font-size: 9px; font-style: normal; }
.intent-card,.memory-card,.knowledge-record-card { margin: 0 17px 14px; padding: 14px; border: 1px solid #e2e8f1; border-radius: 12px; background: #fff; }
.insight-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.insight-title small,.insight-title b { display: block; }
.insight-title small { color: #8b97aa; font-size: 9px; font-weight: 700; }
.insight-title b { margin-top: 3px; font-size: 12px; }
.insight-title strong { color: #273b5b; font-size: 22px; }
.insight-title strong i { color: #98a3b4; font-size: 9px; font-style: normal; }
.intent-level.high { color: #14875b; }
.intent-level.medium { color: #c17b12; }
.intent-level.low { color: #6f7c91; }
.intent-track { height: 7px; margin: 12px 0; overflow: hidden; border-radius: 5px; background: #edf1f6; }
.intent-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#55a0ed,#25b975); }
.signal-list { display: flex; flex-wrap: wrap; gap: 6px; }
.signal-list span { padding: 5px 7px; border-radius: 12px; background: #edf5ff; color: #2870cb; font-size: 9px; font-weight: 700; }
.no-signals { color: #99a3b3; font-size: 9px; }
.memory-card .insight-title > span { display: grid; place-items: center; width: 21px; height: 21px; border-radius: 8px; background: #edf5ff; color: #2870cb; font-size: 9px; font-weight: 800; }
.memory-card ul { display: grid; gap: 10px; margin: 13px 0 0; padding: 0; list-style: none; }
.memory-card li { display: flex; align-items: flex-start; gap: 8px; color: #536178; font-size: 10px; line-height: 1.45; }
.memory-card li i { flex: none; width: 6px; height: 6px; margin-top: 4px; border-radius: 50%; background: #568ddc; }
.memory-empty { margin: 13px 0 0; color: #8b97aa; font-size: 10px; line-height: 1.55; }
.insight-placeholder { margin: 8px 20px; }
.insight-note { margin: 2px 20px; color: #99a3b3; font-size: 9px; line-height: 1.5; }
.knowledge-record-card .insight-title > span { display:grid;place-items:center;width:24px;height:24px;border-radius:8px;background:#eaf8f1;color:#17805a;font-size:9px;font-weight:800; }
.knowledge-record-card > p { margin:10px 0 0;color:#718096;font-size:9px;line-height:1.5; }
.knowledge-record-card > p.knowledge-record-empty { color:#98a3b4; }
.knowledge-record-card > button { display:flex;align-items:center;justify-content:space-between;width:100%;margin-top:11px;padding:8px 10px;border:1px solid #d7e8df;background:#f2faf6;color:#187653;box-shadow:none;font-size:10px; }
.knowledge-record-card > button i { font-size:17px;font-style:normal;line-height:1; }
.knowledge-view-dialog[hidden]{display:none}.knowledge-view-dialog{position:fixed;inset:0;z-index:1300;display:grid;place-items:center;padding:20px}.knowledge-view-backdrop{position:absolute;inset:0;background:rgba(8,18,39,.62);backdrop-filter:blur(4px)}.knowledge-view-dialog>section{position:relative;display:flex;flex-direction:column;width:min(720px,100%);max-height:min(760px,90vh);padding:24px;border-radius:17px;background:#fff;box-shadow:0 28px 80px rgba(8,22,52,.3)}.knowledge-view-dialog header{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0}.knowledge-view-dialog header small{color:#19815c;font-size:9px;font-weight:800;letter-spacing:1px}.knowledge-view-dialog h2{margin:3px 0 0;font-size:19px}.knowledge-view-dialog header button{width:34px;padding:2px;border:0;background:#eef2f7;color:#66738a;box-shadow:none;font-size:22px}.knowledge-view-meta{display:flex;flex-wrap:wrap;gap:7px;margin:16px 0 12px}.knowledge-view-meta span{padding:5px 8px;border-radius:12px;background:#edf7f2;color:#28735b;font-size:9px;font-weight:700}.knowledge-view-dialog pre{flex:1;min-height:220px;margin:0;padding:16px;overflow:auto;border:1px solid #e1e8f0;border-radius:11px;background:#f8fafc;color:#435269;font:11px/1.75 ui-monospace,SFMono-Regular,Menlo,monospace;white-space:pre-wrap;overflow-wrap:anywhere}.knowledge-view-dialog>section>a{align-self:flex-end;margin-top:14px;color:#2476d1;font-size:11px;font-weight:700;text-decoration:none}
@media (min-width: 1251px) {
    .inbox { grid-template-columns: 280px minmax(460px,1fr) 330px; }
}
@media (max-width: 900px) {
    .whatsapp-connect-button { width: auto; }
}
@media (max-width: 520px) {
    .whatsapp-connect-button { width: 100%; }
    .whatsapp-dialog { padding: 10px; }
    .whatsapp-dialog > section { padding: 21px 17px; }
    .whatsapp-dialog-actions { grid-template-columns: 1fr; }
}
