/* ─────────────────────────────────────────────────────────────
   e-NoteBook Help & Feedback Center — the robot assistant on the
   sign-in pages. Used by static/help-assistant.js.
   ───────────────────────────────────────────────────────────── */
.ha-root{
  --ha-red:#C8191E; --ha-red-dark:#a8141a; --ha-cyan:#06b6d4; --ha-cyan-soft:rgba(6,182,212,.14);
  --ha-ink:#1a1a1a; --ha-muted:#6b7280; --ha-line:#e6e8ec; --ha-panel:#ffffff; --ha-soft:#f6f7f9;
  --ha-ok:#10b981; --ha-down:#ef4444;
  font-family:'Inter',Arial,sans-serif; color:var(--ha-ink);
  position:fixed; right:28px; bottom:22px; z-index:50;
  display:flex; flex-direction:column; align-items:flex-end; gap:10px;
}

/* ── the robot (also the button that opens the chat) ── */
.ha-robot{
  position:relative; width:150px; height:190px; border:none; background:none; padding:0;
  cursor:pointer; outline:none; transition:transform .25s ease;
  animation:ha-float 4s ease-in-out infinite;
}
.ha-robot:hover{transform:translateY(-4px) scale(1.03);}
.ha-robot:focus-visible{outline:3px solid var(--ha-cyan); outline-offset:4px; border-radius:16px;}
.ha-robot svg{width:100%; height:100%; overflow:visible; filter:drop-shadow(0 10px 18px rgba(6,182,212,.22));}
.ha-robot .ha-eye{animation:ha-blink 5s infinite; transform-origin:center; transform-box:fill-box;}
.ha-robot .ha-glow{animation:ha-pulse 2.6s ease-in-out infinite;}
@keyframes ha-float{0%,100%{transform:translateY(0)}50%{transform:translateY(-6px)}}
@keyframes ha-blink{0%,92%,100%{transform:scaleY(1)}95%{transform:scaleY(.1)}}
@keyframes ha-pulse{0%,100%{opacity:.55}50%{opacity:1}}

.ha-hint{
  background:var(--ha-panel); border:1px solid var(--ha-line); border-radius:14px 14px 4px 14px;
  padding:9px 13px; font-size:13px; font-weight:600; box-shadow:0 6px 20px rgba(0,0,0,.10);
  cursor:pointer; max-width:220px; line-height:1.4;
}
.ha-hint small{display:block; font-weight:400; color:var(--ha-muted); font-size:11.5px; margin-top:2px;}
.ha-root.open .ha-hint{display:none;}

/* ── the chat window ── */
.ha-panel{
  width:370px; max-width:calc(100vw - 32px); height:min(560px, calc(100vh - 250px)); min-height:380px;
  background:var(--ha-panel); border:1px solid var(--ha-line); border-radius:18px;
  box-shadow:0 18px 50px rgba(0,0,0,.18); display:none; flex-direction:column; overflow:hidden;
  animation:ha-in .22s ease;
}
.ha-root.open .ha-panel{display:flex;}
@keyframes ha-in{from{opacity:0;transform:translateY(10px) scale(.98)}to{opacity:1;transform:none}}

.ha-head{
  display:flex; align-items:center; gap:10px; padding:13px 14px 12px;
  background:linear-gradient(135deg,#0f172a 0%,#13324a 100%); color:#fff;
}
.ha-head-ava{width:34px;height:34px;border-radius:50%;background:var(--ha-cyan-soft);border:1.5px solid var(--ha-cyan);
  display:flex;align-items:center;justify-content:center;flex-shrink:0;}
.ha-head-ava svg{width:22px;height:22px;}
.ha-head-text{flex:1;min-width:0;}
.ha-title{font-weight:800; font-size:14.5px; letter-spacing:.01em;}
.ha-sub{font-size:11.5px; color:#a5f3fc; display:flex; align-items:center; gap:6px; margin-top:1px;}
.ha-sub::before{content:'';width:7px;height:7px;border-radius:50%;background:var(--ha-ok);box-shadow:0 0 6px var(--ha-ok);}
.ha-close{background:rgba(255,255,255,.1);border:none;color:#fff;width:28px;height:28px;border-radius:8px;
  cursor:pointer;font-size:15px;line-height:1;}
.ha-close:hover{background:rgba(255,255,255,.2);}

/* messages */
.ha-log{flex:1; overflow-y:auto; padding:14px 12px 6px; display:flex; flex-direction:column; gap:9px; background:#fff;}
.ha-msg{max-width:86%; padding:9px 12px; border-radius:14px; font-size:13.2px; line-height:1.5; white-space:pre-line; word-wrap:break-word;}
.ha-bot{align-self:flex-start; background:var(--ha-soft); border:1px solid var(--ha-line); border-bottom-left-radius:4px;}
.ha-me{align-self:flex-end; background:var(--ha-red); color:#fff; border-bottom-right-radius:4px;}
.ha-actions{display:flex; flex-wrap:wrap; gap:6px; margin-top:8px;}
.ha-btn{display:inline-flex; align-items:center; gap:6px; border-radius:9px; padding:7px 12px; font-size:12.5px;
  font-weight:700; cursor:pointer; text-decoration:none; border:1.5px solid var(--ha-red); color:var(--ha-red);
  background:#fff; font-family:inherit;}
.ha-btn:hover{background:rgba(200,25,30,.06);}
.ha-btn.primary{background:var(--ha-red); color:#fff;}
.ha-btn.primary:hover{background:var(--ha-red-dark);}
.ha-btn[disabled]{opacity:.6; cursor:not-allowed;}
.ha-typing{align-self:flex-start; display:flex; gap:4px; padding:11px 13px; background:var(--ha-soft);
  border:1px solid var(--ha-line); border-radius:14px; border-bottom-left-radius:4px;}
.ha-typing i{width:6px;height:6px;border-radius:50%;background:var(--ha-muted);animation:ha-dot 1s infinite;}
.ha-typing i:nth-child(2){animation-delay:.15s} .ha-typing i:nth-child(3){animation-delay:.3s}
@keyframes ha-dot{0%,80%,100%{opacity:.25;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}

/* contact form inside the chat */
.ha-form{align-self:stretch; background:#fff; border:1px solid var(--ha-line); border-radius:12px; padding:11px;
  display:flex; flex-direction:column; gap:7px;}
.ha-form b{font-size:13px;}
.ha-form input,.ha-form textarea{width:100%; border:1.5px solid var(--ha-line); border-radius:8px; padding:8px 10px;
  font-size:13px; font-family:inherit; color:var(--ha-ink); outline:none; resize:vertical;}
.ha-form input:focus,.ha-form textarea:focus{border-color:var(--ha-red); box-shadow:0 0 0 3px rgba(200,25,30,.10);}
.ha-form textarea{min-height:72px;}
.ha-form .ha-err{color:var(--ha-down); font-size:12px;}

/* suggested questions: a card in the chat, grouped and wrapped so every question is visible */
.ha-suggest{align-self:stretch; background:#fff; border:1px solid var(--ha-line); border-radius:12px; padding:10px 11px 11px;}
.ha-suggest-title{font-size:11.5px; font-weight:700; color:var(--ha-ink); margin-bottom:2px;}
.ha-suggest-group{font-size:10px; font-weight:700; letter-spacing:.07em; text-transform:uppercase; color:var(--ha-muted);
  margin:8px 0 5px;}
.ha-suggest-row{display:flex; flex-wrap:wrap; gap:6px;}
.ha-chip{border:1px solid var(--ha-line); background:var(--ha-soft); color:var(--ha-ink); text-align:left;
  border-radius:999px; padding:6px 11px; font-size:12px; line-height:1.3; cursor:pointer; font-family:inherit;}
.ha-chip:hover{border-color:var(--ha-cyan); background:var(--ha-cyan-soft);}
.ha-chip-admin{border-color:rgba(200,25,30,.35); color:var(--ha-red); background:#fff; font-weight:600;}
.ha-chip-admin:hover{background:rgba(200,25,30,.06); border-color:var(--ha-red);}

/* input row */
.ha-ideas{background:var(--ha-soft); color:#b45309; border:1px solid var(--ha-line); border-radius:10px; width:42px;
  cursor:pointer; display:flex; align-items:center; justify-content:center; flex-shrink:0;}
.ha-ideas:hover{background:#fef3c7; border-color:#f59e0b;}
.ha-ideas svg{width:18px; height:18px;}
.ha-input{display:flex; gap:8px; padding:10px 12px 12px; border-top:1px solid var(--ha-line); background:#fff;}
.ha-input input{flex:1; border:1.5px solid var(--ha-line); border-radius:10px; padding:10px 12px; font-size:13.5px;
  font-family:inherit; outline:none; min-width:0;}
.ha-input input:focus{border-color:var(--ha-red); box-shadow:0 0 0 3px rgba(200,25,30,.10);}
.ha-send{background:var(--ha-red); color:#fff; border:none; border-radius:10px; width:42px; cursor:pointer;
  display:flex; align-items:center; justify-content:center;}
.ha-send:hover{background:var(--ha-red-dark);}
.ha-send svg{width:17px;height:17px;}
.ha-foot{font-size:10.5px; color:var(--ha-muted); text-align:center; padding:0 12px 9px; background:#fff;}

/* narrow screens: the robot becomes a small round button */
@media (max-width: 1100px){
  .ha-root{right:16px; bottom:16px;}
  .ha-robot{width:64px; height:64px; border-radius:50%; background:#0f172a; animation:none;
    box-shadow:0 8px 22px rgba(15,23,42,.35); display:flex; align-items:center; justify-content:center;}
  .ha-robot svg.ha-full{display:none;}
  .ha-robot svg.ha-mini{display:block; width:40px; height:40px;}
  .ha-hint{display:none;}
}
@media (min-width: 1101px){ .ha-robot svg.ha-mini{display:none;} }
@media (max-width: 480px){
  .ha-panel{height:calc(100vh - 110px); width:calc(100vw - 24px);}
  .ha-root{right:12px; bottom:12px;}
}
@media (prefers-reduced-motion: reduce){
  .ha-robot,.ha-robot .ha-eye,.ha-robot .ha-glow,.ha-panel,.ha-typing i{animation:none !important;}
}
