/* Sys Panda — app tour. Auth screens never show the overlay. */

body.sp-auth-body .tour-backdrop,
body.sp-auth-body .sp-tour-veil,
body.sp-auth-body .popover.tour,
body.sp-reg-body .tour-backdrop,
body.sp-reg-body .sp-tour-veil,
body.sp-reg-body .popover.tour {
  display: none !important;
  pointer-events: none !important;
}

/* Safety net if an older script still injects bootstrap-tour slices.
   Those slices used position:absolute and document height (thousands of px). */
.tour-backdrop {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: auto !important;
  bottom: auto !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  z-index: 1100 !important;
}

.tour-backdrop.top,
.tour-backdrop.left,
.tour-backdrop.right {
  display: none !important;
}

.sp-tour-veil {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-height: 100vh;
  z-index: 1100;
  background: rgba(15, 15, 15, 0.48);
  pointer-events: auto;
}

html[data-theme="dark"] .sp-tour-veil,
html.theme-dark .sp-tour-veil {
  background: rgba(0, 0, 0, 0.62);
}

.sp-tour-target {
  outline: 2px solid var(--sp-orange, #FF4500) !important;
  outline-offset: 3px;
  border-radius: 8px;
}

.popover.tour,
.popover.tour.sp-tour {
  position: fixed !important;
  font-family: var(--sp-font, "IBM Plex Sans Arabic", "IBM Plex Sans", sans-serif) !important;
  z-index: 1110 !important;
  max-width: min(360px, calc(100vw - 24px)) !important;
  min-width: min(280px, calc(100vw - 24px));
  width: auto;
  background: var(--sp-glass-bg, rgba(255, 255, 255, 0.9)) !important;
  color: var(--sp-ink, #111827) !important;
  border: 1px solid var(--sp-border, #E5E7EB) !important;
  border-radius: var(--sp-radius, 12px) !important;
  box-shadow: var(--sp-shadow-lg, 0 16px 40px rgba(17, 24, 39, 0.12)) !important;
  backdrop-filter: blur(var(--sp-glass-blur, 16px));
  -webkit-backdrop-filter: blur(var(--sp-glass-blur, 16px));
  overflow: visible;
}

html[data-theme="dark"] .popover.tour,
html[data-theme="dark"] .popover.tour.sp-tour,
html.theme-dark .popover.tour,
html.theme-dark .popover.tour.sp-tour {
  background: var(--sp-glass, rgba(23, 23, 23, 0.92)) !important;
  color: var(--sp-ink, #f3f4f6) !important;
  border-color: var(--sp-glass-border, rgba(255, 255, 255, 0.12)) !important;
  box-shadow: var(--sp-shadow-lg, 0 16px 40px rgba(0, 0, 0, 0.45)) !important;
}

.popover.tour > .arrow,
.popover.tour.sp-tour > .arrow {
  display: none;
}

html[dir="rtl"] .popover.tour,
html[dir="rtl"] .popover.tour.sp-tour {
  direction: rtl;
  text-align: right;
}

.popover.tour .sp-tour-progress {
  direction: ltr;
  unicode-bidi: isolate;
  text-align: right;
  padding: 14px 16px 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.4;
  color: var(--sp-orange, #FF4500);
}

html[dir="ltr"] .popover.tour .sp-tour-progress {
  text-align: left;
}

.popover.tour .popover-title,
.popover.tour.sp-tour .popover-title {
  margin: 0;
  padding: 4px 16px 0;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0;
  color: inherit !important;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -0.015em;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}

.popover.tour .popover-content,
.popover.tour.sp-tour .popover-content {
  padding: 8px 16px 2px;
  color: var(--sp-muted, #6B7280);
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.65;
  white-space: normal;
  overflow: visible;
  word-break: break-word;
}

html[data-theme="dark"] .popover.tour .popover-content,
html.theme-dark .popover.tour .popover-content {
  color: var(--sp-muted, #9ca3af);
}

.popover.tour .popover-navigation,
.popover.tour.sp-tour .sp-tour-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  float: none;
  overflow: visible;
  padding: 12px 16px 14px;
}

.popover.tour .sp-tour-nav-main {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-inline-start: auto;
}

.popover.tour .popover-navigation [data-role="prev"],
.popover.tour .popover-navigation [data-role="next"],
.popover.tour .popover-navigation [data-role="end"] {
  float: none !important;
}

.popover.tour .sp-tour-btn {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px !important;
  height: auto !important;
  padding: 8px 16px !important;
  margin: 0;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--sp-ink, #111827);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
  white-space: nowrap;
  cursor: pointer;
}

.popover.tour .sp-tour-btn-primary,
.popover.tour.is-last .sp-tour-btn[data-role="end"] {
  background: var(--sp-orange, #FF4500);
  border-color: var(--sp-orange-deep, #E03E00);
  color: #fff;
}

.popover.tour .sp-tour-btn-primary:hover,
.popover.tour.is-last .sp-tour-btn[data-role="end"]:hover {
  background: var(--sp-orange-deep, #E03E00);
  color: #fff;
}

.popover.tour .sp-tour-btn-secondary {
  background: var(--sp-surface-solid, #fff);
  border-color: var(--sp-border, #E5E7EB);
  color: var(--sp-ink, #111827);
}

html[data-theme="dark"] .popover.tour .sp-tour-btn-secondary,
html.theme-dark .popover.tour .sp-tour-btn-secondary {
  background: var(--sp-surface-2, #1f1f1f);
  border-color: var(--sp-border, rgba(255, 255, 255, 0.12));
  color: var(--sp-ink, #f3f4f6);
}

.popover.tour .sp-tour-btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--sp-muted, #6B7280);
  padding-inline: 8px;
}

.popover.tour .sp-tour-btn:focus-visible {
  outline: 2px solid var(--sp-orange, #FF4500);
  outline-offset: 2px;
}

.popover.tour .sp-tour-btn[data-role="prev"].disabled,
.popover.tour .sp-tour-btn[data-role="prev"]:disabled,
.popover.tour .sp-tour-btn[data-role="next"].disabled,
.popover.tour .sp-tour-btn[data-role="next"]:disabled,
.popover.tour.is-last .sp-tour-btn[data-role="next"] {
  display: none !important;
}

.popover.tour.sp-tour-centered > .arrow {
  display: none;
}
