/* AskRoby public pre-signup chat assistant — self-contained widget for the static
   marketing landing (light.html + dark.html). Vanilla, no dependencies. Theme is
   auto-detected from the page background luminance (see assistant-widget.js). */

#roby-assistant, #roby-assistant * { box-sizing: border-box; }

#roby-assistant {
  --ra-blue: #2563eb;
  --ra-purple: #7c3aed;
  --ra-surface: #ffffff;
  --ra-text: #0f172a;
  --ra-muted: #64748b;
  --ra-border: #e5e9f0;
  --ra-bot-bg: #f1f5f9;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2147483000;
  font-family: inherit;
}
#roby-assistant.ra-dark {
  --ra-surface: #161b26;
  --ra-text: #e8edf6;
  --ra-muted: #9aa6bb;
  --ra-border: #2c3442;
  --ra-bot-bg: #222a38;
}

/* Floating bubble */
.ra-fab {
  width: 56px; height: 56px;
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--ra-blue), var(--ra-purple));
  color: #fff;
  font-size: 24px;
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.35);
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s ease;
}
.ra-fab:hover { transform: scale(1.06); }

/* Panel */
.ra-panel {
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 120px);
  background: var(--ra-surface);
  color: var(--ra-text);
  border: 1px solid var(--ra-border);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.28);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
#roby-assistant.ra-open .ra-panel { display: flex; }
#roby-assistant.ra-open .ra-fab { display: none; }

.ra-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--ra-blue), var(--ra-purple));
  color: #fff;
}
.ra-head .ra-avatar {
  width: 32px; height: 32px; border-radius: 9999px;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.ra-head .ra-title { font-weight: 700; font-size: 14px; line-height: 1.2; }
.ra-head .ra-sub { font-size: 11px; opacity: .85; }
.ra-head .ra-close {
  margin-left: auto; background: none; border: none; color: #fff;
  font-size: 18px; cursor: pointer; opacity: .9; padding: 4px;
}

.ra-body {
  flex: 1; overflow-y: auto; padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.ra-msg { max-width: 88%; padding: 9px 12px; border-radius: 14px; font-size: 13.5px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.ra-msg.user { align-self: flex-end; background: var(--ra-blue); color: #fff; border-bottom-right-radius: 4px; }
.ra-msg.bot { align-self: flex-start; background: var(--ra-bot-bg); color: var(--ra-text); border-bottom-left-radius: 4px; }
.ra-msg.bot a { color: var(--ra-blue); }
.ra-typing { align-self: flex-start; color: var(--ra-muted); font-size: 12px; }

.ra-foot { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--ra-border); }
.ra-input {
  flex: 1; min-width: 0;
  border: 1px solid var(--ra-border); border-radius: 10px;
  padding: 9px 11px; font-size: 13.5px; font-family: inherit;
  background: var(--ra-surface); color: var(--ra-text); outline: none;
}
.ra-input:focus { border-color: var(--ra-blue); }
.ra-send {
  border: none; cursor: pointer; border-radius: 10px; padding: 0 14px;
  background: var(--ra-blue); color: #fff; font-size: 13px; font-weight: 600;
}
.ra-send:disabled { opacity: .5; cursor: default; }
