/* Contextual page help — floating trigger + modal */

.page-help-fab {
  position: fixed;
  z-index: 1040;
  inset-inline-end: 1.25rem;
  bottom: 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 0.95rem;
  border: 1px solid var(--c-primary-200, #c7d2fe);
  border-radius: 999px;
  background: var(--c-surface, #fff);
  color: var(--c-primary-700, #4338ca);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background var(--t-fast, 150ms) ease, border-color var(--t-fast, 150ms) ease,
    box-shadow var(--t-fast, 150ms) ease, color var(--t-fast, 150ms) ease;
}

.page-help-fab:hover,
.page-help-fab:focus-visible {
  background: var(--c-primary-50, #eef2ff);
  border-color: var(--c-primary-300, #a5b4fc);
  color: var(--c-primary-800, #3730a3);
  box-shadow: 0 10px 28px rgba(79, 70, 229, 0.18);
}

.page-help-fab:focus-visible {
  outline: 2px solid var(--c-primary-400, #818cf8);
  outline-offset: 2px;
}

.page-help-fab .bi {
  font-size: 1.15rem;
}

.page-help-topbar-btn .bi {
  font-size: 1.05rem;
}

.shopper-shell .page-help-fab,
body:has(.shopper-bottom-nav) .page-help-fab {
  bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
}

.page-help-modal__header {
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--c-border, #e2e8f0);
  background: linear-gradient(180deg, var(--c-primary-50, #eef2ff) 0%, var(--c-surface, #fff) 100%);
}

.page-help-modal__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--c-primary-700, #4338ca);
}

.page-help-modal__lead {
  margin-top: 0.35rem;
  font-size: 0.9rem;
  color: var(--c-text-muted, #64748b);
}

.page-help-modal__body {
  padding: 1.25rem 1.5rem 1.5rem;
  background: var(--c-slate-50, #f8fafc);
}

.page-help-modal__footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--c-border, #e2e8f0);
  background: var(--c-surface, #fff);
}

.page-help-prose {
  color: var(--c-text, #0f172a);
  font-size: 0.9375rem;
  line-height: 1.65;
}

.page-help-prose > :first-child {
  margin-top: 0;
}

.page-help-prose > :last-child {
  margin-bottom: 0;
}

.page-help-prose h2,
.page-help-prose h3,
.page-help-prose h4 {
  margin: 1.25rem 0 0.5rem;
  font-weight: 700;
  color: var(--c-text-strong, #020617);
}

.page-help-prose h2 {
  font-size: 1.05rem;
}

.page-help-prose h3,
.page-help-prose h4 {
  font-size: 1rem;
}

.page-help-prose p {
  margin: 0 0 0.85rem;
}

.page-help-prose ul,
.page-help-prose ol {
  margin: 0 0 1rem;
  padding-inline-start: 1.25rem;
}

.page-help-prose li + li {
  margin-top: 0.35rem;
}

.page-help-prose .path,
.page-help-prose code {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.84em;
  padding: 0.1rem 0.4rem;
  border-radius: 0.35rem;
  background: var(--c-slate-100, #f1f5f9);
  color: var(--c-slate-800, #1e293b);
}

.page-help-prose table.data {
  width: 100%;
  margin: 0.75rem 0 1rem;
  border-collapse: collapse;
  font-size: 0.875rem;
  background: var(--c-surface, #fff);
  border: 1px solid var(--c-border, #e2e8f0);
  border-radius: var(--radius-md, 8px);
  overflow: hidden;
}

.page-help-prose table.data th,
.page-help-prose table.data td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--c-border, #e2e8f0);
  vertical-align: top;
}

.page-help-prose table.data th {
  background: var(--c-slate-100, #f1f5f9);
  font-weight: 600;
  text-align: start;
}

.page-help-prose table.data tr:last-child td {
  border-bottom: none;
}

.page-help-prose .callout {
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--c-border, #e2e8f0);
  background: var(--c-surface, #fff);
}

.page-help-prose .callout-info {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.page-help-prose .callout-tip {
  border-color: #bbf7d0;
  background: #ecfdf5;
}

.page-help-prose .callout-warn {
  border-color: #fde68a;
  background: #fffbeb;
}

.page-help-prose pre.manual-pre,
.page-help-prose pre {
  margin: 0.75rem 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md, 8px);
  background: var(--c-slate-100, #f1f5f9);
  font-size: 0.8125rem;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre-wrap;
}

.page-help-prose .flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin: 0.75rem 0 1rem;
  font-size: 0.875rem;
}

.page-help-prose .flow .arrow {
  color: var(--c-text-muted, #64748b);
}

@media (min-width: 768px) {
  body:has(.app-shell) .page-help-fab {
    display: none;
  }
}

@media (max-width: 575.98px) {
  .page-help-fab {
    inset-inline-end: 1rem;
    bottom: 1rem;
    padding: 0.75rem;
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    justify-content: center;
  }

  .page-help-modal .modal-dialog {
    margin: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-help-fab {
    transition: none;
  }
}
