/* ============================================================
   Proposals — create wizard (modal/sheet shell + step UI).
   Ported from the design kit `ui_kits/proposals/wizard.css`. Tokens only.

   Open/close is driven by the shared wv-oa modal base
   (`wevote--petition--wizard--modal`), which toggles `.is-shown` — so the
   kit's `.is-open` selector is renamed to `.is-shown` here. Desktop: centered
   card that fades + lifts. Mobile: full-screen sheet that slides up (with a drag
   handle for swipe-to-dismiss), matching the auth modal.
   ============================================================ */

/* ---- overlay + backdrop + panel ---- */
.wiz-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; pointer-events: none;
}
.wiz-overlay.is-shown { pointer-events: auto; }
.wiz-backdrop {
  position: absolute; inset: 0; border: 0; padding: 0; margin: 0; cursor: default;
  background: rgba(8, 10, 12, .46);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .22s ease;
}
.wiz-overlay.is-shown .wiz-backdrop { opacity: 1; }

.wiz-panel {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  width: min(820px, 100%); max-height: min(880px, 92vh);
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  border-radius: 22px; overflow: hidden;
  box-shadow: var(--shadow-pop);
  transform: translateY(14px) scale(.985); opacity: 0;
  transition: transform .3s cubic-bezier(.22,.61,.36,1), opacity .2s ease;
}
.wiz-overlay.is-shown .wiz-panel { transform: none; opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .wiz-backdrop, .wiz-panel { transition: none; }
}

/* mobile → full-screen sheet that slides up */
@media (max-width: 639px) {
  .wiz-overlay { padding: 0; align-items: stretch; }
  .wiz-panel {
    width: 100%; max-height: none; height: 100%;
    border: 0; border-radius: 0;
    transform: translateY(100%);
  }
  .wiz-overlay.is-shown .wiz-panel { transform: none; }
}

/* drag handle — swipe-to-dismiss on mobile only */
.wiz-handle { display: none; }
@media (max-width: 639px) {
  .wiz-handle { display: flex; justify-content: center; padding: 8px 0 2px; cursor: grab; }
  .wiz-handle::before { content: ""; width: 40px; height: 5px; border-radius: 999px; background: var(--hairline-strong); }
}

/* ---- header ---- */
.wiz-head {
  flex: none; padding: 18px 20px 0; background: var(--surface);
  border-bottom: 1px solid var(--hairline);
}
@media (min-width: 640px) { .wiz-head { padding: 22px 26px 0; } }
.wiz-head--plain { padding-bottom: 16px; }
@media (min-width: 640px) { .wiz-head--plain { padding-bottom: 18px; } }
.wiz-head__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wiz-title { font-family: "Poppins", sans-serif; font-weight: 700; font-size: 19px; letter-spacing: -.01em; color: var(--ink); }
@media (min-width: 640px) { .wiz-title { font-size: 21px; } }

/* ---- stepper (desktop) ---- */
.wiz-steps { display: flex; align-items: flex-start; padding: 18px 4px 18px; }
@media (max-width: 639px) { .wiz-steps { display: none; } }
.wiz-step { display: flex; flex-direction: column; align-items: center; gap: 7px; flex: none; width: 96px; position: relative; }
.wiz-step__node {
  width: 40px; height: 40px; border-radius: 999px; display: grid; place-items: center;
  background: var(--sunken); color: var(--faint);
  border: 1px solid var(--hairline); transition: all .25s ease; position: relative; z-index: 1;
}
.wiz-step__label { font-size: 12.5px; font-weight: 600; color: var(--faint); transition: color .2s ease; white-space: nowrap; }
.wiz-seg { flex: 1; height: 2px; background: var(--hairline); margin-top: 19px; border-radius: 999px; position: relative; overflow: hidden; }
.wiz-seg::after { content: ""; position: absolute; inset: 0; width: 0; background: var(--accent); transition: width .35s cubic-bezier(.22,.61,.36,1); }
.wiz-seg.is-filled::after { width: 100%; }
.wiz-step.is-current .wiz-step__node { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.wiz-step.is-current .wiz-step__label { color: var(--accent-ink); }
.wiz-step.is-done .wiz-step__node { background: var(--accent); color: #fff; border-color: var(--accent); }
.wiz-step.is-done .wiz-step__label { color: var(--ink); }

/* number ↔ check swap (the kit did this in JS; we server-render the node and
   toggle via the is-done state class, so the swap lives in CSS). */
.wiz-step__check { display: none; }
.wiz-step.is-done .wiz-step__num { display: none; }
.wiz-step.is-done .wiz-step__check { display: grid; place-items: center; }

/* ---- stepper (mobile compact) ---- */
.wiz-steps-m { display: none; padding: 14px 0 16px; }
@media (max-width: 639px) { .wiz-steps-m { display: block; } }
.wiz-steps-m__row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.wiz-steps-m__label { font-family: "Poppins", sans-serif; font-weight: 600; font-size: 15px; color: var(--ink); }
.wiz-steps-m__count { font-family: "Open Sans", monospace; font-size: 12px; color: var(--faint); }
.wiz-steps-m__track { display: flex; gap: 5px; }
.wiz-steps-m__seg { flex: 1; height: 5px; border-radius: 999px; background: var(--sunken); overflow: hidden; }
.wiz-steps-m__seg.is-on { background: var(--accent); }

/* ---- body ---- */
.wiz-body { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 20px 26px; }
@media (min-width: 640px) { .wiz-body { padding: 26px 26px 30px; } }
.wiz-body__head { margin-bottom: 20px; }
.wiz-body__title { font-family: "Poppins", sans-serif; font-weight: 600; font-size: 18px; color: var(--ink); letter-spacing: -.01em; }
.wiz-body__sub { margin-top: 4px; font-size: 14px; line-height: 1.5; color: var(--muted); }

/* ---- footer ---- */
.wiz-foot {
  flex: none; display: flex; align-items: center; gap: 12px;
  padding: 14px 20px; background: var(--surface); border-top: 1px solid var(--hairline);
}
@media (min-width: 640px) { .wiz-foot { padding: 16px 26px; } }
.wiz-foot__spacer { flex: 1; }
.wiz-foot--center { justify-content: center; }
@media (max-width: 639px) {
  .wiz-foot { gap: 10px; }
  .wiz-foot [data-wiz-cancel] { display: none; }
}

/* ---- form field ---- */
.wiz-label { display: flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.wiz-label .req { color: var(--st-unres-dot); }
.wiz-help { font-size: 12.5px; color: var(--faint); }
.wiz-input {
  width: 100%; height: 48px; padding: 0 14px; border-radius: 12px;
  background: var(--surface); border: 1.5px solid var(--hairline-strong);
  font-family: "Open Sans", sans-serif; font-size: 15px; color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.wiz-input::placeholder { color: var(--faint); }
.wiz-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.wiz-input.is-invalid { border-color: var(--st-unres-dot); }
.wiz-counter { font-family: "Open Sans", monospace; font-size: 12.5px; font-weight: 600; color: var(--faint); }
.wiz-counter.is-valid { color: var(--accent-ink); }
.wiz-counter.is-invalid { color: var(--st-unres-fg); }

/* ---- tip box ---- */
.wiz-tip {
  border-radius: 14px; background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
  padding: 14px 16px;
}
.wiz-tip__title { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; color: var(--accent-ink); margin-bottom: 8px; }
.wiz-tip ul { margin: 0; padding-left: 18px; }
.wiz-tip li { font-size: 13.5px; line-height: 1.7; color: var(--muted); }

/* ---- jurisdiction cards ---- */
.wiz-juris { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .wiz-juris { grid-template-columns: repeat(4, 1fr); } }
.wiz-jcard {
  text-align: left; cursor: pointer; border-radius: 16px;
  border: 1.5px solid var(--hairline-strong); background: var(--surface);
  padding: 14px; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.wiz-jcard:hover { border-color: var(--faint); }
.wiz-jcard.is-on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft); }
.wiz-jcard__icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 10px; }
.wiz-jcard__name { font-size: 14.5px; font-weight: 700; color: var(--ink); }
.wiz-jcard__desc { font-size: 12.5px; line-height: 1.4; color: var(--muted); margin-top: 3px; }

/* ---- rich-text editor ---- */
.wiz-rt { border: 1.5px solid var(--hairline-strong); border-radius: 14px; overflow: hidden; transition: border-color .15s ease, box-shadow .15s ease; }
.wiz-rt.is-focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.wiz-rt.is-invalid { border-color: var(--st-unres-dot); }
.wiz-rt__tools { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 8px; background: var(--sunken); border-bottom: 1px solid var(--hairline); }
.wiz-rt__group { display: flex; align-items: center; gap: 2px; }
.wiz-rt__div { width: 1px; height: 22px; background: var(--hairline-strong); margin: 0 6px; }
.wiz-rt__btn {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px;
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.wiz-rt__btn:hover { background: var(--surface); color: var(--ink); }
.wiz-rt__btn.is-on { background: var(--accent-soft); color: var(--accent-ink); }
.wiz-rt__area {
  min-height: 220px; max-height: 360px; overflow-y: auto; padding: 14px 16px;
  font-size: 15px; line-height: 1.65; color: var(--ink); background: var(--surface); outline: none;
}
.wiz-rt__area:empty::before { content: attr(data-placeholder); color: var(--faint); }
.wiz-rt__area p { margin: 0 0 10px; }
.wiz-rt__area h3 { font-family: "Poppins", sans-serif; font-weight: 700; font-size: 18px; margin: 4px 0 8px; }
.wiz-rt__area ul, .wiz-rt__area ol { margin: 0 0 10px; padding-left: 22px; }
.wiz-rt__area li { margin: 2px 0; }
.wiz-rt__area blockquote { margin: 0 0 10px; padding: 4px 0 4px 14px; border-left: 3px solid var(--accent); color: var(--muted); }
.wiz-rt__area a { color: var(--accent-ink); text-decoration: underline; }

/* ---- tags ---- */
.wiz-tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  min-height: 48px; padding: 7px 10px; border-radius: 12px;
  border: 1.5px solid var(--hairline-strong); background: var(--surface); transition: border-color .15s ease, box-shadow .15s ease; }
.wiz-tags.is-focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.wiz-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 6px 0 11px;
  border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-size: 13px; font-weight: 600; }
.wiz-chip button { width: 20px; height: 20px; display: grid; place-items: center; border: 0; border-radius: 999px;
  background: transparent; color: var(--accent-ink); cursor: pointer; opacity: .7; }
.wiz-chip button:hover { opacity: 1; background: color-mix(in srgb, var(--accent) 18%, transparent); }
.wiz-tags input { flex: 1; min-width: 120px; height: 32px; border: 0; outline: none; background: transparent;
  font-size: 14px; color: var(--ink); }
.wiz-tags input::placeholder { color: var(--faint); }

/* ---- image dropzones ---- */
.wiz-imgs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 479px) { .wiz-imgs { grid-template-columns: 1fr; } }
.wiz-drop {
  position: relative; aspect-ratio: 4 / 3; border-radius: 14px; cursor: pointer;
  border: 1.5px dashed var(--hairline-strong); background: var(--sunken);
  display: grid; place-items: center; text-align: center; overflow: hidden;
  transition: border-color .15s ease, background .15s ease;
}
.wiz-drop:hover { border-color: var(--accent); background: var(--accent-soft); }
.wiz-drop__inner { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px; color: var(--faint); }
.wiz-drop__t { font-size: 13px; font-weight: 600; color: var(--muted); }
.wiz-drop__s { font-size: 11.5px; color: var(--faint); }
.wiz-drop.is-filled { border-style: solid; border-color: var(--hairline); background: var(--surface); }
.wiz-drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.wiz-drop__rm { position: absolute; top: 8px; right: 8px; z-index: 2; width: 28px; height: 28px; border: 0; border-radius: 999px;
  background: rgba(8,10,12,.62); color: #fff; display: grid; place-items: center; cursor: pointer; }
.wiz-drop__rm:hover { background: rgba(8,10,12,.82); }

/* ---- video rows ---- */
.wiz-vid-row { display: flex; gap: 8px; align-items: center; }
.wiz-vid-row + .wiz-vid-row { margin-top: 10px; }
.wiz-vid-rm { flex: none; width: 44px; height: 48px; display: grid; place-items: center; border-radius: 12px;
  border: 1.5px solid var(--hairline-strong); background: var(--surface); color: var(--faint); cursor: pointer; }
.wiz-vid-rm:hover { color: var(--st-unres-fg); border-color: var(--st-unres-dot); }

/* ---- review summary ---- */
.wiz-rev { border-radius: 16px; background: var(--sunken); border: 1px solid var(--hairline); padding: 18px 20px; }
.wiz-rev + .wiz-rev { margin-top: 14px; }
.wiz-rev__h { font-family: "Poppins", sans-serif; font-weight: 700; font-size: 15px; color: var(--ink); margin-bottom: 12px; }
.wiz-rev__row { margin-bottom: 12px; }
.wiz-rev__row:last-child { margin-bottom: 0; }
.wiz-rev__k { font-size: 12px; color: var(--faint); margin-bottom: 3px; }
.wiz-rev__v { font-size: 14.5px; color: var(--ink); line-height: 1.5; }
.wiz-warn { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; padding: 14px 16px; border-radius: 14px;
  background: var(--st-pending-bg); color: var(--st-pending-fg); }
.wiz-warn__t { font-size: 13.5px; font-weight: 700; }
.wiz-warn__s { font-size: 13px; line-height: 1.5; opacity: .92; margin-top: 2px; }

/* ---- publish / celebration ---- */
.wiz-pub { padding: 6px 2px 2px; max-width: 460px; margin-left: auto; margin-right: auto; }
.pub-hero { text-align: center; padding: 6px 0 2px; }
.pub-medal { position: relative; width: 76px; height: 76px; margin: 4px auto 18px; display: grid; place-items: center; }
.pub-medal__halo { position: absolute; inset: -12px; border-radius: 999px;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 66%); }
.pub-medal__check { position: relative; z-index: 2; width: 64px; height: 64px; border-radius: 999px;
  background: linear-gradient(158deg, var(--accent) 0%, var(--accent-hover) 100%); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 36%, transparent), inset 0 1px 0 rgba(255,255,255,.24); }
.pub-medal__check svg { width: 30px; height: 30px; stroke-width: 2.4; }
@media (prefers-reduced-motion: no-preference) {
  .pub-medal__check { animation: pub-pop .55s cubic-bezier(.34,1.56,.64,1) both; }
}
@keyframes pub-pop { 0% { transform: scale(.5); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.pub-title { font-family: "Poppins", sans-serif; font-weight: 600; font-size: 23px; letter-spacing: -.02em; color: var(--ink); margin: 0; }
.pub-sub { font-size: 14px; line-height: 1.5; color: var(--muted); margin: 7px auto 0; max-width: 40ch; text-wrap: pretty; }
.pub-card { margin-top: 22px; padding: 15px 16px; border-radius: 16px; background: var(--surface);
  border: 1px solid var(--hairline); box-shadow: var(--shadow-soft); }
.pub-card__row { display: flex; align-items: center; gap: 12px; }
.pub-card__emblem { flex: none; width: 40px; height: 40px; border-radius: 11px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; }
.pub-card__body { min-width: 0; flex: 1; }
.pub-card__title { display: block; font-family: "Poppins", sans-serif; font-weight: 600; font-size: 15px; line-height: 1.3; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pub-card__meta { display: flex; align-items: center; gap: 9px; margin-top: 6px; font-size: 12px; color: var(--faint); }
.pub-prog { margin-top: 14px; }
.pub-prog__bar { height: 6px; border-radius: 999px; background: var(--sunken); overflow: hidden; }
.pub-prog__bar i { display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  animation: pub-grow .9s cubic-bezier(.22,.61,.36,1) .2s both; }
@keyframes pub-grow { from { width: 0; } }
.pub-prog__meta { margin-top: 8px; font-size: 12px; color: var(--muted); }
.pub-prog__meta b { color: var(--ink); font-weight: 700; }
.pub-share { margin-top: 22px; }
.pub-share__copy { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 6px 0 14px; border-radius: 12px;
  background: var(--sunken); border: 1px solid var(--hairline); }
.pub-share__url { flex: 1; min-width: 0; font-family: "Open Sans", monospace; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pub-share__copybtn { flex: none; height: 34px; padding: 0 16px; border-radius: 9px; border: 0; background: var(--accent); color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s ease; }
.pub-share__copybtn:hover { background: var(--accent-hover); }
.pub-share__copybtn.is-copied { background: var(--st-res-dot); }
.pub-share__row { display: flex; gap: 10px; justify-content: center; margin-top: 12px; }
.pub-share-btn { width: 46px; height: 46px; border-radius: 999px; border: 0; background: var(--sunken); color: var(--muted);
  display: grid; place-items: center; cursor: pointer; transition: background .15s ease, color .15s ease, transform .12s ease, box-shadow .15s ease; }
.pub-share-btn:hover { background: var(--accent-soft); color: var(--accent-ink); transform: translateY(-1px); box-shadow: var(--shadow-soft); }
.pub-share-btn:active { transform: translateY(0); }
.pub-glyph { font-family: "Poppins", sans-serif; font-weight: 700; font-size: 17px; line-height: 1; }
.pub-next { margin-top: 24px; }
.pub-next__h { font-size: 11px; font-family: "Open Sans", monospace; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); margin-bottom: 2px; }
.pub-next__list { list-style: none; margin: 0; padding: 0; }
.pub-step { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--hairline); }
.pub-step:last-child { border-bottom: 0; }
.pub-step__ic { flex: none; width: 30px; height: 30px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; }
.pub-step__tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pub-step__t { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.pub-step__s { font-size: 12.5px; line-height: 1.45; color: var(--muted); text-wrap: pretty; }
.pub-donate { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 20px; padding-top: 16px;
  border-top: 1px solid var(--hairline); font-size: 12.5px; color: var(--muted); }
.pub-donate svg { color: var(--accent); flex: none; }
.pub-donate a { font-weight: 600; color: var(--accent); text-decoration: none; }
.pub-donate a:hover { color: var(--accent-hover); text-decoration: underline; }
.pub-cta { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; max-width: 460px; margin: 0 auto; height: 46px;
  border-radius: 13px; border: 0; cursor: pointer;
  background: linear-gradient(158deg, var(--accent) 0%, var(--accent-hover) 100%); color: #fff;
  font-family: "Poppins", sans-serif; font-size: 14.5px; font-weight: 600; letter-spacing: -.01em;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 30%, transparent), inset 0 1px 0 rgba(255,255,255,.2);
  transition: filter .15s ease, transform .12s ease, box-shadow .15s ease; }
.pub-cta:hover { filter: brightness(1.04); box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 36%, transparent), inset 0 1px 0 rgba(255,255,255,.2); }
.pub-cta:active { transform: translateY(1px); box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 28%, transparent); }
.pub-cta svg { width: 18px; height: 18px; transition: transform .18s ease; }
.pub-cta:hover svg { transform: translateX(3px); }
.wiz-foot--cta { display: block; }

/* ---- confetti ---- */
.wiz-confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 3; }
.wiz-confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; opacity: 0; animation: wiz-fall 2.4s cubic-bezier(.3,.7,.5,1) forwards; }
@keyframes wiz-fall { 0% { transform: translateY(-10px) rotate(0); opacity: 0; } 8% { opacity: 1; } 100% { transform: translateY(560px) rotate(540deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .wiz-confetti { display: none; } }
