#dong-widget{--dong-navy:#0e2238;--dong-gold:#a97426;--dong-line:#e4dac2;position:fixed;right:20px;bottom:calc(24px + env(safe-area-inset-bottom));z-index:9999;font:14px/1.6 system-ui,sans-serif;color:var(--dong-navy)}
#dong-widget *{box-sizing:border-box}#dong-widget [hidden]{display:none!important}#dong-widget button,#dong-widget input{font:inherit}#dong-widget button{cursor:pointer}#dong-widget button:focus-visible,#dong-widget a:focus-visible,#dong-widget input:focus-visible{outline:3px solid #a97426;outline-offset:3px}
#dong-widget .dong-launch{border:1px solid var(--dong-line);border-radius:18px 18px 4px 18px;background:var(--dong-navy);color:white;padding:12px 20px;box-shadow:0 10px 28px #0e223833;font-weight:700;float:right}#dong-widget .dong-launch span{color:#e4bd75;margin-right:8px}
#dong-widget #dong-panel{position:absolute;right:0;bottom:62px;width:380px;height:min(590px,calc(100dvh - 180px));background:#fff;border:1px solid var(--dong-line);border-radius:18px 18px 4px 18px;box-shadow:0 14px 32px #0e223833;display:flex;flex-direction:column;overflow:hidden}
#dong-widget header{display:flex;align-items:center;justify-content:space-between;background:var(--dong-navy);color:#fff;padding:15px 18px}#dong-widget header strong{font-size:20px}#dong-widget small{display:block;font-size:11px}#dong-widget .dong-close{border:0;background:transparent;color:white;font-size:28px;width:44px;height:44px}
#dong-widget .dong-log{flex:1;overflow:auto;overscroll-behavior:contain;padding:16px;background:#faf6ee}#dong-widget .dong-message{padding:12px 14px;border-radius:14px 14px 4px 14px;margin-bottom:12px;white-space:pre-wrap;overflow-wrap:anywhere}#dong-widget .dong-answer{background:white;border:1px solid var(--dong-line)}#dong-widget .dong-user{background:var(--dong-navy);color:white;margin-left:34px}
#dong-widget .dong-action{display:inline-block;background:var(--dong-gold);color:#fff;text-decoration:none;padding:9px 11px;margin:8px 6px 0 0;border-radius:4px;font-weight:700;font-size:12px;white-space:normal}#dong-widget .dong-suggestions{display:grid;gap:7px;margin-top:10px}#dong-widget .dong-suggestions button{background:#fff;border:1px solid var(--dong-line);border-radius:8px;padding:10px;text-align:left;color:var(--dong-navy);font-size:12px}
#dong-widget .dong-form{border-top:1px solid var(--dong-line);padding:12px 15px;background:white}#dong-widget label{font-size:12px;display:block;margin-bottom:6px}#dong-widget .dong-form div{display:flex;gap:8px}#dong-widget input{width:100%;min-width:0;border:1px solid var(--dong-line);border-radius:8px;padding:12px;font-size:16px}#dong-widget .dong-form button{border:0;border-radius:8px;background:var(--dong-navy);color:#fff;padding:10px 15px}
@media(max-width:480px){#dong-widget{right:10px;bottom:calc(16px + env(safe-area-inset-bottom))}#dong-widget #dong-panel{width:calc(100vw - 20px);height:min(560px,calc(100dvh - 170px));bottom:60px}#dong-widget .dong-log{padding:12px}}

/* Nút mở = robot Đồng (A muốn giữ hình con AI, 08/10/2026) */
#dong-widget .dong-launch{display:flex;align-items:flex-end;gap:6px;background:none!important;border:0!important;box-shadow:none!important;padding:0!important;cursor:pointer}
#dong-widget .dong-tag{background:var(--dong-navy);color:#fff;font-weight:700;font-size:13px;padding:7px 12px;border-radius:14px 14px 4px 14px;box-shadow:0 6px 16px #0e223833;margin-bottom:26px;white-space:nowrap}
#dong-widget .dong-bot{display:flex;align-items:center;justify-content:center;width:78px;height:78px;border-radius:50%;background:#faf6ee;border:2px solid #d4a94f;box-shadow:0 8px 22px #0e223859;line-height:0}#dong-widget .dong-bot svg{margin-top:6px}
@media (prefers-reduced-motion:no-preference){#dong-widget .dong-bot{animation:dong-bob 3.6s ease-in-out infinite}}
@keyframes dong-bob{0%,100%{transform:translateY(0) rotate(-1.5deg)}50%{transform:translateY(-8px) rotate(1.5deg)}}

/* Hook chủ động, đuôi hướng xuống robot. */
#dong-widget .dong-hook{position:absolute;right:18px;bottom:96px;width:240px;max-width:calc(100vw - 40px);background:#fff;border:1px solid var(--dong-line);border-radius:16px;box-shadow:0 8px 24px #0e223826}
#dong-widget .dong-hook::after{content:"";position:absolute;right:20px;bottom:-7px;width:12px;height:12px;background:#fff;border-right:1px solid var(--dong-line);border-bottom:1px solid var(--dong-line);transform:rotate(45deg)}
#dong-widget .dong-hook-body{display:block;width:100%;border:0;background:transparent;color:var(--dong-navy);text-align:left;padding:15px 28px 15px 14px;border-radius:16px;line-height:1.5;max-height:25dvh;overflow:auto}
#dong-widget .dong-hook-close{position:absolute;right:3px;top:3px;width:26px;height:26px;padding:0;border:0;background:transparent;color:var(--dong-gold);font-size:22px;line-height:1}
@media(max-width:480px){#dong-widget .dong-hook{width:200px;bottom:96px;right:12px;font-size:12.5px;max-height:25dvh}#dong-widget .dong-hook-body{padding:12px 27px 12px 12px}}
@media(prefers-reduced-motion:reduce){#dong-widget *,#dong-widget *::after{animation:none!important;transition:none!important}}
