/* Einstiegstour (tour.js): abgedunkelter Hintergrund mit Aussparung um das
   Ziel (Spotlight) und ein Popover mit Hinweistext. Liegt über Sidebar,
   Topbar und Seiten-Modals. Auf schmalen Bildschirmen wird das Popover
   zum Bottom-Sheet. */

.tour-backdrop,
.tour-spotlight {
  position: fixed;
  z-index: 2000;
  pointer-events: none;
}

.tour-backdrop {
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

/* Die Abdunklung ist der riesige Schatten um die Aussparung; das Ziel
   bleibt darin sichtbar und klickbar (pointer-events: none). */
.tour-spotlight {
  border-radius: 14px;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.55), 0 0 0 3px #2563eb;
  transition: top 0.15s ease, left 0.15s ease, width 0.15s ease, height 0.15s ease;
}

[hidden].tour-backdrop,
[hidden].tour-spotlight {
  display: none;
}

.tour-popover {
  position: fixed;
  z-index: 2001;
  width: min(360px, calc(100vw - 24px));
  padding: 18px 20px 16px;
  border-radius: 18px;
  background: #ffffff;
  color: #111827;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.tour-popover:focus {
  outline: none;
}

.tour-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 24px;
}

.tour-progress {
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.tour-title {
  margin: 4px 0 6px;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

.tour-text {
  margin: 0;
  color: #334155;
  font-size: 0.95rem;
  line-height: 1.55;
}

.tour-hint {
  margin: 10px 0 0;
  color: #b45309;
  font-size: 0.85rem;
}

.tour-hint:empty {
  display: none;
}

.tour-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.tour-actions .tour-hint {
  margin: 0 auto 0 0;
  color: #2563eb;
  font-weight: 600;
}

.tour-button {
  padding: 9px 16px;
  border: none;
  border-radius: 12px;
  background: #2563eb;
  color: #ffffff;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.tour-button:hover {
  background: #1d4ed8;
}

.tour-button.secondary {
  background: #e2e8f0;
  color: #334155;
}

.tour-button.secondary:hover {
  background: #cbd5e1;
}

.tour-button:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

.tour-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px #bfdbfe;
}

.tour-button.tour-close {
  padding: 2px 8px;
  background: transparent;
  color: #64748b;
  font-size: 1.3rem;
  line-height: 1;
}

.tour-button.tour-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

@media (max-width: 640px) {
  .tour-popover {
    top: auto !important;
    left: 0 !important;
    right: 0;
    bottom: 0;
    width: 100%;
    border-radius: 20px 20px 0 0;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }

  /* Platz unter der Seite, damit Ziele am Seitenende über das Sheet
     gescrollt werden können (Höhe setzt tour.js). */
  body.tour-sheet-open {
    padding-bottom: calc(var(--tour-sheet-space) + 24px) !important;
  }
}
