/* ============================================================================
   DodecaGreen — guided tour ("Show me how it works")
   Uses the site's own design tokens (brand.css custom properties) so it
   looks native inside any page. Loaded only by pages that opt in.
   ============================================================================ */

.dg-tour-scrim {
  position: fixed;
  inset: 0;
  z-index: 99998;
  background: rgba(17, 32, 26, 0.5);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.dg-tour-scrim.is-visible { opacity: 1; }

.dg-tour-spotlight {
  position: fixed;
  z-index: 99998;
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(17, 32, 26, 0.5), 0 0 0 2px var(--green-500, #66bb6a), 0 0 24px rgba(102, 187, 106, 0.45);
  transition: top 0.35s cubic-bezier(.4,0,.2,1), left 0.35s cubic-bezier(.4,0,.2,1),
              width 0.35s cubic-bezier(.4,0,.2,1), height 0.35s cubic-bezier(.4,0,.2,1),
              opacity 0.2s ease;
  pointer-events: none;
  opacity: 0;
}
.dg-tour-spotlight.is-visible { opacity: 1; }
.dg-tour-spotlight.is-center { box-shadow: 0 0 0 9999px rgba(17, 32, 26, 0.5); }

.dg-tour-popover {
  position: fixed;
  z-index: 99999;
  width: 340px;
  max-width: calc(100vw - 32px);
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e7e2d4);
  border-radius: var(--radius, 14px);
  box-shadow: var(--shadow-lg, 0 24px 60px rgba(20,30,25,0.18));
  padding: 20px 20px 16px;
  font-family: var(--font-body, 'IBM Plex Sans', system-ui, sans-serif);
  color: var(--ink, #11201a);
  opacity: 0;
  transform: translateY(6px) scale(0.98);
  transition: opacity 0.2s ease, transform 0.2s ease, top 0.35s cubic-bezier(.4,0,.2,1), left 0.35s cubic-bezier(.4,0,.2,1);
  pointer-events: auto;
}
.dg-tour-popover.is-visible { opacity: 1; transform: translateY(0) scale(1); }

.dg-tour-eyebrow {
  font-family: var(--font-mono, monospace);
  font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--green-700, #388e3c); font-weight: 600; margin-bottom: 8px;
}
.dg-tour-title {
  font-family: var(--font-display, Georgia, serif); font-weight: 400;
  font-size: 1.15rem; color: var(--ink, #11201a); letter-spacing: -0.01em; line-height: 1.25;
}
.dg-tour-body { font-size: 0.86rem; color: var(--slate, #3a4a40); line-height: 1.55; margin-top: 9px; }
.dg-tour-body strong { color: var(--ink, #11201a); font-weight: 600; }

.dg-tour-progress {
  height: 3px; border-radius: 2px; background: var(--line-soft, #efece2);
  margin-top: 16px; overflow: hidden;
}
.dg-tour-progress-fill {
  height: 100%; width: 0%; background: var(--green-600, #43a047); border-radius: 2px;
}
.dg-tour-progress-fill.animating { transition: width linear; }

.dg-tour-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 14px; gap: 8px;
}
.dg-tour-steps {
  font-family: var(--font-mono, monospace); font-size: 0.72rem;
  color: var(--stone, #6b7770); font-variant-numeric: tabular-nums;
}
.dg-tour-controls { display: flex; align-items: center; gap: 6px; }

.dg-tour-btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line, #e7e2d4); background: transparent; color: var(--slate, #3a4a40);
  border-radius: 999px; padding: 6px 14px; font-size: 0.78rem; font-weight: 500;
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
  font-family: var(--font-body, inherit);
}
.dg-tour-btn:hover { border-color: var(--green-300, #a5d6a7); color: var(--green-800, #2e7d32); background: var(--green-50, #f3f9f3); }
.dg-tour-btn:disabled { opacity: 0.35; cursor: default; }
.dg-tour-btn.primary { background: var(--green-700, #388e3c); border-color: var(--green-700, #388e3c); color: #fff; }
.dg-tour-btn.primary:hover { background: var(--green-800, #2e7d32); color: #fff; }
.dg-tour-btn.icon { width: 30px; padding: 6px; }
.dg-tour-btn.icon svg { width: 13px; height: 13px; }

.dg-tour-end {
  position: absolute; top: 12px; right: 14px;
  background: transparent; border: none; color: var(--mist, #a8b1a8); cursor: pointer;
  font-size: 1rem; line-height: 1; padding: 4px;
}
.dg-tour-end:hover { color: var(--slate, #3a4a40); }

/* Launcher button, dropped into each tool's own action bar — deliberately
   louder than the other controls since it's the invitation to a first-time
   user, not a routine action. */
.dg-tour-launch {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px 8px 14px;
  background: linear-gradient(135deg, var(--green-600, #43a047), var(--green-700, #388e3c));
  color: #fff;
  border: 1px solid var(--green-700, #388e3c);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.83rem; font-weight: 600; letter-spacing: -0.005em;
  white-space: nowrap;
  font-family: var(--font-body, inherit);
  position: relative;
  box-shadow: 0 2px 12px rgba(56, 142, 60, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  animation: dgTourPulseRing 2.8s ease-out infinite;
}
.dg-tour-launch:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, var(--green-500, #66bb6a), var(--green-600, #43a047));
  box-shadow: 0 4px 18px rgba(56, 142, 60, 0.5);
}
.dg-tour-launch:active { transform: translateY(0); }
.dg-tour-launch svg.dg-tour-play { flex-shrink: 0; }

@keyframes dgTourPulseRing {
  0%, 100% { box-shadow: 0 2px 12px rgba(56,142,60,0.35), 0 0 0 0 rgba(56,142,60,0.4); }
  60% { box-shadow: 0 2px 12px rgba(56,142,60,0.35), 0 0 0 8px rgba(56,142,60,0); }
}
@media (prefers-reduced-motion: reduce) {
  .dg-tour-launch { animation: none; }
}

@media (max-width: 640px) {
  .dg-tour-popover { width: calc(100vw - 32px); }
}
