/* House of Visions public chat widget */
.hov-chat,
.hov-chat * {
  box-sizing: border-box;
}

.hov-chat {
  --hov-chat-bg: #2a2622;
  --hov-chat-bg-deep: #1a1816;
  --hov-chat-bg-soft: #3d3833;
  --hov-chat-gold: #c9a961;
  --hov-chat-gold-light: #e4d4a8;
  --hov-chat-paper: #faf8f6;
  --hov-chat-ink: #2a2622;
  --hov-chat-muted: rgba(250, 248, 246, 0.72);
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 2147483000;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--hov-chat-paper);
  line-height: 1.45;
  text-align: left;
  -webkit-font-smoothing: antialiased;
}

.hov-chat button,
.hov-chat input,
.hov-chat textarea {
  font: inherit;
}

.hov-chat__launcher {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 20px;
  border: 1px solid rgba(228, 212, 168, 0.55);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--hov-chat-bg-soft), var(--hov-chat-bg-deep));
  box-shadow: 0 14px 40px rgba(18, 15, 12, 0.38), 0 0 0 1px rgba(201, 169, 97, 0.08);
  color: var(--hov-chat-paper);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.hov-chat__launcher:hover {
  transform: translateY(-2px);
  border-color: var(--hov-chat-gold);
  box-shadow: 0 18px 46px rgba(18, 15, 12, 0.45), 0 0 0 3px rgba(201, 169, 97, 0.1);
}

.hov-chat__launcher:focus-visible,
.hov-chat__close:focus-visible,
.hov-chat__submit:focus-visible,
.hov-chat input:focus-visible,
.hov-chat textarea:focus-visible {
  outline: 3px solid var(--hov-chat-gold-light);
  outline-offset: 3px;
}

.hov-chat__launcher-icon {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: var(--hov-chat-gold-light);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.hov-chat__panel {
  position: absolute;
  right: 0;
  bottom: 72px;
  display: flex;
  flex-direction: column;
  width: min(380px, calc(100vw - 32px));
  height: min(620px, calc(100vh - 116px));
  min-height: 430px;
  overflow: hidden;
  border: 1px solid rgba(201, 169, 97, 0.38);
  border-radius: 20px;
  background: var(--hov-chat-paper);
  box-shadow: 0 28px 80px rgba(15, 12, 10, 0.48);
  color: var(--hov-chat-ink);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.98);
  transform-origin: bottom right;
  transition: opacity 180ms ease, transform 180ms ease;
}

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

.hov-chat--open .hov-chat__panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.hov-chat--open .hov-chat__launcher {
  visibility: hidden;
}

.hov-chat__header {
  position: relative;
  flex: none;
  padding: 22px 58px 20px 22px;
  background:
    radial-gradient(circle at 85% 0%, rgba(201, 169, 97, 0.2), transparent 45%),
    linear-gradient(145deg, var(--hov-chat-bg-soft), var(--hov-chat-bg-deep));
  color: var(--hov-chat-paper);
}

.hov-chat__eyebrow {
  margin: 0 0 5px;
  color: var(--hov-chat-gold-light);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.hov-chat__title {
  margin: 0;
  color: var(--hov-chat-paper);
  font-family: "Playfair Display", Georgia, serif;
  font-size: 24px;
  font-weight: 400;
  line-height: 1.2;
}

.hov-chat__availability {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 9px 0 0;
  color: var(--hov-chat-muted);
  font-size: 12px;
}

.hov-chat__availability::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--hov-chat-gold);
  box-shadow: 0 0 0 3px rgba(201, 169, 97, 0.15);
  content: "";
}

.hov-chat__close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(250, 248, 246, 0.22);
  border-radius: 50%;
  background: rgba(250, 248, 246, 0.06);
  color: var(--hov-chat-paper);
  cursor: pointer;
  font-size: 24px;
  font-weight: 300;
  line-height: 1;
}

.hov-chat__close:hover {
  border-color: var(--hov-chat-gold);
  background: rgba(201, 169, 97, 0.13);
}

.hov-chat__content {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  background: var(--hov-chat-paper);
}

.hov-chat__intro {
  margin: 0;
  padding: 19px 22px 0;
  color: #675f58;
  font-size: 13px;
}

.hov-chat__start-form {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 13px;
  overflow-y: auto;
  padding: 18px 22px 22px;
}

.hov-chat__field {
  display: grid;
  gap: 6px;
}

.hov-chat__field label {
  color: #4d4640;
  font-size: 12px;
  font-weight: 650;
}

.hov-chat__field input,
.hov-chat__field textarea,
.hov-chat__composer textarea {
  width: 100%;
  border: 1px solid #d8d0c8;
  border-radius: 10px;
  background: #fff;
  color: var(--hov-chat-ink);
  font-size: 14px;
  line-height: 1.45;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.hov-chat__field input {
  min-height: 44px;
  padding: 10px 12px;
}

.hov-chat__field textarea {
  min-height: 96px;
  padding: 11px 12px;
  resize: vertical;
}

.hov-chat__field input:focus,
.hov-chat__field textarea:focus,
.hov-chat__composer textarea:focus {
  border-color: var(--hov-chat-gold);
  box-shadow: 0 0 0 3px rgba(201, 169, 97, 0.14);
}

.hov-chat__field input::placeholder,
.hov-chat__field textarea::placeholder,
.hov-chat__composer textarea::placeholder {
  color: #948a82;
}

.hov-chat__submit {
  min-height: 45px;
  padding: 11px 18px;
  border: 1px solid var(--hov-chat-gold);
  border-radius: 999px;
  background: var(--hov-chat-bg);
  color: var(--hov-chat-paper);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}

.hov-chat__submit:hover:not(:disabled) {
  background: var(--hov-chat-gold);
  color: var(--hov-chat-bg-deep);
  transform: translateY(-1px);
}

.hov-chat__submit:disabled,
.hov-chat textarea:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.hov-chat__error {
  margin: 0;
  color: #a13f36;
  font-size: 12px;
}

.hov-chat__thread-error {
  margin: 0 18px 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f7e7e3;
}

.hov-chat__thread {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}

.hov-chat__messages {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 18px;
  overscroll-behavior: contain;
}

.hov-chat__loading,
.hov-chat__empty {
  margin: auto;
  color: #776d65;
  font-size: 13px;
  text-align: center;
}

.hov-chat__message {
  align-self: flex-start;
  max-width: 84%;
}

.hov-chat__message--visitor {
  align-self: flex-end;
}

.hov-chat__bubble {
  margin: 0;
  padding: 10px 13px;
  border: 1px solid #e1d9d1;
  border-radius: 14px 14px 14px 4px;
  background: #fff;
  color: #302b27;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.hov-chat__message--visitor .hov-chat__bubble {
  border-color: var(--hov-chat-bg);
  border-radius: 14px 14px 4px 14px;
  background: var(--hov-chat-bg);
  color: var(--hov-chat-paper);
}

.hov-chat__message-meta {
  margin: 4px 3px 0;
  color: #857b73;
  font-size: 10px;
}

.hov-chat__message--visitor .hov-chat__message-meta {
  text-align: right;
}

.hov-chat__confirmation {
  margin: 0 18px 4px;
  padding: 9px 11px;
  border-radius: 8px;
  background: #f0eadb;
  color: #5a4b2d;
  font-size: 11px;
  text-align: center;
}

.hov-chat__composer {
  display: flex;
  flex: none;
  align-items: flex-end;
  gap: 9px;
  padding: 12px 14px max(14px, env(safe-area-inset-bottom));
  border-top: 1px solid #e3dcd5;
  background: #fff;
}

.hov-chat__composer textarea {
  min-height: 44px;
  max-height: 110px;
  padding: 10px 11px;
  resize: none;
}

.hov-chat__composer .hov-chat__submit {
  flex: none;
  min-height: 42px;
  padding-inline: 15px;
}

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

@media (max-width: 520px) {
  .hov-chat {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
  }

  .hov-chat__launcher {
    min-height: 52px;
    padding: 0 17px;
  }

  .hov-chat__panel {
    position: fixed;
    inset: auto max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    width: auto;
    height: calc(100vh - 16px);
    height: calc(100dvh - max(8px, env(safe-area-inset-top)) - max(8px, env(safe-area-inset-bottom)));
    min-height: 0;
    border-radius: 16px;
    transform-origin: bottom center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hov-chat__launcher,
  .hov-chat__panel,
  .hov-chat__submit {
    transition: none;
  }
}

@media print {
  .hov-chat {
    display: none !important;
  }
}
