/* ============ Base ============ */
:root {
  --haven-chat-bg: #ffffff;
  --haven-chat-text: #222;
  --haven-chat-accent: #171d4b;
  --haven-chat-accent-2: #cbaf7e;
  --haven-chat-shadow: 0 10px 30px rgba(0,0,0,0.18);
  --haven-chat-radius: 14px;
  --haven-chat-z: 999999; /* stay on top of most UI stacks */
  --haven-focus: 0 0 0 3px rgba(177,150,87,.45);
}

ul {
    padding: 10px 12% 0px;
}

li {font-size:18px;}

.haven-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ============ Toggle Button ============ */
.haven-chat-toggle {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: var(--haven-chat-z);
  width: 54px;
  height: 54px;
  line-height: 54px;
  text-align: center;
  border-radius: 50%;
  border: 1px solid var(--haven-chat-accent-2);
  background: var(--haven-chat-accent);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  box-shadow: var(--haven-chat-shadow);
  transition: transform .15s ease, background .15s ease;
}
.haven-chat-toggle:hover,
.haven-chat-toggle:focus {
  background: var(--haven-chat-accent-2);
  outline: none;
  box-shadow: var(--haven-focus), var(--haven-chat-shadow);
}
.haven-chat-toggle:active { transform: scale(.98); }

/* ============ Chat Window ============ */
.haven-chat {
  position: fixed;
  right: 22px;
  bottom: 86px; /* sits above the toggle */
  z-index: var(--haven-chat-z);
  width: min(92vw, 360px);
  max-height: min(78vh, 640px);
  display: none; /* JS toggles to block */
  background: var(--haven-chat-bg);
  color: var(--haven-chat-text);
  border: 1px solid #e7e7e7;
  border-radius: var(--haven-chat-radius);
  box-shadow: var(--haven-chat-shadow);
  overflow: hidden;
}

/* Header */
.haven-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: #f7f7f8;
  border-bottom: 1px solid #eee;
}
.haven-chat-title {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  color: var(--haven-chat-accent);
}
.haven-chat-close {
  appearance: none;
  border: none;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  padding: 6px;
  cursor: pointer;
  border-radius: 8px;
  color: #666;
}
.haven-chat-close:hover,
.haven-chat-close:focus {
  color: var(--haven-chat-accent);
  outline: none;
  box-shadow: var(--haven-focus);
}

/* Output area */
.haven-chat-output {
  padding: 12px;
  height: 100%;
  max-height: calc(min(78vh, 640px) - 48px - 54px); /* minus header/footer */
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

/* Footer spacer (reserved for future input) */
.haven-chat-footer {
  padding: 8px 12px;
  border-top: 1px solid #eee;
  background: #fafafa;
}

/* ============ Message Bubbles ============ */
.bot-msg,
.user-msg {
  position: relative;
  display: inline-block;
  margin: 6px 0;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 18px;
  line-height: 1.35;
}

.bot-msg {
  background: #f3f4f6;
  color: #222;
}

.user-msg {
  background: #e9f5ff;
  color: #0b3757;
}

/* ============ Action Buttons ============ */
.chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.chat-actions > button {
  appearance: none;
  border: 1px solid var(--haven-chat-accent);
  background: var(--haven-chat-accent);
  color: #fff;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s ease, transform .05s ease, box-shadow .15s ease;
}
.chat-actions > button:hover,
.chat-actions > button:focus {
  background: var(--haven-chat-accent-2);
  outline: none;
  box-shadow: var(--haven-focus);
}
.chat-actions > button:active { transform: translateY(1px); }

/* Links inside messages */
.haven-chat-output a {
  color: var(--haven-chat-accent);
  font-weight: 600;
  text-decoration: underline;
}
.haven-chat-output a:hover,
.haven-chat-output a:focus {
  color: var(--haven-chat-accent-2);
  outline: none;
}

/* ============ Responsive ============ */
@media (max-width: 420px) {
  .haven-chat {
    right: 12px;
    left: 12px;
    width: auto;
  }
  .haven-chat-toggle {
    right: 16px;
    bottom: 16px;
  }
}
