/* ── btn-help pill ──────────────────────────────────────────── */
.btn-help {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--brand-1, #4f46e5);
  background: transparent;
  color: var(--brand-1, #4f46e5);
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.4;
  vertical-align: middle;
  flex-shrink: 0;
  transition: background .15s, color .15s, transform .15s;
  white-space: nowrap;
}
.btn-help i { font-size: .8rem; }
.btn-help:hover {
  background: var(--brand-1, #4f46e5);
  color: #fff;
  transform: scale(1.04);
}
[data-theme="dark"] .btn-help {
  border-color: rgba(255,255,255,0.85);
  color: rgba(255,255,255,0.85);
}
[data-theme="dark"] .btn-help:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border-color: #fff;
}

/* overlay */
#helpModalOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.45);
  backdrop-filter: blur(3px);
  z-index: 1000000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
#helpModalOverlay.active { display: flex; }
#helpModalBox {
  background: var(--surface, #fff);
  border-radius: 16px;
  border: 1px solid var(--border-1, #e2e8f0);
  box-shadow: 0 24px 64px rgba(15,23,42,.18);
  width: 100%;
  max-width: 640px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#helpModalHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border-1, #e2e8f0);
  flex-shrink: 0;
}
#helpModalHeader h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-1, #0f172a);
  display: flex;
  align-items: center;
  gap: 8px;
}
#helpModalHeader h3 i { color: var(--brand-1, #4f46e5); opacity: .8; }
#helpModalClose {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3, #94a3b8);
  font-size: 1.25rem;
  line-height: 1;
  padding: 4px;
  border-radius: 6px;
  transition: color .15s, background .15s;
}
#helpModalClose:hover { color: var(--text-1, #0f172a); background: var(--surface-2, #f1f5f9); }
#helpModalContent {
  overflow-y: auto;
  padding: 20px 22px 24px;
  flex: 1;
}
#helpModalSpinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
  color: var(--text-3, #94a3b8);
  gap: 10px;
  font-size: .9rem;
}
#helpModalSpinner .spinner-border { width: 1.4rem; height: 1.4rem; border-width: 2px; }
.help-modal-body h4 { font-size: 1rem; font-weight: 700; margin: 0 0 4px; color: var(--text-1, #0f172a); }
.help-modal-body h5 { font-size: .88rem; font-weight: 600; margin: 0 0 8px; color: var(--text-1, #0f172a); display: flex; align-items: center; gap: 6px; }
.help-modal-body h5 i { color: var(--brand-1, #4f46e5); opacity: .7; }
.help-modal-body p { font-size: .85rem; color: var(--text-2, #475569); margin: 0 0 8px; line-height: 1.55; }
.help-modal-body ul { font-size: .85rem; color: var(--text-2, #475569); padding-left: 18px; margin: 0 0 8px; line-height: 1.6; }
.help-modal-body ul li { margin-bottom: 4px; }
.help-modal-body a { color: var(--brand-1, #4f46e5); text-decoration: none; font-size: .8rem; }
.help-modal-body a:hover { text-decoration: underline; }
.help-note { font-size: .78rem !important; opacity: .65; }
.help-section-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 4px; }
.help-section-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--brand-1-soft, rgba(79,70,229,.1));
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 1.1rem; color: var(--brand-1, #4f46e5);
}
.help-divider { height: 1px; background: var(--border-1, #e2e8f0); margin: 14px 0; }
.help-status-flow { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: .8rem; }
.help-status-flow i.bi-arrow-right { color: var(--text-3, #94a3b8); font-size: .75rem; }
[data-theme="dark"] #helpModalBox { background: var(--surface, #1e293b); border-color: var(--border-1, #334155); }
[data-theme="dark"] .help-section-icon { background: rgba(79,70,229,.2); }

/* ── dark theme text fixes ────────────────────────────────── */
[data-theme="dark"] .help-modal-body h4,
[data-theme="dark"] .help-modal-body h5 {
  color: rgba(255,255,255,0.92);
}
[data-theme="dark"] .help-modal-body h5 i {
  color: var(--brand-1, #818cf8);
  opacity: .85;
}
[data-theme="dark"] .help-modal-body p,
[data-theme="dark"] .help-modal-body ul {
  color: rgba(255,255,255,0.70);
}
[data-theme="dark"] .help-modal-body ul li strong {
  color: rgba(255,255,255,0.88);
}
[data-theme="dark"] .help-modal-body a {
  color: #818cf8;
}
[data-theme="dark"] #helpModalHeader h3 {
  color: rgba(255,255,255,0.92);
}
[data-theme="dark"] #helpModalClose:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}
[data-theme="dark"] .help-divider {
  background: rgba(255,255,255,0.10);
}
[data-theme="dark"] .help-status-flow i.bi-arrow-right {
  color: rgba(255,255,255,0.35);
}
[data-theme="dark"] .help-note {
  color: rgba(255,255,255,0.45);
}
