/* Guided experience overlay + callout */

.guide-root {
  position: fixed;
  inset: 0;
  /* Above .modal-part-overlay (10000) so guide steps that spotlight an open
       modal can still show their callout. Below tooltips (10002) so hover
       help stays readable on top. */
  z-index: 10001;
  /* The root and SVG are visual-only; input blocking lives on the
       .guide-blocker strips so interactive steps can open the spotlight
       hole to real clicks by shrinking the strips around it. */
  pointer-events: none;
}

/* A step with an authored `delay` hides the whole overlay (dim, callout,
   blockers) while the learner acts before the step appears. */
.guide-root.waiting {
  display: none;
}

/* An `open` step blocks no input (see #updateBlockers) and drops the dim
   with it -- only the callout and the target's border ring remain, an
   invitation rather than a takeover. */
.guide-root.open .guide-svg rect.guide-dim {
  display: none;
}

.guide-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Four transparent strips framing the spotlight hole (or covering the
   whole viewport on watch steps). Geometry is set in px by
   BuilderGuide#updateBlockers. */
.guide-blocker {
  position: absolute;
  pointer-events: auto;
}

.guide-svg rect.guide-dim {
  fill: var(--overlay-black-75);
}

/* The cutout and ring corner radius is set per rect in JS (BuilderGuide
   #cornerRadius): it matches whatever element the rect traces. rx rides
   the same transition as the geometry so the rounding glides between
   steps instead of popping while the cutout is still mid-slide. */

.guide-svg rect.guide-hole {
  fill: black;
  transition:
    x 0.25s ease,
    y 0.25s ease,
    width 0.25s ease,
    height 0.25s ease,
    rx 0.25s ease;
}

.guide-svg rect.guide-border {
  stroke: var(--color-accent);
  stroke-width: var(--border-width);
  transition:
    x 0.25s ease,
    y 0.25s ease,
    width 0.25s ease,
    height 0.25s ease,
    rx 0.25s ease;
}

/* Briefly disables transitions so BuilderGuide can snap a rect to its target's
   center at zero size on the first frame of the guide — that way the
   subsequent x/y/w/h animation grows outward from the new spot instead of
   appearing to fly in from the upper-left. The same class is used during
   the symmetric shrink-to-center on guide exit. */
.guide-svg rect.guide-snap {
  transition: none;
}

.guide-callout {
  position: absolute;
  max-width: min(320px, calc(100% - var(--space-2) * 2));
  min-width: 240px;
  background: var(--color-surface);
  color: var(--color-text);
  border: var(--border-width) var(--border-style) var(--color-accent);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  box-shadow: var(--shadow-drop);
  pointer-events: auto;
  transition:
    top 0.25s ease,
    left 0.25s ease;
}

/* Position is set in px by BuilderGuide#reposition so centered <-> non-centered
   transitions interpolate smoothly; only the max-width differs here. */
.guide-callout.center {
  max-width: min(420px, calc(100% - var(--space-2) * 2));
}

.guide-callout-title {
  font-size: 1.05em;
  margin-bottom: var(--space-2);
  padding-right: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.guide-callout-close {
  position: absolute;
  top: 0;
  right: 0;
}

.guide-callout-body {
  font-size: 0.95em;
  line-height: 1.45;
  margin-bottom: var(--space-2);
}

/* Inline tap-to-reveal tooltip: authors write <sup title="...">*</sup>; the
   guide preprocessor rewrites it into a span button so it works on touch
   devices (where hover does not exist) and wraps cleanly mid-paragraph. */
.guide-callout-body .guide-tip {
  display: inline;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--color-text-dark);
  cursor: pointer;
}
.guide-callout-body .guide-tip sup {
  color: var(--color-text-dark);
}
.guide-callout-body .guide-tip sup::before {
  content: '+';
}
.guide-callout-body .guide-tip.is-open sup::before {
  content: '-';
}
.guide-callout-body .guide-tip-text {
  display: none;
  color: var(--color-text-dark);
}
.guide-callout-body .guide-tip.is-open .guide-tip-text {
  display: inline;
}

.guide-callout-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-2);
}

.guide-callout-counter {
  font-size: 0.85em;
  opacity: 0.7;
}

/* Mute button sits inline with the title text, so size it to the text
   rather than to the standard .button chrome. */
.guide-callout-mute {
  width: auto;
  height: auto;
  padding: 0;
  font-size: inherit;
}

.guide-callout-mute svg {
  width: 1em;
  height: 1em;
}

.guide-callout-controls {
  display: flex;
  gap: var(--space-2);
}

.guide-callout-controls .button {
  font-size: 0.9em;
}
