/* Get Help: floating bottom-right robot assistant */
.gethelp-widget {
  position: fixed;
  right: clamp(12px, 2vw, 24px);
  bottom: clamp(12px, 2vw, 24px);
  z-index: 9999;
  display: grid;
  gap: 12px;
}

/* 3D orb button */
.gethelp-button {
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 18px;
  cursor: pointer;
  outline: none;
  display: grid;
  place-items: center;
  color: #fff;
  background:
    radial-gradient(60px 60px at 30% 28%, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.15) 34%, rgba(255, 255, 255, 0) 50%), linear-gradient(145deg, #f59e0b, #499557 45%, #007bff 100%);
  box-shadow:
    0 16px 28px rgba(0,0,0,0.35),
    inset 0 -10px 18px rgba(0,0,0,0.35),
    inset 0 10px 18px rgba(255,255,255,0.18);
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.gethelp-button i { font-size: 28px; filter: drop-shadow(0 2px 2px rgba(0,0,0,0.35)); }
.gethelp-button:hover { transform: translateY(-2px) rotateX(3deg) rotateY(-3deg); box-shadow: 0 18px 34px rgba(0,0,0,0.4), inset 0 -10px 18px rgba(0,0,0,0.42), inset 0 12px 20px rgba(255,255,255,0.22); }
.gethelp-button:focus-visible { outline: 2px solid var(--tg-beer); outline-offset: 3px; }

/* Panel */
.gethelp-panel {
  position: fixed;
  right: clamp(12px, 2vw, 24px);
  bottom: calc(clamp(12px, 2vw, 24px) + 72px);
  width: min(360px, 94vw);
  max-height: min(70vh, 600px);
  background: var(--tg-navy);
  color: #fff;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 20px 36px rgba(0,0,0,0.45);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  transform: translateY(12px) scale(0.98);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}
.gethelp-panel.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

.gethelp-header {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0));
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.robot-avatar {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  color: #fff; background:
    radial-gradient(34px 34px at 28% 26%, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.12) 36%, rgba(255,255,255,0) 48%),
    linear-gradient(145deg, var(--tg-beer), var(--tg-teal) 50%, var(--tg-pine) 100%);
  box-shadow: inset 0 -6px 10px rgba(0,0,0,0.38), inset 0 6px 10px rgba(255,255,255,0.18);
}
.gethelp-header .title { font-weight: 700; font-size: 0.95rem; }

.gethelp-messages {
  padding: 12px;
  overflow: auto;
  scrollbar-width: thin;
}
.message { max-width: 88%; margin: 8px 0; padding: 8px 10px; border-radius: 12px; line-height: 1.35; font-size: 0.92rem; }
.msg-bot { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.12); }
.msg-user { margin-left: auto; background: color-mix(in srgb, var(--tg-beer) 28%, #fff 10%); border: 1px solid color-mix(in srgb, var(--tg-beer) 60%, #000 10%); }
.chat-link { color: #e8f2ff; text-decoration: underline; }

.gethelp-input-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 10px; border-top: 1px solid rgba(255,255,255,0.12); }
.gethelp-input-row input {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff; border-radius: 10px; padding: 10px 12px;
}
.gethelp-input-row input::placeholder { color: #ccd6e8; opacity: 0.85; }
.gethelp-input-row input:focus { outline: 2px solid var(--tg-teal); outline-offset: 2px; }
.send-btn {
  border: 0; border-radius: 10px; padding: 0 14px;
  background: linear-gradient(145deg, var(--tg-beer), var(--tg-teal));
  color: #fff; cursor: pointer; display: grid; place-items: center;
  box-shadow: 0 6px 14px rgba(0,0,0,0.35), inset 0 -6px 10px rgba(0,0,0,0.25), inset 0 6px 10px rgba(255,255,255,0.18);
}
.send-btn:hover { filter: brightness(1.08); }
.send-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

@media (max-width: 500px) {
  .gethelp-button { width: 56px; height: 56px; }
  .gethelp-panel { width: min(94vw, 400px); max-height: 64vh; }
}

@media (max-width: 768px) {
  .gethelp-widget { bottom: calc(100px + 12px); }
  .gethelp-panel { bottom: calc(100px + 72px); }
}

body.menu-open .gethelp-widget,
body.menu-open .gethelp-panel {
  display: none !important;
}
