/* The setup wizard, on the setup site and the Worker's Setup page alike: a bar with the steps, then
   one step filling the window. A step with a walkthrough puts its screenshot (.tour-stage) on the
   left, as tall as the window, and its text, controls and Back / Next in a column on the right; on a
   phone they stack. The page sets --wz-top to the bar's height (it is measured: the bar wraps).
   Uses the page's --bg, --text, --muted, --border, --accent, --accent-text and --ok. */
:root { --wz-side: clamp(340px, 32vw, 480px); --wz-top: 64px; }

.wz-bar {
  position: sticky; top: var(--app-top, 0px); z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px;
  padding: 10px 20px; background: var(--bg); border-bottom: 1px solid var(--border);
}
.wz-bar .wz-name { font-weight: 700; font-size: 1.05rem; margin: 0; white-space: nowrap; }
.wz-progress { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0; padding: 0; flex: 1 1 auto; }
.wz-progress button {
  display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 4px 10px 4px 4px; border-radius: 999px;
  font: inherit; font-size: 0.85rem; background: none; border: 1px solid transparent; color: var(--muted); cursor: pointer;
}
.wz-progress button:disabled { cursor: default; opacity: 0.55; }
.wz-progress .dot {
  flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 0.75rem; font-weight: 700; border: 1.5px solid var(--border);
}
.wz-progress .done .dot { background: var(--ok); border-color: var(--ok); color: var(--bg); }
.wz-progress .current { border-color: var(--accent); color: var(--text); }
.wz-progress .current .dot { border-color: var(--accent); color: var(--accent); }
.wz-progress .label { white-space: nowrap; }
@media (max-width: 1100px) { .wz-progress button:not(.current) .label { display: none; } .wz-progress button:not(.current) { padding-right: 4px; } }

/* One step. Without a screenshot: a centered column. */
.wz-step { box-sizing: border-box; max-width: 880px; margin: 0 auto; padding: 24px 20px 40px; }
.wz-step > h2.wz-title, .wz-step .wz-title { font-size: 1.5rem; margin: 0 0 14px; }

/* With one: the column sits on the right; the screenshot's stage is pinned to the rest of the window. */
.wz-split { max-width: none; width: var(--wz-side); margin: 0 0 0 auto; min-height: calc(100dvh - var(--wz-top)); display: flex; flex-direction: column; }
.wz-split .tour-stage {
  position: fixed; top: var(--wz-top); left: 0; right: var(--wz-side); bottom: 0; z-index: 1;
  padding: 20px; box-sizing: border-box; border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 92%, var(--text));
}
.wz-split .tour-shot img { max-height: calc(100dvh - var(--wz-top) - 40px); width: auto; }
.wz-split .tour { margin: 0; }

/* Back / Next: at the bottom of the column, always in view. */
.wz-nav {
  position: sticky; bottom: 0; margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 14px 0 16px; background: var(--bg); border-top: 1px solid var(--border);
}
.wz-step:not(.wz-split) .wz-nav { position: static; border-top: 0; margin-top: 18px; }
.wz-nav[hidden] { display: none; }
.wz-nav button {
  font: inherit; font-weight: 600; margin: 0; padding: 10px 20px; border-radius: 8px; cursor: pointer;
  background: var(--accent); color: var(--accent-text); border: 1px solid var(--accent);
}
.wz-nav button.wz-back { background: none; color: var(--text); border-color: var(--border); font-weight: normal; }
.wz-nav button:disabled { opacity: 0.5; cursor: default; }
.wz-nav .wz-why { flex-basis: 100%; color: var(--muted); font-size: 0.88rem; margin: 0; }
/* The wizard's buttons drive the walkthrough: its own are hidden. */
.wz-step .tour .tour-nav .tour-prev, .wz-step .tour .tour-nav .tour-next, .wz-step .tour .tour-nav .tour-count { display: none; }

/* A list to tick off before Next. */
.wz-checks { list-style: none; padding: 0; margin: 8px 0; }
.wz-checks li { margin: 0 0 8px; }
.wz-checks label {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px;
  cursor: pointer; font-weight: normal; margin: 0;
}
.wz-checks input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--ok); }
.wz-checks label:has(input:checked) { border-color: var(--ok); }

@media (max-width: 860px) {
  .wz-split { width: auto; margin: 0; min-height: 0; display: block; }
  .wz-split .tour-stage { position: static; padding: 0; border: 0; background: none; margin-bottom: 12px; }
  .wz-split .tour-shot img { max-height: none; }
}
