.onboarding-lock {
  overflow: hidden;
}

.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.64);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.onboarding-overlay--contextual {
  align-items: flex-start;
  justify-content: flex-start;
}

.onboarding-overlay.is-active {
  opacity: 1;
  pointer-events: auto;
}

.onboarding-card {
  width: min(440px, 100%);
  max-height: min(680px, calc(100dvh - 36px));
  overflow: auto;
  background: #ffffff;
  color: #273142;
  border: 1px solid #e5ebf6;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.28);
  padding: 18px;
}

.onboarding-card--contextual {
  position: fixed;
  width: min(360px, calc(100vw - 24px));
  max-height: min(520px, calc(100dvh - 24px));
  z-index: 3002;
}

.onboarding-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.onboarding-step {
  margin: 0;
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 700;
}

.onboarding-title {
  margin: 3px 0 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.onboarding-close {
  flex: 0 0 auto;
}

.onboarding-text {
  margin: 0 0 14px;
  color: #52627b;
  line-height: 1.45;
}

.onboarding-progress {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 5px;
  margin-bottom: 14px;
}

.onboarding-progress span {
  height: 4px;
  border-radius: 999px;
  background: #dbe6f5;
}

.onboarding-progress span.is-active {
  background: #0d6efd;
}

.onboarding-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.onboarding-actions .btn {
  min-height: 42px;
  -webkit-user-select: none;
  user-select: none;
}

.onboarding-secondary {
  grid-column: 1 / -1;
}

.tour-highlight {
  position: relative;
  z-index: 3001;
  outline: 3px solid rgba(13, 110, 253, 0.48);
  outline-offset: 3px;
  border-radius: 10px;
  box-shadow: 0 0 0 6px rgba(13, 110, 253, 0.16);
}

.app-tour-toggle {
  margin-left: auto;
  flex-shrink: 0;
}

.app-tour-toggle + .app-theme-toggle {
  margin-left: 0;
}

.help-page {
  width: min(960px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.help-hero,
.help-section {
  background: #ffffff;
  border: 1px solid #e8edf5;
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.help-hero {
  display: grid;
  gap: 12px;
}

.help-hero h1 {
  margin: 0 0 6px;
  font-size: 1.45rem;
}

.help-hero p,
.help-section p {
  color: #52627b;
}

.help-section h2 {
  font-size: 1.05rem;
  margin: 0 0 10px;
}

.help-section h3 {
  font-size: 0.98rem;
  margin: 0 0 8px;
}

.help-section ol,
.help-section ul {
  margin-bottom: 0;
  padding-left: 1.2rem;
}

.help-grid {
  display: grid;
  gap: 10px;
}

.help-grid article {
  border: 1px solid #edf1f7;
  border-radius: 12px;
  padding: 12px;
  background: #fcfdff;
}

.help-section details {
  border-top: 1px solid #edf1f7;
  padding: 10px 0;
}

.help-section details:first-of-type {
  border-top: 0;
}

.help-section summary {
  cursor: pointer;
  font-weight: 700;
}

@media (min-width: 760px) {
  .help-hero {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .help-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

[data-theme="dark"] .onboarding-card,
[data-theme="dark"] .help-hero,
[data-theme="dark"] .help-section {
  background: #182235;
  border-color: #2f4058;
  color: #e5e7eb;
  box-shadow: none;
}

[data-theme="dark"] .onboarding-title,
[data-theme="dark"] .help-hero h1,
[data-theme="dark"] .help-section h2,
[data-theme="dark"] .help-section h3 {
  color: #f8fafc;
}

[data-theme="dark"] .onboarding-text,
[data-theme="dark"] .onboarding-step,
[data-theme="dark"] .help-hero p,
[data-theme="dark"] .help-section p {
  color: #a8b3c7;
}

[data-theme="dark"] .onboarding-progress span {
  background: #334155;
}

[data-theme="dark"] .onboarding-progress span.is-active {
  background: #60a5fa;
}

[data-theme="dark"] .help-grid article {
  background: #111827;
  border-color: #334155;
}
