/* Honest Pool Service — chat widget. Uses the site's palette variables from site.css. */
.hp-chat-widget { position: fixed; bottom: 20px; right: 20px; z-index: 9999; font-family: var(--sans); font-size: 15px; line-height: 1.5; }
@media (max-width: 480px) { .hp-chat-widget { bottom: 14px; right: 12px; } }

.hp-chat-toggle { position: relative; display: flex; align-items: center; justify-content: center; width: 60px; height: 60px; border: 0; border-radius: 999px; background: linear-gradient(135deg, var(--deep) 0%, var(--water) 100%); color: #fff; cursor: pointer; box-shadow: var(--shadow); transition: transform .15s ease; }
.hp-chat-toggle:hover { transform: scale(1.05); }
.hp-chat-toggle:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }
.hp-chat-toggle-icon, .hp-chat-toggle-close { position: absolute; display: flex; transition: opacity .15s ease, transform .15s ease; }
.hp-chat-toggle-close { opacity: 0; transform: rotate(-90deg); }
.hp-chat-widget.is-open .hp-chat-toggle-icon { opacity: 0; transform: rotate(90deg); }
.hp-chat-widget.is-open .hp-chat-toggle-close { opacity: 1; transform: rotate(0); }

.hp-chat-attention { position: absolute; bottom: 72px; right: 0; display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #fff; color: var(--deep); font-weight: 600; font-size: .9rem; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); white-space: nowrap; opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .3s, visibility .3s, transform .3s; }
.hp-chat-attention.is-visible { opacity: 1; visibility: visible; transform: none; }
.hp-chat-attention::after { content: ""; position: absolute; bottom: -8px; right: 22px; border: 8px solid transparent; border-top-color: #fff; border-bottom: 0; }
.hp-chat-attention-close { width: 22px; height: 22px; border: 0; border-radius: 50%; background: var(--mist); color: var(--ink-soft); cursor: pointer; font-size: 15px; line-height: 1; padding: 0; }
.hp-chat-widget.is-open .hp-chat-attention { opacity: 0 !important; visibility: hidden !important; }
@media (max-width: 480px) { .hp-chat-attention { white-space: normal; max-width: 240px; font-size: .84rem; } }

.hp-chat-window { position: absolute; bottom: 76px; right: 0; width: 380px; max-width: calc(100vw - 32px); height: min(560px, calc(100vh - 120px)); display: flex; flex-direction: column; background: #fff; border-radius: var(--r); box-shadow: 0 24px 60px -20px rgba(0,59,115,.55); overflow: hidden; opacity: 0; visibility: hidden; transform: translateY(16px) scale(.97); transform-origin: bottom right; transition: opacity .25s, visibility .25s, transform .25s; }
.hp-chat-widget.is-open .hp-chat-window { opacity: 1; visibility: visible; transform: none; }
@media (max-width: 480px) { .hp-chat-window { position: fixed; inset: auto 0 0 0; width: 100%; max-width: 100%; height: calc(100vh - 56px); border-radius: var(--r) var(--r) 0 0; transform: translateY(100%); } .hp-chat-widget.is-open .hp-chat-window { transform: none; } }

.hp-chat-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; background: linear-gradient(120deg, var(--deep) 0%, var(--water) 100%); color: #fff; }
.hp-chat-header-info { display: flex; align-items: center; gap: 12px; }
.hp-chat-avatar { width: 40px; height: 40px; border-radius: 50%; background: #fff; padding: 5px; }
.hp-chat-title { margin: 0; font-family: var(--serif); font-size: 1.05rem; font-weight: 600; color: #fff; }
.hp-chat-status { display: flex; align-items: center; gap: 6px; margin: 0; font-size: .74rem; color: #dbe9f7; }
.hp-chat-status-dot { width: 8px; height: 8px; background: #4ade80; border-radius: 50%; }
.hp-chat-minimize { width: 32px; height: 32px; border: 0; border-radius: 8px; background: rgba(255,255,255,.14); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.hp-chat-minimize:hover { background: rgba(255,255,255,.26); }

.hp-chat-messages { flex: 1; overflow-y: auto; padding: 16px; background: var(--surface); }
.hp-chat-message { display: flex; flex-direction: column; max-width: 86%; margin-bottom: 14px; animation: hpFade .25s ease; }
@keyframes hpFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.hp-chat-message--user { align-items: flex-end; margin-left: auto; }
.hp-chat-message-content { padding: 10px 14px; border-radius: 14px; overflow-wrap: anywhere; }
.hp-chat-message--user .hp-chat-message-content { background: var(--deep); color: #fff; border-bottom-right-radius: 4px; }
.hp-chat-message--bot .hp-chat-message-content { background: #fff; color: var(--ink); border: 1px solid var(--mist); border-bottom-left-radius: 4px; }
.hp-chat-message.is-error .hp-chat-message-content { border-color: #e6a99f; background: #fbe9e6; color: #8a2b1c; }
.hp-chat-message-content p { margin: 0 0 .4rem; max-width: none; }
.hp-chat-message-content p:last-child { margin: 0; }
.hp-chat-button { display: inline-block; margin: 6px 0; padding: 8px 14px; background: var(--sun); color: #29200a !important; font-weight: 700; font-size: .9rem; border-radius: 999px; text-decoration: none; }
.hp-chat-message-time { margin-top: 4px; font-size: .72rem; color: var(--ink-soft); }
.hp-chat-typing-dots { display: flex; gap: 4px; padding: 12px 14px; background: #fff; border: 1px solid var(--mist); border-radius: 14px; }
.hp-chat-typing-dots span { width: 8px; height: 8px; background: var(--water-lt); border-radius: 50%; animation: hpTyping 1.4s ease-in-out infinite; }
.hp-chat-typing-dots span:nth-child(2) { animation-delay: .2s; }
.hp-chat-typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes hpTyping { 0%, 60%, 100% { transform: none; opacity: .4; } 30% { transform: translateY(-4px); opacity: 1; } }

.hp-chat-input-area { padding: 12px 14px; background: #fff; border-top: 1px solid var(--mist); }
.hp-chat-input-container { display: flex; align-items: flex-end; gap: 8px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.hp-chat-input-container:focus-within { border-color: var(--water); box-shadow: 0 0 0 3px rgba(61,132,192,.2); }
.hp-chat-input { flex: 1; min-height: 40px; max-height: 120px; padding: 8px; border: 0; background: transparent; font: inherit; font-size: .95rem; resize: none; color: var(--ink); }
.hp-chat-input:focus { outline: none; }
.hp-chat-send { width: 40px; height: 40px; border: 0; border-radius: 10px; background: var(--deep); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.hp-chat-send:disabled { background: var(--line); cursor: not-allowed; }
.hp-chat-send:hover:not(:disabled) { background: var(--deep-2); }
.hp-chat-powered { margin: 8px 0 0; font-size: .74rem; color: var(--ink-soft); text-align: center; }
.hp-chat-powered a { color: var(--deep); font-weight: 700; text-decoration: none; }

@media (prefers-reduced-motion: reduce) { .hp-chat-widget, .hp-chat-widget * { animation: none !important; transition: none !important; } }
@media print { .hp-chat-widget { display: none !important; } }
