/* HyperCluster's assistant (ui/assistant.js, ui/assistant-panel.js): the button in the corner and
   the chat it opens, in the shared design's colours and type (hc.css; the values after each var()
   are hc.css's own, for a page without it). Everything is inside .hca and named hca-…, and sets
   its own fonts, sizes and margins, so an app's own styles for buttons or text boxes don't reach it.
   Above the shared header and tab bar (hc.css: 50 and less), under the apps' own dialogs, toasts and
   menus (HyperCloud: 90 and up; SweetAlert in Passport: 1060). */
.hca{--hca-lift:0px;position:fixed;right:max(16px,env(safe-area-inset-right,0px));bottom:calc(16px + var(--hca-lift) + env(safe-area-inset-bottom,0px));z-index:85;
  font-family:var(--font,Poppins,'Segoe UI',system-ui,-apple-system,sans-serif);font-size:15px;line-height:1.55;color:var(--text,#e2e8f0);-webkit-font-smoothing:antialiased;text-align:left}
.hca:lang(zh){font-family:var(--font,Poppins,'PingFang SC','Hiragino Sans GB','Microsoft YaHei','Noto Sans SC',system-ui,sans-serif)}
.hca *,.hca *::before,.hca *::after{box-sizing:border-box}
.hca [hidden]{display:none!important}
.hca button,.hca textarea{font:inherit;color:inherit;letter-spacing:normal;text-transform:none;margin:0}
.hca svg{display:block;flex-shrink:0}
.hca :focus-visible{outline:2px solid var(--link,#60a5fa);outline-offset:2px}
.hca-sr{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}

/* the button */
.hca-launch{width:56px;height:56px;border-radius:50%;border:0;padding:0;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;
  background:var(--blue,#2F8CFF);color:#050911;box-shadow:0 10px 30px -8px rgba(47,140,255,.55),0 2px 8px rgba(0,0,0,.4)}
.hca-launch:hover{background:var(--link,#60a5fa)}
.hca-launch .hca-x{display:none}
.hca.open .hca-launch{background:var(--card,#0e1420);color:var(--text,#e2e8f0);border:1px solid var(--line-2,#2a3a55);box-shadow:0 8px 24px -8px rgba(0,0,0,.6)}
.hca.open .hca-launch .hca-x{display:block}
.hca.open .hca-launch .hca-bubble{display:none}

/* the chat */
.hca-panel{position:absolute;right:0;bottom:68px;width:400px;max-width:calc(100vw - 32px);height:min(640px,calc(100vh - 110px - var(--hca-lift)));height:min(640px,calc(100dvh - 110px - var(--hca-lift)));
  display:flex;flex-direction:column;background:var(--bg,#050911);border:1px solid var(--line-2,#2a3a55);border-radius:var(--r,16px);overflow:hidden;
  box-shadow:0 30px 80px -20px rgba(0,0,0,.85)}
@media (prefers-reduced-motion:no-preference){.hca-panel{animation:hca-in .16s ease-out}@keyframes hca-in{from{opacity:0;transform:translateY(8px)}}}
.hca-head{display:flex;align-items:center;gap:10px;padding:12px 10px 12px 14px;background:var(--head,#070c16);border-bottom:1px solid var(--line,#1e293b)}
.hca-mark{width:30px;height:30px;flex-shrink:0}
.hca-mark img{width:30px;height:30px;display:block}
.hca-titles{flex:1;min-width:0}
.hca-title{margin:0;font-size:15px;font-weight:600;line-height:1.25;color:var(--text,#e2e8f0)}
.hca-sub{margin:1px 0 0;font-size:12px;line-height:1.35;color:var(--muted,#94a3b8)}
.hca-icon{width:40px;height:40px;border-radius:10px;border:0;background:transparent;color:var(--muted,#94a3b8);cursor:pointer;display:inline-flex;align-items:center;justify-content:center;padding:0}
.hca-icon:hover{color:var(--text,#e2e8f0);background:var(--card,#0e1420)}

.hca-log{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:16px 14px 8px;display:flex;flex-direction:column;gap:12px}
.hca-msg{max-width:92%;padding:10px 13px;border-radius:14px;font-size:14.5px;line-height:1.6;overflow-wrap:anywhere}
.hca-msg p{margin:0 0 8px}
.hca-msg p:last-child,.hca-msg ul:last-child,.hca-msg ol:last-child{margin-bottom:0}
.hca-msg ul,.hca-msg ol{margin:0 0 8px;padding-left:20px}
.hca-msg li{margin:2px 0}
.hca-msg strong{font-weight:600;color:#fff}
.hca-msg code{font-family:var(--mono,ui-monospace,'SF Mono',Menlo,Consolas,monospace);font-size:13px;background:var(--field,#0a0f18);border:1px solid var(--line,#1e293b);border-radius:6px;padding:1px 5px}
.hca-msg a{color:var(--link,#60a5fa);text-decoration:underline;text-underline-offset:2px}
.hca-msg a:hover{color:var(--link-2,#93c5fd)}
.hca-me{align-self:flex-end;background:#16325a;border-bottom-right-radius:4px;white-space:pre-wrap}
.hca-ai{align-self:flex-start;background:var(--card,#0e1420);border:1px solid var(--line,#1e293b);border-bottom-left-radius:4px}
.hca-quiet{align-self:center;font-size:12px;color:var(--faint,#64748b);text-align:center}
.hca-typing{display:inline-flex;gap:4px;padding:4px 0}
.hca-typing i{width:7px;height:7px;border-radius:50%;background:var(--faint,#64748b)}
@media (prefers-reduced-motion:no-preference){.hca-typing i{animation:hca-dot 1.2s infinite both}.hca-typing i:nth-child(2){animation-delay:.2s}.hca-typing i:nth-child(3){animation-delay:.4s}
  @keyframes hca-dot{0%,80%,100%{opacity:.3}40%{opacity:1}}}

/* buttons and follow-up questions under a reply */
.hca-acts,.hca-chips{display:flex;flex-wrap:wrap;gap:8px;align-self:flex-start;max-width:100%}
.hca-act{display:inline-flex;align-items:center;gap:6px;min-height:40px;padding:0 14px;border-radius:12px;background:var(--blue,#2F8CFF);color:#050911;
  font-size:13.5px;font-weight:600;line-height:1.2;text-decoration:none}
.hca-act:hover{background:var(--link,#60a5fa);color:#050911}
.hca-chip{display:inline-flex;align-items:center;min-height:40px;padding:6px 14px;border-radius:999px;border:1px solid var(--line,#1e293b);background:var(--card,#0e1420);
  color:var(--text,#e2e8f0);font-size:13px;font-weight:500;line-height:1.3;text-align:left;cursor:pointer}
.hca-chip:hover{border-color:var(--link,#60a5fa)}
.hca-chip:disabled{opacity:.5;cursor:default}

/* the question box */
.hca-foot{padding:10px 12px 10px;border-top:1px solid var(--line,#1e293b);background:var(--head,#070c16)}
.hca-form{display:flex;align-items:flex-end;gap:8px;padding:6px 6px 6px 12px;border:1px solid var(--line,#1e293b);border-radius:14px;background:var(--field,#0a0f18)}
.hca-form:focus-within{border-color:var(--link,#60a5fa)}
.hca .hca-input{flex:1;min-width:0;min-height:40px;max-height:120px;resize:none;border:0;outline:0;background:transparent;padding:9px 0;font-size:16px;line-height:1.4;color:var(--text,#e2e8f0)}
.hca-input::placeholder{color:var(--faint,#64748b)}
.hca-send{width:40px;height:40px;border-radius:10px;border:0;background:var(--blue,#2F8CFF);color:#050911;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;padding:0;flex-shrink:0}
.hca-send:disabled{background:#1a2333;color:var(--faint,#64748b);cursor:default}
.hca-note{margin:8px 2px 0;font-size:11.5px;line-height:1.45;color:var(--faint,#64748b)}
.hca-note a{color:var(--muted,#94a3b8)}

/* a phone: the chat fills the screen above the tab bar, and its own close button replaces the corner one */
@media (max-width:520px){
  .hca.open .hca-launch{display:none}
  .hca-panel{position:fixed;left:8px;right:8px;bottom:calc(8px + var(--hca-lift) + env(safe-area-inset-bottom,0px));top:calc(8px + env(safe-area-inset-top,0px));width:auto;max-width:none;height:auto}
}
