/* helper.css - the RFP Helper floating widget: the "?" launcher FAB fixed at
   bottom-right and the docked chat panel it toggles. This is the Higginbotham
   Data Mapper family pattern (Census Data Tool / IRIS "CDT Helper"): a FAB,
   never a full-page slide-over or a topbar dropdown. Message-bubble content
   styling (help-log, help-bubble, composer, report link) lives in help.css;
   this file owns only the widget's own chrome. Tokens only - no hex here. */

/* ---------- launcher FAB ---------- */

.fab-help {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  box-sizing: border-box;
  flex-shrink: 0;
  background: var(--coral);
  color: #fff;
  cursor: pointer;
  z-index: 45; /* above page content and the sticky topbar (40), below modals (50) */
  box-shadow: var(--sh-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--dur-2) var(--ease), background var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}
.fab-help .ic { width: 26px; height: 26px; }

.fab-help:hover { background: var(--coral-strong); transform: translateY(-2px); }
.fab-help:active { transform: translateY(0) scale(.96); }
.fab-help:focus-visible { outline: none; box-shadow: var(--sh-3), var(--ring-coral); }

/* Dim to the hover shade while the panel is open, so the FAB reads as
   "active" instead of competing with the panel for attention. */
.fab-help.is-open { background: var(--coral-strong); }

/* ---------- docked panel ---------- */

.helper-panel {
  position: fixed;
  right: 24px;
  bottom: 92px; /* 24px + 56px FAB + 12px gap */
  width: 380px;
  max-width: calc(100vw - 32px);
  height: min(600px, 70vh);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
  overflow: hidden;
  z-index: 44; /* just under the FAB, still below modals */
  animation: helper-panel-in var(--dur-3) var(--ease);
}

@keyframes helper-panel-in {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .helper-panel { animation: none; }
}

/* Phone width: near-full-width, 16px side gutter, no horizontal scroll. */
@media (max-width: 480px) {
  .fab-help { right: 16px; bottom: 16px; }
  .helper-panel {
    right: 16px;
    left: 16px;
    width: auto;
    max-width: none;
    bottom: 84px;
    height: 70vh;
  }
}

/* ---------- head ---------- */

.helper-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--topbar-a), var(--topbar-b));
  color: var(--on-navy);
  flex: 0 0 auto;
}

.helper-panel-title { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.helper-panel-title-main { font-weight: 700; font-size: 15px; letter-spacing: -0.005em; color: var(--on-navy); }
.helper-panel-title-sub { font-size: 11.5px; font-weight: 500; color: var(--on-navy-soft); }

.helper-panel-close {
  background: var(--on-navy-fill);
  border: 1px solid var(--on-navy-line);
  color: var(--on-navy);
  width: 30px;
  height: 30px;
  padding: 0;
  box-sizing: border-box;
  flex-shrink: 0;
  font-weight: normal;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
.helper-panel-close .ic { width: 15px; height: 15px; }
.helper-panel-close:hover { background: var(--on-navy-fill-2); border-color: rgba(255,255,255,.5); }
.helper-panel-close:focus-visible { outline: none; box-shadow: var(--ring); }

/* ---------- messages area ---------- */
/* help.css's .help-log sets the flex column + gap + background; this just
   gives the docked card its scroll region and inner padding. */
.helper-panel .help-log {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 14px 14px 6px;
  scroll-behavior: smooth;
}

/* ---------- footer / composer ---------- */

.helper-panel-footer {
  flex: 0 0 auto;
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 12px 14px 14px;
}
