/* ═══════════════════════════════════════════════════════════════════
   Help modal + onboarding tour styles
═══════════════════════════════════════════════════════════════════ */

/* Help button injected in page headers */
.help-btn {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 12px;
  padding: 7px 14px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--acc2);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.help-btn:hover {
  background: rgba(99, 102, 241, 0.18);
  border-color: var(--acc);
  transform: translateY(-1px);
}
.help-btn svg { flex-shrink: 0; }

.ph {
  position: relative;
}

/* ── HELP MODAL ───────────────────────────────────────────────────── */
.help-back {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  z-index: 9000;
}
.help-back.open { opacity: 1; visibility: visible; }

.help-modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, calc(-50% + 16px));
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  background: var(--grad-card);
  border: 1px solid var(--brd2);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  z-index: 9001;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s var(--ease), transform 0.3s var(--ease), visibility 0.25s;
}
.help-modal.open {
  transform: translate(-50%, -50%);
  opacity: 1;
  visibility: visible;
}

.help-head {
  display: flex; align-items: center; gap: 14px;
  padding: 22px 26px 18px;
  border-bottom: 1px solid var(--brd);
}
.help-ic {
  width: 40px; height: 40px;
  border-radius: 11px;
  background: var(--grad-soft);
  border: 1px solid var(--brd2);
  display: flex; align-items: center; justify-content: center;
  color: var(--acc2);
  flex-shrink: 0;
}
.help-head h3 {
  flex: 1;
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  margin: 0;
}
.help-close {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--surf);
  border: 1px solid var(--brd);
  color: var(--txt2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  flex-shrink: 0;
}
.help-close:hover {
  background: var(--surf2);
  color: var(--txt);
}

.help-body {
  padding: 22px 26px 26px;
  overflow-y: auto;
  font-size: 0.94rem;
  line-height: 1.65;
  color: var(--txt2);
}
.help-body p { margin-bottom: 12px; color: var(--txt2); }
.help-body p strong { color: var(--txt); }
.help-body ul, .help-body ol {
  margin: 8px 0 14px;
  padding-left: 22px;
}
.help-body li {
  margin-bottom: 8px;
  color: var(--txt2);
}
.help-body li strong { color: var(--txt); font-weight: 700; }
.help-body a {
  color: var(--acc2);
  text-decoration: underline;
  text-decoration-color: rgba(99, 102, 241, 0.4);
}
.help-body a:hover { color: var(--acc3); text-decoration-color: var(--acc); }
.help-body code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
  background: rgba(99, 102, 241, 0.1);
  color: var(--acc2);
  padding: 2px 7px;
  border-radius: 5px;
}
.help-body em { font-style: normal; font-weight: 700; color: var(--cyn2); }

/* Mobile responsive */
@media (max-width: 600px) {
  .help-modal {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 24px);
    border-radius: 18px;
  }
  .help-head { padding: 18px 18px 14px; }
  .help-body { padding: 18px; font-size: 0.9rem; }
  .help-head h3 { font-size: 1.05rem; }
}

/* ═══════════════════════════════════════════════════════════════════
   ONBOARDING TOUR
═══════════════════════════════════════════════════════════════════ */
.tour-back {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.32);
  z-index: 9100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}
.tour-back.open { opacity: 1; visibility: visible; }

.tour-spotlight {
  position: fixed;
  z-index: 9101;
  border-radius: 12px;
  box-shadow:
    0 0 0 9999px rgba(0, 0, 0, 0.38),
    0 0 0 4px rgba(99, 102, 241, 0.85),
    0 0 35px rgba(99, 102, 241, 0.55);
  pointer-events: none;
  transition: all 0.4s var(--ease);
}

.tour-card {
  position: fixed;
  z-index: 9102;
  width: min(380px, calc(100vw - 32px));
  background: var(--grad-card);
  border: 1px solid var(--brd2);
  border-radius: var(--rl);
  box-shadow: var(--shadow-lg);
  padding: 20px 22px;
  transition: top 0.4s var(--ease), left 0.4s var(--ease), opacity 0.3s;
}

.tour-step {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--acc2);
  margin-bottom: 6px;
}
.tour-card h4 {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.015em;
}
.tour-card p {
  color: var(--txt2);
  font-size: 0.9rem;
  line-height: 1.55;
  margin-bottom: 16px;
}
.tour-card p strong { color: var(--txt); }
.tour-card p code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
  background: rgba(99, 102, 241, 0.1);
  color: var(--acc2);
  padding: 1px 6px;
  border-radius: 4px;
}

.tour-progress {
  display: flex; gap: 5px;
  margin-bottom: 16px;
}
.tour-progress span {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  transition: background 0.3s;
}
.tour-progress span.done { background: var(--acc); }
.tour-progress span.current { background: var(--acc2); }

.tour-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.tour-skip {
  background: transparent;
  border: none;
  color: var(--txt3);
  font-size: 0.84rem;
  font-family: inherit;
  cursor: pointer;
  padding: 6px 0;
  transition: color 0.2s;
}
.tour-skip:hover { color: var(--txt2); }

.tour-btn-group { display: flex; gap: 8px; }
.tour-back-btn {
  background: var(--surf);
  border: 1px solid var(--brd);
  color: var(--txt2);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.tour-back-btn:hover {
  background: var(--surf2);
  color: var(--txt);
}
.tour-next-btn {
  background: var(--grad-primary);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.32);
  transition: all 0.2s;
}
.tour-next-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(99, 102, 241, 0.45);
}

/* Welcome / final card style (centered, no spotlight) */
.tour-card.center {
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  width: min(440px, calc(100vw - 32px));
  padding: 30px 28px;
}
.tour-card.center .tour-emoji {
  font-size: 2.6rem;
  margin-bottom: 12px;
  display: block;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.tour-card.center h4 { font-size: 1.4rem; margin-bottom: 10px; }
.tour-card.center .tour-actions { justify-content: center; flex-direction: column; gap: 14px; }
.tour-card.center .tour-skip { order: 2; }

@media (max-width: 600px) {
  .tour-card { padding: 18px; width: calc(100vw - 16px); }
  .tour-card h4 { font-size: 1rem; }
  .tour-card p { font-size: 0.86rem; }
}
