/* Guided import + listen tutorial overlay */
body.tutorial-active {
  overflow: hidden;
}

.tutorial-root {
  position: fixed;
  inset: 0;
  z-index: 17000;
  pointer-events: none;
}

.tutorial-root.is-active {
  pointer-events: none;
}

.tutorial-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 14, 0.38);
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: none;
}

.tutorial-root.is-active .tutorial-backdrop {
  opacity: 1;
  /* Modal: block background clicks unless an action step punches a hole. */
  pointer-events: auto;
}

.tutorial-root.is-action-step .tutorial-backdrop {
  /* Clicks pass through the dim so the directed control stays usable. */
  pointer-events: none;
}

/* Center / no-spotlight steps lack the spotlight hole-punch dim — match that strength. */
.tutorial-root.is-full-dim .tutorial-backdrop {
  background: rgba(8, 10, 14, 0.55);
}

body.tutorial-dim-soft .tutorial-backdrop {
  background: rgba(8, 10, 14, 0.22);
}

body.tutorial-dim-soft .tutorial-root.is-full-dim .tutorial-backdrop {
  background: rgba(8, 10, 14, 0.38);
}

.tutorial-spotlight {
  position: absolute;
  border-radius: 12px;
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--spotlight, #e8a838) 85%, #fff 15%),
    0 0 0 9999px rgba(8, 10, 14, 0.38),
    0 0 24px color-mix(in srgb, var(--spotlight, #e8a838) 35%, transparent);
  transition:
    top 0.28s ease,
    left 0.28s ease,
    width 0.28s ease,
    height 0.28s ease,
    opacity 0.2s ease;
  pointer-events: none;
}

body.tutorial-dim-soft .tutorial-spotlight {
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--spotlight, #e8a838) 85%, #fff 15%),
    0 0 0 9999px rgba(8, 10, 14, 0.2),
    0 0 24px color-mix(in srgb, var(--spotlight, #e8a838) 35%, transparent);
}

.tutorial-spotlight[hidden] {
  opacity: 0;
}

.tutorial-spotlight.is-pulse::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: inherit;
  border: 2px solid color-mix(in srgb, var(--spotlight, #e8a838) 55%, transparent);
  animation: tutorial-spotlight-pulse 1.6s ease-out infinite;
}

@keyframes tutorial-spotlight-pulse {
  0% {
    transform: scale(1);
    opacity: 0.85;
  }
  100% {
    transform: scale(1.08);
    opacity: 0;
  }
}

.tutorial-cursor {
  position: absolute;
  width: 28px;
  height: 28px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #fff 0%, #fff 18%, transparent 19%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.35) 42%, transparent 43%);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
  pointer-events: none;
  opacity: 0;
  transform: translate(-9999px, -9999px);
  transition:
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.2s ease;
  z-index: 2;
}

.tutorial-cursor.is-visible {
  opacity: 1;
}

.tutorial-cursor.is-click {
  animation: tutorial-cursor-click 0.35s ease;
}

@keyframes tutorial-cursor-click {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(0.82);
  }
  100% {
    transform: scale(1);
  }
}

.tutorial-card {
  position: absolute;
  max-width: min(420px, calc(100vw - 32px));
  padding: 1.1rem 1.15rem 1rem;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--spotlight, #e8a838) 28%, var(--border, #3a3f4b));
  background: linear-gradient(
    165deg,
    color-mix(in srgb, var(--panel, #1a1d24) 92%, var(--spotlight, #e8a838) 8%) 0%,
    var(--panel, #1a1d24) 100%
  );
  color: var(--text, #e8eaed);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 color-mix(in srgb, var(--spotlight, #e8a838) 12%, white 8%);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.22s ease,
    transform 0.22s ease,
    top 0.28s ease,
    left 0.28s ease;
}

.tutorial-root.is-active .tutorial-card {
  opacity: 1;
  transform: translateY(0);
}

.tutorial-card.is-dock-top {
  max-width: min(380px, calc(100vw - 32px));
}

.tutorial-card.is-center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.tutorial-root.is-active .tutorial-card.is-center {
  transform: translate(-50%, -50%);
}

.tutorial-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--spotlight, #e8a838) 78%, var(--text, #e8eaed) 22%);
}

.tutorial-title {
  margin: 0 0 0.5rem;
  font-size: 1.12rem;
  line-height: 1.25;
}

.tutorial-body {
  margin: 0 0 0.85rem;
  font-size: 0.92rem;
  line-height: 1.45;
  color: color-mix(in srgb, var(--text, #e8eaed) 88%, transparent);
}

.tutorial-mute-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.55rem;
  font-size: 0.82rem;
  color: color-mix(in srgb, var(--text, #e8eaed) 78%, transparent);
  cursor: pointer;
  user-select: none;
}

.tutorial-mute-label input {
  width: 0.95rem;
  height: 0.95rem;
  margin: 0;
  accent-color: var(--accent, #4f8cff);
  cursor: pointer;
}

.tutorial-progress {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  color: color-mix(in srgb, var(--text, #e8eaed) 62%, transparent);
}

.tutorial-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  align-items: stretch;
}

.tutorial-actions-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-end;
}

.tutorial-actions-row #tutorial-skip {
  margin-right: auto;
}

.tutorial-actions-row .primary,
.tutorial-actions-row .secondary {
  white-space: nowrap;
}

.tutorial-actions-row .primary {
  flex: 0 1 auto;
  max-width: 100%;
}

.tutorial-actions .primary[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.tutorial-card.is-speaking .tutorial-kicker::after {
  content: " · speaking";
  font-weight: 500;
  opacity: 0.85;
}

.tutorial-drag-ghost {
  position: fixed;
  z-index: 17002;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 2px solid color-mix(in srgb, var(--spotlight, #e8a838) 70%, #fff 30%);
  background: color-mix(in srgb, var(--panel, #1a1d24) 88%, #2bb3a0 12%);
  color: var(--text, #e8eaed);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.92);
  transition: opacity 0.18s ease;
}

.tutorial-drag-ghost.is-visible {
  opacity: 1;
}

.tutorial-drag-ghost-avatar {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  color: #fff;
  background: #2bb3a0;
}

.tutorial-drag-ghost-cursor {
  position: absolute;
  right: -10px;
  bottom: -12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #fff 0%, #fff 18%, transparent 19%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.35) 42%, transparent 43%);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

body.tutorial-active .tutorial-whos-there-pulse {
  outline: 2px solid color-mix(in srgb, var(--spotlight, #e8a838) 80%, transparent);
  outline-offset: 3px;
  border-radius: 6px;
  animation: tutorial-line-pulse 1.4s ease-in-out infinite;
}

@keyframes tutorial-line-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--spotlight, #e8a838) 45%, transparent);
  }
  50% {
    box-shadow: 0 0 0 8px color-mix(in srgb, var(--spotlight, #e8a838) 0%, transparent);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tutorial-spotlight,
  .tutorial-card,
  .tutorial-cursor,
  .tutorial-backdrop {
    transition: none;
  }

  .tutorial-spotlight.is-pulse::after,
  .tutorial-cursor.is-click,
  body.tutorial-active .tutorial-whos-there-pulse {
    animation: none;
  }
}
