/* ===== EZBudget guided tour (spotlight) — stream beam + empowerment theme ===== */
:root {
  --ezb-stream-cyan: #00BCD4;
  --ezb-stream-cyan-bright: #00d4ff;
  --ezb-stream-blue: #1E90FF;
  --ezb-stream-blue-deep: #007FFF;
  --ezb-stream-gradient: linear-gradient(90deg, #00BCD4 0%, #00d4ff 25%, #1E90FF 50%, #007FFF 75%, #00BCD4 100%);
  --ezb-empowerment-gradient: linear-gradient(135deg, #6366f1 0%, #0ea5e9 50%, #10b981 100%);
}

#ezb-tutorial-root {
  position: fixed;
  inset: 0;
  z-index: 75;
  pointer-events: none;
}
.ezb-tutorial-shade {
  position: fixed;
  display: none;
  background: rgba(0, 0, 0, 0.72);
  pointer-events: auto;
  z-index: 1;
}
body[data-theme="light"] .ezb-tutorial-shade {
  background: rgba(15, 23, 42, 0.52);
}
#ezb-tutorial-card {
  position: fixed;
  z-index: 90;
  max-width: min(24rem, calc(100vw - 2rem));
  padding: 0;
  pointer-events: auto;
  overflow: visible;
  --ezb-tutorial-arrow: var(--ezb-stream-cyan);
  border: 1px solid rgba(0, 188, 212, 0.35);
  border-radius: 1rem;
  background: #1e293b;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35), 0 0 24px rgba(0, 188, 212, 0.08);
  color: #e2e8f0;
}
body[data-theme="light"] #ezb-tutorial-card {
  --ezb-tutorial-arrow: var(--ezb-stream-blue);
  background: #ffffff;
  border-color: rgba(0, 188, 212, 0.35);
  color: #0f172a;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12), 0 0 20px rgba(0, 188, 212, 0.1);
}
#ezb-tutorial-card:not(.ezb-tutorial-card--center) {
  transition: top 0.25s ease, left 0.25s ease;
}
#ezb-tutorial-card.ezb-tutorial-card--center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
#ezb-tutorial-card.ezb-tutorial-card--welcome,
#ezb-tutorial-card.ezb-tutorial-card--finish {
  max-width: min(36rem, calc(100vw - 1.25rem));
  width: min(36rem, calc(100vw - 1.25rem));
}
#ezb-tutorial-card.ezb-tutorial-card--docked {
  width: auto;
  max-width: none;
}
#ezb-tutorial-card .ezb-tutorial-card-body {
  padding: 1.25rem 1.35rem 1.1rem;
  position: relative;
  z-index: 1;
  border-radius: inherit;
  overflow-y: auto;
  max-height: min(85dvh, calc(100dvh - 2rem));
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
#ezb-tutorial-card #ezb-tutorial-title { color: inherit; }
#ezb-tutorial-card #ezb-tutorial-body { color: #94a3b8; }
body[data-theme="light"] #ezb-tutorial-card #ezb-tutorial-body { color: #475569; }
#ezb-tutorial-card[data-placement]::after {
  content: "";
  position: absolute;
  left: var(--arrow-left, 50%);
  margin-left: -8px;
  border-width: 8px;
  border-style: solid;
  pointer-events: none;
  z-index: 2;
}
#ezb-tutorial-card[data-placement="bottom"]::after {
  bottom: 100%;
  border-color: transparent transparent var(--ezb-tutorial-arrow) transparent;
}
#ezb-tutorial-card[data-placement="top"]::after {
  top: 100%;
  border-color: var(--ezb-tutorial-arrow) transparent transparent transparent;
}
#ezb-tutorial-card[data-placement="left"]::after {
  left: -16px;
  top: var(--arrow-top, 2.5rem);
  margin-left: 0;
  border-color: transparent var(--ezb-tutorial-arrow) transparent transparent;
}
#ezb-tutorial-card[data-placement="right"]::after {
  right: -16px;
  left: auto;
  top: var(--arrow-top, 2.5rem);
  margin-left: 0;
  border-color: transparent transparent transparent var(--ezb-tutorial-arrow);
}
.ezb-tutorial-progress {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}
.ezb-tutorial-bubbles {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.ezb-tutorial-bubble {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: rgba(0, 188, 212, 0.22);
  border: 1px solid rgba(0, 212, 255, 0.4);
  padding: 0;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.ezb-tutorial-bubble:hover:not(.is-active) {
  background: rgba(0, 188, 212, 0.38);
  border-color: rgba(0, 212, 255, 0.65);
  transform: scale(1.12);
}
.ezb-tutorial-bubble.is-active {
  width: 1.35rem;
  background: var(--ezb-stream-gradient);
  background-size: 300% 100%;
  animation: streamFlow 4s linear infinite;
  border-color: transparent;
  box-shadow: 0 0 10px rgba(0, 188, 212, 0.5);
}
.ezb-tutorial-bubble.is-done {
  background: rgba(0, 188, 212, 0.55);
  border-color: rgba(0, 212, 255, 0.65);
}
.ezb-tutorial-step-label {
  margin-left: auto;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}
.ezb-tutorial-section-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ezb-stream-cyan-bright);
  margin: 0.15rem 0 0.65rem;
}
body[data-theme="light"] .ezb-tutorial-section-label {
  color: var(--ezb-stream-blue);
}
.ezb-tutorial-btn {
  font-size: 0.875rem;
  line-height: 1.25rem;
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}
.ezb-tutorial-btn.hidden {
  display: none !important;
}
.ezb-tutorial-btn-ghost {
  background: transparent;
  color: #94a3b8;
}
.ezb-tutorial-btn-ghost:hover {
  background: rgba(0, 188, 212, 0.1);
  color: var(--ezb-stream-cyan-bright);
}
body[data-theme="light"] .ezb-tutorial-btn-ghost:hover {
  background: rgba(0, 188, 212, 0.08);
  color: var(--ezb-stream-blue-deep);
}
.ezb-tutorial-btn-primary {
  color: #fff;
  font-weight: 600;
  border: none;
}
body.ezb-tutorial-active .ezb-tutorial-interactive-zone,
body.ezb-tutorial-active .ezb-tutorial-interactive-zone * {
  pointer-events: auto;
}
body.ezb-tutorial-active .ezb-tutorial-interactive-zone {
  position: relative;
  z-index: 78;
}
/* Settings modal must stay fixed — interactive-zone otherwise overrides position:fixed */
body.ezb-tutorial-active #settingsModal:not(.hidden),
body.ezb-tutorial-active #settingsModal.ezb-tutorial-interactive-zone {
  position: fixed !important;
  inset: 0 !important;
}
body.ezb-tutorial-active .ezb-tutorial-target-ancestor {
  overflow: visible !important;
}
/* Keep Budget Manager swipe strips as their own scrollport (do not leak overflow onto the page). */
body.ezb-tutorial-active .budget-sticky-bar.ezb-tutorial-target-ancestor,
body.ezb-tutorial-active .budget-month-selector-sticky.ezb-tutorial-target-ancestor,
body.ezb-tutorial-active .budget-action-buttons-scroll.ezb-tutorial-target-ancestor,
body.ezb-tutorial-active .is-tutorial-target.ezb-tutorial-hscroll,
body.ezb-tutorial-active .budget-sticky-bar.is-tutorial-target,
body.ezb-tutorial-active .budget-month-selector-sticky.is-tutorial-target,
body.ezb-tutorial-active .budget-action-buttons-scroll.is-tutorial-target,
body.ezb-tutorial-active .ezb-tutorial-hscroll-root {
  overflow-x: auto !important;
  overflow-y: hidden !important;
  max-width: 100%;
  min-width: 0;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}
body.ezb-tutorial-active .ezb-tutorial-hscroll-root {
  touch-action: pan-x;
}
body.ezb-tutorial-active .is-tutorial-target.ezb-tutorial-hscroll::after,
body.ezb-tutorial-active .budget-sticky-bar.is-tutorial-target::after,
body.ezb-tutorial-active .budget-action-buttons-scroll.is-tutorial-target::after {
  inset: 0;
}
/* Keep the Settings panel scrollable while the tour highlights sections inside it */
body.ezb-tutorial-settings-phase .settings-modal-panel,
body.ezb-tutorial-settings-phase .settings-modal-panel.ezb-tutorial-target-ancestor,
body.ezb-tutorial-settings-phase .settings-modal-panel.ezb-tutorial-scroll-root {
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
body.ezb-tutorial-settings-phase .settings-modal-outer {
  overflow: hidden !important;
}
body.ezb-tutorial-active .ezb-tutorial-scroll-root {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
body.ezb-tutorial-active .is-tutorial-target,
body.ezb-tutorial-active #dashboard .glass-card.is-tutorial-target,
body.ezb-tutorial-active #budget .glass-card.is-tutorial-target,
body.ezb-tutorial-active .stream-border-on-focus.is-tutorial-target,
body.ezb-tutorial-active .stream-border-on-hover.is-tutorial-target,
body.ezb-tutorial-active [data-tutorial].is-tutorial-target {
  position: relative;
  z-index: 79;
  overflow: visible !important;
  isolation: isolate;
}
/* Must follow the rule above: attribute+class on [data-tutorial] would otherwise force overflow:visible. */
body.ezb-tutorial-active [data-tutorial].is-tutorial-target.ezb-tutorial-hscroll,
body.ezb-tutorial-active [data-tutorial].budget-sticky-bar.is-tutorial-target,
body.ezb-tutorial-active [data-tutorial].budget-month-selector-sticky.is-tutorial-target,
body.ezb-tutorial-active [data-tutorial].budget-action-buttons-scroll.is-tutorial-target {
  overflow-x: auto !important;
  overflow-y: hidden !important;
}
body.ezb-tutorial-active nav {
  z-index: 81;
}
body.ezb-tutorial-mobile-nav-phase #navMobileMenuBtn {
  position: relative;
  z-index: 83;
}
body.ezb-tutorial-mobile-nav-phase #mobileMenu .is-tutorial-target {
  border-radius: 0.5rem;
}
/* Stream beam encircling loop — ::after avoids > * { position:relative } collapsing child spans */
body.ezb-tutorial-active .is-tutorial-target::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 2px;
  background: var(--ezb-stream-gradient);
  background-size: 300% 100%;
  animation: streamFlow 4s linear infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
  z-index: 999;
  box-shadow: 0 0 12px rgba(0, 188, 212, 0.35);
}
body.ezb-tutorial-active .is-tutorial-target.ezb-tutorial-hscroll::after,
body.ezb-tutorial-active .budget-sticky-bar.is-tutorial-target::after,
body.ezb-tutorial-active .budget-action-buttons-scroll.is-tutorial-target::after {
  inset: 0;
}
body.ezb-tutorial-active .is-tutorial-target.ezb-tutorial-target-tight::after {
  inset: -1px;
  padding: 1.5px;
}
body.ezb-tutorial-active .compare-check-wrap.is-tutorial-target {
  border-radius: 0.375rem;
}
/* Legacy child span rings (no longer injected) — hide if present */
body.ezb-tutorial-active .is-tutorial-target > .ezb-tutorial-field-beam {
  display: none !important;
}
@media (prefers-reduced-motion: reduce) {
  body.ezb-tutorial-active .is-tutorial-target::after {
    animation: none;
  }
}
html.ezb-help-scroll-lock,
body.ezb-help-scroll-lock {
  overflow: hidden !important;
}
#ezb-help-overlay .ezb-help-dialog {
  max-height: min(90vh, 40rem);
  overflow-y: auto;
}

/* Settings modal sits above tour shades when Settings steps are active */
body.ezb-tutorial-settings-phase #ezb-tutorial-root .ezb-tutorial-shade {
  display: none !important;
}
body.ezb-tutorial-active #settingsModal:not(.hidden) {
  z-index: 88 !important;
  pointer-events: auto;
}
body.ezb-tutorial-settings-phase #settingsModal:not(.hidden) {
  z-index: 88 !important;
  overflow: hidden !important;
}
body.ezb-tutorial-settings-phase #settingsModal:not(.hidden) .settings-modal-outer {
  position: relative;
  z-index: 89;
}
body.ezb-tutorial-active #settingsModal .settings-modal-outer {
  position: relative;
  z-index: 83;
}
body.ezb-tutorial-active #settingsModal:not(.hidden) [data-tutorial].is-tutorial-target,
body.ezb-tutorial-active #settingsModal:not(.hidden) .is-tutorial-target {
  overflow: visible !important;
  border-radius: 0.75rem;
}
body.ezb-tutorial-settings-phase #ezb-tutorial-card {
  z-index: 96;
}
body.ezb-tutorial-settings-phase #ezb-tutorial-card.ezb-tutorial-card--docked {
  max-width: min(24rem, calc(100vw - 1.5rem));
}

/* Compare budgets modal sits above tour shades during compare steps */
body.ezb-tutorial-compare-phase #ezb-tutorial-root .ezb-tutorial-shade {
  display: none !important;
}
body.ezb-tutorial-active #compareBudgetsModal:not(.hidden),
body.ezb-tutorial-compare-phase #compareBudgetsModal:not(.hidden) {
  z-index: 88 !important;
  pointer-events: auto;
}
/* Compare steps: center modal in viewport (override mobile align-items:flex-start + scrollable backdrop) */
body.ezb-tutorial-compare-phase #compareBudgetsModal:not(.hidden) {
  display: flex !important;
  position: fixed !important;
  inset: 0 !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  padding: 1rem !important;
}
body.ezb-tutorial-compare-phase #compareBudgetsModal:not(.hidden) [data-tutorial="compare-modal"] {
  position: relative !important;
  z-index: 89;
  margin: 0 auto !important;
  flex-shrink: 0;
  width: 100%;
  max-width: 64rem;
  max-height: min(90vh, 100dvh);
  box-shadow: 0 0 0 2px rgba(0, 188, 212, 0.55), 0 24px 48px rgba(0, 0, 0, 0.35);
}
body.ezb-tutorial-compare-phase #compareBudgetsContent.ezb-tutorial-scroll-root {
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
body.ezb-tutorial-compare-phase #ezb-tutorial-card {
  z-index: 96;
}
