#swai-wrap {
  /* Theme colors. The Chat settings page sets these on the element itself; these are the defaults. */
  --swai-main: #111111;
  --swai-on-main: #ffffff;
  --swai-header: #000000;
  --swai-on-header: #ffffff;
  --swai-header-sub: rgba(255,255,255,0.75);
  --swai-accent: #111111;
  --swai-accent-page: #111111;
  --swai-tint: #e7e7e7;
  --swai-page-bg: #ececec;
  --swai-launcher: #111111;
  --swai-on-launcher: #ffffff;
  --swai-fill: #111111;
  --swai-on-fill: #ffffff;
  --swai-edge: #111111;
  --swai-user: #111111;
  --swai-on-user: #ffffff;
  /* The chat window itself, light or dark (.swai-dark) */
  --swai-bg: #fff;
  --swai-messages-bg: #f9fafb;
  --swai-surface: #fff;
  --swai-field-bg: #fff;
  --swai-chip-bg: #fff;
  --swai-text: #111;
  --swai-text-2: #374151;
  --swai-muted: #6b7280;
  --swai-border: #e5e7eb;
  --swai-field-border: #d1d5db;
  --swai-disabled: #f3f4f6;
  --swai-error: #b91c1c;
  background: var(--swai-page-bg);
  padding: 48px 24px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  box-sizing: border-box;
  overflow-x: hidden;
  /* Themes set these on the page; the chat should not inherit them. */
  line-height: 1.45;
  letter-spacing: normal;
  text-transform: none;
  text-align: left;
}
#swai-wrap.swai-dark {
  --swai-bg: #18181b;
  --swai-messages-bg: #0f0f11;
  --swai-surface: #27272a;
  --swai-field-bg: #18181b;
  --swai-chip-bg: transparent;
  --swai-text: #f4f4f5;
  --swai-text-2: #d4d4d8;
  --swai-muted: #a1a1aa;
  --swai-border: #52525b;
  --swai-field-border: #71717a;
  --swai-accent: #f4f4f5;
  --swai-fill: #f4f4f5;
  --swai-on-fill: #111111;
  --swai-edge: #71717a;
  --swai-user: #3f3f46;
  --swai-on-user: #ffffff;
  --swai-disabled: #3f3f46;
  --swai-error: #fca5a5;
}
#swai-wrap *, #swai-wrap *::before, #swai-wrap *::after { box-sizing: border-box; }
#swai-grid {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}
#swai-grid > * { min-width: 0; }

#swai-left { padding-top: 8px; }
#swai-eyebrow { color: var(--swai-accent-page); font-weight: 700; font-size: 12px; letter-spacing: 0.6px; text-transform: uppercase; margin-bottom: 10px; }
#swai-badge { background: var(--swai-main); color: var(--swai-on-main); display: inline-block; padding: 6px 14px; border-radius: 20px; font-weight: 800; font-size: 13px; letter-spacing: 0.3px; margin-bottom: 14px; }
#swai-heading { font-size: 34px; font-weight: 800; line-height: 1.15; color: #111; margin: 0 0 6px 0; }
#swai-heading .swai-green { color: var(--swai-accent-page); display: block; }
#swai-desc { font-size: 15px; color: #4b5563; line-height: 1.55; margin: 14px 0 26px 0; max-width: 440px; }
#swai-try-label { font-size: 12px; font-weight: 700; color: #6b7280; letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 10px; }
#swai-try-list { display: flex; flex-direction: column; gap: 10px; max-width: 420px; }
#swai-wrap .swai-try-btn {
  background: #fff; border: 1.5px solid var(--swai-main); color: var(--swai-accent-page); border-radius: 22px;
  padding: 11px 16px; font-size: 13.5px; text-align: left; cursor: pointer;
  transition: background 0.15s ease; font-family: inherit; font-weight: 500; line-height: 1.3;
}
#swai-wrap .swai-try-btn:hover { background: var(--swai-page-bg); color: var(--swai-accent-page); }

#swai-panel {
  background: var(--swai-bg); border-radius: 20px; box-shadow: 0 12px 40px rgba(0,0,0,0.10);
  display: flex; flex-direction: column; height: 620px; max-height: 80vh; overflow: hidden;
}
#swai-header { background: var(--swai-header); color: var(--swai-on-header); padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; }
#swai-header-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
#swai-logo { width: 36px; height: 36px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; }
#swai-logo img { width: 100%; height: 100%; object-fit: contain; }
#swai-logo.swai-logo-letter { color: #111; font-weight: 700; font-size: 16px; }
#swai-title { font-weight: 600; font-size: 15px; color: var(--swai-on-header); }
#swai-sub { font-size: 12px; color: var(--swai-header-sub); display: flex; align-items: center; gap: 5px; }
#swai-sub .swai-dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; display: inline-block; }
#swai-header-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
#swai-wrap #swai-reset, #swai-wrap #swai-close { cursor: pointer; background: none; border: none; box-shadow: none; color: var(--swai-header-sub); font-size: 16px; padding: 4px; margin: 0; line-height: 1; min-width: 0; width: auto; height: auto; }
#swai-wrap #swai-close { font-size: 22px; }
#swai-wrap #swai-reset:hover, #swai-wrap #swai-close:hover { color: var(--swai-on-header); background: none; }

#swai-messages { flex: 1; overflow-y: auto; padding: 18px; background: var(--swai-messages-bg); display: flex; flex-direction: column; gap: 10px; -webkit-overflow-scrolling: touch; }
.swai-msg { max-width: 85%; padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.swai-msg-bot { background: var(--swai-surface); color: var(--swai-text); align-self: flex-start; border: 1px solid var(--swai-border); border-bottom-left-radius: 4px; }
.swai-msg-bot a { color: var(--swai-accent); text-decoration: underline; font-weight: 600; word-break: break-all; }
.swai-msg-user { background: var(--swai-user); color: var(--swai-on-user); align-self: flex-end; border-bottom-right-radius: 4px; }
.swai-msg-user a { color: inherit; }
.swai-typing { display: flex; gap: 4px; padding: 12px 14px; }
.swai-typing span { width: 6px; height: 6px; border-radius: 50%; background: #9ca3af; animation: swaiBlink 1.2s infinite; }
.swai-typing span:nth-child(2) { animation-delay: 0.2s; }
.swai-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes swaiBlink { 0%,80%,100% { opacity: 0.3; } 40% { opacity: 1; } }

.swai-intro { background: var(--swai-surface); border: 1.5px solid var(--swai-edge); border-radius: 14px; padding: 14px; align-self: flex-start; width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 8px; margin: 0; }
.swai-intro-text { font-size: 13.5px; line-height: 1.45; color: var(--swai-text); }
#swai-wrap .swai-intro-field { width: 100%; border: 1px solid var(--swai-field-border); border-radius: 10px; padding: 9px 12px; font-size: 14px; font-family: inherit; color: var(--swai-text); background: var(--swai-field-bg); box-shadow: none; outline: none; margin: 0; height: auto; }
#swai-wrap .swai-intro-field::placeholder { color: var(--swai-muted); }
#swai-wrap .swai-intro-field:focus { border-color: var(--swai-edge); }
.swai-intro-hint { font-size: 12.5px; color: var(--swai-muted); margin-top: -2px; }
.swai-intro-error { font-size: 12.5px; color: var(--swai-error); }
.swai-intro-error:empty { display: none; }
#swai-wrap .swai-intro .swai-btn-primary:disabled { opacity: 0.5; cursor: default; }
#swai-wrap .swai-intro-skip { background: none; border: none; color: var(--swai-muted); font-size: 13px; font-family: inherit; text-decoration: underline; cursor: pointer; padding: 9px 6px; }
#swai-wrap .swai-intro-skip:hover { color: var(--swai-text); background: none; }
#swai-input:disabled { background: var(--swai-disabled) !important; }

.swai-sources { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; align-self: flex-start; max-width: 92%; margin-top: -4px; font-size: 12px; }
.swai-sources-label { color: var(--swai-muted); font-weight: 600; }
.swai-sources a { color: var(--swai-accent); background: var(--swai-tint); border: 1px solid var(--swai-border); border-radius: 12px; padding: 3px 9px; text-decoration: none; overflow-wrap: anywhere; }
.swai-sources a:hover { border-color: var(--swai-edge); }

.swai-chips { display: flex; flex-wrap: wrap; gap: 8px; align-self: flex-start; max-width: 100%; }
#swai-wrap .swai-chip-btn { background: var(--swai-chip-bg); border: 1.5px solid var(--swai-edge); color: var(--swai-accent); border-radius: 18px; padding: 8px 13px; font-size: 13px; cursor: pointer; transition: background 0.15s ease; font-family: inherit; text-align: left; line-height: 1.3; }
#swai-wrap .swai-chip-btn:hover { background: var(--swai-tint); color: var(--swai-accent); }
/* The questions that open a floating chat: one per line, like the "Try asking" buttons of the section */
.swai-starters { flex-direction: column; flex-wrap: nowrap; align-self: stretch; }
#swai-wrap .swai-starters .swai-chip-btn { width: 100%; border-radius: 22px; padding: 11px 16px; font-size: 13.5px; font-weight: 500; }

/* Service card: the name (with "Custom quote" under it, or a real price on the right), one
   line of what is included, and one button with a plain "Learn more" link beside it. */
.swai-card { background: var(--swai-surface); border: 1px solid var(--swai-border); border-radius: 14px; overflow: hidden; flex-shrink: 0; align-self: flex-start; width: 100%; max-width: 340px; }
.swai-card-body { padding: 14px; }
.swai-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.swai-card-name { min-width: 0; }
.swai-card-title { font-weight: 700; font-size: 15px; line-height: 1.3; color: var(--swai-text); }
.swai-card-quote { font-size: 12.5px; color: var(--swai-muted); margin-top: 2px; }
.swai-card-price { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; text-align: right; }
.swai-card-price .swai-price-new { font-size: 17px; font-weight: 700; line-height: 1.2; color: var(--swai-text); }
.swai-card-price .swai-price-old { font-size: 12px; color: var(--swai-muted); text-decoration: line-through; }
.swai-card-price .swai-price-badge { font-size: 11px; color: var(--swai-muted); white-space: nowrap; }
#swai-wrap .swai-card-features { margin: 8px 0 12px 0; padding: 0; font-size: 12.5px; line-height: 1.45; color: var(--swai-text-2); }
.swai-card-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
#swai-wrap .swai-card-more { color: var(--swai-text); font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
#swai-wrap .swai-btn-primary { background: var(--swai-fill); color: var(--swai-on-fill); border: none; border-radius: 20px; padding: 9px 16px; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block; }
#swai-wrap .swai-btn-secondary { background: var(--swai-surface); color: var(--swai-text); border: 1.5px solid var(--swai-field-border); border-radius: 20px; padding: 9px 16px; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block; }

.swai-human-card { background: var(--swai-surface); border: 1px solid var(--swai-border); border-radius: 14px; padding: 14px; align-self: flex-start; max-width: 92%; }
.swai-human-title { font-weight: 700; font-size: 14px; margin-bottom: 6px; color: var(--swai-text); }
#swai-wrap .swai-human-list { list-style: none; padding: 0; margin: 0 0 12px 0; font-size: 13px; color: var(--swai-text-2); }
.swai-human-list li { padding: 2px 0; }

/* Call request confirmation: what was sent and how the team will be in touch. */
.swai-booking-card { background: var(--swai-surface); border: 1px solid var(--swai-border); border-radius: 14px; padding: 12px 14px; align-self: flex-start; max-width: 92%; }
.swai-booking-title { font-weight: 700; font-size: 14px; margin-bottom: 8px; color: var(--swai-text); }
#swai-wrap .swai-booking-list { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; }
#swai-wrap .swai-booking-list dt { margin: 0; color: var(--swai-muted); }
#swai-wrap .swai-booking-list dd { margin: 0; color: var(--swai-text); font-weight: 600; overflow-wrap: anywhere; }

#swai-inputbar { display: flex; align-items: center; padding: 12px 14px; border-top: 1px solid var(--swai-border); background: var(--swai-bg); gap: 8px; box-sizing: border-box; }
#swai-input { flex: 1; min-width: 0; border: 1px solid var(--swai-border) !important; border-radius: 20px !important; padding: 10px 14px !important; font-size: 14px !important; outline: none !important; box-shadow: none !important; margin: 0 !important; height: auto !important; background: var(--swai-field-bg) !important; color: var(--swai-text) !important; }
#swai-input::placeholder { color: var(--swai-muted); }
#swai-input:focus { border-color: var(--swai-edge) !important; }
#swai-send { background: var(--swai-fill) !important; border: none !important; width: 42px !important; height: 42px !important; min-width: 42px !important; max-width: 42px !important; border-radius: 50% !important; cursor: pointer; display: inline-flex !important; align-items: center !important; justify-content: center !important; flex-shrink: 0 !important; padding: 0 !important; margin: 0 !important; box-sizing: border-box !important; }
#swai-send:disabled { opacity: 0.5; cursor: default; }
#swai-send svg { width: 18px; height: 18px; fill: var(--swai-on-fill); margin-left: 2px; }

#swai-footer-note { text-align: center; font-size: 11px; color: var(--swai-muted); padding: 8px 14px 4px 14px; background: var(--swai-bg); }
#swai-credit { text-align: center; font-size: 11px; color: var(--swai-muted); padding: 0 14px 12px 14px; background: var(--swai-bg); }
#swai-inputbar + #swai-credit { padding-top: 8px; }
#swai-credit a { color: var(--swai-muted) !important; font-weight: 600; text-decoration: underline !important; }
#swai-footer-note a { color: var(--swai-muted) !important; text-decoration: underline !important; white-space: nowrap; }

/* Tablet and mobile: single column */
@media (max-width: 860px) {
  #swai-wrap { padding: 32px 16px; }
  #swai-grid { grid-template-columns: 1fr; gap: 32px; }
  #swai-heading { font-size: 28px; }
  #swai-desc { max-width: 100%; }
  #swai-try-list { max-width: 100%; }
  #swai-panel { height: 640px; max-height: 85vh; max-height: 85dvh; }
}

/* Small phones */
@media (max-width: 480px) {
  #swai-wrap { padding: 24px 12px; }
  #swai-badge { font-size: 12px; padding: 6px 12px; }
  #swai-heading { font-size: 24px; }
  #swai-desc { font-size: 14px; margin: 12px 0 20px 0; }
  #swai-wrap .swai-try-btn { font-size: 13px; padding: 10px 14px; }

  #swai-panel { border-radius: 16px; height: 600px; max-height: 80vh; max-height: 80dvh; }
  #swai-header { padding: 12px 14px; }
  #swai-messages { padding: 12px; }

  .swai-msg { max-width: 90%; }
  .swai-card, .swai-human-card, .swai-booking-card { max-width: 100%; }

  .swai-card-actions { flex-direction: column; }
  #swai-wrap .swai-btn-primary, #swai-wrap .swai-btn-secondary { text-align: center; width: 100%; }

  #swai-wrap .swai-chip-btn { font-size: 12.5px; padding: 8px 12px; }

  /* 16px stops iPhone from zooming in when the input is tapped */
  #swai-input { font-size: 16px !important; }
  #swai-inputbar { padding: 10px 12px; }
  #swai-footer-note { padding: 6px 12px 4px 12px; }
  #swai-credit { padding: 0 12px 10px 12px; }
}

/* Floating button in a corner of every page, and the chat window it opens */
/* Above sticky site headers and the WordPress admin bar, which would cover the open chat on a phone. */
#swai-wrap.swai-float { position: fixed; bottom: 20px; right: 20px; z-index: 2147483000; background: none; padding: 0; margin: 0; overflow: visible; }
#swai-wrap.swai-float-left { right: auto; left: 20px; }
/* The greeting bubble sits beside the button, on the side facing the page. */
.swai-launch-row { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.swai-float-left .swai-launch-row { flex-direction: row-reverse; }
#swai-wrap #swai-launcher {
  width: 60px !important; height: 60px !important; min-width: 60px !important; border-radius: 50% !important;
  background: var(--swai-launcher) !important; border: none !important; padding: 0 !important; margin: 0 !important;
  display: flex !important; align-items: center !important; justify-content: center !important; flex-shrink: 0;
  cursor: pointer; box-shadow: 0 0 0 2px rgba(255,255,255,0.9), 0 6px 20px rgba(0,0,0,0.3) !important; transition: transform 0.15s ease; font-family: inherit;
}
#swai-wrap #swai-launcher:hover { transform: scale(1.06); }
#swai-launcher svg { width: 28px; height: 28px; fill: var(--swai-on-launcher); flex-shrink: 0; }
#swai-launcher .swai-icon-close, .swai-open #swai-launcher .swai-icon-chat { display: none; }
.swai-open #swai-launcher .swai-icon-close { display: block; }
/* With button text: a pill on computers, the round icon once the chat is open and on phones */
#swai-wrap #swai-launcher.swai-has-text { width: auto !important; gap: 8px; padding: 0 22px 0 18px !important; border-radius: 30px !important; }
#swai-launcher.swai-has-text svg { width: 24px; height: 24px; }
.swai-launcher-text { color: var(--swai-on-launcher); font-size: 15px; font-weight: 600; line-height: 1; white-space: nowrap; }
#swai-wrap.swai-open #swai-launcher.swai-has-text { width: 60px !important; padding: 0 !important; border-radius: 50% !important; }
.swai-open .swai-launcher-text { display: none; }

#swai-bubble { position: relative; max-width: 240px; animation: swaiPop 0.25s ease; }
#swai-bubble[hidden], .swai-open #swai-bubble { display: none; }
#swai-wrap .swai-bubble-text {
  display: block; width: auto; height: auto; min-width: 0; margin: 0; padding: 11px 14px;
  background: var(--swai-bg); color: var(--swai-text); border: 1px solid var(--swai-main); border-radius: 14px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.16); font-family: inherit; font-size: 14px; font-weight: 400; line-height: 1.4;
  text-align: left; text-transform: none; letter-spacing: normal; cursor: pointer;
}
#swai-wrap .swai-bubble-close {
  position: absolute; top: -9px; left: -9px; width: 22px; height: 22px; min-width: 0; margin: 0; padding: 0;
  display: flex; align-items: center; justify-content: center; border-radius: 50%;
  border: 1px solid var(--swai-border); background: var(--swai-bg); color: var(--swai-muted);
  font-family: inherit; font-size: 15px; line-height: 1; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.swai-float-left .swai-bubble-close { left: auto; right: -9px; }
@keyframes swaiPop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { #swai-bubble { animation: none; } }

.swai-float #swai-panel {
  display: none; position: absolute; bottom: 0; right: 0;
  width: 380px; max-width: calc(100vw - 40px);
  /* Full size. It sits where the chat button was, so it reaches down to the bottom corner
     and stays clear of the site's header above. */
  height: 600px; max-height: calc(100vh - 120px); max-height: calc(100dvh - 120px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.22);
}
.swai-float-left #swai-panel { right: auto; left: 0; }
.swai-float.swai-open #swai-panel { display: flex; }
/* While the chat is open, its own header has the close button, so the round button below it is
   hidden: it took 76px of height and could vanish against a dark section of the page. */
#swai-wrap.swai-float.swai-open #swai-launcher, .swai-float.swai-open #swai-bubble { display: none !important; }

/* Phones: the open chat fills the screen and is closed from its header */
@media (max-width: 480px) {
  #swai-wrap.swai-float { bottom: 16px; right: 16px; }
  #swai-wrap.swai-float-left { right: auto; left: 16px; }
  #swai-wrap #swai-launcher.swai-has-text { width: 60px !important; padding: 0 !important; border-radius: 50% !important; }
  .swai-launcher-text { display: none; }
  #swai-bubble { max-width: calc(100vw - 110px); }
  .swai-float.swai-open #swai-panel { position: fixed; top: 0; right: 0; bottom: 0; left: 0; width: auto; max-width: none; height: auto; max-height: none; border-radius: 0; }
  #swai-wrap.swai-open #swai-launcher { display: none !important; }
}

/* Short screens, such as a phone held sideways (about 390px tall): the floating chat fills the
   screen too, and the header and footer get slimmer, so the messages keep most of the height.
   Before, the window was 270px tall and the messages had a 60px strip. */
@media (max-height: 520px) {
  .swai-float.swai-open #swai-panel { position: fixed; top: 0; right: 0; bottom: 0; left: 0; width: auto; max-width: none; height: auto; max-height: none; border-radius: 0; }
  #swai-wrap.swai-open #swai-launcher { display: none !important; }
  /* The chat on a page of its own: as tall as the screen, so scrolling the page shows all of it. */
  #swai-wrap:not(.swai-float) #swai-panel { height: calc(100vh - 16px); height: calc(100dvh - 16px); max-height: none; }
  #swai-header { padding: 6px 14px; }
  #swai-logo { width: 28px; height: 28px; }
  #swai-messages { padding: 10px 14px; }
  #swai-inputbar { padding: 6px 12px; }
  #swai-footer-note { padding: 4px 14px 0 14px; font-size: 10.5px; }
  #swai-credit { padding: 0 14px 6px 14px; font-size: 10.5px; }
  #swai-inputbar + #swai-credit { padding-top: 4px; }
}

/* A clear ring on whatever the keyboard is on. The message box and form fields hide the
   browser's own outline, so without this a keyboard user could not see where they were. */
#swai-wrap button:focus-visible, #swai-wrap a:focus-visible, #swai-wrap input:focus-visible, #swai-wrap textarea:focus-visible {
  outline: 2px solid var(--swai-text) !important; outline-offset: 2px !important;
}
#swai-wrap #swai-header button:focus-visible { outline-color: var(--swai-on-header) !important; }
#swai-wrap #swai-launcher:focus-visible { outline: 3px solid var(--swai-launcher) !important; outline-offset: 3px !important; }
#swai-wrap #swai-send:focus-visible { outline-offset: 3px !important; }
