/* --- Main chat window (hidden by default) --- */

#sv-chatbot {
  position: fixed;
  bottom: 16px;
  right: 16px;
  width: 320px;
  max-height: 60vh;
  background: #ffffff;
  border: 1px solid #ddd;
  border-radius: 12px;
  display: none; /* hidden until JS adds .sv-open */
  flex-direction: column;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  z-index: 9999;
}

#sv-chatbot.sv-open {
  display: flex;
}

#sv-chat-header {
  background: #1D7445;
  color: #fff;
  padding: 8px 12px;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sv-chat-title {
  margin-right: 8px;
}

.sv-chat-close-btn {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

#sv-chat-log {
  padding: 8px;
  flex: 1;
  overflow-y: auto;
  font-size: 13px;
}

.sv-msg {
  margin-bottom: 8px;
}

.sv-msg-user {
  text-align: right;
}

.sv-bubble {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 10px;
  max-width: 90%;
}

.sv-bubble-user {
  background: #e0f3ff;
}

.sv-bubble-bot {
  background: #f4f4f4;
}

#sv-chat-form {
  border-top: 1px solid #eee;
  display: flex;
  gap: 4px;
  padding: 6px;
}

#sv-chat-input {
  flex: 1;
  padding: 6px 8px;
  font-size: 13px;
  border-radius: 8px;
  border: 1px solid #ccc;
}

#sv-chat-form button {
  padding: 6px 10px;
  border-radius: 8px;
  border: none;
  background: #1D7445;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
}

#sv-chat-form button:disabled {
  opacity: 0.7;
  cursor: default;
}

/* --- Floating launcher button --- */

#sv-chat-launcher {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 9998;
  border-radius: 999px;
  border: none;
  background: #1D7445;
  color: #fff;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

#sv-chat-launcher:hover {
  background: #005eaa;
}

.sv-chat-launcher-icon {
  font-size: 18px;
  line-height: 1;
}

.sv-chat-launcher-label {
  white-space: nowrap;
}

/* --- Contact bar under assistant replies --- */

.sv-contact-bar {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed #ddd;
  font-size: 12px;
  color: #444;
}

.sv-contact-bar-title {
  margin-bottom: 4px;
  font-weight: 600;
}

.sv-contact-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.sv-contact-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid #ddd;
  text-decoration: none;
  color: #222;
  background: #fafafa;
  transition: background 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.sv-contact-button:hover {
  background: #f0f4ff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.sv-contact-button-email {
  border-color: #1D7445;
}

.sv-contact-button-call {
  border-color: #2e7d32;
}

.sv-contact-button-dept {
  border-style: dashed;
}

.sv-contact-button-page {
  border-color: #757575;
}

/* --- Mobile tweaks --- */

@media (max-width: 640px) {
  #sv-chatbot {
    width: 100%;
    right: 0;
    left: 0;
    bottom: 0;
    max-height: 80vh;
    border-radius: 12px 12px 0 0;
  }

  #sv-chat-launcher {
    bottom: 12px;
    right: 12px;
    padding: 10px;
  }

  .sv-chat-launcher-label {
    display: none; /* on small screens show only the bubble icon */
  }
}
