:root {
  --ssc-primary: #D7263D;
  --ssc-primary-dark: #b31f34;
  --ssc-bg: #fff;
  --ssc-bg-light: #ffffff;
  --ssc-surface: #ffffff;
  --ssc-muted: #f3f4f6;
  --ssc-border: rgba(15, 23, 42, 0.12);
  --ssc-text: #0f172a;
  --ssc-text-muted: rgba(15,23,42,0.65);
  --ssc-font: 'Inter', Arial, sans-serif;
  --ssc-radius: 28px;
  --ssc-shadow: 0 8px 36px rgba(215, 38, 61, 0.15);
  --ssc-shadow-light: 0 3px 12px rgba(215, 38, 61, 0.07);
}

/* Reset y base */
body {
  font-family: var(--ssc-font);
  margin: 0;
  padding: 0;
  background: transparent;
}

/* Chat bubble flotante */
#ssc-chat-bubble-zone {
  position: fixed;
  bottom: 30px;
  right: 30px;
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 9999;
  user-select: none;
  cursor: pointer;
}

.ssc-bubble-hola-static {
  background-color: #fff;
  color: var(--ssc-primary);
  font-weight: 700;
  font-size: 1.1em;
  padding: 6px 14px;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(215, 38, 61, 0.15);
  white-space: nowrap;
  user-select: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

#ssc-chat-bubble-zone:hover .ssc-bubble-hola-static {
  transform: translateX(-4px);
}

#ssc-chat-bubble {
  width: 62px;
  height: 62px;
  background: var(--ssc-primary);
  border-radius: 50%;
  border: 3px solid var(--ssc-primary);
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
  position: relative;
  z-index: 10001;
}

#ssc-chat-bubble:hover,
#ssc-chat-bubble:focus-visible {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 10px 25px rgba(215, 38, 61, 0.4);
  outline: none;
  background-color: var(--ssc-primary-dark);
}

#ssc-chat-bubble:focus-visible {
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px rgba(215, 38, 61, 0.7);
}

#ssc-chat-bubble svg {
  width: 60px;
  height: 60px;
  fill: white;
  pointer-events: none;
}

#ssc-chat-bubble-zone.hola-off .ssc-bubble-hola-static {
  opacity: 0;
  pointer-events: none;
}

/* Chat container */
#ssc-chat-box {
  position: fixed;
  bottom: 100px;
  right: 32px;
  width: 450px;
  max-width: 90vw;
  height: 560px;
  max-height: calc(100vh - 120px);
  background: var(--ssc-surface);
  border-radius: var(--ssc-radius);
  box-shadow: 0 18px 60px rgba(2, 8, 23, 0.18);
  border: 1px solid var(--ssc-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--ssc-primary-dark);
  opacity: 0;
  pointer-events: none;
  transform: translateY(36px) scale(0.96);
  transition: opacity 0.4s cubic-bezier(.61,0,.33,1), transform 0.4s cubic-bezier(.61,0,.33,1);
  z-index: 10000;
}

#ssc-chat-box.ssc-visible {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0) scale(1);
}

/* Cabecera */
.ssc-header {
  background: var(--ssc-primary);
  color: #fff;
  border-bottom: none;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-weight: 700;
  font-size: 1.05em;
  user-select: none;
  border-radius: var(--ssc-radius) var(--ssc-radius) 0 0;
  box-shadow: 0 4px 14px rgba(215, 38, 61, 0.4);
  font-family: 'Inter', Arial, sans-serif;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.ssc-title {
  font-weight: 700;
  font-size: 1.05em;
  margin: 0;
  padding-right: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ssc-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ssc-header-actions button {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.3em;
  cursor: pointer;
  height: 34px;
  width: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
  border-radius: 50%;
  /* Defensive reset against theme button styles */
  padding: 0 !important;
  margin: 0 !important;
  min-height: 34px;
  min-width: 34px;
  line-height: 1 !important;
  box-sizing: border-box;
  flex: 0 0 auto;
  -webkit-appearance: none;
  appearance: none;
}

.ssc-header-actions button:hover,
.ssc-header-actions button:focus-visible {
  background-color: rgba(255,255,255,0.2);
  outline: none;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.6);
}

.ssc-header-actions button:focus-visible {
  box-shadow: 0 0 0 3px #fff;
}

.ssc-header-actions button svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: currentColor;
  pointer-events: none;
}

/* Make key CTAs (Book / Email) easier to recognise */
.ssc-header-actions button.ssc-pill{
  width: auto;
  padding: 0 10px;
  border-radius: 999px;
  gap: 6px;
}
.ssc-header-actions button.ssc-pill svg{
  width: 18px;
  height: 18px;
}
.ssc-btn-label{
  display: none;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #fff;
}

/* Desktop/tablet: keep header CTAs compact (icon-only) */
@media (min-width: 481px){
  #ssc-chat-box .ssc-header-actions button.ssc-pill{
    width: 34px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    gap: 0 !important;
  }
  #ssc-chat-box .ssc-header-actions .ssc-btn-label{
    display: none !important;
  }
}

@media (max-width: 480px){
  .ssc-header-actions button.ssc-pill .ssc-btn-label{
    display: inline;
  }
}

.ssc-close {
  font-size: 1.5em;
  line-height: 1;
  color: #fff;
  font-weight: 700;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

.ssc-close:hover,
.ssc-close:focus-visible {
  background-color: rgba(255,255,255,0.2);
  outline: none;
  box-shadow: 0 0 0 3px #fff;
}

/* Área de mensajes */
.ssc-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 24px 26px 20px 26px;
  background: var(--ssc-bg);
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-sizing: border-box;
  color: var(--ssc-primary-dark);
  scroll-behavior: smooth;
  word-wrap: break-word;
  font-size: 1rem;
  line-height: 1.55;
}

.ssc-messages::-webkit-scrollbar {
  width: 9px;
}

.ssc-messages::-webkit-scrollbar-track {
  background: var(--ssc-surface);
  border-radius: 10px;
}

.ssc-messages::-webkit-scrollbar-thumb {
  background: var(--ssc-primary);
  border-radius: 10px;
  border: 3px solid var(--ssc-bg-light);
  transition: background-color 0.3s;
}

.ssc-messages::-webkit-scrollbar-thumb:hover {
  background: var(--ssc-primary-dark);
}

.ssc-messages {
  scrollbar-width: thin;
  scrollbar-color: var(--ssc-primary) var(--ssc-bg-light);
}

.ssc-msg {
  border-radius: 30px;
  padding: 14px 18px;
  font-size: 0.95rem;
  line-height: 1.4;
  max-width: 83%;
  user-select: text;
  transition: background-color 0.3s, box-shadow 0.3s;
  box-shadow: 0 8px 32px rgba(215, 38, 61, 0.07);
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  animation: fadeInBubble 0.38s forwards cubic-bezier(0.53, 0, 0.21, 1);
  letter-spacing: 0.025em;
}

/* ===== Bulk level test (clean layout) ===== */
.ssc-test-card{
  background: rgba(15, 23, 42, 0.03);
  border: 1px solid var(--ssc-border);
  border-radius: 18px;
  padding: 14px 14px;
}
.ssc-test-title{
  font-weight: 900;
  font-size: 1rem;
  margin-bottom: 2px;
  color: var(--ssc-text);
}
.ssc-test-sub{
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--ssc-text-muted);
  margin-bottom: 10px;
}
.ssc-test-instructions p{
  margin: 0 0 6px 0;
}
.ssc-test-example code{
  display: block;
  background: var(--ssc-muted);
  border: 1px solid rgba(15, 23, 42, 0.08);
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 0.86rem;
  overflow-x: auto;
}
.ssc-test-note{
  font-size: 0.86rem;
  color: var(--ssc-text-muted);
  margin-top: 6px;
}
.ssc-test-list{
  margin: 12px 0 0 18px;
  padding: 0;
}
.ssc-test-list li{
  margin: 10px 0;
}
.ssc-test-es{
  display: block;
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--ssc-text-muted);
}
.ssc-test-missing{
  margin-bottom: 12px;
}

@keyframes fadeInBubble {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ssc-user {
  align-self: flex-end;
  background: var(--ssc-primary);
  color: var(--ssc-bg);
  font-weight: 700;
  margin-left: 62px;
  border-radius: 30px 34px 24px 38px;
  box-shadow: 0 8px 30px rgba(215, 38, 61, 0.4);
  letter-spacing: 0.028em;
}

.ssc-user * {
  color: var(--ssc-bg) !important;
}

.ssc-user:hover {
  box-shadow: 0 10px 40px rgba(179, 31, 52, 0.6);
}

.ssc-bot {
  align-self: flex-start;
  background: var(--ssc-bg);
  border-radius: 30px 24px 28px 26px;
  border: 1.5px solid #f4bcc0;
  font-weight: 600;
  color: var(--ssc-primary-dark);
}

.ssc-bot a {
  color: var(--ssc-primary);
  font-weight: 700;
  text-decoration: underline;
  transition: color 0.3s ease;
}

.ssc-bot a:hover,
.ssc-bot a:focus-visible {
  color: var(--ssc-primary-dark);
  outline: none;
}

.ssc-bot:hover {
  background: var(--ssc-surface);
}

/* Tarjeta de lead */
.ssc-lead-card {
  border-style: dashed;
  border-color: rgba(215, 38, 61, 0.4);
  background: #fff7f8;
}

/* Indicador de escritura */
.ssc-typing-dots {
  display: inline-block;
  height: 1.2em;
}

.ssc-typing-dot {
  display: inline-block;
  background: var(--ssc-primary-dark);
  border-radius: 50%;
  width: 7px;
  height: 7px;
  margin: 0 4px;
  animation: dotBounce 1.2s infinite ease-in-out;
  box-shadow: 0 0 6px var(--ssc-primary);
  opacity: 0.85;
}

.ssc-typing-dot:nth-child(1) { animation-delay: 0s; }
.ssc-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.ssc-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.85; }
  40% { transform: translateY(-8px); opacity: 1; }
}

/* Quick replies */
.ssc-quick-replies {
  display: flex;
  flex-wrap: wrap;
  overflow-x: hidden;
  gap: 10px;
  padding: 14px 22px;
  background: var(--ssc-bg);
  justify-content: flex-start;
  user-select: none;
  scrollbar-width: thin;
  scrollbar-color: var(--ssc-primary) var(--ssc-bg-light);
}

.ssc-quick-replies::-webkit-scrollbar {
  height: 6px;
}

.ssc-quick-replies::-webkit-scrollbar-track {
  background: var(--ssc-surface);
  border-radius: 10px;
}

.ssc-quick-replies::-webkit-scrollbar-thumb {
  background: var(--ssc-primary);
  border-radius: 10px;
  border: 2px solid var(--ssc-bg-light);
}

.ssc-quick-btn {
  position: relative;
  flex: 0 0 auto;
  padding: 9px 20px;
  border-radius: 25px;
  border: none;
  background: #fafafa;
  color: var(--ssc-primary-dark);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(215, 38, 61, 0.12);
  user-select: none;
  white-space: nowrap;
  transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease, transform 0.15s ease;
  outline: none;
}

.ssc-quick-btn:hover,
.ssc-quick-btn:focus-visible {
  background: var(--ssc-primary);
  color: var(--ssc-bg);
  box-shadow: 0 12px 38px rgba(215, 38, 61, 0.32);
  transform: translateY(-1px);
}

.ssc-quick-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 30px;
  background: radial-gradient(circle, rgba(215,57,70,0.3) 10%, transparent 70%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: -1;
}

.ssc-quick-btn:hover::after,
.ssc-quick-btn:focus-visible::after {
  opacity: 1;
}

/* Modal genérico */
.ssc-modal {
  position: fixed;
  z-index: 11000;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  opacity: 1;
  transition: opacity 0.3s ease;
}

.ssc-modal.ssc-hidden {
  display: none !important;
  opacity: 0;
  pointer-events: none;
}

.ssc-modal-content {
  background: var(--ssc-bg);
  border-radius: var(--ssc-radius);
  padding: 24px 24px 22px;
  width: 360px;
  max-width: 92vw;
  box-shadow: var(--ssc-shadow);
  font-family: var(--ssc-font);
  color: var(--ssc-primary-dark);
  position: relative;
}

.ssc-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.6em;
  color: var(--ssc-primary-dark);
  cursor: pointer;
  transition: color 0.2s, transform 0.15s;
}

.ssc-modal-close:hover,
.ssc-modal-close:focus-visible {
  color: var(--ssc-primary);
  outline: none;
  transform: scale(1.1);
}

/* Formulario de entrada */
.ssc-form {
  display: flex;
  padding: 14px 22px 18px;
  background: var(--ssc-bg);
  border-top: 1.5px solid #f8c3cb;
  border-radius: 0 0 var(--ssc-radius) var(--ssc-radius);
  box-sizing: border-box;
  gap: 12px;
}

.ssc-form input[type="text"] {
  flex: 1;
  border-radius: 30px;
  border: 1px solid var(--ssc-border);
  padding: 12px 18px;
  font-size: 1.05em;
  font-family: var(--ssc-font);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.ssc-form input[type="text"]:focus-visible {
  border-color: var(--ssc-primary-dark);
  box-shadow: 0 0 0 2px rgba(215, 38, 61, 0.25);
}

.ssc-send-btn {
  background: var(--ssc-bg);
  border: none;
  border-radius: 50%;
  width: 46px;
  height: 46px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.25s ease, box-shadow 0.25s ease, transform 0.15s ease;
  flex-shrink: 0;
}

.ssc-send-btn svg polygon {
  fill: var(--ssc-primary);
  transition: fill 0.25s ease;
}

.ssc-send-btn:hover,
.ssc-send-btn:focus-visible {
  background: #f8dade;
  box-shadow: 0 0 15px rgba(215, 38, 61, 0.4);
  outline: none;
  transform: translateY(-1px);
}

.ssc-send-btn:hover svg polygon,
.ssc-send-btn:focus-visible svg polygon {
  fill: var(--ssc-primary-dark);
}

/* ---------- Responsive: Tablets (601px–1024px) ---------- */
@media (max-width: 1024px) and (min-width: 601px) {
  #ssc-chat-bubble-zone {
    bottom: 24px;
    right: 24px;
  }

  #ssc-chat-box {
    right: 16px;
    bottom: 90px;
    width: 380px;
    max-width: 90vw;
    height: 520px;
    max-height: calc(100vh - 120px);
  }

  .ssc-messages {
    padding: 18px 18px 16px;
    font-size: 1rem;
  }

  .ssc-msg {
    max-width: 88%;
  }

  .ssc-quick-replies {
    padding: 10px 18px;
  }
}

/* ---------- Responsive: Móviles (≤ 600px) ---------- */
@media (max-width: 600px) {
  #ssc-chat-bubble-zone {
    bottom: 20px;
    right: 20px;
    gap: 10px;
  }

  #ssc-chat-bubble {
    width: 70px;
    height: 70px;
  }

  #ssc-chat-bubble svg {
    width: 68px;
    height: 68px;
  }

  #ssc-chat-box {
    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    max-width: 100vw;
    max-height: 100dvh;
    border-radius: 0;
    box-shadow: none;
    border: none;
    display: flex;
    flex-direction: column;
    z-index: 99999;
  }

  .ssc-header {
    height: 54px;
    padding: 0 14px;
    font-size: 1em;
  }

  .ssc-messages {
    padding: 14px 14px 10px;
    gap: 10px;
    font-size: 1.02em;
    line-height: 1.45;
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .ssc-msg {
    max-width: 90vw;
    padding: 12px 16px;
  }

  .ssc-quick-replies {
    flex-wrap: nowrap;
    overflow-y: auto;
    overflow-x: hidden;
    flex-direction: column;
    padding: 10px 16px;
    max-height: 150px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--ssc-primary) var(--ssc-bg-light);
  }

  .ssc-quick-replies::-webkit-scrollbar {
    width: 6px;
  }

  .ssc-quick-btn {
    flex: none;
    width: auto;
    padding: 11px 20px;
    margin-bottom: 8px;
    font-size: 1.02em;
    white-space: normal;
  }

  .ssc-form {
    padding: 10px 14px calc(env(safe-area-inset-bottom, 12px) + 6px);
    gap: 10px;
    position: sticky;
    bottom: 0;
    z-index: 10;
  }

  .ssc-form input[type='text'] {
    font-size: 1.02em !important;
    padding: 11px 14px;
  }

  .ssc-send-btn {
    width: 42px !important;
    height: 42px !important;
  }

  body {
    touch-action: pan-y;
    overscroll-behavior: contain;
  }

  body.chat-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
    touch-action: auto;
  }

  .ssc-modal-content {
    width: 90vw;
    max-width: 90vw;
    padding: 20px 20px 18px;
  }
}

/* Respeto a usuarios con reduce motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}



/* =========================
   PRO UI OVERRIDES (v7.1)
   ========================= */

#ssc-chat-box { color: var(--ssc-text); }

.ssc-header {
  padding: 14px 14px;
  gap: 10px;
  align-items: center;
}

.ssc-title {
  font-weight: 700;
  letter-spacing: 0.2px;
  font-size: 15px;
}

.ssc-header:after{
  content: "Online";
  margin-left: 10px;
  font-size: 12px;
  opacity: 0.9;
  background: rgba(255,255,255,0.18);
  padding: 4px 8px;
  border-radius: 999px;
}

.ssc-messages {
  background: var(--ssc-muted);
}

.ssc-msg {
  border: 1px solid transparent;
  box-shadow: 0 6px 16px rgba(2, 8, 23, 0.06);
}

.ssc-msg.ssc-bot{
  background: var(--ssc-surface);
  border-color: rgba(15,23,42,0.08);
  color: var(--ssc-text);
}

.ssc-msg.ssc-user{
  background: var(--ssc-primary);
  color: #fff;
  border-color: rgba(255,255,255,0.1);
}

.ssc-quick-replies{
  padding: 10px 12px;
  background: var(--ssc-surface);
  border-top: 1px solid rgba(15,23,42,0.08);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: nowrap;
  gap: 8px;
}

.ssc-quick-btn{
  border-radius: 999px !important;
  padding: 10px 12px !important;
  font-size: 13px !important;
  border: 1px solid rgba(15,23,42,0.10) !important;
  background: #fff !important;
  color: var(--ssc-text) !important;
}

.ssc-quick-btn:hover{
  transform: translateY(-1px);
}

.ssc-form{
  background: var(--ssc-surface);
  border-top: 1px solid rgba(15,23,42,0.08);
  padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 0px));
  gap: 10px;
}

textarea.ssc-input{
  width: 100%;
  resize: none;
  border-radius: 14px;
  border: 1px solid rgba(15,23,42,0.12);
  padding: 12px 12px;
  font-size: 16px;
  outline: none;
  line-height: 1.3;
  min-height: 44px;
  max-height: 140px;
  color: var(--ssc-text);
  background: #fff;
}

textarea.ssc-input:focus{
  border-color: rgba(15,23,42,0.25);
  box-shadow: 0 0 0 4px rgba(13,110,253,0.12);
}

.ssc-send-btn{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--ssc-primary);
}

.ssc-send-btn svg polygon{
  fill: #fff;
}

@media (max-width: 600px){
  #ssc-chat-box{
    height: 100dvh !important;
  }

  body.chat-open{
    overflow: hidden !important;
    /* Mobile: do NOT force position:fixed on body (breaks iOS Safari + keyboard) */
    position: static !important;
    width: auto !important;
    height: auto !important;
  }

  .ssc-messages{
    padding: 14px 14px 12px;
  }

  .ssc-header-actions button{
    width: 40px;
    height: 40px;
  }
}

/* =========================
   SALES BOOSTER: QUICK ACTIONS
   ========================= */
.ssc-cta-card{
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(15,23,42,0.10);
  box-shadow: var(--ssc-shadow-light);
}

.ssc-cta-title{
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--ssc-text);
}

.ssc-cta-buttons{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ssc-cta-btn{
  border: 1px solid rgba(15,23,42,0.12);
  background: #fff;
  color: var(--ssc-text);
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
  font-size: 0.85rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ssc-cta-btn:hover,
.ssc-cta-btn:focus-visible{
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(2,8,23,0.12);
  outline: none;
}

.ssc-cta-book{
  border-color: rgba(215,38,61,0.25);
}

.ssc-cta-test{
  border-color: rgba(15,23,42,0.14);
}

.ssc-cta-wa{
  border-color: rgba(34,197,94,0.25);
}



/* =========================
   HEADER + MOBILE FIXES (v7.2)
   ========================= */
#ssc-chat-box .ssc-header{
  height: auto !important;
  min-height: 58px;
  padding: 10px 12px !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

#ssc-chat-box .ssc-header-left{
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

#ssc-chat-box .ssc-avatar{
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: rgba(255,255,255,0.18);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.5px;
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,0.22);
}

#ssc-chat-box .ssc-header-text{
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.05;
}

#ssc-chat-box .ssc-title{
  font-size: 15px !important;
  font-weight: 800 !important;
  letter-spacing: 0.2px !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

#ssc-chat-box .ssc-subtitle{
  font-size: 12px;
  font-weight: 600;
  opacity: 0.92;
  display: flex;
  align-items: center;
  gap: 6px;
}

#ssc-chat-box .ssc-dot{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(66, 244, 109, 0.95);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.18);
}

#ssc-chat-box .ssc-header:after{
  content: none !important; /* remove old "Online" pseudo badge */
}

#ssc-chat-box .ssc-header-actions{
  gap: 6px !important;
}

#ssc-chat-box .ssc-header-actions button{
  width: 38px !important;
  height: 38px !important;
}

#ssc-chat-box .ssc-header-actions button svg{
  width: 18px !important;
  height: 18px !important;
}

/* Prevent iOS zoom on focus + consistent input */
#ssc-chat-box textarea.ssc-input{
  font-size: 16px !important;
  -webkit-text-size-adjust: 100%;
}

#ssc-chat-box textarea.ssc-input::placeholder{
  color: rgba(15,23,42,0.45);
}

@media (max-width: 420px){
  /* Reduce clutter so title + icons look clean */
  #ssc-chat-box .ssc-book,
  #ssc-chat-box .ssc-actions,
  #ssc-chat-box .ssc-clear{
    display: none !important;
  }

  #ssc-chat-box .ssc-title{
    max-width: 180px;
  }
}

@media (max-width: 600px){
  /* Better keyboard + safe-area feel */
  #ssc-chat-box{
    height: var(--ssc-vh, 100dvh) !important;
  }
  #ssc-chat-box .ssc-form{
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }
}



/* =========================
   HEADER CLEANUP + iOS FIXES (v7.3)
   ========================= */

/* Remove duplicated "Online" badge injected via pseudo-element in older overrides */
#ssc-chat-box .ssc-header:after{
  content: none !important;
  display: none !important;
}

/* Stronger header layout */
#ssc-chat-box .ssc-header{
  min-height: 60px !important;
  padding: 10px 12px !important;
}

#ssc-chat-box .ssc-header-left{
  flex: 1 1 auto;
  min-width: 0;
}

#ssc-chat-box .ssc-header-actions{
  flex: 0 0 auto;
  gap: 6px;
}

#ssc-chat-box .ssc-header-actions button{
  width: 36px !important;
  height: 36px !important;
}

/* Ensure title always visible */
#ssc-chat-box .ssc-title{
  max-width: 260px;
}

/* iOS Safari zoom prevention: ALWAYS >= 16px */
#ssc-chat-box input,
#ssc-chat-box textarea,
#ssc-chat-box select{
  font-size: 16px !important;
}

/* Use JS-driven visualViewport height to avoid keyboard jump */
@media (max-width: 600px){
  #ssc-chat-box{
    height: var(--ssc-vh, 100dvh) !important;
  }
  body.chat-open{
    -webkit-text-size-adjust: 100%;
  }
}

/* Ultra-small phones: reduce clutter in header (keep sales CTAs) */
@media (max-width: 420px){
  #ssc-chat-box .ssc-clear{ display: none !important; }
  #ssc-chat-box .ssc-title{ max-width: 170px; }
}


/* =========================
   MOBILE PRO OVERHAUL (v7.4)
   Full-screen, clean header, no iOS zoom weirdness
   ========================= */

@media (max-width: 768px){
  #ssc-chat-box{
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: var(--ssc-vh, 100dvh) !important;
    max-height: none !important;
    border-radius: 0 !important;
    transform: none !important;
  }

  /* Header = safe + clean */
  #ssc-chat-box .ssc-header{
    border-radius: 0 !important;
    min-height: 64px !important;
    padding: 12px 12px calc(10px + env(safe-area-inset-top, 0px)) 12px !important;
    letter-spacing: 0 !important;
    box-shadow: none !important;
  }

  #ssc-chat-box .ssc-title{
    font-size: 16px !important;
    font-weight: 800 !important;
    max-width: 52vw !important;
  }

  #ssc-chat-box .ssc-subtitle{
    font-size: 12px !important;
    opacity: 0.95 !important;
  }

  #ssc-chat-box .ssc-header-actions button{
    width: 40px !important;
    height: 40px !important;
    border-radius: 14px !important;
    background: rgba(255,255,255,0.14) !important;
  }

  #ssc-chat-box .ssc-header-actions button svg{
    width: 18px !important;
    height: 18px !important;
  }

  /* Messages */
  #ssc-chat-box .ssc-messages{
    padding: 16px 14px 14px 14px !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  /* Quick replies as horizontal chips */
  #ssc-chat-box .ssc-quick-replies{
    padding: 10px 10px !important;
    gap: 8px !important;
    border-top: 1px solid rgba(15,23,42,0.08);
  }

  #ssc-chat-box .ssc-quick-btn{
    font-size: 13px !important;
    padding: 10px 12px !important;
    border-radius: 999px !important;
  }

  /* Input bar */
  #ssc-chat-box .ssc-form{
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 0px)) 10px !important;
  }

  #ssc-chat-box textarea.ssc-input{
    font-size: 16px !important; /* prevent iOS zoom */
    min-height: 46px !important;
    border-radius: 16px !important;
  }

  #ssc-chat-box .ssc-send-btn{
    width: 46px !important;
    height: 46px !important;
    border-radius: 16px !important;
  }

  /* Bubble stays usable */
  #ssc-chat-bubble-zone{
    right: 18px !important;
    bottom: 18px !important;
    z-index: 10002 !important;
  }
}

/* Ultra-small phones: keep header readable */
@media (max-width: 420px){
  /* Keep Book + Email visible for sales; hide only Clear to save space */
  #ssc-chat-box .ssc-clear{ display: none !important; }

  #ssc-chat-box .ssc-title{
    max-width: 48vw !important;
  }
}


/* =========================
   MOBILE KEYBOARD FULLSCREEN FIX (v7.5)
   ========================= */
@media (max-width: 600px){
  /* Use visualViewport-aware variables to avoid the "jump up" when the keyboard opens */
  #ssc-chat-box{
    top: var(--ssc-vv-top, 0px) !important;
    bottom: auto !important;
    height: var(--ssc-vh, 100dvh) !important;
    max-height: var(--ssc-vh, 100dvh) !important;
    min-height: var(--ssc-vh, 100dvh) !important;
  }

  /* Do NOT force body fixed on mobile (it breaks fullscreen when keyboard appears) */
  body.chat-open{
    position: static !important;
    top: auto !important;
    height: auto !important;
    width: auto !important;
  }
}

