/* ThemeDokan AI Assistant widget (td-ai-widget-v1.js). The old in-bundle chat is hidden. */
.td-ai-fab,.td-ai{display:none!important}
.tdw-root{font-family:inherit}
.tdw-fab{position:fixed;right:20px;bottom:92px;z-index:44;display:inline-flex;align-items:center;gap:7px;height:36px;padding:0 13px 0 9px;border:1px solid transparent;border-radius:5px 0 5px 0;background:linear-gradient(135deg,hsl(var(--primary,217 91% 55%)),#6d4aff);color:#fff;font-size:12.5px;font-weight:600;line-height:1;cursor:pointer}
.tdw-fab svg{width:19px;height:19px}
.tdw{position:fixed;right:14px;bottom:16px;z-index:58;display:flex;flex-direction:column;width:340px;max-width:calc(100vw - 20px);height:min(500px,calc(100dvh - 110px));overflow:hidden;background:hsl(var(--card,0 0% 100%));color:hsl(var(--foreground,222 47% 11%));border:1px solid hsl(var(--border,220 16% 90%));border-radius:14px 14px 24px 14px;box-shadow:0 28px 60px -22px rgba(0,0,0,.5)}
.tdw-head{display:flex;align-items:center;gap:10px;padding:10px 12px;color:#fff;background:linear-gradient(120deg,#0a1230 0%,#14307a 55%,#1f56d8 100%)}
.tdw-av{position:relative;display:grid;place-items:center;flex:none;width:38px;height:38px;border-radius:12px;background:rgba(255,255,255,.14);border:1px solid rgba(255,255,255,.25)}
.tdw-av svg{width:22px;height:22px}
.tdw-on{position:absolute;right:-3px;bottom:-3px;width:11px;height:11px;border-radius:50%;background:#22c55e;border:2px solid #14307a}
.tdw-ht{min-width:0;flex:1}
.tdw-ht b{display:flex;align-items:center;gap:5px;font-size:14px;line-height:1.2;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tdw-ht em{display:inline-flex;font-style:normal}
.tdw-ht em svg{width:15px;height:15px}
.tdw-ht small{display:block;margin-top:2px;font-size:11px;opacity:.85}
.tdw-lang{flex:none;height:26px;padding:0 9px;border:1px solid rgba(255,255,255,.35);border-radius:5px 0 5px 0;background:rgba(255,255,255,.12);color:#fff;font-size:12px;font-weight:600;cursor:pointer}
.tdw-x{display:grid;place-items:center;flex:none;width:28px;height:28px;border:0;border-radius:50%;background:#fff;color:#0f172a;cursor:pointer}
.tdw-x svg{width:14px;height:14px}
.tdw-body{flex:1;display:flex;flex-direction:column;gap:9px;overflow-y:auto;padding:12px 10px;background:hsl(var(--muted,220 20% 97%)/.6)}
.tdw-row{display:flex;align-items:flex-end;gap:7px}
.tdw-row.u{justify-content:flex-end}
.tdw-mini{display:grid;place-items:center;flex:none;width:24px;height:24px;border-radius:8px;background:linear-gradient(135deg,hsl(var(--primary,217 91% 55%)),#6d4aff);color:#fff}
.tdw-mini svg{width:14px;height:14px}
.tdw-col{display:flex;flex-direction:column;gap:7px;min-width:0;max-width:86%}
.tdw-b{padding:8px 11px;border-radius:14px;font-size:13px;line-height:1.5;overflow-wrap:anywhere}
.tdw-row.a .tdw-b{background:hsl(var(--card,0 0% 100%));border:1px solid hsl(var(--border,220 16% 90%));border-bottom-left-radius:4px}
.tdw-row.u .tdw-b{max-width:86%;background:hsl(var(--primary,217 91% 55%));color:#fff;border-bottom-right-radius:4px}
.tdw-b p{margin:0}
.tdw-b p+p,.tdw-b ul+p,.tdw-b p+ul{margin-top:6px}
.tdw-b ul{margin:0;padding-left:17px;list-style:disc}
.tdw-link{color:hsl(var(--primary,217 91% 55%));text-decoration:underline}
.tdw-langs{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.tdw-btn{height:40px;border:1px solid hsl(var(--primary,217 91% 55%)/.4);border-radius:5px 0 5px 0;background:hsl(var(--card,0 0% 100%));color:hsl(var(--primary,217 91% 55%));font-size:14px;font-weight:700;cursor:pointer}
.tdw-btn:hover{background:hsl(var(--primary,217 91% 55%)/.08)}
.tdw-typing{display:inline-flex;gap:4px;padding:11px 13px}
.tdw-typing i{width:6px;height:6px;border-radius:50%;background:hsl(var(--muted-foreground,220 9% 46%));animation:tdwb 1.1s infinite ease-in-out}
.tdw-typing i:nth-child(2){animation-delay:.15s}
.tdw-typing i:nth-child(3){animation-delay:.3s}
@keyframes tdwb{0%,80%,100%{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}
.tdw-wa{display:flex;align-items:center;gap:10px;padding:9px 12px;border:1px solid #1fa855;border-radius:5px 0 5px 0;background:#e9fbf0;color:#0b7a3a;text-decoration:none}
.tdw-wa svg{width:24px;height:24px;flex:none;color:#1fa855}
.tdw-wa span{display:flex;flex-direction:column;min-width:0}
.tdw-wa b{font-size:13px;line-height:1.25}
.tdw-wa small{font-size:12px;opacity:.85}
.tdw-chips{display:flex;gap:7px;overflow-x:auto;padding:8px 10px;border-top:1px solid hsl(var(--border,220 16% 90%));background:hsl(var(--card,0 0% 100%));scrollbar-width:none}
.tdw-chips::-webkit-scrollbar{display:none}
.tdw-chip{flex:none;max-width:230px;padding:6px 11px;border:1px solid hsl(var(--primary,217 91% 55%)/.3);border-radius:5px 0 5px 0;background:hsl(var(--primary,217 91% 55%)/.07);color:hsl(var(--primary,217 91% 55%));font-size:12.5px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}
.tdw-form{display:flex;gap:7px;padding:8px 10px;border-top:1px solid hsl(var(--border,220 16% 90%));background:hsl(var(--card,0 0% 100%))}
.tdw-form input{flex:1;min-width:0;height:38px;padding:0 12px;border:1px solid hsl(var(--border,220 16% 90%));border-radius:5px 0 5px 0;background:hsl(var(--background,0 0% 100%));color:inherit;font-size:13.5px}
.tdw-form input:focus{outline:2px solid hsl(var(--primary,217 91% 55%)/.35);outline-offset:0}
.tdw-send{display:grid;place-items:center;flex:none;width:38px;height:38px;border:1px solid transparent;border-radius:5px 0 5px 0;background:hsl(var(--primary,217 91% 55%));color:#fff;cursor:pointer}
.tdw-send svg{width:16px;height:16px}
.tdw-note{margin:0;padding:0 12px 8px;background:hsl(var(--card,0 0% 100%));font-size:10.5px;line-height:1.35;color:hsl(var(--muted-foreground,220 9% 46%))}
@media (max-width:1023px){
 .tdw-fab{right:14px;bottom:calc(148px + env(safe-area-inset-bottom,0px))}
 .tdw{left:8px;right:8px;width:auto;max-width:none;bottom:calc(70px + env(safe-area-inset-bottom,0px));height:min(72dvh,540px);max-height:calc(100dvh - 90px - env(safe-area-inset-bottom,0px))}
 .tdw-form input{font-size:16px}
}
@media (max-height:520px){.tdw{bottom:8px;height:calc(100dvh - 16px);max-height:none}}
@media (prefers-reduced-motion:reduce){.tdw-typing i{animation:none}}
