.chat-launcher { position: fixed; z-index: 40; right: 24px; bottom: max(22px, env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 9px 20px 9px 9px; border: 1px solid #bdd3c3; border-radius: 100px; background: var(--navy); color: white; box-shadow: 0 8px 28px #102b2e30; font-size: 16px; font-weight: 600; }
.chat-launcher img { width: 40px; height: 40px; object-fit: contain; }
.chat-launcher:hover { background: #1a4545; }
.chat-panel { position: fixed; z-index: 41; inset: auto 24px max(22px, env(safe-area-inset-bottom)) auto; width: 390px; max-width: calc(100vw - 32px); height: min(640px, calc(100dvh - 40px)); padding: 0; margin: 0; border: 1px solid #ccdbcf; border-radius: 24px; color: var(--ink); background: var(--paper); box-shadow: 0 20px 65px #102b2e35; overflow: hidden; }
.chat-panel[open] { display: flex; flex-direction: column; }
.chat-panel::backdrop { background: #102b2e40; backdrop-filter: blur(2px); }
.chat-heading { display: flex; align-items: center; gap: 12px; padding: 18px 16px; background: var(--navy); color: white; flex-shrink: 0; }
.chat-heading img { width: 46px; height: 46px; object-fit: contain; }
.chat-heading h2 { font-size: 22px; letter-spacing: -.03em; margin: 0; }
.chat-heading p { font-size: 12px; color: #cfddcf; margin-top: 3px; }
.chat-close { margin-left: auto; width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%; background: #264c48; color: white; font-size: 28px; }
.chat-history { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 16px 12px; overscroll-behavior: contain; scroll-behavior: smooth; }
.chat-message { margin-bottom: 18px; }
.chat-message-label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 0 4px 5px; }
.chat-bubble { background: white; border: 1px solid #dce5de; border-radius: 4px 16px 16px; padding: 14px; font-size: 16px; line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.chat-message-user { margin-left: 36px; }
.chat-message-user .chat-bubble { background: #e3efd8; border-color: #d1e1c6; border-radius: 16px 4px 16px 16px; }
.chat-message-user .chat-message-label { text-align: right; }
.chat-options { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chat-option { text-align: left; padding: 10px 13px; min-height: 44px; border: 1px solid #b3cbb9; border-radius: 13px; background: white; color: var(--green); font-size: 14px; line-height: 1.4; font-weight: 600; }
.chat-option:hover { background: #eaf3e2; }
.chat-compose { flex-shrink: 0; border-top: 1px solid var(--line); padding: 12px 16px 16px; background: white; }
.chat-compose label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.chat-input-row { display: flex; align-items: stretch; gap: 8px; }
.chat-input-row input { min-width: 0; flex: 1; min-height: 48px; padding: 11px 12px; font: 400 16px var(--font); border: 1px solid #b8cbbc; border-radius: 12px; background: var(--paper); color: var(--ink); }
.chat-input-row input:focus-visible { outline: 3px solid #257bb4; outline-offset: 2px; }
.chat-send { border-radius: 12px; padding: 10px 16px; font-size: 14px; font-weight: 600; background: var(--green); color: white; }
.chat-bottom { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.chat-bottom p { font-size: 12px; line-height: 1.5; color: var(--muted); }
.chat-reset { flex-shrink: 0; min-height: 44px; font-size: 12px; background: none; color: var(--green); padding: 5px 0; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 600px) {
  .chat-launcher { right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); min-height: 54px; font-size: 14px; padding-right: 16px; }
  .chat-panel { inset: auto 10px max(10px, env(safe-area-inset-bottom)) 10px; width: auto; max-width: none; height: min(660px, calc(100dvh - 20px)); max-height: calc(100dvh - 20px); border-radius: 20px; }
  .chat-heading { padding: 13px; }
  .chat-history { padding: 16px 12px 8px; }
  .chat-compose { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) { .chat-history { scroll-behavior: auto; } }
