/* ScrubMaster USA draft chat widget — standalone; later add to any page with chat.css + chat.js */
:root {
  --smc-red: #e3262f;
  --smc-blue: #1f4fd8;
  --smc-blue2: #4f7dff;
  --smc-purple: #6b3fd1;
  --smc-ink: #0a0726;
  --smc-ink2: #120c3a;
  --smc-card: rgba(255, 255, 255, .08);
  --smc-line: rgba(255, 255, 255, .14);
  --smc-text: #eef0ff;
  --smc-muted: rgba(238, 240, 255, .78);
  --smc-gold: #ffcc4d;
}

.sm-chat-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 10000;
  font-family: Inter, system-ui, sans-serif;
  color: var(--smc-text);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.sm-chat-launch {
  width: 60px;
  height: 60px;
  border: 0;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,.18), transparent 45%),
    linear-gradient(135deg, var(--smc-red), #b51d2a 60%, var(--smc-purple));
  box-shadow: 0 10px 28px rgba(227, 38, 47, .45), 0 0 0 2px rgba(255,255,255,.16);
  display: grid;
  place-items: center;
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease;
}
.sm-chat-launch:hover { transform: translateY(-2px) scale(1.04); }
.sm-chat-launch:focus-visible { outline: 3px solid var(--smc-blue2); outline-offset: 3px; }
.sm-chat-launch img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  pointer-events: none;
}
.sm-chat-root.is-open .sm-chat-launch { display: none; }

.sm-chat-panel {
  display: none;
  width: 380px;
  max-width: calc(100vw - 24px);
  height: min(640px, calc(100dvh - 24px));
  max-height: calc(100dvh - 24px);
  background: linear-gradient(180deg, rgba(18, 12, 58, .98), var(--smc-ink) 40%);
  border: 1px solid var(--smc-line);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0,0,0,.5), 0 0 0 1px rgba(79,125,255,.18);
  overflow: hidden;
  flex-direction: column;
}
.sm-chat-root.is-open .sm-chat-panel { display: flex; }

.sm-chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 12px 14px;
  background: rgba(10, 7, 38, .7);
  border-bottom: 1px solid var(--smc-line);
  flex-shrink: 0;
}
.sm-chat-head img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, rgba(79,125,255,.35), rgba(10,7,38,.9));
  box-shadow: 0 0 0 1px var(--smc-line);
  flex-shrink: 0;
}
.sm-chat-head h2 {
  font-family: Bungee, Inter, sans-serif;
  font-size: 14px;
  letter-spacing: .02em;
  margin: 0;
  line-height: 1.2;
  text-align: left;
  font-weight: 400;
}
.sm-chat-head h2 .r { color: var(--smc-red); }
.sm-chat-head h2 .b { color: var(--smc-blue2); }
.sm-chat-head p {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--smc-muted);
  font-weight: 600;
}
.sm-chat-head-text { flex: 1; min-width: 0; }
.sm-chat-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.sm-chat-close:hover { background: var(--smc-card); }
.sm-chat-close:focus-visible { outline: 2px solid var(--smc-blue2); }

.sm-chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overscroll-behavior: contain;
}
.sm-chat-msg {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 14px;
  word-wrap: break-word;
}
.sm-chat-msg p { margin: 0 0 8px; }
.sm-chat-msg p:last-child { margin-bottom: 0; }
.sm-chat-msg a { color: var(--smc-gold); font-weight: 700; }
.sm-chat-msg ul {
  margin: 6px 0 0;
  padding-left: 1.1em;
}
.sm-chat-msg li { margin: 3px 0; }
.sm-chat-msg.is-bot {
  align-self: flex-start;
  background: var(--smc-card);
  border: 1px solid var(--smc-line);
  border-top-left-radius: 6px;
}
.sm-chat-msg.is-user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--smc-red), #ff5a4f);
  color: #fff;
  border-top-right-radius: 6px;
  font-weight: 600;
}

.sm-chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 14px 10px;
  flex-shrink: 0;
}
.sm-chat-chip {
  border: 1px solid var(--smc-line);
  background: var(--smc-card);
  color: var(--smc-text);
  font: 600 12px/1.2 Inter, system-ui, sans-serif;
  padding: 7px 10px;
  border-radius: 999px;
  cursor: pointer;
  text-align: left;
}
.sm-chat-chip:hover,
.sm-chat-chip:focus-visible {
  border-color: rgba(79, 125, 255, .7);
  background: rgba(79, 125, 255, .16);
  outline: none;
}

.sm-chat-form {
  display: flex;
  gap: 8px;
  padding: 0 12px 8px;
  border-top: 1px solid var(--smc-line);
  padding-top: 10px;
  flex-shrink: 0;
  background: rgba(10, 7, 38, .55);
}
.sm-chat-form input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--smc-line);
  background: rgba(255,255,255,.06);
  color: var(--smc-text);
  border-radius: 999px;
  padding: 10px 14px;
  font: 15px Inter, system-ui, sans-serif;
}
.sm-chat-form input::placeholder { color: rgba(238, 240, 255, .45); }
.sm-chat-form input:focus { outline: 2px solid var(--smc-blue2); border-color: transparent; }
.sm-chat-form button[type="submit"] {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  font: 800 13px Inter, system-ui, sans-serif;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, var(--smc-red), #ff5a4f);
  box-shadow: 0 6px 16px rgba(227, 38, 47, .35);
}
.sm-chat-form button[type="submit"]:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.sm-chat-note {
  margin: 0;
  padding: 0 14px 10px;
  font-size: 10.5px;
  color: var(--smc-muted);
  text-align: center;
  flex-shrink: 0;
  background: rgba(10, 7, 38, .55);
}

/* Keep the launcher off the right/bottom edge on narrow screens.
   Call / Text / Email are in the hero, not a fixed bar, but leave room anyway. */
@media (max-width: 430px) {
  /* When closed, shrink-wrap the bubble so the root doesn't block taps
     along the bottom of the screen. When open, span the width for the panel. */
  .sm-chat-root {
    right: 12px;
    bottom: 12px;
    left: auto;
  }
  .sm-chat-root.is-open {
    left: 12px;
    right: 12px;
  }
  .sm-chat-launch {
    margin-left: auto;
    width: 56px;
    height: 56px;
  }
  .sm-chat-panel {
    width: auto;
    height: min(680px, calc(100dvh - 24px));
    border-radius: 18px;
  }
  /* Leave a bottom-right corner so the bubble doesn't sit on Call / Text / Email. */
  .cta2 { padding-right: 72px; }
  footer .wrap { padding-right: 72px; }
}