/* Floating visitor chat, shown on every public page of the site. */

.ovc-chat {
  --ovc-chat-navy: #112f4e;
  --ovc-chat-navy-soft: #1c3f63;
  --ovc-chat-green: #2e8367;
  --ovc-chat-ink: #1b1b1b;
  --ovc-chat-muted: #565c65;
  --ovc-chat-line: #dfe1e2;
  font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  color: var(--ovc-chat-ink);
}

.ovc-chat *,
.ovc-chat *::before,
.ovc-chat *::after {
  box-sizing: border-box;
}

.ovc-chat__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ovc-chat__launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9000;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px 14px 16px;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: var(--ovc-chat-navy);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(17, 47, 78, 0.35);
  transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.ovc-chat__launcher:hover,
.ovc-chat__launcher:focus-visible {
  background: var(--ovc-chat-navy-soft);
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(17, 47, 78, 0.4);
}

.ovc-chat__launcher:focus-visible {
  outline: 3px solid #2491ff;
  outline-offset: 2px;
}

.ovc-chat__icon {
  width: 24px;
  height: 24px;
  flex: none;
}

.ovc-chat__launcher-text {
  white-space: nowrap;
}

.ovc-chat__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #b50909;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
}

.ovc-chat__panel {
  position: fixed;
  right: 24px;
  bottom: 92px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 480px;
  max-height: calc(100vh - 140px);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(16, 24, 40, 0.28);
  overflow: hidden;
}

.ovc-chat__panel[hidden] {
  display: none;
}

.ovc-chat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--ovc-chat-navy);
  color: #fff;
}

.ovc-chat__head strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
}

.ovc-chat__head span {
  display: block;
  font-size: 13px;
  color: #cfe0ef;
}

.ovc-chat__close {
  flex: none;
  width: 32px;
  height: 32px;
  margin: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.ovc-chat__close:hover,
.ovc-chat__close:focus-visible {
  background: rgba(255, 255, 255, 0.28);
}

.ovc-chat__log {
  flex: 1 1 auto;
  padding: 16px;
  overflow-y: auto;
  background: #f4f6f8;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ovc-chat__msg {
  max-width: 84%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 15px;
  white-space: pre-wrap;
  word-break: break-word;
}

.ovc-chat__msg--visitor {
  align-self: flex-end;
  background: #1a4480;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.ovc-chat__msg--admin {
  align-self: flex-start;
  background: #fff;
  color: var(--ovc-chat-ink);
  border: 1px solid var(--ovc-chat-line);
  border-bottom-left-radius: 4px;
}

.ovc-chat__msg-meta {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  opacity: 0.75;
}

.ovc-chat__note {
  align-self: center;
  max-width: 92%;
  padding: 8px 12px;
  border-radius: 8px;
  background: #eef1f4;
  color: var(--ovc-chat-muted);
  font-size: 13px;
  text-align: center;
}

.ovc-chat__form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--ovc-chat-line);
  background: #fff;
}

.ovc-chat__form textarea {
  flex: 1 1 auto;
  min-height: 44px;
  max-height: 120px;
  padding: 10px 12px;
  border: 1px solid #a9aeb1;
  border-radius: 10px;
  font: inherit;
  font-size: 15px;
  line-height: 1.4;
  color: var(--ovc-chat-ink);
  resize: none;
}

.ovc-chat__form textarea:focus {
  outline: 3px solid #2491ff;
  outline-offset: 1px;
  border-color: #2491ff;
}

.ovc-chat__send {
  flex: none;
  height: 44px;
  padding: 0 16px;
  margin: 0;
  border: 0;
  border-radius: 10px;
  background: var(--ovc-chat-green);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}

.ovc-chat__send:hover,
.ovc-chat__send:focus-visible {
  background: #256b54;
}

.ovc-chat__send:disabled {
  background: #9db8ad;
  cursor: default;
}

.ovc-chat__status {
  margin: 0;
  padding: 0 12px 10px;
  min-height: 16px;
  font-size: 12px;
  color: var(--ovc-chat-muted);
  background: #fff;
}

.ovc-chat__status:empty {
  padding-bottom: 0;
}

@media (max-width: 480px) {
  .ovc-chat__launcher {
    right: 16px;
    bottom: 16px;
    width: 56px;
    height: 56px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }

  .ovc-chat__launcher-text {
    display: none;
  }

  .ovc-chat__panel {
    right: 8px;
    left: 8px;
    bottom: 84px;
    width: auto;
    height: min(70vh, 520px);
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ovc-chat__launcher {
    transition: none;
  }

  .ovc-chat__launcher:hover {
    transform: none;
  }
}

/* Keep the launcher clear of the "return to top" control when it exists. */
body:has(#return-to-top) .ovc-chat__launcher {
  bottom: 88px;
}
