/* Connected CRM / Service / portal conversations — v7.8.0 */
.customer-messaging-panel{display:grid;gap:18px;padding:22px;border:1px solid #dbe4f0;border-radius:24px;background:linear-gradient(145deg,#fff,#f8fafc);box-shadow:0 14px 38px rgba(15,23,42,.08)}
.customer-messaging-head{display:flex;justify-content:space-between;gap:18px;align-items:flex-start}.customer-messaging-head span{display:block;font-size:11px;font-weight:900;letter-spacing:.12em;color:#1d4ed8}.customer-messaging-head h2{margin:5px 0 4px;font-size:25px;letter-spacing:-.035em;color:#0f172a}.customer-messaging-head p{margin:0;color:#64748b;max-width:680px}.customer-messaging-head>strong{padding:9px 12px;border-radius:999px;background:#dbeafe;color:#1e40af;font-size:12px;white-space:nowrap}
.customer-message-context{display:grid;grid-template-columns:repeat(auto-fit,minmax(145px,1fr));gap:9px}.customer-message-context>div{padding:12px;border-radius:14px;background:#0f172a;color:#fff}.customer-message-context small{display:block;color:#94a3b8;font-size:10px;font-weight:900;letter-spacing:.08em;text-transform:uppercase}.customer-message-context strong{display:block;margin-top:4px;font-size:13px;overflow-wrap:anywhere}
.customer-thread-list{display:grid;gap:12px}.customer-thread{border:1px solid #dbe4f0;border-radius:19px;background:#fff;overflow:hidden}.customer-thread>summary{list-style:none;cursor:pointer;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;padding:16px 18px;align-items:center}.customer-thread>summary::-webkit-details-marker{display:none}.customer-thread>summary strong{display:block;color:#0f172a;font-size:15px}.customer-thread>summary span{display:block;color:#64748b;font-size:12px;margin-top:3px}.customer-thread>summary b{padding:7px 10px;border-radius:999px;background:#eff6ff;color:#1d4ed8;font-size:11px}.customer-thread[open]>summary{background:#f8fafc;border-bottom:1px solid #e2e8f0}.customer-thread-body{display:grid;gap:11px;padding:16px;max-height:520px;overflow:auto}.customer-message{max-width:min(78%,680px);padding:13px 15px;border-radius:18px;color:#0f172a;background:#f1f5f9;border:1px solid #e2e8f0}.customer-message.is-staff{justify-self:end;background:#0b2aa2;color:#fff;border-color:#0b2aa2;border-bottom-right-radius:5px}.customer-message.is-customer{justify-self:start;border-bottom-left-radius:5px}.customer-message p{margin:0;white-space:pre-wrap;line-height:1.55;font-size:14px}.customer-message small{display:block;margin-top:7px;color:#64748b;font-size:10px}.customer-message.is-staff small{color:#bfdbfe}.customer-message-empty{padding:20px;text-align:center;color:#64748b;background:#f8fafc;border-radius:16px}
.customer-message-compose{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:end;padding-top:4px}.customer-message-compose label{display:grid;gap:6px;color:#334155;font-size:12px;font-weight:800}.customer-message-compose input,.customer-message-compose textarea{width:100%;box-sizing:border-box;border:1px solid #cbd5e1;border-radius:13px;padding:11px 13px;background:#fff;color:#0f172a;font:inherit}.customer-message-compose textarea{min-height:96px;resize:vertical}.customer-message-compose .compose-fields{display:grid;gap:9px}.customer-message-compose button{min-height:46px}.customer-message-delivery-note{padding:12px 14px;border-radius:14px;background:#eff6ff;color:#1e3a8a;font-size:12px;line-height:1.5}

.customer-message-context-note,.portal-message-concern{padding:13px 15px;border-radius:15px;background:#fff7ed;border:1px solid #fed7aa;color:#7c2d12}.customer-message-context-note small,.portal-message-concern small{display:block;font-size:10px;font-weight:900;letter-spacing:.08em;text-transform:uppercase;color:#c2410c}.customer-message-context-note p,.portal-message-concern p{margin:5px 0 0;line-height:1.55;white-space:pre-wrap}.portal-message-concern{margin:12px 17px 0}.portal-section-nav a b{display:inline-grid;place-items:center;min-width:19px;height:19px;margin-left:5px;padding:0 5px;border-radius:999px;background:#dc2626;color:#fff;font-size:10px;line-height:1}
/* Portal */
.portal-message-grid{display:grid;gap:16px}.portal-message-thread{border:1px solid #dbe4f0;border-radius:22px;background:#fff;overflow:hidden;box-shadow:0 12px 34px rgba(15,23,42,.06)}.portal-message-thread>summary{list-style:none;cursor:pointer;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;padding:18px}.portal-message-thread>summary::-webkit-details-marker{display:none}.portal-message-thread>summary strong{display:block;font-size:16px;color:#0f172a}.portal-message-thread>summary span{display:block;color:#64748b;font-size:12px;margin-top:4px}.portal-message-thread>summary b{align-self:start;padding:7px 10px;border-radius:999px;background:#dbeafe;color:#1d4ed8;font-size:11px}.portal-message-thread[open]>summary{background:#f8fafc;border-bottom:1px solid #e2e8f0}.portal-message-context{display:flex;flex-wrap:wrap;gap:7px;padding:14px 17px 0}.portal-message-context span{padding:7px 10px;border-radius:999px;background:#f1f5f9;color:#334155;font-size:11px;font-weight:800}.portal-message-stream{display:grid;gap:10px;padding:16px;max-height:540px;overflow:auto}.portal-message{max-width:min(84%,650px);padding:13px 15px;border-radius:18px;background:#eef2f7;color:#0f172a;border-bottom-left-radius:5px}.portal-message.is-customer{justify-self:end;background:#001f7a;color:#fff;border-bottom-left-radius:18px;border-bottom-right-radius:5px}.portal-message p{margin:0;white-space:pre-wrap;line-height:1.55}.portal-message small{display:block;margin-top:7px;font-size:10px;color:#64748b}.portal-message.is-customer small{color:#bfdbfe}.portal-message-reply{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;padding:0 16px 16px;align-items:end}.portal-message-reply textarea{width:100%;min-height:82px;box-sizing:border-box;border:1px solid #cbd5e1;border-radius:15px;padding:12px;font:inherit;resize:vertical}.portal-message-reply button{min-height:46px}
@media(max-width:900px){.customer-message-context{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:640px){.customer-messaging-panel{padding:16px;border-radius:19px}.customer-messaging-head{display:grid}.customer-message-context{grid-template-columns:1fr 1fr}.customer-message{max-width:92%}.customer-message-compose,.portal-message-reply{grid-template-columns:1fr}.customer-message-compose button,.portal-message-reply button{width:100%}.portal-message{max-width:92%}}
