.portal-chat{position:fixed;right:18px;bottom:18px;z-index:12000;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#17344f}.portal-chat *{box-sizing:border-box}.portal-chat-launcher{min-width:220px;height:50px;border:0;border-radius:16px;background:linear-gradient(135deg,#0f67bd,#1498c2);color:#fff;box-shadow:0 14px 34px rgba(12,72,126,.28);display:flex;align-items:center;gap:10px;padding:0 15px;font:inherit;font-weight:800;cursor:pointer}.portal-chat-launcher:hover{transform:translateY(-1px)}.portal-chat-launcher .chat-online-dot{width:10px;height:10px;border-radius:50%;background:#56df7a;box-shadow:0 0 0 3px rgba(86,223,122,.16)}.portal-chat-launcher .chat-launcher-text{flex:1;text-align:left}.portal-chat-count{min-width:22px;height:22px;border-radius:999px;background:#ff4f67;color:#fff;display:none;place-items:center;font-size:.72rem;font-weight:900;padding:0 6px}.portal-chat-count.visible{display:grid}.portal-chat-panel{width:370px;height:min(560px,calc(100vh - 36px));border:1px solid #cbdceb;border-radius:20px;background:#fff;box-shadow:0 24px 70px rgba(11,47,78,.28);overflow:hidden;display:none;grid-template-rows:auto 1fr}.portal-chat.open .portal-chat-launcher{display:none}.portal-chat.open .portal-chat-panel{display:grid}.portal-chat-header{background:linear-gradient(135deg,#0f67bd,#1594bf);color:#fff;min-height:62px;padding:11px 13px;display:flex;align-items:center;gap:10px}.portal-chat-header-main{min-width:0;flex:1}.portal-chat-header-main strong{display:block;font-size:.94rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.portal-chat-header-main span{display:block;margin-top:2px;font-size:.75rem;opacity:.88}.portal-chat-icon-button{width:36px;height:36px;border:0;border-radius:10px;background:rgba(255,255,255,.15);color:#fff;display:grid;place-items:center;cursor:pointer;font-size:1rem}.portal-chat-body{min-height:0;background:#f7fafc;display:grid}.portal-chat-view{min-height:0;display:none}.portal-chat-view.active{display:grid}.portal-chat-contacts{grid-template-rows:auto 1fr}.portal-chat-search-wrap{padding:11px;background:#fff;border-bottom:1px solid #e3ecf3}.portal-chat-search{width:100%;border:1px solid #cfdeea;border-radius:11px;padding:10px 12px;font:inherit;font-size:.84rem;outline:none}.portal-chat-search:focus{border-color:#5ca5d9;box-shadow:0 0 0 3px rgba(64,145,205,.12)}.portal-chat-list{overflow:auto;padding:6px}.portal-chat-empty{padding:26px 18px;color:#71869a;font-size:.84rem;text-align:center;line-height:1.5}.portal-chat-contact{width:100%;border:0;background:transparent;border-radius:13px;padding:9px;display:grid;grid-template-columns:44px minmax(0,1fr) auto;gap:10px;align-items:center;text-align:left;cursor:pointer;color:inherit}.portal-chat-contact:hover{background:#eaf4fb}.portal-chat-avatar{width:44px;height:44px;border-radius:50%;overflow:hidden;background:linear-gradient(135deg,#e0edf7,#c6dceb);display:grid;place-items:center;color:#24536f;font-weight:900;font-size:.78rem;background-size:cover;background-position:center;border:1px solid #c4d7e5}.portal-chat-contact-main{min-width:0}.portal-chat-contact-main strong{display:block;font-size:.84rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.portal-chat-contact-main small{display:block;margin-top:2px;color:#71869a;font-size:.72rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.portal-chat-presence{display:flex;align-items:center;gap:5px;margin-top:4px;color:#7b8fa1;font-size:.68rem}.portal-chat-presence-dot{width:8px;height:8px;border-radius:50%;background:#b8c2ca}.portal-chat-presence.online{color:#2d8b51}.portal-chat-presence.online .portal-chat-presence-dot{background:#49ca70}.portal-chat-unread{min-width:22px;height:22px;border-radius:999px;background:#1579c9;color:#fff;display:grid;place-items:center;padding:0 6px;font-size:.68rem;font-weight:900}.portal-chat-conversation{grid-template-rows:1fr auto;background:#eef4f8}.portal-chat-messages{overflow:auto;padding:14px;display:flex;flex-direction:column;gap:8px}.portal-chat-message{max-width:82%;padding:9px 11px;border-radius:14px;background:#fff;border:1px solid #d9e6ef;box-shadow:0 3px 10px rgba(16,52,82,.05);font-size:.82rem;line-height:1.42;white-space:pre-wrap;word-break:break-word}.portal-chat-message.mine{align-self:flex-end;background:#dff1ff;border-color:#b8dff8}.portal-chat-message.theirs{align-self:flex-start}.portal-chat-message-time{display:block;margin-top:4px;font-size:.64rem;color:#748899;text-align:right}.portal-chat-compose{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;padding:10px;background:#fff;border-top:1px solid #dce8f0}.portal-chat-input{resize:none;min-height:42px;max-height:100px;border:1px solid #cfdeea;border-radius:11px;padding:10px 11px;font:inherit;font-size:.82rem;outline:none}.portal-chat-input:focus{border-color:#5ca5d9;box-shadow:0 0 0 3px rgba(64,145,205,.12)}.portal-chat-send{border:0;border-radius:11px;background:#147bc4;color:#fff;font-weight:800;padding:0 14px;cursor:pointer}.portal-chat-status{position:absolute;right:12px;bottom:60px;max-width:300px;background:#fff8df;border:1px solid #ead99a;color:#6a541b;border-radius:10px;padding:9px 11px;font-size:.72rem;box-shadow:0 8px 20px rgba(0,0,0,.1);display:none}.portal-chat-status.visible{display:block}.portal-chat-note{padding:7px 11px;color:#708597;font-size:.66rem;background:#fff;border-top:1px solid #edf2f5}.portal-chat-notification-card{margin-top:9px;padding:10px;border:1px solid #cfe2f2;border-radius:12px;background:#f1f8fd;display:flex;align-items:center;gap:10px}.portal-chat-notification-card[hidden]{display:none}.portal-chat-notification-card>div{min-width:0;flex:1}.portal-chat-notification-card strong{display:block;font-size:.72rem;color:#215477}.portal-chat-notification-card span{display:block;margin-top:3px;font-size:.66rem;line-height:1.35;color:#648096}.portal-chat-notification-card button{border:0;border-radius:9px;background:#1579c9;color:#fff;padding:8px 9px;font:inherit;font-size:.66rem;font-weight:800;cursor:pointer;white-space:nowrap}.portal-chat-notification-card.blocked{background:#fff8e8;border-color:#efdba2}.portal-chat-notification-card.blocked strong{color:#7a5b18}.portal-chat-panel{position:relative}@media(max-width:600px){.portal-chat{right:8px;bottom:8px}.portal-chat-launcher{min-width:190px}.portal-chat-panel{width:calc(100vw - 16px);height:min(72vh,620px);border-radius:18px}.portal-chat-header{min-height:58px}.portal-chat-message{max-width:88%}.portal-chat-notification-card{align-items:flex-start;flex-direction:column}.portal-chat-notification-card button{width:100%}}

/* Aparência escura do chat interno — mantém o tema claro existente intacto. */
html[data-portal-theme="dark"] .portal-chat {
  color: var(--portal-theme-text, #e5eef5);
  color-scheme: dark;
}
html[data-portal-theme="dark"] .portal-chat-panel {
  background: var(--portal-theme-bg-soft, #0b1a27) !important;
  border-color: var(--portal-theme-border, #294456) !important;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .46) !important;
}
html[data-portal-theme="dark"] .portal-chat-header {
  background: linear-gradient(135deg, #0a3150, #0b5575) !important;
  color: #f3f8fc !important;
  border-color: var(--portal-theme-border, #294456) !important;
}
html[data-portal-theme="dark"] .portal-chat-icon-button {
  background: rgba(255, 255, 255, .10) !important;
  color: #f3f8fc !important;
}
html[data-portal-theme="dark"] .portal-chat-icon-button:hover,
html[data-portal-theme="dark"] .portal-chat-icon-button:focus-visible {
  background: rgba(255, 255, 255, .18) !important;
}
html[data-portal-theme="dark"] .portal-chat-body,
html[data-portal-theme="dark"] .portal-chat-contacts,
html[data-portal-theme="dark"] .portal-chat-list {
  background: var(--portal-theme-bg-soft, #0b1a27) !important;
  color: var(--portal-theme-text, #e5eef5) !important;
}
html[data-portal-theme="dark"] .portal-chat-search-wrap,
html[data-portal-theme="dark"] .portal-chat-compose,
html[data-portal-theme="dark"] .portal-chat-note {
  background: var(--portal-theme-surface, #102332) !important;
  color: var(--portal-theme-muted, #9fb2c1) !important;
  border-color: var(--portal-theme-border, #294456) !important;
}
html[data-portal-theme="dark"] .portal-chat-search,
html[data-portal-theme="dark"] .portal-chat-input {
  background: var(--portal-theme-input, #0c1e2c) !important;
  color: var(--portal-theme-text, #e5eef5) !important;
  border-color: #355469 !important;
  caret-color: #8dcbff;
}
html[data-portal-theme="dark"] .portal-chat-search::placeholder,
html[data-portal-theme="dark"] .portal-chat-input::placeholder {
  color: #8299aa !important;
  opacity: 1;
}
html[data-portal-theme="dark"] .portal-chat-search:focus,
html[data-portal-theme="dark"] .portal-chat-input:focus {
  border-color: #5aa9df !important;
  box-shadow: 0 0 0 3px rgba(90, 169, 223, .18) !important;
}
html[data-portal-theme="dark"] .portal-chat-empty {
  color: var(--portal-theme-muted, #9fb2c1) !important;
}
html[data-portal-theme="dark"] .portal-chat-contact {
  color: var(--portal-theme-text, #e5eef5) !important;
}
html[data-portal-theme="dark"] .portal-chat-contact:hover,
html[data-portal-theme="dark"] .portal-chat-contact:focus-visible {
  background: var(--portal-theme-hover, #173247) !important;
  outline: none;
}
html[data-portal-theme="dark"] .portal-chat-contact-main strong {
  color: #e6f0f7 !important;
}
html[data-portal-theme="dark"] .portal-chat-contact-main small,
html[data-portal-theme="dark"] .portal-chat-presence {
  color: #91a8b8 !important;
}
html[data-portal-theme="dark"] .portal-chat-presence.online {
  color: #75dda0 !important;
}
html[data-portal-theme="dark"] .portal-chat-avatar {
  background: linear-gradient(135deg, #18354a, #234b63) !important;
  border-color: #365a72 !important;
  color: #bfe1f4 !important;
}
html[data-portal-theme="dark"] .portal-chat-conversation,
html[data-portal-theme="dark"] .portal-chat-messages {
  background: #081722 !important;
  color: var(--portal-theme-text, #e5eef5) !important;
}
html[data-portal-theme="dark"] .portal-chat-message {
  background: #102637 !important;
  color: #e6eef4 !important;
  border-color: #2e4b60 !important;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .18) !important;
}
html[data-portal-theme="dark"] .portal-chat-message.mine {
  background: #173e5a !important;
  border-color: #2c6487 !important;
  color: #f2f8fc !important;
}
html[data-portal-theme="dark"] .portal-chat-message.theirs {
  background: #102637 !important;
}
html[data-portal-theme="dark"] .portal-chat-message-time {
  color: #8fa6b7 !important;
}
html[data-portal-theme="dark"] .portal-chat-send {
  background: linear-gradient(135deg, #1675b8, #168fb5) !important;
  color: #fff !important;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .18);
}
html[data-portal-theme="dark"] .portal-chat-send:hover,
html[data-portal-theme="dark"] .portal-chat-send:focus-visible {
  filter: brightness(1.08);
}
html[data-portal-theme="dark"] .portal-chat-status {
  background: #362b12 !important;
  border-color: #65501f !important;
  color: #f2d58a !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28) !important;
}
html[data-portal-theme="dark"] .portal-chat-notification-card {
  background: #112f43 !important;
  border-color: #285978 !important;
  color: #b9dff6 !important;
}
html[data-portal-theme="dark"] .portal-chat-notification-card strong {
  color: #c8e8fb !important;
}
html[data-portal-theme="dark"] .portal-chat-notification-card span {
  color: #9fc2d8 !important;
}
html[data-portal-theme="dark"] .portal-chat-notification-card.blocked {
  background: #362b12 !important;
  border-color: #65501f !important;
}
html[data-portal-theme="dark"] .portal-chat-notification-card.blocked strong {
  color: #f2d58a !important;
}
html[data-portal-theme="dark"] .portal-chat-list,
html[data-portal-theme="dark"] .portal-chat-messages {
  scrollbar-color: #36556b #0b1a27;
}
