/* Shared RTL, keyboard-accessible spotlight tours. Kept separate from page styles. */
.guided-tour, .guided-tour *, .tour-launcher { box-sizing: border-box; }
.tour-launcher {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: 38px; min-height: 38px; padding: 7px; border: 1px solid var(--border-color, #ddd);
  border-radius: 50%; background: var(--bg-primary, #fff); color: var(--text-primary, #26232b);
  font: 600 12px/1.6 'Vazirmatn', sans-serif; cursor: pointer; flex-shrink: 0;
}
.tour-launcher[hidden] { display: none !important; }
.tour-launcher:hover { border-color: var(--melon, #e8614d); color: var(--melon-dark, #b13c2c); }
.tour-launcher--floating {
  position: fixed; left: 18px; bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  z-index: 105; box-shadow: 0 4px 20px #0002;
}
.tour-launcher i { font-size: 17px; }
.guided-tour {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  padding: 0; margin: 0; border: 0; background: transparent; overflow: hidden;
  color: var(--text-primary, #26232b); direction: rtl; font-family: 'Vazirmatn', sans-serif;
}
.guided-tour::backdrop { background: transparent; }
.tour-shade { position: absolute; background: rgba(15, 18, 27, .7); }
.tour-spotlight {
  position: absolute; border: 2px solid #ffba91; border-radius: 10px;
  box-shadow: 0 0 0 3px #fff5, 0 0 24px #ffb48b44; pointer-events: none;
}
.tour-card {
  position: absolute; width: min(360px, calc(100% - 24px)); padding: 20px;
  background: var(--bg-primary, #fff); border: 1px solid var(--border-color, #ddd);
  border-radius: 18px; box-shadow: 0 14px 60px #0005; overflow-y: auto;
  overscroll-behavior: contain; text-align: right;
}
.tour-card:focus { outline: none; }
.tour-eyebrow { color: var(--text-secondary, #666); font-size: 11px; padding-left: 28px; margin-bottom: 10px; }
.tour-title { font-size: 17px; line-height: 1.8; font-weight: 800; margin: 0 0 8px; }
.tour-description { font-size: 13px; line-height: 2; margin: 0 0 18px; color: var(--text-secondary, #555); }
.tour-close {
  position: absolute; top: 12px; left: 12px; width: 32px; height: 32px; border: 0;
  border-radius: 50%; background: var(--bg-secondary, #f4f4f4); color: inherit;
  font: 22px/1 sans-serif; cursor: pointer;
}
.tour-progress { height: 4px; border-radius: 8px; background: var(--border-color, #eee); margin-bottom: 18px; overflow: hidden; }
.tour-progress-fill { display: block; height: 100%; background: var(--melon, #e8614d); border-radius: inherit; }
.tour-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tour-button {
  min-height: 40px; border: 1px solid var(--border-color, #ddd); border-radius: 10px;
  padding: 7px 14px; font: 600 12px/1.7 'Vazirmatn', sans-serif; cursor: pointer;
  background: var(--bg-secondary, #f5f5f5); color: var(--text-primary, #26232b);
}
.tour-next { background: var(--melon-dark, #bc4030); border-color: transparent; color: white; }
.tour-skip { margin-left: auto; border-color: transparent; background: transparent; padding-inline: 2px; color: var(--text-secondary, #666); }
.tour-button:disabled { opacity: .4; cursor: default; }
.tour-button:focus-visible, .tour-close:focus-visible, .tour-launcher:focus-visible { outline: 3px solid var(--melon, #e8614d); outline-offset: 3px; }
html.tour-is-open { overflow: hidden !important; scroll-behavior: auto !important; }
html.tour-is-open body { overflow: hidden !important; }
html.tour-is-open .mb-player__controls { opacity: 1 !important; pointer-events: auto !important; transform: none !important; }
@media (max-width: 767px) {
  .tour-launcher--floating { left: 12px; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  .tour-card { padding: 16px; border-radius: 16px; }
  .tour-title { font-size: 16px; }
  .reader-toolbar .tour-launcher { width: 30px; min-height: 30px; padding: 0; }
  .reader-toolbar .tour-launcher span, .ai-chat-topbar .tour-launcher span { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .tour-card { animation: tour-appear .16s ease-out; }
  @keyframes tour-appear { from { opacity: 0; } to { opacity: 1; } }
}
