/* tour.css — coach-mark tour (#tour-layer, z 180). */
#tour-layer { display: none; }
#tour-layer.is-open { display: block; position: fixed; inset: 0; z-index: 180; }
#tour-layer.is-leaving { opacity: 0; transition: opacity 0.2s; }

.tour-block { position: fixed; inset: 0; }
.tour-spot {
  position: fixed; left: 50%; top: 50%; width: 0; height: 0;
  border-radius: 12px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(14, 14, 16, 0.58);
  outline: 3px dashed var(--acid); outline-offset: 4px;
  transition: left 0.38s var(--ease-out), top 0.38s var(--ease-out), width 0.38s var(--ease-out), height 0.38s var(--ease-out);
  animation: tour-in 0.3s ease-out both;
}

.tour-spot.is-none { width: 0; height: 0; left: 50%; top: 50%; outline: 0; }
@keyframes tour-in { from { opacity: 0; } }
/* secondary hint: a bright ring around a second control (cut out of the dim too) */
.tour-ring {
  position: fixed; display: none; pointer-events: none; border-radius: 50%;
  background: transparent; outline: 3px solid var(--acid); outline-offset: 0;
  box-shadow: 0 0 0 4px #0e0e10, 0 0 18px var(--acid);
  animation: tour-ring 1.4s ease-in-out infinite;
}
.tour-ring.is-on { display: block; }
@keyframes tour-ring { 50% { transform: scale(1.12); } }

.tour-card {
  --tilt: -1deg; --ax: 40px;
  position: fixed; left: 0; top: 0; width: min(340px, calc(100vw - 24px));
  padding: 20px 18px 14px;
  background: var(--pi-yellow); color: #0e0e10;
  border: 2px solid #0e0e10; border-radius: 4px;
  box-shadow: 6px 6px 0 #0e0e10;
  transform: rotate(var(--tilt));
  transition: left 0.38s var(--ease-out), top 0.38s var(--ease-out), transform 0.3s var(--ease-spring);
}

.tour-card.is-swap { animation: tour-swap 0.4s var(--ease-spring); }
@keyframes tour-swap { 0% { transform: rotate(calc(var(--tilt) * -2)) scale(0.94); opacity: 0.4; } }
.tour-card.is-nudge { animation: tour-nudge 0.4s; }
@keyframes tour-nudge { 25% { transform: rotate(var(--tilt)) translateX(-6px); } 75% { transform: rotate(var(--tilt)) translateX(6px); } }
/* arrow notch toward the target */
.tour-card::before {
  content: ""; position: absolute; left: calc(var(--ax) - 9px); width: 14px; height: 14px;
  background: var(--pi-yellow); border: 2px solid #0e0e10; transform: rotate(45deg); display: none;
}
.tour-card[data-side="top"]::before { display: block; top: -9px; border-right: 0; border-bottom: 0; }
.tour-card[data-side="bottom"]::before { display: block; bottom: -9px; border-left: 0; border-top: 0; }
.tour-tape {
  position: absolute; top: -12px; right: 26px; width: 74px; height: 22px; transform: rotate(5deg);
  background: repeating-linear-gradient(45deg, rgba(255,255,255,.45) 0 6px, transparent 6px 12px), var(--pi-pink);
  border: 1.5px solid rgba(14,14,16,.3);
}
.tour-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.tour-kicker { font-family: var(--f-mono); font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; padding: 2px 6px; background: #0e0e10; color: var(--pi-yellow); }
.tour-count { font-family: var(--f-mono); font-size: 11px; font-weight: 700; opacity: 0.6; }
.tour-title { margin: 4px 0 6px; font-family: var(--f-display); font-style: italic; font-weight: 400; font-size: 32px; line-height: 0.95; letter-spacing: -0.02em; }
.tour-body { margin: 0; font-size: 14px; line-height: 1.42; }
.tour-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.tour-dots { display: flex; gap: 5px; }
.tour-dots i { width: 8px; height: 8px; border: 1.5px solid #0e0e10; border-radius: 50%; background: transparent; transition: width 0.25s var(--ease-spring), background 0.2s; }
.tour-dots i.is-past { background: rgba(14,14,16,.35); }
.tour-dots i.is-on { width: 20px; border-radius: 6px; background: #0e0e10; }
.tour-btns { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.tour-btns .btn { height: 34px; padding: 0 11px; font-size: 12px; background: #fffdf7; color: #0e0e10; border-color: #0e0e10; box-shadow: 2px 2px 0 #0e0e10; }
.tour-btns .btn-acid { background: #0e0e10; color: var(--pi-yellow); }
.tour-btns .btn:disabled { opacity: 0.35; pointer-events: none; }
.tour-skip {
  border: 0; background: none; padding: 4px 4px; margin-right: 2px;
  font-family: var(--f-mono); font-size: 11px; text-decoration: underline; text-underline-offset: 3px; color: #0e0e10; opacity: 0.7;
}
.tour-skip:hover { opacity: 1; }

/* force the hovered-card quick actions visible during the "card" step */
.card.tour-hover .card-actions { opacity: 1; transform: none; }
.card.tour-hover { z-index: 5; }
/* presence cursors/tips would clutter the spotlight */
body.is-touring .tip { opacity: 0; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  .tour-spot, .tour-card, .tour-ring { transition: none; animation: none; }
  .tour-card.is-swap, .tour-card.is-nudge { animation: none; }
}

/* ----- polish: press + touch ----- */
.tour-btns .btn:not(:disabled):active { transform: translate(2px, 2px); box-shadow: none; }
@media (pointer: coarse) {
  .tour-btns .btn { height: 42px; padding: 0 14px; }
  .tour-skip { min-height: 40px; padding: 8px 6px; }
}

/* ----- responsive pass ----- */
.tour-card { max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain; }
/* the tape + arrow notch poke outside the card: keep them visible despite overflow */
.tour-card { overflow: visible; }
@media (max-height: 560px), (max-width: 380px) {
  .tour-card { padding: 16px 14px 12px; overflow-y: auto; }
  .tour-title { font-size: 26px; }
  .tour-body { font-size: 14px; line-height: 1.38; }
}
@media (max-width: 700px) {
  .tour-card { width: calc(100vw - 24px); max-width: 380px; }
  .tour-foot { margin-top: 12px; }
  .tour-btns { gap: 4px; }
}
@media (hover: none), (pointer: coarse) {
  .tour-btns .btn { min-width: 44px; height: 44px; }
  .tour-skip { min-height: 44px; }
}
