:root {
  --bg: #0f172a;
  --panel: #111827;
  --muted: #6b7280;
  --text: #e5e7eb;
  --accent: #10b981;
  --danger: #ef4444;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.4 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif; }
.subtitle { color: var(--muted); margin: 0; font-size: 12px; }
.dot { display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:6px; vertical-align:middle; }
.dot-green { background:#22c55e; box-shadow:0 0 8px rgba(34,197,94,.75); }

/* Floating action button */
.chat-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 40;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: #052e25; border: 0; border-radius: 999px;
  padding: 10px 14px; font-weight: 700; cursor: pointer;
  box-shadow: 0 10px 25px rgba(0,0,0,.35);
}
.chat-fab:hover { filter: brightness(1.05); }
.chat-fab .fab-label { font-size: 14px; }
.chat-fab .badge {
  position: absolute; top: -6px; right: -6px;
  display: none; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 4px;
  background: var(--danger); color: white; border-radius: 999px;
  font-size: 11px; line-height: 1; font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
}
.chat-fab.has-unread .badge { display: inline-flex; }
.chat-fab.is-hidden { display: none; }

/* Floating chat window */
.chat-widget {
  position: fixed; right: 20px; bottom: 80px; z-index: 50;
  width: min(380px, 92vw); height: 520px;
  background: var(--panel); color: var(--text);
  border: 1px solid #1f2937; border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0,0,0,.45);
  display: grid; grid-template-rows: auto 1fr auto; overflow: hidden;
}
.chat-hidden { display: none; }

.chat-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid #1f2937; background: #0c1424; }
.chat-title { display: grid; gap: 2px; }
.icon-btn { background: transparent; border: 0; color: var(--text); cursor: pointer; padding: 6px; border-radius: 8px; }
.icon-btn:hover { background: rgba(255,255,255,.06); }

.chat { padding: 12px; overflow: auto; display: grid; gap: 8px; }

.msg { display: inline-block; padding: 8px 12px; border-radius: 12px; max-width: 80%; }
.msg.user { background: #1f2937; align-self: end; justify-self: end; }
.msg.bot { background: #0b3d2e; border: 1px solid rgba(16,185,129,.6); }
.msg.error { background: #3f1d1d; border: 1px solid rgba(239,68,68,.6); }

.composer { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 10px 12px; border-top: 1px solid #1f2937; background: #0b1220; }
#message {
  padding: 10px 12px; border-radius: 10px; border: 1px solid #374151; background: #0b1220; color: var(--text);
}
button { background: var(--accent); color: #052e25; border: none; padding: 10px 16px; border-radius: 10px; font-weight: 600; cursor: pointer; }
button:disabled { opacity: .5; cursor: not-allowed; }

.chat-footer { color: var(--muted); font-size: 12px; padding: 6px 12px; background: #0c1424; border-top: 1px solid #1f2937; }
