/* White, conversation-first panel inspired by the observed LumaLink / Tidio widget. */
.consultation { --chat-accent:#1f694b; --chat-ink:#202b32; --chat-muted:#596773; position:fixed; z-index:70; right:max(24px,env(safe-area-inset-right)); bottom:max(24px,env(safe-area-inset-bottom)); color:var(--chat-ink); font-family:Arial,"Microsoft YaHei",sans-serif; font-size:14px; line-height:1.5; }
.consultation [hidden] { display:none !important; }
.consultation button,.consultation textarea { font:inherit; }
.consultation button { cursor:pointer; }
.consultation button:disabled { cursor:not-allowed; }
.consultation ::selection { background:#cde5d7; color:#173b2a; }
.consultation :is(button,a,input,textarea,summary,[tabindex]):focus-visible { outline:3px solid #b37a2c; outline-offset:3px; }
.consultation .lucide-icon { width:20px; height:20px; }
.consultation-launcher { display:grid; place-items:center; width:56px; height:56px; border-radius:50%; background:#20c77a; color:#fff; box-shadow:0 4px 12px rgb(0 18 12 / 18%); transition:background 180ms ease; }
.consultation-launcher:hover { background:#17b66c; }
.consultation-launcher .chat-launcher-open { fill:currentColor; stroke:none; }
.consultation-launcher .lucide-icon { width:28px; height:28px; }
.consultation .chat-launcher-close,.consultation.is-open .chat-launcher-open { display:none; }
.consultation.is-open .chat-launcher-close { display:block; }
.chat-teaser { position:absolute; right:0; bottom:68px; width:280px; border-radius:12px; padding:20px; background:#fff; box-shadow:0 12px 36px rgb(0 18 12 / 13%); }
.chat-teaser p { margin:0 0 20px; font-size:14px; line-height:1.5; }
.chat-teaser p strong { font-weight:600; }
.chat-teaser-dismiss { position:absolute; top:-36px; right:0; display:grid; place-items:center; width:32px; height:32px; border:0; border-radius:50%; background:#fff; color:var(--chat-muted); opacity:0; }
.chat-teaser:hover .chat-teaser-dismiss,.chat-teaser:focus-within .chat-teaser-dismiss { opacity:1; }
.chat-teaser-dismiss .lucide-icon { width:14px; height:14px; }
.chat-teaser-start { display:flex; align-items:center; width:100%; min-height:44px; border:0; border-top:1px solid #d9e1dd; border-radius:0; padding:16px 0 0; background:#fff; color:#202b32; text-align:left; }
.chat-teaser-start:hover { background:#f2f7f4; }
.consultation-panel { position:absolute; right:0; bottom:68px; display:flex; flex-direction:column; width:372px; height:min(652px,calc(100dvh - 116px)); min-height:240px; overflow:hidden; border-radius:12px; background:#fff; box-shadow:0 8px 24px rgb(0 18 46 / 16%); }
.consultation-panel.is-entering { animation:chat-reveal 220ms cubic-bezier(.16,1,.3,1); }
@keyframes chat-reveal { from { opacity:.65; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
.chat-header { display:flex; flex:0 0 auto; align-items:center; gap:8px; min-height:60px; padding:8px 16px 8px 12px; background:#fff; color:var(--chat-ink); }
.chat-brand { display:grid; place-items:center; flex-shrink:0; width:30px; height:30px; border-radius:50%; background:var(--chat-accent); }
.chat-brand img { width:22px; height:22px; object-fit:contain; }
.chat-heading { display:flex; align-items:baseline; gap:8px; flex:1; min-width:0; }
.chat-heading h2 { margin:0; color:var(--chat-ink); font-family:inherit; font-size:14px; font-weight:600; line-height:1.4; letter-spacing:0; }
.chat-heading p { margin:2px 0 0; color:var(--chat-muted); font-size:12px; line-height:1.4; }
.chat-icon-button { display:grid; place-items:center; flex-shrink:0; width:32px; height:40px; border:0; border-radius:8px; background:transparent; color:var(--chat-muted); }
.chat-icon-button:hover { background:#f2f5f3; color:var(--chat-accent); }
.chat-conversation { display:flex; flex:1; min-height:0; flex-direction:column; }
.chat-transcript { display:flex; flex:1; min-height:0; flex-direction:column; overflow-y:auto; overscroll-behavior:contain; padding:20px; scrollbar-width:thin; scrollbar-color:#c8d2cb #fff; }
.chat-welcome { flex-shrink:0; width:fit-content; max-width:90%; margin-top:auto; padding-top:24px; }
.chat-message { flex-shrink:0; max-width:100%; margin:20px 0 0; }
.chat-author { display:block; margin-bottom:6px; color:var(--chat-muted); font-size:12px; }
.chat-bubble { width:fit-content; max-width:92%; margin:0; border-radius:12px 12px 12px 4px; padding:12px 16px; background:#f3f5f7; color:var(--chat-ink); font-size:14px; line-height:1.6; white-space:pre-wrap; overflow-wrap:anywhere; }
.chat-welcome .chat-message { margin:0; }
.chat-welcome .chat-bubble { max-width:100%; border-radius:12px 12px 0 0; padding:16px; }
.chat-message-user { display:flex; align-items:flex-end; flex-direction:column; }
.chat-message-user .chat-bubble { border-radius:12px 12px 4px 12px; background:var(--chat-accent); color:#fff; }
.chat-suggestions { display:flex; align-items:stretch; flex-direction:column; }
.chat-suggestions button { max-width:100%; min-height:40px; border:1px solid #dce4df; border-top:0; border-radius:0; padding:10px 12px; background:#fff; color:#1c5b40; text-align:center; font-size:13px; line-height:1.5; }
.chat-suggestions button:last-child { border-radius:0 0 12px 12px; }
.chat-suggestions button:hover { background:#f2f7f4; }
.chat-welcome:has(.chat-suggestions[hidden]) .chat-bubble { border-radius:12px 12px 12px 4px; }
.chat-status { flex-shrink:0; margin:0; padding:8px 20px; color:#365d48; background:#f2f7f4; font-size:12px; }
.chat-error { flex-shrink:0; border-top:1px solid #ecd1bb; padding:10px 20px; background:#fff6ee; color:#78401c; font-size:12px; }
.chat-error p { margin:0; }
.chat-error button { min-height:36px; border:0; padding:5px 0; background:transparent; color:#78401c; font-size:12px; text-decoration:underline; text-underline-offset:3px; }
.chat-composer { flex-shrink:0; margin:0 20px; border-top:1px solid #edf0ee; padding:8px 0 12px; background:#fff; }
.chat-consent-row { position:relative; display:flex; align-items:center; flex-wrap:wrap; column-gap:12px; }
.chat-consent { display:flex; align-items:center; gap:7px; min-height:32px; margin:0; color:var(--chat-muted); font-size:12px; line-height:1.5; cursor:pointer; }
.chat-consent input { flex-shrink:0; width:15px; height:15px; margin:0; accent-color:var(--chat-accent); }
.chat-privacy-details { color:var(--chat-muted); font-size:12px; }
.chat-privacy-details summary { display:flex; align-items:center; gap:4px; min-height:32px; cursor:pointer; list-style:none; text-decoration:underline; text-underline-offset:3px; }
.chat-privacy-details summary::-webkit-details-marker { display:none; }
.chat-privacy-details summary::after { content:""; width:5px; height:5px; border-right:1px solid currentColor; border-bottom:1px solid currentColor; transform:rotate(45deg) translateY(-2px); }
.chat-privacy-details[open] summary::after { transform:rotate(225deg) translate(-2px,-1px); }
.chat-privacy-details p { position:absolute; z-index:2; right:0; left:0; bottom:100%; margin:0 0 8px; border-radius:8px; padding:14px 16px; background:#f0f5f2; color:#354d40; box-shadow:0 4px 16px rgb(0 18 12 / 12%); line-height:1.7; }
.chat-privacy-details a { color:#1c5b40; text-decoration:underline; text-underline-offset:3px; }
.chat-input-row { display:flex; align-items:flex-end; gap:8px; }
.chat-input-row textarea { flex:1; width:0; min-width:0; max-height:116px; min-height:48px; resize:none; border:0; border-radius:0; padding:12px 0; background:#fff; color:var(--chat-ink); line-height:1.6; caret-color:var(--chat-accent); scrollbar-width:thin; }
.chat-input-row textarea:focus-visible { outline-offset:0; }
.chat-input-row textarea::placeholder { color:#65727d; opacity:1; }
.chat-send { display:grid; place-items:center; flex-shrink:0; width:32px; height:44px; border:0; border-radius:8px; background:transparent; color:var(--chat-accent); }
.chat-send:hover:not(:disabled) { background:#f2f7f4; }
.chat-send:disabled { background:transparent; color:#bcc6c0; }
.chat-sensitive-note { margin:0 0 8px; color:var(--chat-muted); font-size:12px; }
.chat-input-meta { display:none; justify-content:space-between; gap:8px; margin:4px 0 8px; color:var(--chat-muted); font-size:12px; font-variant-numeric:tabular-nums; }
.chat-composer:focus-within .chat-input-meta { display:flex; }
.chat-contact { flex:1; min-height:0; overflow-y:auto; padding:12px 24px 24px; scrollbar-width:thin; scrollbar-color:#c8d2cb #fff; }
.chat-contact h3 { margin:24px 0 12px; font-family:inherit; font-size:22px; letter-spacing:-.02em; }
.chat-contact p { margin:0 0 20px; }
.chat-contact dl { margin:24px 0; padding:18px 0; border-block:1px solid #e3e9e4; }
.chat-contact dl > div + div { margin-top:18px; }
.chat-contact dt { margin-bottom:4px; color:var(--chat-muted); font-size:12px; }
.chat-contact dd { margin:0; overflow-wrap:anywhere; }
.chat-contact dd a { text-decoration:underline; text-underline-offset:4px; }
.chat-contact-link { display:flex; justify-content:space-between; min-height:48px; border-radius:8px; padding:12px 16px; background:var(--chat-accent); color:#fff; }
.chat-contact .chat-contact-note { margin:12px 0 20px; color:var(--chat-muted); font-size:12px; }
.chat-back { display:flex; align-items:center; gap:5px; min-height:40px; border:0; padding:0; background:transparent; color:var(--chat-accent); font-size:13px !important; }
.chat-reset { min-height:44px; border:1px solid #b8cfc1; border-radius:8px; padding:10px 16px; background:#fff; color:var(--chat-accent); }
.chat-visually-hidden { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
@media(max-width:600px) {
  .consultation { right:max(16px,env(safe-area-inset-right)); bottom:max(16px,env(safe-area-inset-bottom)); }
  .consultation-panel { position:fixed; right:max(8px,env(safe-area-inset-right)); bottom:max(8px,env(safe-area-inset-bottom)); left:max(8px,env(safe-area-inset-left)); width:auto; height:min(720px,calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom))); min-height:0; }
  .consultation.is-open .consultation-launcher { visibility:hidden; }
  .chat-input-row textarea { min-height:52px; font-size:16px; }
  .chat-input-meta > span:first-child { display:none; }
  .chat-input-meta { justify-content:flex-end; }
  .chat-teaser { width:min(280px,calc(100vw - 32px)); }
}
@media(pointer:coarse) {
  .chat-icon-button,.chat-send { width:44px; height:44px; }
  .chat-teaser-dismiss { width:44px; height:44px; }
  .chat-teaser-dismiss { top:-48px; opacity:1; }
  .chat-consent,.chat-privacy-details summary,.chat-suggestions button,.chat-back,.chat-error button { min-height:44px; }
}
@media(max-height:500px) {
  .consultation-panel { position:fixed; right:max(8px,env(safe-area-inset-right)); bottom:max(8px,env(safe-area-inset-bottom)); height:calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); min-height:0; }
  .consultation.is-open .consultation-launcher { visibility:hidden; }
  .chat-header { min-height:56px; padding-block:4px; }
  .chat-welcome { padding-top:0; }
  .chat-composer .chat-input-meta { display:none; }
}
@media(prefers-reduced-motion:reduce) { .consultation-panel.is-entering { animation:none; } .consultation-launcher { transition:none; } }
@media print { .consultation { display:none; } }
