/* AI Assistant widget */
#dd-chat { --ddc-black: #000; --ddc-line: #e5e5e5; --ddc-soft: #f3f3f3; position: fixed; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); z-index: 9990; font-family: inherit; font-size: 15px; line-height: 1.5; color: #222; }
#dd-chat *, #dd-chat *::before, #dd-chat *::after { box-sizing: border-box; }
#dd-chat button, #dd-chat textarea { font: inherit; }
.ddc-launch { display: inline-flex; align-items: center; gap: .55rem; padding: .75rem 1.15rem; border: 0; border-radius: 999px; background: var(--ddc-black); color: #fff; font-weight: 600; cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,.28); transition: transform .2s, box-shadow .2s; }
.ddc-launch:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0,0,0,.34); }
.ddc-launch:focus-visible, .ddc-close:focus-visible, .ddc-send:focus-visible, .ddc-chip:focus-visible, .ddc-input:focus-visible, .ddc-human:focus-visible, .ddc-copy:focus-visible, .ddc-btn:focus-visible { outline: 2px solid #000; outline-offset: 2px; }
.ddc-launch:focus-visible { outline-color: #fff; box-shadow: 0 0 0 2px #000, 0 0 0 4px #fff; }
#dd-chat.is-open .ddc-launch { display: none; }
.ddc-panel { position: fixed; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); width: min(380px, calc(100vw - 2rem)); height: min(580px, calc(100vh - 2rem)); display: flex; flex-direction: column; background: #fff; border: 1px solid var(--ddc-line); border-radius: 18px; box-shadow: 0 18px 50px rgba(0,0,0,.28); overflow: hidden; }
.ddc-panel[hidden] { display: none; }
.ddc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; padding: .9rem 1rem; background: #000; color: #fff; }
.ddc-head strong { display: block; font-size: 1.0625rem; }
.ddc-head span { display: block; font-size: .8125rem; color: #cfcfcf; }
.ddc-close { flex: 0 0 auto; width: 2rem; height: 2rem; border: 0; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; font-size: 1.4rem; line-height: 1; cursor: pointer; }
.ddc-close:hover { background: rgba(255,255,255,.26); }
.ddc-close:focus-visible { outline-color: #fff; }
.ddc-log { flex: 1 1 auto; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .7rem; background: #fff; overscroll-behavior: contain; }
.ddc-msg { display: flex; flex-direction: column; max-width: 88%; }
.ddc-msg--user { align-self: flex-end; align-items: flex-end; }
.ddc-msg--bot { align-self: flex-start; align-items: flex-start; }
.ddc-bubble { padding: .6rem .85rem; border-radius: 14px; word-wrap: break-word; overflow-wrap: anywhere; }
.ddc-msg--user .ddc-bubble { background: #000; color: #fff; border-bottom-right-radius: 4px; }
.ddc-msg--bot .ddc-bubble { background: var(--ddc-soft); color: #222; border-bottom-left-radius: 4px; }
.ddc-bubble a { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.ddc-actions { margin-top: .4rem; }
.ddc-btn { display: inline-block; padding: .45rem .95rem; border-radius: 999px; background: #000; color: #fff !important; font-weight: 600; font-size: .875rem; text-decoration: none; }
.ddc-btn:hover { background: #222; }
.ddc-typing { display: inline-flex; gap: .3rem; align-items: center; min-height: 2.2rem; }
.ddc-typing i { width: 7px; height: 7px; border-radius: 50%; background: #888; animation: ddc-bounce 1.2s infinite ease-in-out; }
.ddc-typing i:nth-child(2) { animation-delay: .15s; }
.ddc-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes ddc-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
.ddc-chips { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0 1rem .75rem; background: #fff; }
.ddc-chips:empty { display: none; }
.ddc-chip { padding: .4rem .8rem; border: 1px solid #000; border-radius: 999px; background: #fff; color: #000; font-size: .8125rem; font-weight: 600; cursor: pointer; text-align: left; }
.ddc-chip:hover { background: #000; color: #fff; }
.ddc-form { display: flex; gap: .5rem; align-items: flex-end; padding: .75rem 1rem; border-top: 1px solid var(--ddc-line); background: #fff; }
.ddc-input { flex: 1 1 auto; resize: none; max-height: 110px; padding: .55rem .75rem; border: 1px solid #bbb; border-radius: 12px; color: #222; background: #fff; }
.ddc-send { flex: 0 0 auto; padding: .6rem 1rem; border: 0; border-radius: 999px; background: #000; color: #fff; font-weight: 600; cursor: pointer; }
.ddc-send:hover { background: #222; }
.ddc-send:disabled { opacity: .5; cursor: default; }
.ddc-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .75rem; padding: .6rem 1rem .8rem; border-top: 1px solid var(--ddc-line); background: var(--ddc-soft); font-size: .8125rem; }
.ddc-human { font-weight: 700; color: #000; text-decoration: underline; text-underline-offset: 2px; }
.ddc-copy { padding: 0; border: 0; background: none; color: #444; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.ddc-note { flex: 1 0 100%; color: #666; font-size: .75rem; }
@media (max-width: 700px) {
	#dd-chat.has-cookie { bottom: calc(8.5rem + env(safe-area-inset-bottom, 0px)); }
	#dd-chat.has-cookie .ddc-panel { bottom: calc(.75rem + env(safe-area-inset-bottom, 0px)); height: min(580px, calc(100vh - 1.5rem)); }
}
@media (max-width: 520px) {
	#dd-chat { right: .75rem; }
	.ddc-launch span { display: none; }
	.ddc-launch { padding: .85rem; }
	.ddc-panel { right: .5rem; left: .5rem; bottom: calc(.5rem + env(safe-area-inset-bottom, 0px)); width: auto; height: min(640px, calc(100dvh - 1rem)); border-radius: 16px; }
	.ddc-input { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { .ddc-launch, .ddc-typing i { transition: none; animation: none; } }
@media print { #dd-chat { display: none; } }
