.pw-chat { --chat-edge: 24px; --chat-bottom: max(22px, env(safe-area-inset-bottom)); position: fixed; right: var(--chat-edge); bottom: var(--chat-bottom); width: min(420px,calc(100% - var(--chat-edge) * 2)); pointer-events: none; z-index: 100; }
.pw-chat-launcher { pointer-events: auto; margin-left: auto; display: flex; gap: 18px; align-items: center; min-height: 52px; padding: 14px 20px; background: #dab18b; color: #21160e; border: 1px solid #edc9a7; border-radius: 999px; box-shadow: 0 8px 35px #0005; font: 600 .875rem Inter,system-ui,sans-serif; }
.pw-chat-launcher span { font-size: 1.2rem; }
.pw-chat-dialog { pointer-events: auto; position: absolute; inset: auto 0 calc(100% + 12px) auto; margin: 0; width: 100%; max-width: none; height: min(640px,calc(100dvh - var(--chat-bottom) - 88px)); max-height: calc(100dvh - var(--chat-bottom) - 88px); padding: 0; overflow: hidden; color: #f7ede3; background: #1d1611; border: 1px solid #b8794270; border-radius: 16px; box-shadow: 0 16px 60px #0008; }
.pw-chat-dialog[open] { display: flex; flex-direction: column; }
.pw-chat-header { display: flex; flex-shrink: 0; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 18px 18px 10px; }
.pw-chat-header h2 { margin: 0; font: 500 1.85rem/1.1 'Cormorant Garamond',Georgia,serif; }
.pw-chat-header p { margin: 6px 0 0; color: #bfa48d; font-size: .875rem; }
.pw-chat-header button { font-size: 1.5rem; line-height: 1; background: transparent; border: 0; color: #e9cbae; min-width: 40px; min-height: 40px; padding: 4px; }
.pw-chat-notice { flex-shrink: 0; color: #b7a291; font-size: .8125rem; line-height: 1.6; padding: 0 18px 14px; margin: 0; border-bottom: 1px solid #d8b08a25; }
.pw-chat-notice a { text-decoration: underline; text-underline-offset: 3px; }
.pw-chat-messages { overflow-y: auto; min-height: 0; flex: 1 1 auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; overscroll-behavior: contain; scrollbar-width: thin; }
.pw-chat-message { flex-shrink: 0; padding: 12px 14px; background: #302319; border: 1px solid #d8b08a20; border-radius: 12px; margin: 0; font-size: 1rem; line-height: 1.65; overflow-wrap: anywhere; }
.pw-chat-message[data-role="user"] { white-space: pre-wrap; background: #d8b08a; color: #25180e; align-self: flex-end; max-width: 90%; border-bottom-right-radius: 2px; }
.pw-chat-message p, .pw-chat-message ul, .pw-chat-message ol, .pw-chat-message blockquote, .pw-chat-message pre { margin: 0 0 .75em; }
.pw-chat-message > :last-child { margin-bottom: 0; }
.pw-chat-message ul, .pw-chat-message ol { padding-left: 1.3em; }
.pw-chat-message li + li { margin-top: .3em; }
.pw-chat-message .pw-chat-heading { font-weight: 700; color: #f5d8bd; }
.pw-chat-message a { color: #edc9a7; text-decoration: underline; text-underline-offset: 3px; }
.pw-chat-message code { font-size: .9em; background: #17110d; padding: .12em .3em; border-radius: 4px; }
.pw-chat-message pre { white-space: pre-wrap; padding: 10px; background: #17110d; border-radius: 6px; }
.pw-chat-message pre code { padding: 0; }
.pw-chat-message blockquote { border-left: 2px solid #b68b65; padding-left: 12px; color: #d1bba7; }
.pw-chat-prompts { display: flex; flex-shrink: 0; gap: 7px; flex-wrap: wrap; padding: 0 16px 12px; }
.pw-chat-prompts[hidden] { display: none; }
.pw-chat-prompts button { text-align: left; background: transparent; border: 1px solid #d8b08a55; border-radius: 7px; color: #d7b18f; font-size: .875rem; padding: 7px 9px; }
.pw-chat-form { display: flex; flex-shrink: 0; gap: 8px; margin: 0; padding: 0 16px; }
.pw-chat-form textarea { flex: 1; min-width: 0; min-height: 60px; height: 60px; resize: none; padding: 10px; border: 1px solid #997454; border-radius: 9px; background: #17110d; color: #f7ede3; font: 1rem/1.5 Inter,system-ui,sans-serif; }
.pw-chat-form textarea::placeholder { color: #bca693; }
.pw-chat-form button { border: 0; border-radius: 9px; background: #dab18b; color: #25180e; padding: 10px 14px; font-size: .875rem; align-self: stretch; }
.pw-chat-status { flex-shrink: 0; font-size: .8125rem; line-height: 1.5; padding: 7px 17px 0; margin: 0; color: #e3b488; }
.pw-chat-status:empty { padding: 0; }
.pw-chat-actions { display: flex; flex-shrink: 0; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 16px 14px; }
.pw-chat-actions a, .pw-chat-actions button { font-size: .8125rem; color: #d8b08a; }
.pw-chat-actions a { text-decoration: underline; text-underline-offset: 4px; padding-block: 6px; }
.pw-chat-actions button { margin-left: auto; padding: 6px 0; background: transparent; border: 0; }
.pw-chat-dialog button:disabled, .pw-chat-form textarea:disabled { opacity: .6; cursor: not-allowed; }
.pw-chat :focus-visible { outline: 2px solid #edc9a7; outline-offset: 3px; }
@media(max-width: 480px) { .pw-chat { --chat-edge: 12px; --chat-bottom: max(12px, env(safe-area-inset-bottom)); }.pw-chat-launcher { min-height: 48px; padding: 11px 16px; }.pw-chat-dialog { height: min(620px,calc(100dvh - var(--chat-bottom) - 76px)); max-height: calc(100dvh - var(--chat-bottom) - 76px); }.pw-chat-header { padding-top: 14px; } }
@media(max-height: 600px) { .pw-chat-dialog[open] { overflow-y: auto; }.pw-chat-messages { flex: 1 0 110px; }.pw-chat-prompts, .pw-chat-notice { display: none; }.pw-chat-header h2 { font-size: 1.5rem; } }
