#internalChatBadge,.ic-count{background:#16846b;color:#fff;border-radius:20px;min-width:20px;padding:2px 6px;font-size:11px;text-align:center}
#internalChatBadge[hidden]{display:none}
dialog.internal-chat{box-sizing:border-box;width:min(1000px,94vw);max-width:none;height:min(740px,90dvh);max-height:94dvh;padding:0;border:1px solid #d9e5e1;border-radius:20px;background:#fff;color:#182e29;box-shadow:0 24px 80px #102e3540;font:14px/1.5 system-ui,sans-serif;overflow:hidden}
.internal-chat::backdrop{background:#10262d80;backdrop-filter:blur(3px)}
.internal-chat *{box-sizing:border-box}
.internal-chat button{cursor:pointer;font:inherit;border:0;border-radius:9px;padding:8px 12px;background:#edf4f1;color:#214b40}
.internal-chat button:focus-visible,.internal-chat input:focus-visible,.internal-chat textarea:focus-visible{outline:3px solid #3f9dca;outline-offset:2px}
.internal-chat button:disabled{opacity:.5;cursor:default}
.ic-header{height:82px;display:flex;align-items:center;justify-content:space-between;padding:16px 24px;border-bottom:1px solid #e4ece8}
.ic-header h2{font-size:22px;letter-spacing:-.5px;margin:0;color:#183b32}
.ic-header p{margin:1px 0 0;color:#61776f;font-size:13px}
.ic-header button{font-size:25px;line-height:1}
.ic-status{margin:0;min-height:27px;padding:3px 24px;font-size:12px;background:#f5f9f7;color:#765218}
.ic-layout{display:grid;grid-template-columns:290px 1fr;height:calc(100% - 109px);min-height:0}
.ic-sidebar{padding:18px 12px;border-right:1px solid #e0e9e5;overflow:auto;background:#fbfcfc}
.ic-sidebar>label{display:block;font-size:12px;font-weight:700;color:#627970;padding:0 6px 8px}
.ic-sidebar input{width:100%;border:1px solid #d6e3dd;border-radius:10px;padding:10px 12px;font:inherit;background:#fff;color:#182e29;margin-bottom:12px}
.ic-users{display:flex;flex-direction:column;gap:5px}
.ic-users .ic-user{width:100%;display:flex;align-items:center;gap:10px;padding:12px 9px;background:transparent;text-align:left;border:1px solid transparent}
.ic-users .ic-user:hover{background:#edf4f1}
.ic-users .ic-user.is-selected{background:#e5f3ed;border-color:#b6d9c9}
.ic-avatar{flex:0 0 36px;height:36px;display:grid;place-items:center;border-radius:12px;background:#d9ebe4;color:#23614e;font-weight:700;font-size:16px}
.ic-user-copy{min-width:0;flex:1}.ic-user-copy strong,.ic-user-copy small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ic-user-copy strong{font-size:13px;color:#1b3e33}.ic-user-copy small{font-size:12px;color:#6a7b74;margin-top:3px}
.ic-conversation{display:flex;flex-direction:column;min-width:0;min-height:0;background:#f4f8f5}
.ic-peer{height:67px;flex-shrink:0;padding:12px 22px;background:white;border-bottom:1px solid #e4ece8;display:flex;flex-direction:column;justify-content:center}
.ic-peer strong{font-size:15px}.ic-peer small{font-size:12px;color:#6a7b74}.ic-peer [data-ic-back]{display:none}
.ic-messages{flex:1;min-height:0;overflow:auto;padding:20px;display:flex;flex-direction:column;gap:10px;overscroll-behavior:contain}
.ic-message{max-width:82%;align-self:flex-start;padding:10px 14px;background:#fff;border:1px solid #dfe8e3;border-radius:14px 14px 14px 3px;box-shadow:0 2px 2px #142e2210;flex-shrink:0}
.ic-message.is-mine{align-self:flex-end;background:#dcf0e6;border-color:#c4e0d2;border-radius:14px 14px 3px 14px}
.ic-message p{margin:0;white-space:pre-wrap;overflow-wrap:anywhere;color:#19392e}.ic-message small{display:block;margin-top:5px;text-align:right;font-size:10px;color:#61756b}
.ic-empty{text-align:center;margin:auto;padding:24px;color:#718079;font-size:13px}
.ic-messages .ic-older{align-self:center;flex-shrink:0;font-size:12px;background:white;border:1px solid #d6e3dd}
.ic-compose{display:grid;grid-template-columns:1fr auto;gap:8px 10px;padding:14px 18px 12px;background:#fff;border-top:1px solid #e0e9e5;flex-shrink:0}
.ic-compose textarea{font:inherit;line-height:1.4;resize:none;min-height:52px;max-height:160px;padding:10px 12px;border:1px solid #ccdcd3;border-radius:11px;background:#fff;color:#182e29}
.ic-compose button{align-self:center;background:#16846b;color:white;font-weight:700;padding:12px 18px}.ic-compose small{grid-column:1/-1;color:#829087;font-size:10px}
.ic-sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
@media(max-width:640px){dialog.internal-chat{width:100vw;height:100dvh;max-height:100dvh;border:0;border-radius:0;margin:0}.ic-header{padding:12px 18px;height:72px}.ic-layout{display:block;height:calc(100% - 99px)}.ic-sidebar{height:100%;border:0}.ic-conversation{height:100%;display:none}.ic-show-conversation .ic-sidebar{display:none}.ic-show-conversation .ic-conversation{display:flex}.ic-peer{position:relative;padding-left:64px}.ic-peer [data-ic-back]{display:block;position:absolute;left:14px;top:14px}.ic-message{max-width:90%}.ic-messages{padding:14px}.ic-compose{padding:12px}.ic-compose textarea{font-size:16px}.ic-status{padding-left:18px}}


/* v1.1 — alerta compacto no menu */
.internal-chat-nav { position: relative; padding-right: 17px !important; }
#internalChatBadge {
  position: absolute;
  top: 2px;
  right: 2px;
  z-index: 3;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  display: inline-grid;
  place-items: center;
  border: 2px solid var(--panel, #fff);
  border-radius: 999px;
  color: #fff;
  background: #dc2626;
  box-shadow: 0 2px 6px rgba(127,29,29,.24);
  font-size: 8px;
  font-weight: 900;
  line-height: 1;
}
#internalChatBadge[hidden] { display: none !important; }
.internal-chat-nav.has-unread > span:first-child {
  transform-origin: 50% 50%;
  animation: internal-chat-attention 1.8s ease-in-out infinite;
}
@keyframes internal-chat-attention {
  0%, 72%, 100% { transform: scale(1); }
  82% { transform: scale(1.13); }
  91% { transform: scale(.98); }
}
.internal-chat-alert {
  position: fixed;
  z-index: 360;
  top: calc(var(--topbar-h, 64px) + 12px);
  right: 14px;
  width: min(320px, calc(100vw - 28px));
  min-height: 58px;
  padding: 10px 11px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid color-mix(in srgb, var(--brand, #16846b) 34%, #d7e3de);
  border-radius: 14px;
  color: var(--text, #183b32);
  background: color-mix(in srgb, var(--panel, #fff) 94%, var(--brand-soft, #edf8f4));
  box-shadow: 0 16px 40px rgba(15, 42, 35, .18);
  text-align: left;
  cursor: pointer;
  animation: internal-chat-alert-in .18s ease-out;
}
.internal-chat-alert[hidden] { display: none !important; }
.ic-alert-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: color-mix(in srgb, var(--brand-soft, #e5f3ed) 82%, #fff);
  font-size: 17px;
}
.ic-alert-copy { min-width: 0; display: grid; gap: 2px; }
.ic-alert-copy strong,
.ic-alert-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ic-alert-copy strong { font-size: 11px; }
.ic-alert-copy small { color: var(--muted, #61776f); font-size: 10px; }
.ic-alert-open { color: var(--brand, #16846b); font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; }
@keyframes internal-chat-alert-in {
  from { opacity: 0; transform: translateY(-7px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .internal-chat-nav.has-unread > span:first-child,
  .internal-chat-alert { animation: none; }
}
@media (max-width: 640px) {
  .internal-chat-alert { top: 10px; right: 10px; width: calc(100vw - 20px); }
}
