/* =========================================================
   SWH Meridian — chat widget styles (chatbot.css)
   Navy #0D1B2E + teal #19D3BE, matching the site.
   ========================================================= */
.sw-chat,
.sw-chat *,
#sw-launcher,
#sw-teaser {
  box-sizing: border-box;
}

.sw-chat {
  --sw-ink: #0D1B2E;
  --sw-ink-2: #16304B;
  --sw-teal: #19D3BE;
  --sw-teal-deep: #0E9C8C;
  --sw-bg: #F5F7FA;
  --sw-bg-2: #EDF1F5;
  --sw-line: rgba(13, 27, 46, 0.12);
  --sw-text: #0D1B2E;
  --sw-muted: #64748B;
  --sw-red: #b42318;
  --sw-green: #146c2e;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ---------- Launcher ---------- */
#sw-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1000;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 1.5px solid rgba(25, 211, 190, .55);
  cursor: pointer;
  background: linear-gradient(135deg, #16304B 0%, #0D1B2E 100%);
  box-shadow: 0 10px 28px rgba(13, 27, 46, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .25s ease, box-shadow .25s ease;
}

#sw-launcher:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 14px 32px rgba(13, 27, 46, 0.5);
}

#sw-launcher:focus-visible {
  outline: 3px solid #19D3BE;
  outline-offset: 3px;
}

#sw-launcher svg {
  width: 28px;
  height: 28px;
}

#sw-launcher .sw-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #19D3BE;
  border: 2px solid #0D1B2E;
  animation: swPulse 2s infinite;
}

@keyframes swPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(25, 211, 190, .6)
  }

  70% {
    box-shadow: 0 0 0 10px rgba(25, 211, 190, 0)
  }

  100% {
    box-shadow: 0 0 0 0 rgba(25, 211, 190, 0)
  }
}

body.menu-open #sw-launcher,
body.menu-open #sw-teaser {
  display: none;
}

/* ---------- Teaser bubble ---------- */
#sw-teaser {
  position: fixed;
  right: 22px;
  bottom: 96px;
  z-index: 1000;
  max-width: 250px;
  background: #fff;
  color: #0D1B2E;
  border-radius: 14px 14px 4px 14px;
  border: 1px solid rgba(25, 211, 190, .5);
  padding: 12px 34px 12px 14px;
  font: 600 14px/1.35 "Inter", system-ui, sans-serif;
  box-shadow: 0 10px 30px rgba(13, 27, 46, .25);
  cursor: pointer;
  animation: swRise .4s ease both;
}

#sw-teaser button {
  position: absolute;
  top: 4px;
  right: 6px;
  border: 0;
  background: none;
  font-size: 20px;
  line-height: 1;
  color: #64748B;
  cursor: pointer;
  padding: 4px;
}

@keyframes swRise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Panel ---------- */
.sw-panel {
  position: fixed;
  right: 22px;
  bottom: 96px;
  z-index: 1001;
  width: 394px;
  height: min(670px, calc(100vh - 120px));
  height: min(670px, calc(100dvh - 120px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--sw-bg);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(13, 27, 46, .4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px) scale(.98);
  transform-origin: bottom right;
  transition: opacity .25s ease, transform .25s ease, visibility .25s;
}

.sw-panel.sw-open {
  opacity: 1;
  visibility: visible;
  transform: none;
}

/* ---------- Header (logo slot) ---------- */
.sw-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 14px 16px;
  background: linear-gradient(135deg, var(--sw-ink) 0%, var(--sw-ink-2) 100%);
  color: #eef3fb;
  border-bottom: 3px solid var(--sw-teal);
}

.sw-logo {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .12);
}

.sw-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0 7px;
}

.sw-logo .sw-logo-fallback {
  font: 800 14px "Instrument Sans", sans-serif;
  color: var(--sw-ink);
  letter-spacing: .02em;
}

.sw-head-text {
  flex: 1;
  min-width: 0;
}

.sw-title {
  font: 600 17px/1.2 "Instrument Sans", "Inter", sans-serif;
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sw-sub {
  font-size: 12px;
  color: #9FB0C3;
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sw-sub i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #19D3BE;
  display: inline-block;
}

.sw-head button {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 0;
  color: #eef3fb;
  background: rgba(255, 255, 255, .08);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}

.sw-head button:hover {
  background: rgba(255, 255, 255, .18);
}

.sw-head button svg {
  width: 18px;
  height: 18px;
}

/* ---------- Messages ---------- */
.sw-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}

.sw-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  max-width: 92%;
  animation: swRise .25s ease both;
}

.sw-row.sw-user {
  align-self: flex-end;
}

.sw-bubble {
  padding: 10px 13px;
  font-size: 14.5px;
  line-height: 1.5;
  white-space: pre-line;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  border-radius: 14px;
  color: var(--sw-text);
}

.sw-bot .sw-bubble {
  background: #fff;
  border: 1px solid var(--sw-line);
  border-bottom-left-radius: 4px;
}

.sw-user .sw-bubble {
  background: var(--sw-ink);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.sw-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
  min-width: 0;
}

.sw-tts {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--sw-line);
  background: #fff;
  color: var(--sw-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}

.sw-tts svg {
  width: 15px;
  height: 15px;
}

.sw-tts:hover {
  color: var(--sw-teal-deep);
  border-color: var(--sw-teal-deep);
}

.sw-tts.sw-speaking {
  background: var(--sw-teal);
  color: var(--sw-ink);
  border-color: var(--sw-teal);
  animation: swPulse2 1.2s infinite;
}

@keyframes swPulse2 {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: .6
  }
}

.sw-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sw-action {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  font: 600 13px "Inter", sans-serif;
  background: var(--sw-ink);
  color: #fff !important;
  text-decoration: none;
  transition: background .2s;
}

.sw-action:hover {
  background: var(--sw-ink-2);
}

.sw-action.sw-wa {
  background: #1faa59;
}

.sw-action.sw-wa:hover {
  background: #178a47;
}

.sw-action.sw-ghost {
  background: #fff;
  color: var(--sw-ink) !important;
  border: 1px solid var(--sw-line);
}

.sw-action.sw-ghost:hover {
  border-color: var(--sw-teal-deep);
  background: #fff;
}

.sw-typing {
  display: inline-flex;
  gap: 4px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--sw-line);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}

.sw-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9aa8c2;
  animation: swBounce 1.2s infinite;
}

.sw-typing span:nth-child(2) {
  animation-delay: .15s;
}

.sw-typing span:nth-child(3) {
  animation-delay: .3s;
}

@keyframes swBounce {

  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: .5
  }

  30% {
    transform: translateY(-5px);
    opacity: 1
  }
}

/* ---------- Chips ---------- */
.sw-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  animation: swRise .25s ease both;
}

.sw-chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--sw-teal-deep);
  background: #fff;
  color: var(--sw-ink);
  font: 600 13.5px "Inter", sans-serif;
  cursor: pointer;
  transition: all .18s;
  text-align: left;
}

.sw-chip:hover {
  background: var(--sw-teal);
  border-color: var(--sw-teal);
}

.sw-chip:focus-visible {
  outline: 2px solid var(--sw-ink);
  outline-offset: 2px;
}

.sw-chip.sw-primary {
  background: var(--sw-teal);
  border-color: var(--sw-teal);
}

.sw-chip.sw-primary:hover {
  background: var(--sw-ink);
  border-color: var(--sw-ink);
  color: #fff;
}

.sw-chip.sw-accent {
  border-color: var(--sw-ink);
  border-style: dashed;
}

.sw-chip.sw-accent:hover {
  background: var(--sw-ink);
  color: #fff;
}

/* ---------- Summary card ---------- */
.sw-card {
  background: #fff;
  border: 1px solid var(--sw-line);
  border-radius: 14px;
  padding: 12px 14px;
  width: 100%;
  animation: swRise .25s ease both;
}

.sw-card dl {
  margin: 0;
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 7px 10px;
  font-size: 13.5px;
}

.sw-card dt {
  color: var(--sw-muted);
  font-weight: 500;
}

.sw-card dd {
  margin: 0;
  color: var(--sw-text);
  font-weight: 600;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

/* ---------- Calendar ---------- */
.sw-cal {
  background: #fff;
  border: 1px solid var(--sw-line);
  border-radius: 14px;
  padding: 14px;
  width: 100%;
  animation: swRise .25s ease both;
}

.sw-cal h4 {
  margin: 0 0 8px;
  font: 600 13px "Instrument Sans", sans-serif;
  color: var(--sw-text);
  letter-spacing: 0;
}

.sw-cal h4 span {
  color: var(--sw-muted);
  font-weight: 500;
}

.sw-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.sw-cal-head strong {
  font: 600 15px "Instrument Sans", sans-serif;
}

.sw-nav {
  width: 32px;
  height: 32px;
  border: 1px solid var(--sw-line);
  background: #fff;
  border-radius: 8px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: var(--sw-text);
}

.sw-nav:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.sw-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.sw-dow {
  font-size: 11px;
  text-align: center;
  color: var(--sw-muted);
  padding: 3px 0;
  font-weight: 600;
}

.sw-day {
  aspect-ratio: 1;
  border: 1px solid transparent;
  background: var(--sw-bg-2);
  border-radius: 8px;
  font: 600 13px "Inter", sans-serif;
  color: var(--sw-text);
  cursor: pointer;
  padding: 0;
}

.sw-day:hover:not(:disabled) {
  border-color: var(--sw-teal-deep);
}

.sw-day:disabled {
  background: none;
  color: #b4bcc6;
  cursor: not-allowed;
  text-decoration: line-through;
}

.sw-day.sw-sel {
  background: var(--sw-ink);
  color: #fff;
}

.sw-day.sw-today {
  box-shadow: inset 0 0 0 1.5px var(--sw-teal);
}

.sw-blank {
  visibility: hidden;
}

.sw-slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 6px;
}

.sw-slot {
  padding: 8px 2px;
  border: 1px solid #c9d3de;
  background: #fff;
  border-radius: 8px;
  font: 600 13px/1.25 "Inter", sans-serif;
  color: var(--sw-text);
  cursor: pointer;
}

.sw-slot:hover:not(:disabled) {
  border-color: var(--sw-teal-deep);
}

.sw-slot.sw-sel {
  background: var(--sw-ink);
  border-color: var(--sw-ink);
  color: #fff;
}

.sw-slot.sw-booked {
  background: #fdeaea;
  border-color: #e5484d;
  color: var(--sw-red);
  cursor: not-allowed;
}

.sw-slot small {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
}

.sw-sec {
  margin-top: 14px;
}

.sw-summary {
  margin-top: 12px;
  padding: 9px 11px;
  background: var(--sw-bg-2);
  border-radius: 8px;
  font-size: 13.5px;
}

.sw-summary small {
  display: block;
  color: var(--sw-muted);
  margin-top: 2px;
  font-size: 12px;
}

.sw-btn {
  width: 100%;
  margin-top: 10px;
  padding: 11px;
  border: 0;
  border-radius: 8px;
  background: var(--sw-teal);
  color: var(--sw-ink);
  font: 700 14px "Instrument Sans", "Inter", sans-serif;
  cursor: pointer;
}

.sw-btn:hover:not(:disabled) {
  background: var(--sw-ink);
  color: #fff;
}

.sw-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.sw-msg {
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: 8px;
  font-size: 13px;
}

.sw-msg.sw-err {
  background: #fdeaea;
  color: var(--sw-red);
}

.sw-msg.sw-info {
  background: #e6f9f6;
  color: #0b6b60;
}

.sw-muted {
  color: var(--sw-muted);
  font-size: 12.5px;
  margin: 8px 0 0;
}

.sw-cal.sw-done {
  padding: 10px 12px;
  background: #e7f6ec;
  border-color: #b7e2c4;
  color: var(--sw-green);
  font-weight: 600;
  font-size: 13.5px;
}

/* ---------- Input row ---------- */
.sw-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #fff;
  border-top: 1px solid var(--sw-line);
}

.sw-input {
  flex: 1;
  min-width: 0;
  padding: 11px 14px;
  border: 1.5px solid var(--sw-line);
  border-radius: 999px;
  font: 400 15px "Inter", sans-serif;
  color: var(--sw-text);
  background: var(--sw-bg);
  outline: none;
}

.sw-input:focus {
  border-color: var(--sw-teal-deep);
  background: #fff;
}

.sw-icon-btn {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}

.sw-icon-btn svg {
  width: 19px;
  height: 19px;
}

.sw-icon-btn[hidden] {
  display: none;
}

#sw-send {
  background: var(--sw-teal);
  color: var(--sw-ink);
}

#sw-send:hover {
  background: var(--sw-ink);
  color: #fff;
}

#sw-mic {
  background: var(--sw-bg-2);
  color: var(--sw-ink);
}

#sw-mic:hover {
  background: #dde3ee;
}

#sw-mic.sw-listening {
  background: #e5484d;
  color: #fff;
  animation: swPulse2 1s infinite;
}

.sw-foot {
  text-align: center;
  font-size: 11px;
  color: var(--sw-muted);
  padding: 0 0 8px;
  background: #fff;
}

/* ---------- Mobile ---------- */
@media (max-width: 520px) {
  .sw-panel {
    right: 0;
    bottom: 0;
    left: 0;
    top: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
  }

  .sw-head {
    padding-top: calc(14px + env(safe-area-inset-top, 0px));
  }

  .sw-foot {
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  }

  #sw-launcher.sw-hide {
    display: none;
  }

  #sw-launcher {
    right: 16px;
    bottom: 16px;
  }

  #sw-teaser {
    right: 16px;
    bottom: 88px;
  }

  .sw-input {
    font-size: 16px;
  }

  /* stops iOS zoom-on-focus */
}

@media (prefers-reduced-motion: reduce) {

  .sw-chat *,
  #sw-launcher,
  #sw-teaser,
  .sw-panel {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}