/* The live chat at /chat and /ja/chat (scripts/site/build_support.py), in Ivory's look. */
/* The chat, in Ivory's look (14 Oct 2026). PostHog's own widget is hidden; this page talks to it through
   posthog.conversations (sendMessage, getMessages), so messages still arrive in PostHog's inbox. */
#ph-conversations-widget-container { display: none !important; }
.chat-intro { margin: 0 0 18px; color: var(--muted); }
.chat { display: flex; flex-direction: column; height: min(72vh, 680px); background: var(--paper); border: 1px solid var(--line); border-radius: 26px; overflow: hidden; box-shadow: 0 18px 50px rgba(91,60,30,.08); }
.chat-log { flex: 1; overflow-y: auto; padding: 22px 18px 10px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.msg { max-width: 82%; padding: 11px 15px; border-radius: 20px; font-size: 16px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.them { align-self: flex-start; background: var(--pill); color: var(--ink); border-bottom-left-radius: 6px; }
.msg.me { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 6px; }
.msg.me.sending { opacity: .6; }
.msg.failed { background: #F6E3DA; color: var(--ink); }
.meta { font-size: 12px; color: var(--muted); margin: -4px 4px 2px; }
.meta.me { align-self: flex-end; }
.meta.them { align-self: flex-start; }
.who { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--muted); margin: 4px 2px 0; }
.who .pearl { width: 20px; height: 20px; }
.retry { font: inherit; font-size: 12px; font-weight: 700; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }
.composer { border-top: 1px solid var(--line); padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--paper); display: grid; gap: 8px; }
.composer-row { display: flex; align-items: flex-end; gap: 10px; }
.composer textarea { flex: 1; resize: none; font: 500 16px/1.4 Figtree, system-ui, sans-serif; color: var(--ink); background: var(--page); border: 1px solid var(--line); border-radius: 20px; padding: 11px 15px; max-height: 140px; outline: none; }
.composer textarea:focus { border-color: var(--peach); }
.send { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; cursor: pointer; transition: opacity .15s, transform .15s; }
.send:disabled { opacity: .35; cursor: default; }
.send:not(:disabled):active { transform: scale(.94); }
.email-row { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }
.email-row input { flex: 1; min-width: 0; font: 500 14px Figtree, system-ui, sans-serif; color: var(--ink); background: transparent; border: 0; border-bottom: 1px dashed var(--line); padding: 4px 2px; outline: none; }
.email-row input:focus { border-bottom-color: var(--peach); }
.chat-note { font-size: 13px; color: var(--muted); margin: 12px 4px 0; }
.chat-down[hidden], .chat[hidden], .email-row[hidden] { display: none; }
/* Opened from the app (Settings › Chat with us): no site header, footer or intro; the chat fills the screen. */
html.in-app header.site, html.in-app footer.site, html.in-app .chat-head { display: none; }
html.in-app body, html.in-app main.wrap { padding: 0; margin: 0; max-width: none; }
html.in-app article.doc { margin: 0; padding: 0; max-width: none; }
html.in-app .chat { height: 100vh; height: 100dvh; border: 0; border-radius: 0; box-shadow: none; background: var(--page); }
html.in-app .composer { background: var(--page); }
html.in-app .chat-note { display: none; }
