

.chat-fab { position: fixed; right: 22px; bottom: 22px; z-index: 70; display: flex; align-items: center; gap: 10px; padding: 9px 18px 9px 10px; border: 0; border-radius: 999px; background: linear-gradient(135deg, var(--brand-600), var(--brand)); color: #fff; font: inherit; text-align: left; cursor: pointer; box-shadow: 0 16px 34px -14px rgba(31, 77, 58, .55), 0 2px 6px rgba(24, 36, 32, .12); transition: transform .18s ease, box-shadow .18s ease; }
.chat-fab::before { content: ""; position: absolute; inset: -4px; border-radius: 999px; border: 2px solid rgba(196, 112, 58, .5); animation: chatpulse 2.6s ease-out infinite; pointer-events: none; }
@keyframes chatpulse { 0% { transform: scale(.97); opacity: .9 } 70% { transform: scale(1.12); opacity: 0 } 100% { transform: scale(1.12); opacity: 0 } }
.chat-fab:hover { transform: translateY(-2px); box-shadow: 0 20px 40px -14px rgba(31, 77, 58, .6), 0 2px 6px rgba(24, 36, 32, .14); }
.chat-fab-icon { position: relative; flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #fdfbf3 0%, #f2ecdc 100%); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .75), 0 2px 6px rgba(0, 0, 0, .12); display: grid; place-items: center; }
.chat-fab-icon img { width: 88%; height: 88%; object-fit: contain; display: block; animation: donkbob 3.4s ease-in-out infinite; transform-origin: 50% 88%; }
.chat-fab-icon::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; pointer-events: none; animation: donkglow 2.8s ease-out infinite; }
.chat-fab-icon svg { width: 20px; height: 20px; }
.chat-fab-text { display: flex; flex-direction: column; line-height: 1.25; }
.chat-fab-text strong { font-size: 14.5px; font-weight: 700; letter-spacing: .2px; }
.chat-fab-text em { font-style: normal; font-size: 11.5px; opacity: .8; margin-top: 2px; }

.chat-panel { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; width: 100%; height: 100%; height: 100dvh; background: var(--card); overflow: hidden; }
.chat-panel[hidden] { display: none; }
.chat-panel:not([hidden]) { animation: chatIn .26s cubic-bezier(.22, .7, .3, 1) both; }
@keyframes chatIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.chat-widget.is-open .chat-fab { display: none; }
html.chat-lock, html.chat-lock body { overflow: hidden; }

.chat-head { flex: 0 0 auto; display: flex; align-items: center; gap: 12px; padding: 12px max(18px, calc((100% - 880px) / 2)); padding-top: max(12px, env(safe-area-inset-top)); border-bottom: 1px solid var(--line); background: var(--card); }
.chat-mark { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand-600), var(--brand)); color: #fff; }
.chat-mark svg { width: 18px; height: 18px; }
.chat-title { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.chat-title strong { font-size: 15px; font-weight: 700; color: var(--ink); }
.chat-title span { font-size: 12px; color: var(--ink-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-close { flex: 0 0 auto; margin-left: auto; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); font: inherit; font-size: 13px; padding: 7px 15px; border-radius: 999px; cursor: pointer; }
.chat-close:hover { border-color: var(--ink-3); color: var(--ink); }

.chat-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 22px max(18px, calc((100% - 880px) / 2)) 10px; display: flex; flex-direction: column; gap: 12px; background: var(--card); }
.chat-msg { max-width: min(78%, 680px); padding: 11px 15px; border-radius: 14px; font-size: 14.5px; line-height: 1.75; white-space: pre-wrap; word-break: break-word; }
.chat-msg.bot { align-self: flex-start; background: var(--paper); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.chat-msg.bot a { color: var(--brand, #b4521f); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.chat-msg.bot a:hover { opacity: .82; }
.chat-msg.me { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.sys { align-self: stretch; max-width: 100%; background: var(--clay-50); border: 1px solid #f0d9c8; font-size: 12.5px; color: var(--ink-2); }

.chat-hero { margin: auto 0; padding: 4vh 0 2vh; text-align: center; }
.chat-hero-mark { width: 62px; height: 62px; margin: 0 auto 20px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand-600), var(--brand)); color: #fff; box-shadow: 0 18px 34px -16px rgba(31, 77, 58, .6); }
.chat-hero-mark svg { width: 30px; height: 30px; }
.chat-hero h2 { margin: 0 0 10px; font-size: clamp(22px, 3.6vw, 34px); font-weight: 800; letter-spacing: .6px; color: var(--ink); }
.chat-hero p { margin: 0; font-size: clamp(14px, 1.6vw, 17px); color: var(--ink-3); letter-spacing: .4px; }

.chat-quick { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px max(18px, calc((100% - 880px) / 2)) 10px; background: var(--card); }
.chat-widget.is-empty .chat-quick { justify-content: center; }
.chat-quick button { border: 1px solid var(--line); background: var(--card); color: var(--ink-2); font: inherit; font-size: 13px; padding: 8px 14px; border-radius: 999px; cursor: pointer; }
.chat-quick button:hover { border-color: var(--ink-3); color: var(--ink); }

.chat-sug { align-self: stretch; display: flex; flex-wrap: wrap; gap: 6px; margin: -1px 0 3px; }
.chat-sug a, .chat-sug button { border: 1px solid var(--clay); background: #fff; color: var(--clay); font-size: 12.5px; line-height: 1.4; padding: 6px 11px; border-radius: 999px; cursor: pointer; text-decoration: none; font-family: inherit; }
.chat-sug a:hover, .chat-sug button:hover { background: var(--clay-50); }

.chat-form { flex: 0 0 auto; display: flex; gap: 10px; padding: 10px max(18px, calc((100% - 880px) / 2)); border-top: 1px solid var(--line); background: var(--card); }
.chat-input { flex: 1 1 auto; min-width: 0; border: 1px solid var(--line); border-radius: 999px; padding: 11px 18px; font-size: 14.5px; font-family: inherit; background: var(--paper); }
.chat-input:focus { outline: 2px solid var(--brand-50); border-color: var(--ink-3); }
.chat-form .btn { flex: 0 0 auto; border-radius: 999px; padding: 10px 24px; }
.chat-mic { flex: 0 0 auto; width: 40px; height: 40px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 50%; background: var(--paper); color: var(--ink-2); cursor: pointer; transition: color .15s, border-color .15s, background .15s; }
.chat-mic svg { width: 19px; height: 19px; }
.chat-mic:hover { border-color: var(--ink-3); color: var(--ink); }
.chat-mic[hidden] { display: none; }
.chat-mic.is-busy { opacity: .5; pointer-events: none; }
.chat-mic.is-rec { background: #c0392b; border-color: #c0392b; color: #fff; animation: chatmic 1.2s infinite; }
@keyframes chatmic { 0%, 100% { box-shadow: 0 0 0 0 rgba(192, 57, 43, .5) } 50% { box-shadow: 0 0 0 9px rgba(192, 57, 43, 0) } }
@media (max-width: 430px) {
  .chat-form { gap: 7px; padding-left: 12px; padding-right: 12px; }
  .chat-form .btn { padding: 10px 15px; }
  .chat-mic { width: 36px; height: 36px; }
  .chat-mic svg { width: 17px; height: 17px; }
  .chat-input { padding: 10px 13px; font-size: 14px; }
}
.chat-foot { flex: 0 0 auto; padding: 8px max(18px, calc((100% - 880px) / 2)) max(12px, env(safe-area-inset-bottom)); font-size: 12px; color: var(--ink-3); text-align: center; background: var(--card); }
.chat-foot a { color: var(--ink-2); text-decoration: underline; }

.chat-dots { display: flex; align-items: center; gap: 4px; }
.chat-dots span { display: inline-block; width: 5px; height: 5px; margin-right: 3px; border-radius: 50%; background: var(--ink-3); animation: chatblink 1.1s infinite; }
.chat-dots span:nth-child(2) { animation-delay: .18s; }
.chat-dots span:nth-child(3) { animation-delay: .36s; }
@keyframes chatblink { 0%, 60%, 100% { opacity: .25 } 30% { opacity: 1 } }
.chat-dots::before {
  content: '';
  width: 11px; height: 11px; margin-right: 2px;
  border: 2px solid var(--line);
  border-top-color: var(--ink-3);
  border-radius: 50%;
  animation: chatspin .8s linear infinite;
}
@keyframes chatspin { to { transform: rotate(360deg); } }
@keyframes donkbob {
  0%, 100% { transform: translateY(0) rotate(0); }
  42% { transform: translateY(-3px) rotate(-3.5deg); }
  58% { transform: translateY(-3px) rotate(3.5deg); }
}
@keyframes donkglow {
  0% { box-shadow: 0 0 0 0 rgba(196, 112, 58, .55); }
  70% { box-shadow: 0 0 0 13px rgba(196, 112, 58, 0); }
  100% { box-shadow: 0 0 0 0 rgba(196, 112, 58, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .chat-fab::before, .chat-panel:not([hidden]),
  .chat-fab-icon img, .chat-fab-icon::after { animation: none; }
}
@media (max-width: 560px) {
  .chat-fab { right: 12px; bottom: 12px; gap: 8px; padding: 8px 15px 8px 8px; }
  .chat-fab-icon { width: 38px; height: 38px; }
  .chat-fab-text strong { font-size: 13.5px; }
  .chat-fab-text em { font-size: 11px; }
  .chat-msg { max-width: 88%; font-size: 14px; }
  .chat-hero-mark { width: 54px; height: 54px; margin-bottom: 16px; }
}
