/* Feature: Ask the helper (AI chat), and its small round button on every customer screen.
   Owner: Jose
   Uses the Clarity variables only. Big text and big buttons, like a phone's chat app:
   the helper on the left in white, the senior on the right in dark red. */

.hp-list { display: grid; gap: .875rem; margin: 1.25rem 0; padding: 0; list-style: none; }
.hp-msg {
  max-width: 88%; padding: .875rem 1.125rem; border-radius: 20px;
  font-size: 1.125rem; line-height: 1.5; scroll-margin-top: 5.5rem;   /* scrolled-to messages clear the top bar */
}
.hp-msg p { margin: 0; }
.hp-msg--bot { justify-self: start; background: var(--surface); box-shadow: var(--shadow); border-bottom-left-radius: 6px; }
.hp-msg--user {
  justify-self: end; background: var(--red-dark); color: var(--white); border-bottom-right-radius: 6px;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.hp-msg--urgent { border: 2px solid var(--red); }

/* The buttons under a reply: one per row, the width of the bubble */
.hp-actions { display: grid; gap: .5rem; margin-top: .875rem; }
.hp-action { justify-content: flex-start; text-align: left; }

/* "Thinking...": three dots that pulse, then the words */
.hp-thinking { display: flex; align-items: center; gap: .75rem; color: var(--muted); }
.hp-dots { display: inline-flex; gap: .25rem; }
.hp-dots span { width: .5rem; height: .5rem; border-radius: 50%; background: var(--red); animation: hp-pulse 1.2s ease-in-out infinite; }
.hp-dots span:nth-child(2) { animation-delay: .2s; }
.hp-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes hp-pulse { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .hp-dots span { animation: none; opacity: .6; } }

.hp-chips { margin: 0 0 1rem; }
.hp-chips .chip { min-height: 48px; font-size: 1.0625rem; }

/* Writing a message: the box and a big Send button side by side */
.hp-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; align-items: end; }
.hp-form textarea {
  width: 100%; min-height: 3.75rem; box-sizing: border-box; padding: .75rem 1rem;
  font: inherit; font-size: 1.125rem; color: var(--text); background: var(--surface);
  border: 2px solid var(--field-border); border-radius: 16px; resize: vertical;
}
.hp-send { min-height: 3.75rem; }

.hp-note { display: flex; align-items: flex-start; gap: .5rem; margin: .875rem 0 0; color: var(--muted); font-size: 1rem; }
.hp-note .icon { flex: none; width: 1.25rem; height: 1.25rem; margin-top: .125rem; }

/* The "AI helper" button: a small pill at the bottom right of every customer screen, like the
   chat button on most websites. On a phone it sits just above the bottom bar. It hides on
   stressful screens with the "Call OCBC" bar (one thing to do there) and while reading aloud
   (the Stop button takes that spot). */
.hp-fab {
  position: fixed; right: 1rem; bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px)); z-index: 18;
  display: inline-flex; align-items: center; gap: .5rem; min-height: 3.25rem; padding: .375rem 1rem .375rem .375rem;
  background: var(--surface); color: var(--red-dark); font-size: 1rem; font-weight: 800; text-decoration: none;
  border: 2px solid var(--red); border-radius: 999px; box-shadow: 0 8px 24px rgba(54, 59, 64, .18);
  transition: transform .15s;
}
.hp-fab-icon { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%; background: var(--red); color: var(--white); }
.hp-fab-icon .icon { width: 1.375rem; height: 1.375rem; }
.hp-fab:active { transform: scale(.96); }
@media (hover: hover) { .hp-fab:hover { transform: translateY(-2px); } }
.shell-main:has(.hp-fab) .cust-main { padding-bottom: 6rem; }   /* the page can scroll out from under it */
.is-reading .hp-fab, body:has(.call-bar) .hp-fab { display: none; }
/* While typing, it would sit on top of the box (and the phone's keyboard is up anyway) */
body:has(textarea:focus, input:focus) .hp-fab { display: none; }
@media (max-width: 37.49rem) {
  .hp-fab { bottom: calc(5.75rem + env(safe-area-inset-bottom, 0px)); }
}
