/* ===============================
   GUIDED TOURS (js/tours.js)
   =============================== */

/* Prompt offering a tour — sits above the section, never blocks it */
/* Positioned by js/tours.js: centred over the content area, just below the
   section header. Falls back to the top-centre of the window. */
.tour-prompt {
  position: fixed;
  top: 80px;
  left: 50%;
  z-index: 950;
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 420px;
  padding: 12px 14px;
  border: 1px solid var(--accent-muted);
  border-radius: 6px;
  background: var(--bg-panel);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--text-secondary);
}

.tour-prompt-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tour-prompt-text strong {
  color: var(--text-primary);
}

.tour-prompt-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* Running tour */
.tour-layer {
  position: fixed;
  inset: 0;
  z-index: 960;
  pointer-events: none;
}

.tour-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  pointer-events: auto;
}

/* Ring around the control a step is about, cut out of the backdrop */
.tour-spotlight {
  position: absolute;
  border: 2px solid var(--accent);
  border-radius: 6px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
  transition: top 0.18s ease, left 0.18s ease, width 0.18s ease, height 0.18s ease;
  pointer-events: none;
}

.tour-layer .tour-backdrop {
  /* The spotlight's own shadow provides the dimming */
  background: transparent;
}

.tour-popover {
  position: absolute;
  width: 320px;
  max-width: calc(100vw - 24px);
  padding: 14px 16px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-panel);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  font-family: var(--font-ui);
  pointer-events: auto;
}

.tour-popover.is-centred {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.tour-close {
  position: absolute;
  top: 6px;
  right: 8px;
  padding: 2px 4px;
  border: 0;
  background: none;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.tour-close:hover {
  color: var(--text-primary);
}

.tour-title {
  margin-right: 18px;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--text-primary);
}

.tour-body {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.tour-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.tour-count {
  font-size: 11px;
  letter-spacing: 0.4px;
  color: var(--text-secondary);
  opacity: 0.8;
}

.tour-nav {
  display: flex;
  gap: 6px;
}

.tour-nav .btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Replay link in the contextual help panel */
.ctx-help-tour {
  margin-bottom: 14px;
}

@media (prefers-reduced-motion: reduce) {
  .tour-spotlight { transition: none; }
}

@media print {
  .tour-layer,
  .tour-prompt { display: none !important; }
}