/* Support Assistant chat widget. Colours come from the site's own variables. */

#supportBot {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1200;
  font-family: "Inter", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

#supportBot [hidden] {
  display: none !important;
}

.sb-toggle {
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 50%;
  background: var(--brand, #0c5f55);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(8, 49, 44, 0.32);
  transition: transform 0.15s ease, background 0.15s ease;
}

.sb-toggle:hover {
  background: var(--brand-strong, #094740);
  transform: translateY(-2px);
}

.sb-toggle:focus-visible,
.sb-close:focus-visible,
.sb-send:focus-visible,
.sb-btn:focus-visible,
.sb-chip:focus-visible,
.sb-vote:focus-visible {
  outline: 3px solid var(--gold, #c38e2f);
  outline-offset: 2px;
}

.sb-panel {
  position: absolute;
  right: 0;
  bottom: 72px;
  width: 370px;
  max-width: calc(100vw - 24px);
  height: 540px;
  max-height: calc(100vh - 110px);
  display: flex;
  flex-direction: column;
  background: var(--surface, #fff);
  border: 1px solid var(--line, #d8e6e2);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(8, 49, 44, 0.24);
}

.sb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--brand, #0c5f55);
  color: #fff;
}

.sb-heading {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sb-heading strong {
  font-size: 15px;
  font-weight: 600;
}

.sb-heading span {
  font-size: 12px;
  opacity: 0.85;
}

.sb-close {
  flex: none;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
}

.sb-close:hover {
  background: rgba(255, 255, 255, 0.26);
}

.sb-log {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg, #f4f8f7);
}

.sb-msg {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 14px;
  color: var(--text, #152422);
  overflow-wrap: anywhere;
}

.sb-bot {
  align-self: flex-start;
  background: var(--surface, #fff);
  border: 1px solid var(--line, #d8e6e2);
  border-bottom-left-radius: 4px;
}

.sb-user {
  align-self: flex-end;
  background: var(--brand, #0c5f55);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.sb-text {
  margin: 0;
  white-space: pre-line;
}

.sb-title {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
  color: var(--brand-strong, #094740);
}

.sb-typing .sb-text {
  letter-spacing: 3px;
  color: var(--muted, #55706b);
  animation: sb-pulse 1s ease-in-out infinite;
}

@keyframes sb-pulse {
  50% {
    opacity: 0.35;
  }
}

.sb-link {
  display: inline-block;
  margin-top: 8px;
  font-weight: 600;
  color: var(--brand, #0c5f55);
  text-decoration: underline;
}

.sb-related {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line, #d8e6e2);
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 13px;
}

.sb-related span {
  color: var(--muted, #55706b);
}

.sb-related a {
  color: var(--brand, #0c5f55);
  text-decoration: underline;
}

/* Rows read live from the database */
.sb-items {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.sb-items li {
  padding-left: 10px;
  border-left: 2px solid var(--line, #d8e6e2);
  display: flex;
  flex-direction: column;
  overflow-wrap: anywhere;
}

.sb-items a,
.sb-item-title {
  font-weight: 600;
  color: var(--brand, #0c5f55);
}

.sb-items a {
  text-decoration: underline;
}

.sb-items small {
  color: var(--muted, #55706b);
  font-size: 12px;
}

.sb-more {
  display: flex;
  margin-top: 10px;
  padding: 5px 12px;
  font-size: 13px;
}

.sb-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.sb-chip {
  padding: 5px 11px;
  border: 1px solid var(--brand, #0c5f55);
  border-radius: 999px;
  background: transparent;
  color: var(--brand, #0c5f55);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.sb-chip:hover {
  background: var(--brand, #0c5f55);
  color: #fff;
}

.sb-feedback {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted, #55706b);
}

.sb-vote {
  padding: 2px 10px;
  border: 1px solid var(--line, #d8e6e2);
  border-radius: 999px;
  background: var(--surface, #fff);
  color: var(--text, #152422);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.sb-vote:hover {
  border-color: var(--brand, #0c5f55);
  color: var(--brand, #0c5f55);
}

.sb-support {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.sb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--brand, #0c5f55);
  border-radius: 10px;
  background: var(--surface, #fff);
  color: var(--brand, #0c5f55);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.sb-btn-primary {
  background: var(--brand, #0c5f55);
  color: #fff;
}

.sb-btn:hover {
  background: var(--brand-strong, #094740);
  border-color: var(--brand-strong, #094740);
  color: #fff;
}

.sb-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.sb-note {
  color: var(--muted, #55706b);
  font-size: 12px;
}

.sb-callback {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.sb-field {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid var(--line, #d8e6e2);
  border-radius: 8px;
  background: #fff;
  color: var(--text, #152422);
  font: inherit;
  resize: vertical;
}

.sb-field:focus,
.sb-input:focus {
  outline: 2px solid var(--brand, #0c5f55);
  outline-offset: 0;
}

.sb-trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.sb-error {
  margin: 0;
  color: #b42318;
  font-size: 12px;
}

.sb-form {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--line, #d8e6e2);
  background: var(--surface, #fff);
}

.sb-input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line, #d8e6e2);
  border-radius: 999px;
  background: #fff;
  color: var(--text, #152422);
  /* 16px stops iOS zooming the page when the field is focused */
  font: inherit;
  font-size: 16px;
}

.sb-send {
  flex: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--brand, #0c5f55);
  color: #fff;
  cursor: pointer;
}

.sb-send:hover {
  background: var(--brand-strong, #094740);
}

.sb-send:disabled {
  opacity: 0.55;
  cursor: default;
}

@media (max-width: 480px) {
  #supportBot {
    right: 12px;
    bottom: 12px;
  }

  .sb-panel {
    position: fixed;
    right: 8px;
    left: 8px;
    bottom: 80px;
    width: auto;
    max-width: none;
    height: auto;
    top: 12px;
    max-height: none;
  }
}

@media print {
  #supportBot {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sb-toggle,
  .sb-typing .sb-text {
    transition: none;
    animation: none;
  }
}
