.chat-launcher, .chat-button { font: inherit; cursor: pointer; border-radius: 10px; border: 1px solid #34434b; color: #eef5f7; background: #18242c; padding: 10px 14px; line-height: 1.4; }
.chat-launcher { position: fixed; z-index: 40; right: 24px; bottom: 20px; box-shadow: 0 5px 24px #0008; border-color: #8ca89a; color: #b5f56c; font-size: 14px; }
.chat-button:hover, .chat-launcher:hover { border-color: #b5f56c; }
.chat-button:focus-visible, .chat-launcher:focus-visible, .chat-dialog :is(a, textarea, input):focus-visible { outline: 2px solid #b5f56c; outline-offset: 3px; }
.chat-button:disabled { cursor: not-allowed; opacity: .5; }
.chat-primary { background: #b5f56c; color: #101810; border-color: #b5f56c; font-weight: 650; }
.chat-dialog { position: fixed; inset: auto 24px 20px auto; padding: 0; margin: 0; width: min(440px, calc(100% - 32px)); max-width: calc(100% - 32px); max-height: min(780px, calc(100dvh - 32px)); background: #111b22; color: #eef5f7; border: 1px solid #3c5059; border-radius: 18px; box-shadow: 0 24px 90px #000b; font-size: 14px; line-height: 1.6; }
.chat-dialog::backdrop { background: #02070b99; }
.chat-dialog[open] { display: flex; }
.chat-shell { display: flex; flex-direction: column; width: 100%; max-height: min(780px, calc(100dvh - 32px)); min-height: 0; }
.chat-header { display: flex; align-items: center; justify-content: space-between; padding: 17px 20px; border-bottom: 1px solid #293940; flex: none; gap: 12px; }
.chat-header h2 { font-size: 23px; margin: 0; letter-spacing: -.7px; }
.chat-badge { font-size: 12px; color: #b5f56c; }
.chat-body { padding: 18px 20px; overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.chat-body p { margin: 0 0 12px; }
.chat-privacy, .chat-small { color: #adbcc3; font-size: 12px; }
.chat-body a { color: #7cebf1; text-decoration: underline; }
.chat-notice { margin-top: 12px !important; padding: 10px 12px; background: #1c2e36; border-left: 2px solid #7cebf1; border-radius: 5px; font-size: 13px; }
.chat-greeting { white-space: pre-line; }
.chat-log { display: grid; gap: 12px; }
.chat-line { border-radius: 10px; background: #1b2931; padding: 12px; overflow-wrap: anywhere; white-space: pre-wrap; }
.chat-line-user { background: #263727; }
.chat-line strong { display: block; font-size: 11px; color: #c7d7dc; margin-bottom: 5px; }
.chat-line p { margin: 0; }
.chat-form { display: grid; gap: 7px; margin: 16px 0; }
.chat-form label { font-weight: 600; }
.chat-form textarea, .chat-form input { display: block; box-sizing: border-box; width: 100%; min-width: 0; max-width: 100%; color: #f1f6f7; background: #090e12; border: 1px solid #4b606b; padding: 10px 12px; border-radius: 8px; font: inherit; font-size: 16px; }
.chat-form textarea { resize: vertical; min-height: 90px; max-height: 210px; }
.chat-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.chat-controls .chat-button { font-size: 12px; }
.chat-status { color: #d9d8ac; font-size: 13px; margin-top: 12px !important; overflow-wrap: anywhere; }
.chat-preview { border: 1px solid #3b4d57; border-radius: 10px; padding: 14px; margin-top: 12px; }
.chat-preview h3 { font-size: 16px; margin: 0 0 14px; }
.chat-preview p { overflow-wrap: anywhere; }
.chat-copy { white-space: pre-wrap; }
.chat-preview button { margin-top: 8px; }
.chat-footer { padding: 12px 20px; border-top: 1px solid #293940; flex: none; }
.chat-footer button { width: 100%; }
.chat-dialog [hidden] { display: none !important; }
.contact-draft-entry { margin-top: 12px; }
body:has(.chat-launcher) .site-footer { padding-bottom: 100px; }
@media (max-width: 640px) {
  .chat-launcher { right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); }
  .chat-dialog { inset: auto 8px max(8px, env(safe-area-inset-bottom)) 8px; width: calc(100% - 16px); max-width: calc(100% - 16px); max-height: calc(100dvh - 16px); }
  .chat-shell { max-height: calc(100dvh - 16px); }
  .chat-header { padding: 12px 14px; }
  .chat-body { padding: 14px; }
}

.chat-exchange { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.chat-message { overflow-wrap: anywhere; white-space: pre-wrap; max-width: 94%; min-width: 0; padding: 14px 16px; border: 1px solid; border-radius: 16px; }
.chat-user { align-self: flex-end; background: #263727; border-color: #5d8143; border-bottom-right-radius: 5px; }
.chat-assistant { align-self: flex-start; background: #132e37; border-color: #376c78; border-bottom-left-radius: 5px; }
.chat-speaker { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 650; letter-spacing: .02em; }
.chat-user .chat-speaker { color: var(--green, #b5f56c); }
.chat-assistant .chat-speaker { color: var(--cyan, #7cebf1); }
.chat-body .chat-message-text { margin: 0; color: #eef4f5; }
.chat-body .chat-review { margin: 10px 0 0; padding-top: 9px; border-top: 1px solid #376c78; color: #d9d8ac; font-size: 12px; }
.chat-body .chat-contact-status { margin: 10px 0 0; padding-top: 9px; border-top: 1px solid #376c78; color: var(--cyan, #7cebf1); font-size: 12px; }
@media (max-width: 640px) { .chat-message { max-width: 96%; padding: 12px 13px; } }
.chat-controls select { max-width: 100%; color: #eef5f7; background: #18242c; border: 1px solid #4b606b; border-radius: 8px; padding: 8px; }
.chat-controls select:focus-visible { outline: 2px solid #b5f56c; outline-offset: 3px; }
