/* ---------- Анімована демонстрація ---------- */

.walkthrough {
  margin: 8px 0 24px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.wt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.wt-title { font-weight: 600; font-size: 14.5px; }

.wt-mode { display: inline-flex; gap: 3px; padding: 3px; border-radius: 9px; background: var(--hover); }
.wt-mode button { border: 0; padding: 5px 12px; border-radius: 7px; background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.wt-mode button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

.wt-viewport { position: relative; overflow: hidden; background: #e9e6df; }

.wt-stage { position: absolute; left: 0; top: 0; width: 960px; height: 600px; transform-origin: 0 0; }
.wt-screen { position: absolute; inset: 0; }
.wt-img { display: block; width: 100%; height: 100%; user-select: none; }
.wt-typed { position: absolute; overflow: hidden; font: 15px/1.45 system-ui, "Segoe UI", sans-serif; color: #1f1e1c; white-space: pre-wrap; }
.wt-typed.typing::after { content: ""; display: inline-block; width: 1.5px; height: 1.1em; margin-left: 1px; background: currentColor; vertical-align: -.2em; animation: wt-blink 1s steps(1) infinite; }
@keyframes wt-blink { 50% { opacity: 0; } }
.walkthrough.try .wt-stage { cursor: pointer; }

.wt-ring {
  position: absolute;
  z-index: 4;
  border: 3px solid #c2603e;
  border-radius: 11px;
  box-shadow: 0 0 0 5px rgba(194, 96, 62, .22);
  pointer-events: none;
}
.wt-ring.pulse { animation: wt-pulse 1s ease-in-out 3; }
@keyframes wt-pulse { 50% { box-shadow: 0 0 0 12px rgba(194, 96, 62, .1); } }

.wt-cursor {
  position: absolute;
  left: -4px;
  top: -2px;
  z-index: 6;
  pointer-events: none;
  transition-property: transform;
  transition-timing-function: cubic-bezier(.45, 0, .2, 1);
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .3));
}
.walkthrough.try .wt-cursor { display: none; }

.wt-ripple {
  position: absolute;
  z-index: 5;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  background: rgba(194, 96, 62, .4);
  opacity: 0;
  pointer-events: none;
}
.wt-ripple.go { animation: wt-ripple .5s ease-out; }
@keyframes wt-ripple { from { transform: scale(.2); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }

.wt-toast {
  position: absolute;
  left: 50%;
  bottom: 14px;
  z-index: 7;
  transform: translateX(-50%);
  padding: 8px 14px;
  border-radius: 8px;
  background: #1f1e1c;
  color: #fff;
  font-size: 14px;
  white-space: nowrap;
}

.wt-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  background: rgba(25, 24, 22, .5);
  backdrop-filter: blur(2px);
  text-align: center;
}

.wt-overlay[hidden], .wt-toast[hidden], .wt-ring[hidden] { display: none; }

.wt-big {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border: 0;
  border-radius: 999px;
  background: #c2603e;
  color: #fff;
  font: inherit;
  font-size: 15.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
}
.wt-big:hover { filter: brightness(1.08); }
.wt-big svg { width: 18px; height: 18px; }
.wt-big.small { padding: 9px 16px; font-size: 14px; }
.wt-big.ghost { background: #fff; color: #1f1e1c; }
.wt-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.wt-done { color: #fff; font-size: 20px; font-weight: 700; }
.wt-hint { color: #fff; font-size: 14px; opacity: .9; }

.wt-caption {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 62px;
  padding: 12px 16px 8px;
  border-top: 1px solid var(--border);
  font-size: 15px;
}

.wt-step-num {
  flex: none;
  margin-top: 1px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.wt-controls { display: flex; align-items: center; gap: 6px; padding: 4px 16px 14px; }

.wt-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}
.wt-btn:hover { border-color: var(--accent); }
.wt-play { background: var(--accent); border-color: var(--accent); color: #fff; }
.wt-play svg { width: 16px; height: 16px; }

.wt-dots { display: flex; gap: 6px; margin-left: auto; }

/* На весь екран: екран вписується у висоту вікна */
.walkthrough:fullscreen,
.walkthrough.wt-expanded { display: flex; flex-direction: column; justify-content: center; margin: 0; border: 0; border-radius: 0; }
.walkthrough.wt-expanded { position: fixed; inset: 0; z-index: 1000; overflow: auto; }
.wt-noscroll { overflow: hidden; }
.walkthrough:fullscreen .wt-head, .walkthrough.wt-expanded .wt-head,
.walkthrough:fullscreen .wt-viewport, .walkthrough.wt-expanded .wt-viewport,
.walkthrough:fullscreen .wt-caption, .walkthrough.wt-expanded .wt-caption,
.walkthrough:fullscreen .wt-controls, .walkthrough.wt-expanded .wt-controls { width: 100%; max-width: calc((100vh - 200px) * var(--wt-ratio, 1.6)); margin-inline: auto; }
.wt-dots button { width: 10px; height: 10px; padding: 0; border: 0; border-radius: 50%; background: var(--border); cursor: pointer; }
.wt-dots button.done { background: var(--ok); }
.wt-dots button.current { background: var(--accent); transform: scale(1.25); }

@media (max-width: 520px) {
  .wt-caption { flex-direction: column; gap: 6px; }
  .wt-dots { display: none; }
}
