/* madAssist Chat Call-to-Action — every rule is prefixed .mact- so nothing
   collides with Divi. The accent is a CSS variable set inline by the plugin
   from the Settings page. */

.mact-root {
  --mact-accent: #6d28d9;
  --mact-ink: #0f1219;
  --mact-panel-bg: #ffffff;
  --mact-muted: #5b6270;
  --mact-border: #e5e7eb;
  position: fixed;
  bottom: 20px;
  z-index: 2147483000;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--mact-ink);
}
.mact-root.mact-right { right: 20px; }
.mact-root.mact-left  { left: 20px; }
.mact-root *, .mact-root *::before, .mact-root *::after { box-sizing: border-box; }

/* ---------- the floating pill ---------- */
.mact-bubble {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px 12px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--mact-accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(15, 18, 25, 0.28);
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.mact-bubble:hover { transform: translateY(-1px); box-shadow: 0 14px 34px rgba(15, 18, 25, 0.32); }
.mact-bubble:focus-visible { outline: 3px solid rgba(109, 40, 217, 0.45); outline-offset: 3px; }
.mact-bubble-icon { display: inline-flex; }
.mact-root.mact-open .mact-bubble { display: none; }

/* ---------- the popup ---------- */
.mact-panel {
  width: 360px;
  max-width: calc(100vw - 32px);
  background: var(--mact-panel-bg);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15, 18, 25, 0.30);
  overflow: hidden;
  border: 1px solid var(--mact-border);
  animation: mact-rise 180ms ease-out;
}
.mact-panel[hidden] { display: none; }
@keyframes mact-rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .mact-panel { animation: none; }
  .mact-bubble { transition: none; }
}

.mact-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 14px 16px;
  background: var(--mact-ink);
  color: #fff;
}
.mact-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--mact-accent);
  flex: 0 0 auto;
}
.mact-heading { flex: 1 1 auto; min-width: 0; }
.mact-title { font-weight: 700; font-size: 16px; letter-spacing: 0.01em; }
.mact-subtitle { font-size: 12.5px; opacity: 0.8; }
.mact-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  opacity: 0.85;
}
.mact-close:hover { background: rgba(255, 255, 255, 0.12); opacity: 1; }
.mact-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.mact-body { padding: 16px 16px 6px; background: #f7f7f9; }
.mact-greeting {
  display: inline-block;
  max-width: 100%;
  padding: 10px 14px;
  border-radius: 14px 14px 14px 4px;
  background: #fff;
  border: 1px solid var(--mact-border);
  color: var(--mact-ink);
  font-size: 14.5px;
}
.mact-suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 8px; }
.mact-chip {
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--mact-border);
  background: #fff;
  color: var(--mact-ink);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}
.mact-chip:hover { border-color: var(--mact-accent); color: var(--mact-accent); }

.mact-form { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px 14px; background: #fff; border-top: 1px solid var(--mact-border); }
.mact-input {
  width: 100%;
  resize: none;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--mact-border);
  font: inherit;
  font-size: 14.5px;
  color: var(--mact-ink);
  background: #fff;
}
.mact-input:focus { outline: none; border-color: var(--mact-accent); box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.15); }
.mact-send {
  align-self: flex-end;
  padding: 9px 16px;
  border: 0;
  border-radius: 10px;
  background: var(--mact-accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.mact-send:hover { filter: brightness(1.08); }
.mact-send:focus-visible { outline: 3px solid rgba(109, 40, 217, 0.45); outline-offset: 2px; }
.mact-footnote { padding: 0 16px 12px; font-size: 12px; color: var(--mact-muted); background: #fff; }

.mact-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* ---------- phones ---------- */
@media (max-width: 480px) {
  .mact-root { bottom: 12px; }
  .mact-root.mact-right { right: 12px; }
  .mact-root.mact-left  { left: 12px; }
  .mact-bubble { padding: 11px 15px 11px 12px; font-size: 14px; }
  .mact-panel { width: calc(100vw - 24px); }
}
