/* Same widget styling in Flask and Next. */
.chat-widget { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(calc(16px + env(safe-area-inset-bottom) + var(--dw-keyboard-inset, 0px)), var(--dw-footer-lift, 0px)); z-index: 60; display: block; }
.chat-widget[data-open] { bottom: calc(16px + env(safe-area-inset-bottom) + var(--dw-keyboard-inset, 0px)); }
.chat-widget[data-ready] > .dw-launcher { display: none; }
.dw-launcher { display: grid; place-items: center; width: 58px; height: 58px; padding: 0; box-sizing: border-box; border: 1px solid rgba(223, 189, 131, .48); border-radius: 50%; background: radial-gradient(ellipse at 30% 15%, #263345, #111c2b 75%); color: #f5ead8; box-shadow: 0 6px 26px rgba(0, 0, 0, .26), inset 0 1px 0 rgba(245, 234, 216, .08); cursor: pointer; text-decoration: none; transition: border-color .2s, box-shadow .2s, transform .2s; }
.dw-launcher:hover { border-color: #dfbd83; transform: translateY(-2px); box-shadow: 0 9px 30px rgba(0, 0, 0, .36); }
.dw-launcher:focus-visible { outline: 2px solid #dfbd83; outline-offset: 4px; }
.dw-launcher img { width: 34px; height: 34px; display: block; }
.dw-launcher-close { display: none; font: 300 31px/1 Inter, sans-serif; }
.chat-widget[data-open] .dw-launcher img { display: none; }
.chat-widget[data-open] .dw-launcher-close { display: block; }
.dw-window { position: absolute; right: 0; bottom: 72px; width: min(390px, calc(var(--dw-viewport-width, 100vw) - 32px)); height: min(610px, calc(var(--dw-viewport-height, 100dvh) - 110px - env(safe-area-inset-bottom))); overflow: hidden; border: 1px solid rgba(223, 189, 131, .28); border-radius: 20px; background: #101927; box-shadow: 0 18px 70px rgba(0, 0, 0, .4); }
.dw-window[hidden] { display: none !important; }
.dw-window iframe { display: block; border: 0; width: 100%; height: 100%; background: #101927; }
.dw-chat { display: flex; flex-direction: column; height: 100dvh; overflow: hidden; margin: 0; background: radial-gradient(ellipse at 20% 0, rgba(223, 189, 131, .045), transparent 65%), #101927; color: #e4efff; font-family: Inter, sans-serif; font-size: 14px; }
.dw-header { display: flex; align-items: center; gap: .4rem; flex: none; padding: .8rem .85rem; border-bottom: 1px solid rgba(223, 189, 131, .16); }
.dw-chat-link { display: flex; align-items: center; gap: .6rem; flex: 1; min-width: 0; color: #f5ead8; text-decoration: none; font-family: Georgia, serif; font-size: 1.1rem; letter-spacing: .02em; }
.dw-chat-link img { flex: none; }
.dw-chat-link small { display: block; margin-top: .15rem; color: #a2b0c5; font: .67rem/1.4 Inter, sans-serif; letter-spacing: .01em; }
.dw-icon-button { display: grid; place-items: center; flex: none; width: 36px; height: 36px; padding: 0; border: 1px solid transparent; border-radius: 50%; background: transparent; color: #c7b89d; font: 300 25px/1 Inter, sans-serif; cursor: pointer; }
.dw-new { border-color: rgba(223, 189, 131, .2); background: rgba(223, 189, 131, .04); }
.dw-icon-button:hover { background: rgba(223, 189, 131, .1); border-color: rgba(223, 189, 131, .35); color: #f5ead8; }
.dw-chat :is(button, a, textarea):focus-visible { outline: 2px solid #dfbd83; outline-offset: 2px; }
.dw-chat button:disabled { opacity: .4; cursor: default; }
.dw-messages { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 1rem .85rem; scrollbar-width: thin; }
.dw-welcome { display: grid; justify-items: center; align-content: center; height: 100%; box-sizing: border-box; text-align: center; padding: .5rem .7rem; color: #a2b0c5; }
.dw-welcome img { opacity: .65; margin-bottom: .9rem; }
.dw-welcome h1 { margin: 0 0 .6rem; color: #f5ead8; font: 400 1.5rem/1.25 Georgia, serif; letter-spacing: -.02em; }
.dw-welcome p { margin: 0; line-height: 1.7; font-size: .82rem; max-width: 28ch; }
.dw-message { margin: 0 0 .8rem; padding: .75rem .85rem; border-radius: 15px; line-height: 1.65; overflow-wrap: anywhere; white-space: normal; }
.dw-message > span { display: block; margin-bottom: .25rem; font-size: .66rem; color: #aeb9ca; }
.dw-message p { margin: 0; white-space: pre-wrap; }
.dw-user { margin-left: 1.5rem; background: #1b2d46; border-bottom-right-radius: 4px; }
.dw-assistant { margin-right: .35rem; background: #172333; border: 1px solid rgba(223, 189, 131, .12); border-bottom-left-radius: 4px; }
.dw-composer-area { flex: none; padding: .65rem .8rem .55rem; border-top: 1px solid rgba(223, 189, 131, .12); }
.dw-composer { display: flex; align-items: end; gap: .5rem; margin: 0; padding: .6rem .65rem; border: 1px solid rgba(223, 189, 131, .2); border-radius: 16px; background: #142031; }
.dw-composer textarea { flex: 1; min-width: 0; width: 100%; max-height: 90px; padding: 0; resize: none; border: 0; background: transparent; color: #e4efff; font: 14px/1.5 Inter, sans-serif; }
.dw-composer textarea::placeholder { color: #8d9db6; }
.dw-composer button { display: grid; place-items: center; flex: none; width: 34px; height: 34px; padding: 0; border: 1px solid rgba(223, 189, 131, .35); border-radius: 50%; color: #f5ead8; background: #283649; cursor: pointer; }
.dw-composer svg { width: 18px; height: 18px; }
.dw-disclaimer { margin: .5rem 0 0; font-size: .62rem; line-height: 1.4; text-align: center; color: #8d9db6; }
.dw-notice, .dw-error { margin: 0 0 .6rem; font-size: .76rem; line-height: 1.5; color: #b8c5d6; }
.dw-error { color: #efbe9d; }
.dw-notice a { color: #dfbd83; }
@media (max-width: 480px) { .dw-icon-button { width: 40px; height: 40px; } .dw-composer textarea { font-size: 16px; } }
@media (prefers-reduced-motion: reduce) { .dw-launcher { transition: none; } }
