/* ═════════════════════════════════════════════════════════════════════
   wizard.css · Onboarding wizard. Prototype FLOW/structure, but skinned to the
   CURRENT app: same tokens (base.css :root), same font (Inter), same component
   idioms (var(--card)/(--border), --accent buttons, focus glow). Does NOT touch
   any existing CSS — it only styles the wiz-* classes wizard.js renders.
   ═════════════════════════════════════════════════════════════════════ */

/* Full takeover: hide the dashboard chrome while the wizard is up. */
body.wizard-active nav,
body.wizard-active .main,
body.wizard-active #layerRoot { display: none !important; }
body.wizard-active { overflow: hidden; }

.wiz{
  position: fixed; inset: 0; z-index: 60;
  display: grid; grid-template-columns: 300px minmax(0, 1fr);  /* minmax(0,…) so the work column can't blow out to content min-width */
  background: var(--bg); color: var(--text);
  font-family: 'Inter', sans-serif;
}

/* ── Rail (dispatch board) ──────────────────────────────── */
.wiz-rail{ background: var(--surface); border-right: 1px solid var(--border); padding: calc(30px + env(safe-area-inset-top)) 26px 30px calc(26px + env(safe-area-inset-left)); display: flex; flex-direction: column; }
.wiz-brand{ font-family:'Bebas Neue', sans-serif; font-size: 1.4rem; letter-spacing:.04em; display:flex; align-items:center; gap:10px; margin-bottom: 36px; }
.wiz-brand-2{ color: var(--accent); }
.wiz-mark{ width: 26px; height: 26px; border-radius: 7px; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-glow); flex: none; }
.wiz-steps{ list-style: none; margin: 0; padding: 0; flex: 1; position: relative; }
.wiz-steps::before{ content:""; position: absolute; left: 13px; top: 14px; bottom: 18px; width: 2px; background: var(--border); }
.wiz-step{ position: relative; padding: 0 0 4px 40px; margin-bottom: 18px; cursor: pointer; color: var(--muted2); }
.wiz-dot{ position: absolute; left: 4px; top: 1px; width: 20px; height: 20px; border-radius: 50%; background: var(--card2); border: 2px solid var(--border); display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--muted2); z-index: 1; transition: .18s; }
.wiz-lbl{ font-size: 13.5px; font-weight: 600; line-height: 1.2; display: block; padding-top: 2px; }
.wiz-substep{ font-size: 11.5px; color: var(--muted); margin-top: 2px; display:block; }
.wiz-step.done{ color: var(--text); }
.wiz-step.done .wiz-dot{ background: var(--green); border-color: var(--green); color: #06140c; }
.wiz-step.active{ color: var(--text); }
.wiz-step.active .wiz-dot{ background: var(--accent); border-color: var(--accent); color: #1a1205; box-shadow: 0 0 0 5px var(--accent-glow); }
.wiz-step.locked{ cursor: not-allowed; opacity: .55; }
.wiz-rail-foot{ font-size: 11.5px; color: var(--muted2); border-top: 1px solid var(--border); padding-top: 16px; margin-top: 8px; line-height: 1.5; }

/* ── Work area ──────────────────────────────────────────── */
.wiz-work{ display: flex; flex-direction: column; min-width: 0; }
.wiz-top{ display: none; }                       /* desktop: the rail carries progress */
.wiz-stage{ flex: 1; display: grid; place-items: start center; padding: 46px 40px 26px; overflow-y: auto; }
.wiz-card{ width: 100%; max-width: 560px; min-width: 0; animation: wiz-rise .4s cubic-bezier(.2,.7,.3,1) both; }
@keyframes wiz-rise{ from{ opacity:0; transform: translateY(8px); } to{ opacity:1; transform: none; } }

.wiz-eyebrow{ font-weight: 700; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--accent-light); margin-bottom: 14px; display: flex; align-items: center; gap: 9px; }
.wiz-eyebrow span{ color: var(--muted2); }
.wiz-h1{ font-family:'Inter', sans-serif; font-weight: 800; font-size: 32px; letter-spacing: -.02em; line-height: 1.05; margin: 0 0 8px; }
.wiz-lede{ color: var(--muted2); font-size: 15px; margin: 0 0 26px; max-width: 48ch; line-height: 1.5; }

/* ── Fields ─────────────────────────────────────────────── */
.wiz-field{ display: block; margin-bottom: 18px; }
.wiz-cap{ font-size: 12.5px; font-weight: 600; margin-bottom: 7px; display: flex; justify-content: space-between; color: var(--text); }
.wiz-cap em{ font-style: normal; color: var(--muted2); font-weight: 500; }
.wiz-field input, .wiz-field select{
  width: 100%; font: inherit; font-size: 15px; padding: 12px 13px;
  border: 1.5px solid var(--border); border-radius: 9px; background: var(--card2); color: var(--text);
  transition: border-color .15s, box-shadow .15s; outline: none;
}
.wiz-field input:focus, .wiz-field select:focus{ border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-glow); }
.wiz-field input::placeholder{ color: var(--muted); }
.wiz-row{ display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wiz-row .wiz-field{ min-width: 0; }
.wiz-hint{ font-size: .72rem; color: var(--muted); line-height: 1.5; margin: -4px 0 4px; }

/* ── Handle ─────────────────────────────────────────────── */
.wiz-handle{ border: 1.5px solid var(--border); border-radius: 12px; background: var(--card); overflow: hidden; transition: border-color .18s; }
.wiz-handle.ok{ border-color: var(--green); } .wiz-handle.no{ border-color: var(--red); }
.wiz-handle-row{ display: flex; align-items: center; padding: 6px 6px 6px 16px; gap: 4px; }
.wiz-handle-pre{ font-weight: 600; font-size: 18px; color: var(--muted2); flex-shrink: 0; }
.wiz-handle-row input{ border: none; background: transparent; box-shadow: none !important; padding: 10px 4px; font-weight: 700; font-size: 18px; flex: 1; min-width: 0; color: var(--text); outline: none; }
.wiz-pill{ font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 7px 12px; border-radius: 8px; white-space: nowrap; display: flex; align-items: center; gap: 6px; flex-shrink: 0; max-width: 50%; overflow: hidden; text-overflow: ellipsis; }
.wiz-pill.checking{ background: var(--card2); color: var(--muted2); }
.wiz-pill.ok{ background: rgba(34,197,94,.14); color: var(--green); }
.wiz-pill.no{ background: rgba(248,113,113,.14); color: var(--red); }
.wiz-spin{ width: 11px; height: 11px; border: 2px solid var(--muted2); border-top-color: transparent; border-radius: 50%; animation: wiz-spin .6s linear infinite; }
@keyframes wiz-spin{ to{ transform: rotate(360deg); } }
.wiz-meta{ display: flex; justify-content: space-between; padding: 9px 16px; border-top: 1px dashed var(--border); font-size: 12px; color: var(--muted2); background: var(--card2); }
.wiz-meta .bad{ color: var(--red); }
.wiz-suggest{ margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.wiz-s-lbl{ font-size: 12.5px; color: var(--muted2); }
.wiz-chip{ font: inherit; font-size: 13px; font-weight: 600; border: 1.5px solid var(--border); background: var(--card); color: var(--text); padding: 6px 11px; border-radius: 20px; cursor: pointer; transition: .14s; }
.wiz-chip:hover{ border-color: var(--accent); background: var(--accent-glow); }
.wiz-links{ margin-top: 18px; display: grid; gap: 8px; }
.wiz-lp{ display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted2); }
.wiz-lp .k{ font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted2); width: 54px; flex: none; }
.wiz-lp b{ color: var(--text); }

/* ── Template grid ──────────────────────────────────────── */
.wiz-grid{ display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.wiz-opt{ border: 1.5px solid var(--border); border-radius: 12px; padding: 16px; background: var(--card); cursor: pointer; transition: .15s; position: relative; }
.wiz-opt:hover{ border-color: var(--accent); }
.wiz-opt.sel{ border-color: var(--accent); background: var(--accent-glow); box-shadow: 0 0 0 3px var(--accent-glow); }
.wiz-opt.soon{ opacity: .5; cursor: not-allowed; }
.wiz-opt.soon:hover{ border-color: var(--border); }
.wiz-ic{ font-size: 22px; margin-bottom: 9px; display: block; }
.wiz-opt-t{ font-weight: 700; font-size: 14.5px; margin-bottom: 2px; }
.wiz-opt-d{ font-size: 12px; color: var(--muted2); }
.wiz-check{ position: absolute; top: 12px; right: 12px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: #1a1205; display: none; place-items: center; font-size: 11px; font-weight: 800; }
.wiz-opt.sel .wiz-check{ display: grid; }
.wiz-soon{ position: absolute; top: 12px; right: 12px; font-size: 9.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted2); border: 1px solid var(--border); border-radius: 6px; padding: 2px 6px; }

/* ── Plans ──────────────────────────────────────────────── */
.wiz-plans{ display: grid; gap: 11px; }
.wiz-plan{ border: 1.5px solid var(--border); border-radius: 12px; padding: 15px 16px; background: var(--card); cursor: pointer; transition: .15s; display: flex; align-items: flex-start; gap: 14px; }
.wiz-plan:hover{ border-color: var(--accent); }
.wiz-plan.sel{ border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.wiz-radio{ width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border); margin-top: 2px; flex: none; }
.wiz-plan.sel .wiz-radio{ border-color: var(--accent); background: radial-gradient(circle at center, var(--accent) 0 5px, transparent 6px); }
.wiz-plan-body{ flex: 1; }
.wiz-plan-h{ display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.wiz-plan-h b{ font-weight: 700; font-size: 15.5px; }
.wiz-price{ font-weight: 700; font-size: 15px; white-space: nowrap; }
.wiz-price small{ font-weight: 500; color: var(--muted2); font-size: 11.5px; }
.wiz-plan-desc{ font-size: 12.5px; color: var(--muted2); margin-top: 3px; }
.wiz-tag{ font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; background: var(--accent-glow); color: var(--accent-light); margin-left: 8px; }
.wiz-whiteglove{ margin-top: 10px; font-size: 12px; color: var(--accent-light); background: var(--accent-glow); border-radius: 8px; padding: 9px 11px; display: none; gap: 7px; line-height: 1.4; }
.wiz-plan.sel.t4 .wiz-whiteglove, .wiz-whiteglove.show{ display: flex; }

/* ── Publish summary + live ─────────────────────────────── */
.wiz-summary{ border: 1.5px solid var(--border); border-radius: 12px; background: var(--card); padding: 4px 16px; margin-bottom: 8px; }
.wiz-sum-row{ display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.wiz-sum-row:last-child{ border-bottom: none; }
.wiz-sum-row .k{ color: var(--muted2); font-weight: 500; font-size: 13.5px; }
.wiz-sum-row .v{ font-weight: 600; font-size: 13.5px; }
.wiz-err{ color: var(--red); font-size: 13px; margin-top: 12px; min-height: 1px; }

.wiz-live{ border: 1.5px solid var(--green); background: rgba(34,197,94,.10); border-radius: 14px; padding: 24px; text-align: center; }
.wiz-live-badge{ font-weight: 800; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--green); display: inline-flex; align-items: center; gap: 7px; margin-bottom: 12px; }
.wiz-led{ width: 9px; height: 9px; border-radius: 50%; background: var(--green); animation: wiz-pulse 1.8s infinite; }
@keyframes wiz-pulse{ 0%{ box-shadow: 0 0 0 0 rgba(34,197,94,.45); } 70%{ box-shadow: 0 0 0 10px rgba(34,197,94,0); } 100%{ box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
.wiz-urlbox{ display: flex; align-items: center; gap: 8px; background: var(--card); border: 1.5px solid var(--border); border-radius: 9px; padding: 8px 8px 8px 13px; margin: 8px auto; max-width: 380px; }
.wiz-urlbox .u{ flex: 1; text-align: left; font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wiz-copy{ font: inherit; font-size: 12px; font-weight: 600; border: none; background: var(--accent); color: #1a1205; padding: 7px 12px; border-radius: 7px; cursor: pointer; }
.wiz-copy.done{ background: var(--green); color: #06140c; }
.wiz-dash{ margin-top: 18px; width: auto; display: inline-block; padding: 11px 22px; }

/* ── Footer + buttons ───────────────────────────────────── */
.wiz-foot{ border-top: 1px solid var(--border); background: var(--surface); padding: 16px max(40px, env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) max(40px, env(safe-area-inset-left)); display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.wiz-midfoot{ flex: 1; text-align: center; }
.wiz-btn{ font: inherit; font-weight: 600; font-size: 14.5px; padding: 12px 22px; border-radius: 10px; cursor: pointer; border: 1.5px solid transparent; transition: .15s; }
.wiz-btn.ghost{ background: transparent; border-color: var(--border); color: var(--text); }
.wiz-btn.ghost:hover{ border-color: var(--accent); color: var(--accent-light); }
.wiz-btn.ghost.hide{ visibility: hidden; }
.wiz-btn.primary{ background: var(--accent); color: #1a1205; }
.wiz-btn.primary:hover{ background: var(--accent-light); }
.wiz-btn.primary:disabled{ background: var(--card2); color: var(--muted2); cursor: not-allowed; }
.wiz-btn.go{ background: var(--green); color: #06140c; }
.wiz-btn.go:hover{ filter: brightness(1.08); }
.wiz-skip{ font: inherit; font-size: 13px; color: var(--muted2); background: none; border: none; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.wiz-skip:hover{ color: var(--text); }

/* transient toast for start errors (cap / race) */
.wiz-flash{ position: fixed; bottom: 88px; left: 50%; transform: translateX(-50%) translateY(8px); background: var(--card2); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 11px 16px; font-size: 13px; opacity: 0; pointer-events: none; transition: .2s; z-index: 70; max-width: 90vw; }
.wiz-flash.show{ opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Mobile: collapse rail → topbar progress (prototype parity) ── */
@media (max-width: 820px){
  .wiz{ grid-template-columns: minmax(0, 1fr); }
  .wiz-rail{ display: none; }
  .wiz-top{ display: flex; align-items: center; gap: 14px; padding: calc(14px + env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 14px max(20px, env(safe-area-inset-left)); background: var(--surface); border-bottom: 1px solid var(--border); }
  .wiz-pbar{ flex: 1; height: 6px; background: var(--card2); border-radius: 4px; overflow: hidden; }
  .wiz-pbar i{ display: block; height: 100%; background: var(--accent); transition: width .3s; }
  .wiz-pc{ font-size: 12px; color: var(--muted2); white-space: nowrap; }
  .wiz-stage{ padding: 30px max(20px, env(safe-area-inset-right)) 24px max(20px, env(safe-area-inset-left)); }
  .wiz-h1{ font-size: 26px; }
  .wiz-foot{ padding: 14px max(20px, env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); }
  .wiz-grid{ grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce){ .wiz *{ animation: none !important; transition: none !important; } }

/* ── Official sign-in / create-account screen (app.js renderLogin) ──
   Full-viewport column: hero centered up top, CTA + footer pinned to the bottom.
   Fixed so it escapes .main's padding and fills the screen regardless. */
.cs-auth{
  position: fixed; inset: 0; z-index: 40; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  text-align: center; gap: 0; min-height: 0; overflow-y: auto;
  padding: calc(28px + env(safe-area-inset-top)) max(24px, env(safe-area-inset-right))
           calc(24px + env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
}
.cs-auth-hero{ flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 13px; }
.cs-auth-bottom{ width: 100%; max-width: 380px; display: flex; flex-direction: column; align-items: center; gap: 16px; flex-shrink: 0; }
.cs-logo{ height: 40px; width: auto; max-width: 220px; object-fit: contain; margin-bottom: 4px; }
.cs-wordmark{ font-family: 'Bebas Neue', sans-serif; font-size: 1.9rem; letter-spacing: .05em; color: var(--text); margin-bottom: 4px; }
.cs-google{ display: inline-flex; align-items: center; gap: 10px; width: 100%; max-width: 320px; justify-content: center; }
.cs-g{ width: 18px; height: 18px; flex: none; }
.cs-foot{ display: grid; gap: 8px; max-width: 360px; }
.cs-fine{ font-size: .72rem; color: var(--muted2); line-height: 1.55; }
.cs-copyright{ font-size: .68rem; color: var(--muted); line-height: 1.5; }