/* chat-widget.css — Armour Homes floating live chat (worker portals) */
html { overflow-x: clip !important; }
body { overflow-x: clip !important; position: static !important; width: 100%; }
.awc-root {
  --awc-accent: #14532d; --awc-accent-2: #16a34a; --awc-bg: #ffffff; --awc-text: #1a1a1a;
  position: fixed !important; right: 18px; bottom: 18px; z-index: 2147483000;
  width: 58px; height: 58px; overflow: visible; pointer-events: none;
}
.awc-fab {
  position: absolute; right: 0; bottom: 0; z-index: 1;
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--awc-accent); color: #fff; border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(0,0,0,.28); transition: transform .15s ease;
  font-size: 24px; pointer-events: auto;
}
.awc-fab:hover { transform: scale(1.06); }
.awc-fab-label {
  position: absolute; right: calc(100% + 8px); top: 50%; transform: translateY(-50%);
  white-space: nowrap; background: var(--awc-accent); color: #fff;
  font-size: 12px; font-weight: 800; letter-spacing: .02em;
  padding: 7px 10px; border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0,0,0,.22);
  line-height: 1;
}
.awc-fab-label::after {
  content: ''; position: absolute; right: -5px; top: 50%; transform: translateY(-50%) rotate(45deg);
  width: 10px; height: 10px; background: var(--awc-accent);
}
.awc-unread {
  position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px;
  border-radius: 10px; background: #dc2626; color: #fff; font-size: 12px;
  font-weight: 800; display: flex; align-items: center; justify-content: center;
  padding: 0 5px;
}
.awc-panel {
  position: fixed; right: 18px; bottom: 88px; z-index: 2147483000; pointer-events: auto;
  width: min(380px, calc(100vw - 24px)); height: min(560px, calc(100vh - 120px));
  background: var(--awc-bg); color: var(--awc-text); border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,.35); display: flex; flex-direction: column;
  overflow: hidden; font-size: 14px; border: 1px solid rgba(0,0,0,.08);
}
.awc-panel[hidden] { display: none; }
.awc-head {
  background: var(--awc-accent); color: #fff; padding: 12px 14px;
  display: flex; align-items: center; justify-content: space-between; flex: 0 0 auto;
}
.awc-head-info { display: flex; flex-direction: column; gap: 2px; }
.awc-head-info strong { font-size: 15px; }
.awc-status { display: flex; align-items: center; gap: 5px; font-size: 12px; opacity: .9; }
.awc-dot { width: 8px; height: 8px; border-radius: 50%; background: #fbbf24; display: inline-block; }
.awc-dot.on { background: #4ade80; }
.awc-dot.off { background: #f87171; }
.awc-head-actions { display: flex; align-items: center; gap: 4px; }
.awc-icon-btn {
  background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.22);
  border-radius: 6px; padding: 4px 7px; font-size: 11px; font-weight: 700; cursor: pointer;
}
.awc-icon-btn:hover { background: rgba(255,255,255,.22); }
.awc-close { background: transparent; border: 0; color: #fff; font-size: 16px; cursor: pointer; padding: 4px; opacity: .85; }
.awc-close:hover { opacity: 1; }
.awc-sessions {
  flex: 0 0 auto; max-height: 180px; overflow-y: auto; background: #f8fafc;
  border-bottom: 1px solid #e5e7eb; padding: 8px 10px;
}
.awc-sessions[hidden] { display: none; }
.awc-sessions-head { font-size: 11px; font-weight: 800; color: #64748b; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.awc-sessions-list { display: flex; flex-direction: column; gap: 4px; }
.awc-session-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 7px 8px;
  cursor: pointer; text-align: left; width: 100%;
}
.awc-session-item strong { font-size: 12px; color: #0f172a; }
.awc-session-item span { font-size: 11px; color: #64748b; }
.awc-session-item.current { border-color: #16a34a; background: #f0fdf4; }
.awc-session-empty { font-size: 12px; color: #64748b; padding: 6px 2px; }
.awc-messages { flex: 1 1 auto; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.awc-msg { max-width: 85%; padding: 8px 11px; border-radius: 12px; line-height: 1.4; white-space: pre-wrap; word-wrap: break-word; }
.awc-msg.user { align-self: flex-end; background: var(--awc-accent-2); color: #fff; border-bottom-right-radius: 4px; }
.awc-msg.assistant { align-self: flex-start; background: #f1f5f9; color: var(--awc-text); border-bottom-left-radius: 4px; }
.awc-msg.sys { align-self: center; background: #fef3c7; color: #78350f; font-size: 12px; padding: 6px 10px; border-radius: 8px; }
.awc-actions { flex: 0 0 auto; padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; }
.awc-actions[hidden] { display: none; }
.awc-action-btn {
  background: #eef2ff; color: #3730a3; border: 1px solid #c7d2fe; border-radius: 8px;
  padding: 8px 10px; font-size: 13px; cursor: pointer; text-align: left; font-weight: 600;
}
.awc-action-btn:hover { background: #e0e7ff; }
.awc-input { flex: 0 0 auto; display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid #e5e7eb; background: #fff; }
.awc-input input {
  flex: 1; border: 1px solid #d1d5db; border-radius: 8px; padding: 9px 11px; font-size: 14px; outline: none;
}
.awc-input input:focus { border-color: var(--awc-accent-2); }
.awc-send {
  background: var(--awc-accent-2); color: #fff; border: 0; border-radius: 8px;
  width: 42px; font-size: 15px; cursor: pointer;
}
.awc-send:disabled { opacity: .5; cursor: default; }
.awc-typing { font-style: italic; color: #6b7280; font-size: 13px; padding: 4px 2px; display: flex; align-items: center; gap: 6px; }
.awc-typing-dots { display: inline-flex; gap: 3px; }
.awc-typing-dots span { width: 6px; height: 6px; border-radius: 50%; background: #9ca3af; animation: awc-bounce 1.4s infinite ease-in-out both; }
.awc-typing-dots span:nth-child(1) { animation-delay: -.32s; }
.awc-typing-dots span:nth-child(2) { animation-delay: -.16s; }
@keyframes awc-bounce { 0%, 80%, 100% { transform: scale(.6); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }
@media (max-width: 480px) {
  .awc-panel { right: 8px; bottom: 80px; left: 8px; width: auto; height: min(520px, calc(100vh - 110px)); }
  .awc-fab { right: 12px; bottom: 12px; }
}
