/* Scoped progressive enhancement; the script creates the launcher. */
#fw-chat { --chat-bg: var(--bg, Canvas); --chat-fg: var(--fg, CanvasText); position: fixed; z-index: 1000; right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom)); color: var(--chat-fg); font: inherit; color-scheme: light dark; }
#fw-chat *, #fw-chat *::before, #fw-chat *::after { box-sizing: border-box; }
#fw-chat [hidden] { display: none !important; }
#fw-chat button, #fw-chat a { min-height: 44px; }
#fw-chat button, #fw-chat textarea { font: inherit; color: inherit; background: var(--chat-bg); border: 1px solid currentColor; border-radius: .5rem; padding: .65rem .8rem; }
#fw-chat button { cursor: pointer; }
#fw-chat button:disabled { opacity: .55; cursor: not-allowed; }
#fw-chat :focus-visible { outline: 3px solid Highlight; outline-offset: 2px; }
#fw-chat a { color: LinkText; display: inline-flex; align-items: center; padding: .4rem; overflow-wrap: anywhere; }
#fw-chat-panel { width: min(440px, calc(100vw - 2rem)); height: min(720px, calc(100dvh - 6rem)); background: var(--chat-bg); border: 1px solid currentColor; border-radius: .8rem; box-shadow: 0 8px 32px #0003; padding: 1rem; display: flex; flex-direction: column; gap: .6rem; overflow: auto; overscroll-behavior: contain; }
#fw-chat-panel > button { align-self: flex-end; flex-shrink: 0; }
#fw-chat-panel > div { display: flex; flex-direction: column; gap: .5rem; min-height: 0; flex: 1; }
#fw-chat [role="log"] { flex: 1; min-height: 3rem; overflow-y: auto; overflow-wrap: anywhere; white-space: pre-wrap; }
#fw-chat form { display: flex; flex-wrap: wrap; gap: .5rem; flex-shrink: 0; }
#fw-chat textarea { width: 100%; resize: vertical; max-height: 10rem; font-size: 16px; }
#fw-chat label { display: flex; align-items: center; gap: .6rem; min-height: 44px; }
#fw-chat input[type="checkbox"] { min-width: 24px; min-height: 24px; }
#fw-chat .fw-chat-card { border: 1px solid currentColor; border-radius: .5rem; padding: .5rem; margin-block: .5rem; }
@media (max-width: 600px) {
  #fw-chat:has(#fw-chat-panel:not([hidden])) { inset: 0; }
  #fw-chat-panel { width: 100vw; height: var(--fw-chat-height, 100dvh); border-radius: 0; padding: max(.75rem, env(safe-area-inset-top)) max(.75rem, env(safe-area-inset-right)) max(.75rem, env(safe-area-inset-bottom)) max(.75rem, env(safe-area-inset-left)); }
  #fw-chat:has(#fw-chat-panel:not([hidden])) > button { display: none; }
}
@media (prefers-reduced-motion: reduce) { #fw-chat * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
