.theme-toggle{top:99px;bottom:auto;right:29px;left:auto}
.chat-launch{position:fixed;bottom:24px;right:28px;z-index:40;padding:13px 18px;border:1px solid var(--line);border-radius:22px;background:var(--surface);box-shadow:0 4px 0 var(--soft);font:13px var(--pixel)}
.chat-launch[hidden]{display:none}
.chat-panel{position:fixed;inset:auto 28px 24px auto;z-index:45;margin:0;padding:0;transform:none;width:min(400px,calc(100vw - 32px));max-width:none;height:min(480px,calc(100dvh - 48px));max-height:calc(100dvh - 48px);display:flex;flex-direction:column;color:var(--ink);background:var(--surface);border:1px solid var(--line);border-radius:26px;box-shadow:0 24px 90px #25152f40;overflow:hidden}
.chat-panel[hidden]{display:none}
.chat-header{display:flex;align-items:center;justify-content:space-between;padding:12px 24px;border-bottom:1px solid var(--line);flex:none}
.chat-header h2{font:700 25px var(--sans);color:var(--plum);margin:0}
.chat-header p{font:13px var(--sans);color:var(--muted);margin:6px 0 0}
.chat-close{font-size:26px;line-height:1;border:0;padding:0 0 0 14px}
.chat-messages{flex:1;min-height:80px;overflow-y:auto;overscroll-behavior:contain;padding:25px 28px;display:flex;flex-direction:column;gap:18px}
.chat-message{display:flex;align-items:flex-end;gap:10px;overflow-wrap:anywhere;flex:none}
.chat-avatar{display:grid;place-items:center;flex:none;width:34px;height:34px;border-radius:50%;background:#e6d9f5;color:#735192;border:1px solid #ba9bd133;font:700 13px var(--sans)}
.chat-bubble{max-width:75%;background:#eee1fa;border:1px solid #d5bde84d;padding:11px 15px;border-radius:17px 17px 17px 4px;min-width:60px}
.chat-meta{font:700 11px var(--sans);color:#785296;margin-bottom:4px}
.chat-message p{font:14px/1.55 var(--sans);white-space:pre-wrap;margin:0;color:#4d365e}
.chat-message time{font:10px var(--sans);color:var(--muted);white-space:nowrap;padding-bottom:4px;opacity:.75}
.chat-message.is-own{flex-direction:row-reverse}
.chat-message.is-own .chat-bubble{background:#f9deeb;border-color:#e6b7cb66;border-radius:17px 17px 4px 17px}
.chat-message.is-own .chat-avatar{background:#f3d0e1;color:#995d7a}
.chat-message.is-own .chat-meta{color:#995d7a}
.chat-status{font:12px/1.4 var(--sans);color:var(--muted);padding:0 28px 14px;margin:0;flex:none}
.chat-form{border-top:1px solid var(--line);padding:19px 24px;display:grid;gap:10px;flex:none}
.chat-compose{display:flex;align-items:stretch;gap:10px}
.chat-name-field,.chat-text-field{position:relative;min-width:0}
.chat-name-field{flex:0 0 120px}
.chat-text-field{flex:1}
.chat-form input,.chat-form textarea{box-sizing:border-box;width:100%;height:48px;background:var(--paper);color:var(--ink);border:1px solid var(--line);border-radius:14px;padding:7px 12px 17px;font:14px/1.4 var(--sans)}
.chat-form textarea{resize:none}
.chat-form input:focus-visible,.chat-form textarea:focus-visible{outline:2px solid var(--plum);outline-offset:2px}
.chat-name-field small,.chat-text-field output{position:absolute;bottom:9px;right:11px;pointer-events:none;opacity:.4;font:10px var(--sans);color:var(--ink)}
.chat-send{align-self:center;border:0;background:transparent;color:var(--plum);width:32px;height:38px;flex:none;font-size:24px;padding:0}
.chat-status:empty{display:none}
.chat-send:disabled{opacity:.5;cursor:wait}
#chat-privacy{font:10px/1.4 var(--sans);color:var(--muted)}
[data-theme="dark"] .chat-bubble{background:#392449;border-color:#72528a55}
[data-theme="dark"] .chat-message p{color:#ecdef5}
[data-theme="dark"] .chat-avatar{background:#432c55;color:#d9b5f1}
[data-theme="dark"] .chat-meta{color:#c7a2e0}
[data-theme="dark"] .chat-message.is-own .chat-bubble{background:#502b40;border-color:#9a5d7e55}
[data-theme="dark"] .chat-message.is-own .chat-avatar{background:#5a3048;color:#efb8d0}
[data-theme="dark"] .chat-message.is-own .chat-meta{color:#edb3d1}
@media(max-width:650px){.theme-toggle{position:absolute;top:86px;right:23px;left:auto;bottom:auto}.chat-launch{bottom:18px;right:16px}.chat-header{padding:20px}.chat-messages{padding:20px 16px}.chat-form{padding:15px 14px}.chat-name-field{flex-basis:80px}.chat-compose{gap:7px}.chat-status{padding-inline:18px}.chat-avatar{width:27px;height:27px}.chat-message{gap:7px}.chat-bubble{max-width:68%;padding:10px 12px}.chat-message time{font-size:9px}.chat-send{width:32px;height:32px}.chat-header h2{font-size:22px}}

@media(max-width:650px){.chat-panel{right:16px;bottom:18px;max-height:calc(100dvh - 36px)}}

@media(max-width:650px){.chat-header{padding:12px 18px}}

/* Keep the live conversation light and compact. */
.chat-header h2{font-size:19px}
.chat-header p{font-size:11px;margin-top:4px}
.chat-messages{gap:12px}
.chat-message{gap:7px}
.chat-avatar{width:27px;height:27px;font-size:11px}
.chat-bubble{padding:7px 10px;min-width:46px;border-radius:13px 13px 13px 4px}
.chat-message.is-own .chat-bubble{border-radius:13px 13px 4px 13px}
.chat-meta{font-size:10px;margin-bottom:2px}
.chat-message p{font-size:12px;line-height:1.4}
.chat-message time{font-size:9px}
@media(max-width:650px){.chat-header h2{font-size:18px}.chat-bubble{padding:6px 9px}.chat-avatar{width:24px;height:24px}}
@media(max-width:700px){
  .chat-launch{right:16px;bottom:calc(82px + env(safe-area-inset-bottom));min-height:44px}
  .chat-panel{right:12px;bottom:calc(80px + env(safe-area-inset-bottom));width:calc(100vw - 24px);height:min(480px,calc(100dvh - 104px));max-height:calc(100dvh - 104px)}
  .chat-header{padding:12px 16px}
  .chat-header h2{font-size:19px}
  .chat-form input,.chat-form textarea{font-size:16px}
  .chat-send,.chat-close{min-width:36px;min-height:40px}
  .chat-messages{min-height:40px}
}
