/* Tutoriel contextuel avec zone mise en lumière — Erika (texte uniquement) */

.erika-tour-root {
  position: fixed;
  inset: 0;
  z-index: 118;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s ease-out;
}
.erika-tour-root.is-visible {
  opacity: 1;
}
.erika-tour-root.hidden,
#erikaTourRoot .hidden,
.erika-tour-card .hidden {
  display: none !important;
}

.erika-tour-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: auto;
  background: color-mix(in srgb, var(--ink, #0f172a) 32%, transparent);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  will-change: clip-path;
  contain: strict;
}
html.design-studio.theme-dark .erika-tour-backdrop {
  background: rgba(6, 9, 13, .6);
  backdrop-filter: blur(5.5px);
  -webkit-backdrop-filter: blur(5.5px);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .erika-tour-backdrop {
    background: rgba(15, 23, 42, .62);
  }
}

.erika-tour-hole-guard {
  position: fixed;
  left: 0;
  top: 0;
  pointer-events: auto;
  background: transparent;
  will-change: transform, width, height;
}
.erika-tour-root.is-interactive .erika-tour-hole-guard {
  pointer-events: none;
}

.erika-tour-ring {
  position: fixed;
  left: 0;
  top: 0;
  pointer-events: none;
  border: 2px solid var(--brand, #1d4ed8);
  box-shadow:
    0 0 0 1px color-mix(in srgb, #fff 65%, transparent),
    0 0 0 6px color-mix(in srgb, var(--brand, #1d4ed8) 22%, transparent);
  will-change: transform, width, height;
}
html.design-studio.theme-dark .erika-tour-ring {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, .28),
    0 0 0 6px color-mix(in srgb, var(--brand, #60a5fa) 32%, transparent);
}

.erika-tour-card {
  position: fixed;
  left: 0;
  top: 0;
  width: min(352px, calc(100vw - 24px));
  overflow: visible;
  pointer-events: auto;
  display: grid;
  gap: .65rem;
  padding: 1rem 1.05rem .9rem;
  border: 1px solid var(--studio-border-strong, #cbd5e1);
  border-radius: 16px;
  background: var(--studio-surface, #ffffff);
  color: var(--studio-text, #0f172a);
  box-shadow: 0 20px 50px rgba(15, 23, 42, .22), 0 4px 12px rgba(15, 23, 42, .08);
  will-change: transform, opacity;
  transition: transform .26s cubic-bezier(.22, .68, .32, 1), opacity .16s ease;
}
.erika-tour-card.is-sync-instant {
  transition: none !important;
}
html.design-studio.theme-dark .erika-tour-card {
  box-shadow: 0 24px 60px rgba(0, 0, 0, .52), 0 4px 14px rgba(0, 0, 0, .3);
}
.erika-tour-card:focus {
  outline: none;
}

.erika-tour-arrow {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--studio-surface, #ffffff);
  border-left: 1px solid var(--studio-border-strong, #cbd5e1);
  border-top: 1px solid var(--studio-border-strong, #cbd5e1);
  pointer-events: none;
}
.erika-tour-card[data-placement="bottom"] .erika-tour-arrow {
  top: -7px;
  left: var(--erika-arrow-offset, 28px);
  transform: translateX(-50%) rotate(45deg);
}
.erika-tour-card[data-placement="top"] .erika-tour-arrow {
  bottom: -7px;
  left: var(--erika-arrow-offset, 28px);
  transform: translateX(-50%) rotate(225deg);
}
.erika-tour-card[data-placement="right"] .erika-tour-arrow {
  left: -7px;
  top: var(--erika-arrow-offset, 28px);
  transform: translateY(-50%) rotate(-45deg);
}
.erika-tour-card[data-placement="left"] .erika-tour-arrow {
  right: -7px;
  top: var(--erika-arrow-offset, 28px);
  transform: translateY(-50%) rotate(135deg);
}
.erika-tour-card[data-placement="floating"] .erika-tour-arrow,
.erika-tour-card.is-sheet .erika-tour-arrow {
  display: none;
}

.erika-tour-head {
  display: flex;
  align-items: center;
  gap: .62rem;
}
.erika-tour-avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1.5px solid color-mix(in srgb, var(--brand, #1d4ed8) 38%, transparent);
  background: var(--brand-soft, #dbeafe);
  object-fit: cover;
}
.erika-tour-meta {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: .08rem;
}
.erika-tour-speaker {
  font-size: .78rem;
  font-weight: 800;
  color: var(--brand-deep, #1e40af);
  line-height: 1.2;
}
.erika-tour-progress {
  font-size: .71rem;
  font-weight: 650;
  color: var(--studio-text-muted, #64748b);
  line-height: 1.2;
}
.erika-tour-close {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--studio-text-muted, #64748b);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.erika-tour-close:hover {
  background: var(--studio-surface-soft, #f1f5f9);
  color: var(--studio-text, #0f172a);
}

.erika-tour-body {
  display: grid;
  gap: .32rem;
  min-height: 0;
  max-height: calc(100dvh - 175px);
  overflow-y: auto;
  transition: opacity .12s ease;
}
.erika-tour-body.is-swapping {
  opacity: .35;
}
.erika-tour-title {
  margin: 0;
  font-size: .96rem;
  font-weight: 800;
  color: var(--studio-text, #0f172a);
  line-height: 1.3;
}
.erika-tour-text {
  margin: 0;
  font-size: .84rem;
  color: var(--studio-text-muted, #475569);
  line-height: 1.5;
}
.erika-tour-interactive-hint {
  margin: .1rem 0 0;
  font-size: .74rem;
  font-weight: 650;
  color: var(--brand-deep, #1e40af);
}

.erika-tour-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .45rem;
  margin-top: .15rem;
}
.erika-tour-nav-group {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-left: auto;
}
.erika-tour-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  min-height: 2.05rem;
  padding: .34rem .82rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 650;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.erika-tour-btn-secondary {
  border: 1px solid var(--studio-border-strong, #cbd5e1);
  background: var(--studio-surface-soft, #f8fafc);
  color: var(--studio-text-muted, #475569);
}
.erika-tour-btn-secondary:hover {
  border-color: color-mix(in srgb, var(--brand, #1d4ed8) 38%, var(--studio-border-strong, #cbd5e1));
  background: var(--brand-soft, #dbeafe);
  color: var(--brand-deep, #1e40af);
}
.erika-tour-btn-primary {
  border: 1px solid color-mix(in srgb, var(--brand, #1d4ed8) 40%, transparent);
  background: color-mix(in srgb, var(--brand-soft, #dbeafe) 65%, var(--studio-surface, #fff));
  color: var(--brand-deep, #1e40af);
  box-shadow: inset 0 -1.5px 0 color-mix(in srgb, var(--brand, #1d4ed8) 45%, transparent);
}
.erika-tour-btn-primary:hover {
  background: color-mix(in srgb, var(--brand, #1d4ed8) 12%, var(--studio-surface, #fff));
  border-color: color-mix(in srgb, var(--brand, #1d4ed8) 55%, transparent);
}
.erika-tour-btn:focus-visible,
.erika-tour-close:focus-visible,
.erika-tour-disable-btn:focus-visible {
  outline: 2px solid var(--brand, #1d4ed8);
  outline-offset: 2px;
}

.erika-tour-foot {
  display: flex;
  justify-content: flex-start;
  padding-top: .25rem;
  border-top: 1px solid var(--studio-border, #e2e8f0);
}
.erika-tour-disable-btn {
  padding: .15rem 0;
  border: 0;
  background: transparent;
  color: var(--studio-text-muted, #64748b);
  font-size: .72rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.erika-tour-disable-btn:hover {
  color: var(--studio-text, #0f172a);
}

.erika-tour-live {
  position: fixed;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 720px) {
  .erika-tour-card.is-sheet {
    width: calc(100vw - 20px);
    max-width: 520px;
    border-radius: 16px;
  }
}

:is(html.reduce-motion, body.reduce-motion) .erika-tour-root,
:is(html.reduce-motion, body.reduce-motion) .erika-tour-card,
:is(html.reduce-motion, body.reduce-motion) .erika-tour-body {
  transition-duration: .01ms !important;
}

.erika-spotlight-target .cell-flag-trigger,
.cell-flag-trigger.erika-spotlight-target {
  opacity: 1 !important;
  pointer-events: auto;
  border-color: rgba(14, 165, 233, 0.55);
  background: #f0f9ff;
  color: #0369a1;
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.16);
}

@media print {
  #erikaTourRoot,
  .erika-tour-root {
    display: none !important;
  }
}
