.hpai-root { --hp-blue: #0a63e8; --hp-blue-d: #0b4fc4; --hp-blue-l: #e6f0ff; --hp-ink: #0f1c33; --hp-ink2: #4a5a75; --hp-line: #e3e9f2; --hp-bg: #f5f7fb; --hp-red: #d92d3a; font-family: inherit; color: var(--hp-ink); font-size: 14px; line-height: 1.5; }
.hpai-root *, .hpai-root *::before, .hpai-root *::after { box-sizing: border-box; }
.hpai-root [hidden] { display: none !important; }
.hpai-root button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
.hpai-fab { position: fixed; right: 20px; bottom: 20px; z-index: 99990; display: flex; align-items: center; gap: 8px; background: var(--hp-blue); color: #fff !important; padding: 13px 20px; border-radius: 99px; font-weight: 600; box-shadow: 0 6px 20px rgba(10, 99, 232, .4); transition: background-color .18s, transform .18s; }
.hpai-fab:hover { background: var(--hp-blue-d); transform: translateY(-2px); }
.hpai-root :focus-visible { outline: 3px solid #2b7fff; outline-offset: 2px; }
.hpai-chat { position: fixed; right: 20px; bottom: 20px; z-index: 99991; width: 390px; height: min(620px, calc(100dvh - 40px)); background: #fff; border-radius: 14px; box-shadow: 0 12px 48px rgba(15, 28, 51, .28); display: flex; flex-direction: column; overflow: hidden; }
.hpai-head { background: var(--hp-blue); color: #fff; padding: 14px 16px; display: flex; align-items: center; gap: 12px; }
.hpai-head b { display: block; font-size: 15px; }
.hpai-head small { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #dbe8ff; }
.hpai-head small i { width: 8px; height: 8px; border-radius: 50%; background: #5ee6a8; }
.hpai-av { width: 38px; height: 38px; border-radius: 10px; background: rgba(255, 255, 255, .18); display: grid; place-items: center; flex: none; }
.hpai-x { margin-left: auto; width: 34px; height: 34px; border-radius: 8px; color: #fff !important; display: grid; place-items: center; }
.hpai-x:hover { background: rgba(255, 255, 255, .18); }
.hpai-ctx { background: #f3f8ff; padding: 8px 16px; font-size: 13px; color: var(--hp-ink2); border-bottom: 1px solid var(--hp-line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hpai-ctx b { color: var(--hp-ink); }
.hpai-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--hp-bg); }
.hpai-msg { max-width: 90%; padding: 10px 14px; border-radius: 14px; overflow-wrap: anywhere; }
.hpai-msg.b { background: #fff; border: 1px solid var(--hp-line); border-bottom-left-radius: 4px; align-self: flex-start; }
.hpai-msg.u { background: var(--hp-blue); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.hpai-msg a { color: var(--hp-blue); }
.hpai-typing { display: flex; gap: 4px; padding: 14px; }
.hpai-typing i { width: 7px; height: 7px; border-radius: 50%; background: #9aa8c0; animation: hpai-bounce 1s infinite; }
.hpai-typing i:nth-child(2) { animation-delay: .15s; } .hpai-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes hpai-bounce { 0%, 60%, 100% { transform: none; } 30% { transform: translateY(-4px); } }
.hpai-card { display: flex; gap: 10px; margin-top: 10px; padding: 8px; border: 1px solid var(--hp-line); border-radius: 10px; background: #fff; }
.hpai-card .mi { width: 76px; aspect-ratio: 1; border-radius: 8px; flex: none; overflow: hidden; display: grid; place-items: center; }
.hpai-card .mi img { width: 100%; height: 100%; object-fit: contain; padding: 6%; }
.hpai-card .mt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hpai-card .mt b { font-size: 13px; line-height: 1.3; }
.hpai-card .mt span { font-size: 12px; color: var(--hp-ink2); }
.hpai-card .mt em { font-style: normal; font-weight: 800; color: var(--hp-red); }
.hpai-card .mt em s { font-weight: 400; color: #6b7a92; font-size: 12px; }
.hpai-card .oos { color: var(--hp-red) !important; }
.hpai-root .mb { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.hpai-root .mb button, .hpai-root .mb a { padding: 5px 10px; font-size: 12px; font-weight: 600; border-radius: 6px; background: #f3f8ff; color: var(--hp-blue); text-decoration: none; white-space: nowrap; }
.hpai-root .mb button:hover, .hpai-root .mb a:hover { background: var(--hp-blue-l); }
.hpai-root .mb .pri { background: var(--hp-blue); color: #fff; }
.hpai-root .mb .pri:hover { background: var(--hp-blue-d); }
.hpai-root .mb .sp { background: #fff; border: 1px solid #f1c3b9; color: #c93a1e; }
.hpai-root .mb button:disabled { opacity: .6; cursor: default; }
.hpai-draft { margin-top: 10px; padding: 12px; border: 1px solid var(--hp-blue); border-radius: 10px; background: #f8fbff; }
.hpai-draft ul { list-style: none; margin: 6px 0; padding: 0; }
.hpai-draft li { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }
.hpai-draft p { margin: 4px 0; font-size: 13px; }
.hpai-draft .tot strong { color: var(--hp-red); }
.hpai-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 16px; background: var(--hp-bg); }
.hpai-chips:not(:empty) { padding-block: 8px; }
.hpai-chips button { padding: 6px 12px; border-radius: 99px; border: 1px solid #2b7fff; color: var(--hp-blue); background: #fff; font-size: 13px; font-weight: 500; }
.hpai-chips button:hover { background: #f3f8ff; }
.hpai-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--hp-line); background: #fff; margin: 0; }
.hpai-form input { flex: 1; min-width: 0; border: 1px solid var(--hp-line); border-radius: 10px; padding: 10px 12px; font: inherit; color: var(--hp-ink); background: #fff; margin: 0; height: auto; }
.hpai-form button { width: 42px; border-radius: 10px; background: var(--hp-blue); color: #fff !important; display: grid; place-items: center; }
.hpai-form button:hover { background: var(--hp-blue-d); }
@media (max-width: 600px) {
  .hpai-chat { inset: 0; width: 100%; height: 100dvh; border-radius: 0; }
  .hpai-fab span { display: none; }
  .hpai-fab { padding: 14px; right: 16px; bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) { .hpai-typing i { animation: none; } .hpai-fab { transition: none; } }
.hpai-draft li span { white-space: nowrap; }
