#sychat-root {
  --sychat-accent: #2f6f6a;
  --sychat-bg: #ffffff;
  --sychat-text: #1f2a2a;
  --sychat-muted: #5f6b6b;
  --sychat-bot-bg: #f1f4f3;
  --sychat-border: #dfe5e3;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 99999;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.45;
  color: var(--sychat-text);
}

#sychat-root *, #sychat-root *::before, #sychat-root *::after { box-sizing: border-box; }

#sychat-toggle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  background: var(--sychat-accent);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  margin-left: auto;
  transition: transform 0.15s ease;
}
#sychat-toggle:hover { transform: scale(1.05); }
#sychat-toggle:focus-visible { outline: 3px solid #fff; box-shadow: 0 0 0 5px var(--sychat-accent); }
.sychat-open #sychat-toggle { display: none; }

#sychat-panel {
  width: 370px;
  height: min(600px, calc(100vh - 40px));
  background: var(--sychat-bg);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#sychat-panel[hidden] { display: none; }

.sychat-header {
  background: var(--sychat-accent);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sychat-title { font-weight: 600; font-size: 16px; }
.sychat-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.sychat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sychat-msg {
  max-width: 85%;
  padding: 10px 13px;
  border-radius: 14px;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.sychat-msg p { margin: 0 0 6px; }
.sychat-msg p:last-child { margin-bottom: 0; }
.sychat-msg ul { margin: 4px 0 6px; padding-left: 18px; }
.sychat-msg li { margin: 2px 0; }

.sychat-bot {
  align-self: flex-start;
  background: var(--sychat-bot-bg);
  border-bottom-left-radius: 4px;
}
.sychat-bot a { color: var(--sychat-accent); text-decoration: underline; font-weight: 600; }

.sychat-user {
  align-self: flex-end;
  background: var(--sychat-accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.sychat-typing { display: flex; gap: 4px; align-items: center; padding: 14px; }
.sychat-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sychat-muted);
  animation: sychat-bounce 1.2s infinite ease-in-out;
}
.sychat-typing span:nth-child(2) { animation-delay: 0.15s; }
.sychat-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes sychat-bounce {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

.sychat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 10px;
}
.sychat-chips[hidden] { display: none; }
.sychat-chip {
  border: 1px solid var(--sychat-accent);
  background: #fff;
  color: var(--sychat-accent);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.sychat-chip:hover { background: var(--sychat-accent); color: #fff; }

.sychat-form {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--sychat-border);
  align-items: flex-end;
}
.sychat-form textarea {
  flex: 1;
  resize: none;
  border: 1px solid var(--sychat-border);
  border-radius: 10px;
  padding: 9px 11px;
  font: inherit;
  font-size: 16px; /* prevents iPhone zoom on focus */
  color: var(--sychat-text);
  background: #fff;
  max-height: 110px;
  margin: 0;
}
.sychat-form textarea:focus { outline: 2px solid var(--sychat-accent); outline-offset: -1px; }
.sychat-send {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--sychat-accent);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sychat-send:disabled { opacity: 0.5; cursor: default; }

.sychat-note {
  font-size: 11.5px;
  color: var(--sychat-muted);
  text-align: center;
  padding: 0 12px 10px;
}
.sychat-note a { color: inherit; }

@media (max-width: 480px) {
  #sychat-root { right: 12px; bottom: 12px; }
  .sychat-open#sychat-root { right: 0; bottom: 0; left: 0; top: 0; }
  .sychat-open #sychat-panel {
    width: 100vw;
    height: 100%;
    border-radius: 0;
  }
}

/* Text label on the chat button ("Questions? Ask us") */
#sychat-toggle.sychat-has-label {
  width: auto;
  padding: 0 22px 0 18px;
  border-radius: 999px;
  gap: 9px;
}
#sychat-toggle.sychat-has-label:hover { transform: scale(1.03); }
.sychat-label {
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
}
@media (max-width: 480px) {
  #sychat-toggle.sychat-has-label { width: 58px; padding: 0; border-radius: 50%; }
  .sychat-label { display: none; }
}

/* Preview badge (only admins see the chatbot in preview mode) */
.sychat-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #fff;
  color: var(--sychat-accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  vertical-align: 2px;
}
