/* 🆘 «Помощь» — кнопка в шапке и экран-чат с агентом поддержки. */

.sup-btn {
  position: relative; flex: 0 0 auto;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; padding: 0; cursor: pointer;
  background: linear-gradient(145deg, rgba(45, 212, 191, .22), rgba(99, 102, 241, .22)), var(--bg3);
  border: 1px solid rgba(45, 212, 191, .45);
  color: var(--accent);
  box-shadow: 0 2px 10px rgba(45, 212, 191, .18);
  -webkit-tap-highlight-color: transparent;
}
.sup-btn:active { transform: scale(.94); }
.sup-btn svg { display: block; }
.sup-online {
  position: absolute; right: 1px; bottom: 1px; width: 11px; height: 11px; border-radius: 50%;
  background: #22c55e; border: 2px solid var(--bg);
  box-shadow: 0 0 6px rgba(34, 197, 94, .8);
}
.sup-alert {
  position: absolute; right: -2px; top: -2px; width: 13px; height: 13px; border-radius: 50%;
  background: #ef4444; border: 2px solid var(--bg);
  box-shadow: 0 0 8px rgba(239, 68, 68, .85);
  animation: supPulse 1.4s ease-in-out infinite;
}
.sup-alert[hidden] { display: none; }
@keyframes supPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.22); } }

/* в чате с ИИ шапка другая — кнопка там не нужна */
#genScreen.chat-mode .sup-btn { display: none; }

/* ── экран ─────────────────────────────────────────────────────────────── */
body.sup-open .bottom-nav { display: none !important; }
.sup-screen {
  position: fixed; top: 0; left: 0; right: 0; bottom: auto; height: 100vh; z-index: 450;
  display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
}
.sup-screen[hidden] { display: none; }

.sup-top {
  display: flex; align-items: center; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 12px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(45, 212, 191, .10), transparent);
}
.sup-back {
  width: 44px; height: 44px; border-radius: 14px; flex: 0 0 auto; cursor: pointer;
  background: var(--bg3); border: 1px solid var(--line); color: var(--text); font-size: 24px;
}
.sup-ava {
  position: relative; flex: 0 0 auto; width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center; color: #06221e;
  background: linear-gradient(135deg, var(--accent), #6366f1);
}
.sup-ava svg { width: 34px; height: 34px; }
.sup-ava .sup-online { width: 15px; height: 15px; right: 0; bottom: 0; }
.sup-hello-k { font-size: 14px; color: var(--muted); font-weight: 600; }
.sup-hello-t { font-size: 20px; font-weight: 800; line-height: 1.15; }

.sup-thread {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 12px;
}
.sup-msg { max-width: 92%; border-radius: 20px; padding: 13px 16px; font-size: 18px; line-height: 1.4; word-wrap: break-word; overflow-wrap: anywhere; }
.sup-agent { align-self: flex-start; background: var(--bg3); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.sup-user { align-self: flex-end; background: linear-gradient(135deg, #0d9488, #4f46e5); color: #fff; border-bottom-right-radius: 6px; }
.sup-who { font-size: 13px; font-weight: 700; color: var(--accent); margin-bottom: 4px; letter-spacing: .02em; }
.sup-owner { border-color: rgba(250, 204, 21, .55); background: rgba(250, 204, 21, .08); }
.sup-owner .sup-who { color: #facc15; }
.sup-agent.is-note { border-color: rgba(250, 204, 21, .45); }
.sup-agent.is-err { border-color: rgba(240, 110, 80, .6); background: rgba(240, 110, 80, .10); }
.sup-done { margin-top: 10px; padding-top: 10px; border-top: 1px dashed rgba(255, 255, 255, .18); font-size: 17px; font-weight: 700; display: flex; flex-direction: column; gap: 6px; }
.sup-typing { display: flex; align-items: center; gap: 10px; color: #d4d6de; }

.sup-quick { display: flex; flex-direction: column; gap: 10px; padding: 6px 14px 10px; }
.sup-quick[hidden] { display: none; }
.sup-chip {
  width: 100%; text-align: left; cursor: pointer;
  padding: 15px 18px; border-radius: 16px; font-size: 18px; font-weight: 700;
  background: var(--bg3); color: var(--text); border: 1px solid rgba(45, 212, 191, .4);
}
.sup-chip:active { background: rgba(45, 212, 191, .18); }

.sup-compose {
  display: flex; flex-direction: column; gap: 10px;
  padding: 10px 14px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line); background: var(--bg2);
}
.sup-input {
  width: 100%; min-height: 76px; max-height: 160px; resize: none; display: block;
  padding: 13px 14px; border-radius: 16px; font-size: 18px; line-height: 1.35; font-family: inherit;
  background: var(--bg3); color: var(--text); border: 1px solid var(--line); outline: none;
}
.sup-input:focus { border-color: var(--accent); }
.sup-send {
  width: 100%; padding: 15px; border-radius: 16px; border: 0; cursor: pointer;
  font-size: 19px; font-weight: 800; color: #04201c;
  background: linear-gradient(135deg, var(--accent), #6ee7d8);
}
.sup-send:disabled { opacity: .55; }
