/* EGE.School help robot — frequently asked questions, no external service.
   Uses the site tokens (site-ui.css) with fallbacks so it works on any page. */
.hb { --hb-brand: var(--brand, #0F5E4E); --hb-brand-soft: var(--brand-soft, #E5EFEB); --hb-on: var(--on-brand, #fff);
  --hb-surface: var(--surface, #fff); --hb-surface-2: var(--surface-2, #FAF9F6); --hb-line: var(--line, #E6E3DC);
  --hb-ink: var(--ink, #0F1114); --hb-ink-2: var(--ink-2, #363B42); --hb-ink-3: var(--ink-3, #575D66); --hb-gold: #E2B15A;
  position: fixed; bottom: 20px; inset-inline-end: 20px; z-index: 9500; font-family: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif; }
.hb *, .hb *::before, .hb *::after { box-sizing: border-box; }
/* Pages that animate every element (transition: all) must not slow the robot down. */
.hb, .hb *, .hb *::before, .hb *::after { transition: none !important; }
.hb-chip, .hb-form input, .hb-launch { transition: background-color .12s ease, border-color .12s ease, color .12s ease, transform .15s ease !important; }

/* Launcher: the robot head */
.hb-launch { position: relative; width: 66px; height: 66px; padding: 0; border: 0; border-radius: 50%; background: var(--hb-brand); color: var(--hb-on);
  box-shadow: 0 10px 28px rgba(15, 94, 78, .35); cursor: pointer; display: grid; place-items: center; animation: hb-bob 3.2s ease-in-out infinite; }
.hb-launch:hover { animation-play-state: paused; transform: translateY(-2px) scale(1.04); }
.hb-launch:focus-visible { outline: 3px solid var(--hb-gold); outline-offset: 3px; }
.hb-launch svg { width: 46px; height: 46px; }
.hb[data-open] .hb-launch { animation: none; }
.hb-badge { position: absolute; top: 2px; inset-inline-end: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--hb-gold); border: 2px solid var(--hb-surface); }
.hb[data-seen] .hb-badge { display: none; }
.hb-tease { position: absolute; bottom: 76px; inset-inline-end: 0; width: max-content; max-width: 230px; background: var(--hb-surface); color: var(--hb-ink); border: 1px solid var(--hb-line);
  border-radius: 14px; border-end-end-radius: 4px; padding: 10px 14px; font-size: 13.5px; line-height: 1.6; box-shadow: 0 10px 30px rgba(0, 0, 0, .12); animation: hb-pop .35s ease both; }
.hb-tease button { all: unset; cursor: pointer; position: absolute; top: 2px; inset-inline-start: 6px; color: var(--hb-ink-3); font-size: 15px; line-height: 1; padding: 2px; }
.hb[data-open] .hb-tease, .hb[data-seen] .hb-tease { display: none; }

/* Robot drawing */
.hb-eye { transform-origin: center; transform-box: fill-box; animation: hb-blink 4.5s infinite; }
.hb-antenna { transform-origin: 50% 100%; transform-box: fill-box; animation: hb-wiggle 3.2s ease-in-out infinite; }

/* Panel */
.hb-panel { position: absolute; bottom: 80px; inset-inline-end: 0; width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100vh - 120px));
  display: none; flex-direction: column; background: var(--hb-surface); color: var(--hb-ink); border: 1px solid var(--hb-line); border-radius: 18px; overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .22); }
.hb[data-open] .hb-panel { display: flex; animation: hb-pop .25s ease both; }
.hb-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--hb-brand); color: var(--hb-on); }
.hb-head .hb-face { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; background: rgba(255, 255, 255, .14); display: grid; place-items: center; }
.hb-head .hb-face svg { width: 34px; height: 34px; }
.hb-head b { display: block; font-size: 15.5px; font-weight: 700; }
.hb-head small { display: flex; align-items: center; gap: 6px; font-size: 12px; opacity: .9; }
.hb-head small::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #7CE0B5; }
.hb-close { margin-inline-start: auto; width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: var(--hb-on); cursor: pointer; font-size: 18px; line-height: 1; }
.hb-close:hover { background: rgba(255, 255, 255, .25); }

.hb-log { flex: 1; overflow-y: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 10px; background: var(--hb-surface-2); scroll-behavior: smooth; scrollbar-width: none; }
.hb-msg { max-width: 86%; padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.8; white-space: pre-line; overflow-wrap: anywhere; animation: hb-in .2s ease both; }
.hb-msg.bot { align-self: flex-start; background: var(--hb-surface); border: 1px solid var(--hb-line); border-start-start-radius: 4px; color: var(--hb-ink); }
.hb-msg.me { align-self: flex-end; background: var(--hb-brand); color: var(--hb-on); border-start-end-radius: 4px; }
.hb-msg a { color: var(--hb-brand); font-weight: 600; }
.hb-msg.bot .hb-cta { display: inline-flex; margin-top: 8px; padding: 6px 12px; border-radius: 8px; background: var(--hb-brand); color: var(--hb-on); text-decoration: none; font-size: 13px; font-weight: 600; border: 0; cursor: pointer; font-family: inherit; }
.hb-typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: 12px 14px; background: var(--hb-surface); border: 1px solid var(--hb-line); border-radius: 14px; border-start-start-radius: 4px; }
.hb-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--hb-ink-3); animation: hb-dot 1s infinite; }
.hb-typing i:nth-child(2) { animation-delay: .15s; } .hb-typing i:nth-child(3) { animation-delay: .3s; }

.hb-chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 132px; overflow-y: auto; padding: 8px 12px; border-top: 1px solid var(--hb-line); background: var(--hb-surface); scrollbar-width: none; }
.hb-chip { flex: 0 0 auto; padding: 6px 12px; border: 1px solid var(--hb-line); border-radius: 999px; background: var(--hb-surface); color: var(--hb-ink-2); font: inherit; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.hb-chip:hover { border-color: var(--hb-brand); color: var(--hb-brand); background: var(--hb-brand-soft); }
.hb-form { display: flex; gap: 8px; padding: 10px 12px 12px; background: var(--hb-surface); }
.hb-form input { flex: 1; min-width: 0; height: 42px; padding: 0 14px; border: 1px solid var(--hb-line); border-radius: 999px; background: var(--hb-surface-2); color: var(--hb-ink); font: inherit; font-size: 14px; outline: none; }
.hb-form input:focus { border-color: var(--hb-brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--hb-brand) 18%, transparent); }
.hb-form button { width: 42px; height: 42px; flex: 0 0 42px; border: 0; border-radius: 50%; background: var(--hb-brand); color: var(--hb-on); cursor: pointer; display: grid; place-items: center; }
.hb-form button svg { width: 18px; height: 18px; }
html[dir="rtl"] .hb-form button svg { transform: scaleX(-1); }

/* Scrolling still works with the wheel and touch; the bars are just not drawn. */
.hb-log::-webkit-scrollbar, .hb-chips::-webkit-scrollbar { display: none; }

@keyframes hb-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes hb-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes hb-wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-10deg); } 75% { transform: rotate(10deg); } }
@keyframes hb-pop { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes hb-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes hb-dot { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .hb *, .hb { animation: none !important; } }
@media (max-width: 480px) {
  .hb { bottom: 14px; inset-inline-end: 14px; }
  .hb-panel { position: fixed; inset: auto 8px 90px 8px; width: auto; height: min(70vh, 560px); }
}
