/* Visualizer page — uses the same vocabulary as styles.css; only feature-specific bits here.
   Typography (.h2/.h3/.italic-serif/.aside/.eyebrow), buttons (.btn/.btn-primary/.btn-ghost) and
   form primitives come from styles.css. This file only styles the picker/upload/progress/result
   feature-specific chrome, using tokens (--paper, --ink, --bone, --line, --navy). */

.viz-main { background: var(--paper); }

/* Hero ------------------------------------------------------------------ */
.viz-hero {
  padding: 96px 0 56px;
  background: linear-gradient(180deg, var(--bone) 0%, var(--paper) 100%);
  border-bottom: 1px solid var(--line-soft);
}
.viz-hero-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: 18px;
}
.viz-hero-kicker .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success, #16a34a);
  box-shadow: 0 0 0 4px rgba(22,163,74,.18);
}

.viz-stepper {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px 14px;
  margin: 44px auto 0;
  max-width: 960px;
  padding: 14px 18px;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  box-shadow: 0 1px 0 rgba(14,26,34,.02), 0 12px 28px -18px rgba(14,26,34,.18);
}
.viz-stepper .st {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .04em;
  line-height: 1;
  white-space: nowrap;
  transition: color .18s ease, background-color .18s ease;
}
.viz-stepper .st + .st::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 1px;
  background: var(--line);
  margin: 0 4px 0 -6px;
}
.viz-stepper .st-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-mute);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  flex-shrink: 0;
}
.viz-stepper .st-lbl {
  font-family: inherit;
  color: inherit;
}
.viz-stepper .st.done {
  color: var(--ink-soft);
}
.viz-stepper .st.done .st-badge {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
  font-size: 12px;
}
.viz-stepper .st.active {
  color: var(--ink);
  background: var(--bone);
  font-weight: 600;
}
.viz-stepper .st.active .st-badge {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(31,182,193,.18);
}

/* Body ------------------------------------------------------------------ */
.viz-body { padding: 56px 0 120px; }

.viz-step { max-width: 920px; margin: 0 auto; }
.viz-step-head { margin-bottom: 36px; }
.viz-step-head .section-num { align-self: start; }

.viz-field { margin-bottom: 32px; }
.viz-label {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 12px;
}

/* Picker */
.viz-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.viz-cat {
  text-align: start;
  background: var(--bone);
  border: 1px solid var(--line-soft);
  padding: 18px 18px 16px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.viz-cat:hover { border-color: var(--ink-soft); background: var(--paper); }
.viz-cat.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.viz-cat-en {
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-mute);
}
.viz-cat.active .viz-cat-en { color: rgba(251,250,246,.55); }
.viz-cat-he {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
  margin: 6px 0;
  color: var(--ink);
}
.viz-cat.active .viz-cat-he { color: var(--paper); }
.viz-cat-desc { font-size: 13px; color: var(--ink-soft); line-height: 1.5; }
.viz-cat.active .viz-cat-desc { color: rgba(251,250,246,.7); }

.viz-models { display: flex; flex-wrap: wrap; gap: 8px; }
.viz-pill {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 9px 16px;
  font-size: 14px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all .15s ease;
}
.viz-pill:hover { border-color: var(--ink-soft); color: var(--ink); }
.viz-pill.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* Models we can't auto-generate yet: still selectable (we want the lead), but
   labelled up front so nobody uploads three photos expecting an instant render. */
.viz-pill.is-manual { display: inline-flex; align-items: center; gap: 8px; border-style: dashed; }
.viz-pill-tag {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .02em;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0,0,0,.06);
  color: var(--ink-soft);
  white-space: nowrap;
}
.viz-pill.is-manual.active .viz-pill-tag { background: rgba(251,250,246,.18); color: var(--paper); }
.viz-manual-note {
  max-width: 620px;
  margin: 18px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--accent, #1fb6c1);
  background: rgba(0,0,0,.02);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.viz-colors { display: flex; flex-wrap: wrap; gap: 8px; }
.viz-color {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 7px 13px 7px 9px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all .15s ease;
}
.viz-color .dot {
  width: 14px; height: 14px; border-radius: 50%;
  border: 1px solid rgba(0,0,0,.12);
  box-shadow: inset 0 -3px 6px rgba(0,0,0,.18);
}
.viz-color:hover { border-color: var(--ink-soft); color: var(--ink); }
.viz-color.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.viz-color.active .dot { border-color: rgba(255,255,255,.4); }

/* Upload */
.viz-drop {
  background: var(--bone);
  border: 2px dashed var(--line);
  padding: 18px;
  margin-bottom: 18px;
}
.viz-drop.empty { padding: 0; }
.viz-drop-empty {
  padding: 60px 24px;
  text-align: center;
  cursor: pointer;
}
.viz-drop-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  font-size: 28px;
  color: var(--ink-mute);
  margin: 0 auto 14px;
}
.viz-drop-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.viz-drop-sub {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .08em;
  color: var(--ink-mute);
  margin-top: 8px;
}

.viz-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.viz-tile {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--paper);
  overflow: hidden;
  border: 1px solid var(--line-soft);
}
.viz-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.viz-tile-add {
  border: 2px dashed var(--line);
  background: rgba(251, 250, 246, .6);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--ink-mute);
  gap: 6px;
}
.viz-tile-add .plus { font-size: 28px; }
.viz-tile-add .lbl { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .08em; }
.viz-tile-x {
  position: absolute; top: 8px; inset-inline-start: 8px;
  background: rgba(14, 26, 34, .6);
  color: var(--paper);
  border: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}
.viz-tile-meta {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(0deg, rgba(14, 26, 34, .55), transparent);
  color: var(--paper);
  display: flex; justify-content: space-between;
  padding: 18px 10px 8px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .04em;
}

.viz-tips {
  background: var(--bone);
  border: 1px solid var(--line-soft);
  padding: 18px 20px;
  margin: 20px 0 8px;
}
.viz-tips .t {
  font-family: var(--font-mono);
  font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 10px;
}
.viz-tips ul { margin: 0; padding-inline-start: 18px; color: var(--ink-soft); line-height: 1.7; font-size: 14px; }

/* Contact-step form fields — local helpers, neutral tokens */
.viz-contact-form { max-width: 520px; }
.viz-contact-form .fld { display: block; margin-bottom: 14px; }
.viz-contact-form .fld > span {
  display: block;
  font-size: 12.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 6px;
  font-family: var(--font-mono);
}
.viz-contact-form .fld > span em { color: var(--danger, #d97706); font-style: normal; margin-inline-start: 2px; }
.viz-contact-form .fld input,
.viz-contact-form .fld select,
.viz-contact-form .fld textarea {
  width: 100%; font: inherit; font-size: 15px; color: var(--ink);
  background: var(--bone);
  border: 1px solid var(--line-soft);
  padding: 11px 12px;
  outline: none;
  transition: border-color .15s ease, background .15s ease;
}
.viz-contact-form .fld input:focus,
.viz-contact-form .fld select:focus,
.viz-contact-form .fld textarea:focus { border-color: var(--ink); background: var(--paper); }
.viz-contact-form .fld textarea { resize: vertical; min-height: 70px; }

/* Common actions row */
.viz-actions {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
}
.btn-block { width: 100%; justify-content: center; }

.viz-err {
  margin-top: 12px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 13px;
  padding: 10px 12px;
  border-inline-start: 3px solid #ef4444;
}
.viz-err-box { max-width: 520px; margin-top: 14px; }

/* Progress */
.viz-progress { display: flex; justify-content: center; padding: 20px 0; }
.viz-progress-card {
  width: 100%;
  max-width: 640px;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  padding: 40px 36px 32px;
}
.viz-progress-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--success, #16a34a);
}
.viz-progress-kicker .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success, #16a34a);
  box-shadow: 0 0 0 4px rgba(22,163,74,.18);
  animation: vizPulse 1.6s ease-in-out infinite;
}
@keyframes vizPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(22,163,74,.18); }
  50%      { box-shadow: 0 0 0 10px rgba(22,163,74,0); }
}
.viz-progress-h2 { margin: 16px 0 10px; }
.viz-progress-card .lede { margin: 0 0 22px; }

.viz-bar {
  position: relative;
  height: 10px;
  background: var(--bone-deep, var(--bone));
  overflow: hidden;
  margin-bottom: 28px;
}
.viz-bar-fill {
  position: absolute;
  inset-inline-start: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, var(--ink), var(--ink-soft));
  transition: width .25s ease;
}
.viz-bar-pct {
  position: absolute;
  inset-inline-end: 8px; top: -22px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-mute);
  letter-spacing: .05em;
}

.viz-stages { list-style: none; margin: 0; padding: 0; }
.viz-stages li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line-soft);
}
.viz-stages li:first-child { border-top: 0; }
.viz-stages .ix {
  font-family: var(--font-mono);
  font-size: 12.5px; color: var(--ink-mute); letter-spacing: .06em;
}
.viz-stages .cnt .t { font-size: 14px; color: var(--ink); font-weight: 500; }
.viz-stages .cnt .m { font-size: 12px; color: var(--ink-mute); }
.viz-stages .mark { color: var(--success, #16a34a); font-weight: 700; min-width: 12px; text-align: center; }
.viz-stages li.pending .cnt .t { color: var(--ink-mute); }
.viz-stages li.pending .cnt .m { color: var(--ink-mute); }
.viz-stages li.active .cnt .t { color: var(--ink); }
.viz-stages li.active .ix { color: var(--ink); font-weight: 600; }
.viz-stages li.done .cnt .t { color: var(--ink-soft); }
.viz-stages li.done .ix { color: var(--ink-soft); }

.viz-finishing {
  margin-top: 18px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .08em;
  color: var(--ink-mute);
}

/* Result */
.viz-result-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}
.viz-result-img {
  position: relative;
  background: var(--bone);
  overflow: hidden;
  border: 1px solid var(--line-soft);
}
.viz-result-img img { width: 100%; height: auto; display: block; }
.viz-result-watermark {
  position: absolute;
  bottom: 14px; inset-inline-start: 14px;
  background: rgba(14, 26, 34, .55);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .08em;
  padding: 6px 10px;
  backdrop-filter: blur(4px);
}
.viz-result-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--success, #16a34a);
}
.viz-result-kicker .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success, #16a34a);
}
.viz-result-h2 { margin: 12px 0 10px; }
.viz-result-side .lede { color: var(--ink-soft); font-size: 15px; line-height: 1.6; margin: 0 0 22px; }

.viz-result-meta {
  list-style: none; margin: 0 0 24px; padding: 0;
  border-top: 1px solid var(--line-soft);
}
.viz-result-meta li {
  display: grid;
  grid-template-columns: 110px 1fr;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
}
.viz-result-meta .k {
  font-family: var(--font-mono);
  font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-mute);
  align-self: center;
}
.viz-result-meta .v { color: var(--ink); display: inline-flex; align-items: center; }
.viz-result-meta .dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0,0,0,.1); }

.viz-result-quote {
  margin-top: 28px;
  background: var(--bone);
  border: 1px solid var(--line-soft);
  padding: 22px 20px;
}
.viz-result-quote .t {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
  margin-bottom: 6px;
}
.viz-result-quote p { color: var(--ink-soft); font-size: 13px; margin: 0 0 14px; }

/* Upload: prepared photos ------------------------------------------------ */
.viz-drop-empty {
  display: block;
  width: 100%;
  background: none;
  border: 0;
  font: inherit;
  color: inherit;
}
.viz-drop-empty:focus-visible { outline: 2px solid var(--navy); outline-offset: -6px; }
.viz-drop-title, .viz-drop-sub { display: block; }
.viz-tile-busy {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px;
  color: var(--ink-mute);
  font-size: 13px;
}
.viz-spinner {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--line);
  border-top-color: var(--ink);
  animation: vizSpin .8s linear infinite;
}
@keyframes vizSpin { to { transform: rotate(360deg); } }
.viz-tile-x::before { content: ""; position: absolute; inset: -9px; }
.viz-warn {
  margin-top: 12px;
  background: #fffbeb;
  color: #92400e;
  font-size: 13px;
  padding: 10px 12px;
  border-inline-start: 3px solid #f59e0b;
}

.viz-step .btn:disabled { opacity: .38; cursor: not-allowed; transform: none; box-shadow: none; }
.viz-step .btn-primary:disabled:hover { background: var(--navy); color: #052a2d; }

/* Mark step ---------------------------------------------------------------- */
.viz-mark-head { scroll-margin-top: 16px; margin-bottom: 28px; } /* + html scroll-padding-top (styles.css): 96px from the top as before */
/* Hebrew labels in the body face: the mono face has no Hebrew glyphs, and the
   fallback spaces every letter apart. */
.viz-mark-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-mute);
  margin-bottom: 8px;
}
.viz-mark-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 14px 24px;
  margin-bottom: 16px;
}
.viz-mark-group { display: flex; flex-direction: column; align-items: center; }
.viz-mark-strip { display: flex; gap: 8px; }
.viz-mark-thumb {
  position: relative;
  flex: 0 0 auto;
  width: 56px; height: 56px;
  padding: 0;
  border: 2px solid transparent;
  background: var(--bone);
  cursor: pointer;
  overflow: hidden;
}
.viz-mark-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .62; transition: opacity .15s ease; }
.viz-mark-thumb.is-on { border-color: var(--ink); }
.viz-mark-thumb.is-on img { opacity: 1; }
.viz-mark-thumb:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.viz-mark-thumb-dot {
  position: absolute; top: 4px; inset-inline-end: 4px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--navy);
  box-shadow: 0 0 0 2px #fff;
}
.viz-mark-chips { display: inline-flex; gap: 8px; }
.viz-mark-chip {
  min-width: 68px;
  height: 56px;
  padding: 0 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font: inherit;
  font-size: 15px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.viz-mark-chip:hover { border-color: var(--ink-soft); color: var(--ink); }
.viz-mark-chip.is-on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.viz-mark-chip:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }

.viz-mark-stage {
  --viz-mark-max-h: min(70vh, 720px);
  display: flex;
  justify-content: center;
  padding: 22px;
  background: var(--bone);
  border: 1px solid var(--line-soft);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  outline: none;
  /* Corner hit areas reach past the gutter at the photo's edge; clip them here
     rather than let them widen the page. */
  overflow: hidden;
  overflow: clip;
}
.viz-mark-stage:focus-visible { box-shadow: inset 0 0 0 2px var(--navy); }
/* Sized from the photo's own ratio (--ar) rather than shrink-wrapped around a
   max-height image: WebKit can leave such a wrapper wider than the image, and
   the overlay must sit on the image to the pixel. */
.viz-mark-frame {
  position: relative;
  flex: 0 0 auto;
  width: min(100%, calc(var(--viz-mark-max-h) * var(--ar, 1.3333)));
  aspect-ratio: var(--ar, 1.3333);
  line-height: 0;
  overflow: visible;
  /* pinch-zoom too: the photo fills most of a phone screen (§4.5, the page never
     disables pinch-zoom). The box and handles keep touch-action: none. */
  touch-action: pan-y pinch-zoom;
  cursor: crosshair;
}
.viz-mark-img {
  display: block;
  width: 100%;
  height: 100%;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}
.viz-mark-dim {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
.viz-mark-box {
  position: absolute;
  box-sizing: border-box;
  container-type: size;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,.55), inset 0 0 0 1px rgba(0,0,0,.35);
  background: rgba(31,182,193,.12);
  cursor: move;
  touch-action: none;
  outline: none;
}
.viz-mark-box:focus-visible {
  box-shadow: 0 0 0 1px rgba(0,0,0,.55), inset 0 0 0 1px rgba(0,0,0,.35), 0 0 0 4px var(--navy);
}
.viz-mark-box.is-pulse { animation: vizMarkPulse .6s ease-out; }
@keyframes vizMarkPulse {
  from { box-shadow: 0 0 0 1px rgba(0,0,0,.55), inset 0 0 0 1px rgba(0,0,0,.35), 0 0 0 0 rgba(31,182,193,.85); }
  to   { box-shadow: 0 0 0 1px rgba(0,0,0,.55), inset 0 0 0 1px rgba(0,0,0,.35), 0 0 0 16px rgba(31,182,193,0); }
}
/* Top right (the RTL start), clear of the corner handle; body face for the
   same reason as .viz-mark-label. Hidden when the box is too small for it. */
.viz-mark-pill {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 8px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.1;
  white-space: nowrap;
  pointer-events: none;
}
@container (max-width: 110px) or (max-height: 48px) {
  .viz-mark-pill { display: none; }
}
.viz-mark-handle {
  position: absolute;
  width: 18px; height: 18px;
  padding: 0;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #0e1a22;
  box-shadow: 0 0 0 1px #fff, 0 1px 4px rgba(0,0,0,.35);
  touch-action: none;
  z-index: 1;
  transition: transform .12s ease;
}
.viz-mark-handle::before {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 48px; height: 48px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
}
.viz-mark-handle.tl { left: -10px; top: -10px; cursor: nwse-resize; }
.viz-mark-handle.tr { right: -10px; top: -10px; cursor: nesw-resize; }
.viz-mark-handle.br { right: -10px; bottom: -10px; cursor: nwse-resize; }
.viz-mark-handle.bl { left: -10px; bottom: -10px; cursor: nesw-resize; }
.viz-mark-handle.is-active { transform: scale(1.3333); }
.viz-mark-handle:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }
.viz-mark-tap-hint {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  background: rgba(14,26,34,.74);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  border-radius: 999px;
  pointer-events: none;
}
.viz-mark-tap-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--navy);
  animation: vizTapPulse 1.6s ease-out infinite;
}
@keyframes vizTapPulse {
  0%   { box-shadow: 0 0 0 0 rgba(31,182,193,.7); }
  70%  { box-shadow: 0 0 0 10px rgba(31,182,193,0); }
  100% { box-shadow: 0 0 0 0 rgba(31,182,193,0); }
}
@media (prefers-reduced-motion: reduce) {
  .viz-mark-box.is-pulse, .viz-mark-tap-dot, .viz-spinner { animation: none; }
}

.viz-mark-status {
  max-width: 560px;
  min-height: 3.4em;
  margin: 14px auto 0;
  text-align: center;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
}
.viz-mark-status .l1 { display: block; font-weight: 500; }
.viz-mark-status .l2 { display: block; margin-top: 2px; font-size: 13px; color: var(--ink-mute); }
.viz-mark-status.is-block .l1 { color: #b91c1c; }
.viz-mark-status.is-warn .l1 { color: #b45309; }
.viz-sr {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.viz-mark-tools { display: flex; justify-content: center; gap: 8px; margin-top: 8px; }
.viz-mark-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}
.viz-mark-tool > span { font-size: 17px; line-height: 1; color: var(--ink-mute); }
.viz-mark-tool:hover:not(:disabled):not([aria-disabled="true"]) { border-color: var(--ink-soft); color: var(--ink); }
.viz-mark-tool:disabled, .viz-mark-tool[aria-disabled="true"] { opacity: .4; cursor: not-allowed; }
.viz-mark-tool:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.viz-mark-bar { margin-top: 20px; }
/* Desktop: the status and the bar are grid items of .viz-mark-layout. */
.viz-mark-foot { display: contents; }

/* Desktop: the photo beside a control column, sized so the photo, the controls
   and Continue all fit a 900 px-tall laptop screen under the step head. */
@media (min-width: 961px) {
  .viz-step.viz-mark { max-width: 1100px; }
  .viz-mark .viz-step-head { max-width: none; }
  .viz-mark-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    grid-template-rows: auto auto auto auto 1fr;
    grid-template-areas:
      "stage controls"
      "stage status"
      "stage tools"
      "stage bar"
      "stage .";
    column-gap: 32px;
    align-items: start;
  }
  .viz-mark-stage {
    grid-area: stage;
    --viz-mark-max-h: clamp(360px, calc(100vh - 400px), 720px);
  }
  .viz-mark-controls { grid-area: controls; flex-direction: column; align-items: stretch; gap: 18px; margin: 0 0 20px; }
  .viz-mark-group { align-items: flex-start; }
  .viz-mark-status { grid-area: status; margin: 0; text-align: start; }
  .viz-mark-tools { grid-area: tools; justify-content: flex-start; margin-top: 12px; }
  .viz-mark-bar { grid-area: bar; flex-direction: column-reverse; align-items: stretch; gap: 10px; margin-top: 24px; }
  .viz-mark-bar .btn { justify-content: center; }
}

.viz-mark-loupe {
  position: fixed;
  left: 0; top: 0;
  width: 112px; height: 112px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px rgba(14,26,34,.35), 0 12px 28px -8px rgba(14,26,34,.55);
  pointer-events: none;
  z-index: 100;
  visibility: hidden;
}
.viz-mark-loupe.is-on { visibility: visible; }

/* Phones and tablets: the status line and the bar stick to the bottom
   together, so the category hint, a blocking message and Continue stay on
   screen while the photo is being marked; the accessibility button docks
   into the bar's start slot instead of covering the photo. */
@media (max-width: 960px) {
  .viz-mark { --viz-pad: var(--gutter); }
  .viz-mark-foot {
    display: block;
    position: sticky;
    bottom: 0;
    z-index: 5;
    background: var(--paper);
    margin: 12px calc(-1 * var(--viz-pad)) 0;
    padding: 8px var(--viz-pad) calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line-soft);
  }
  .viz-mark-foot .viz-mark-status {
    min-height: 2.9em;
    margin: 0 auto 8px;
    font-size: 14px;
    line-height: 1.4;
  }
  .viz-mark-foot .viz-mark-status .l2 { margin-top: 0; font-size: 12.5px; }
  .viz-actions.viz-mark-bar {
    flex-direction: row;
    align-items: stretch;
    gap: 10px;
    margin: 0;
  }
  .viz-actions.viz-mark-bar .btn { width: auto; }
  .viz-actions.viz-mark-bar .btn-ghost { flex: 0 0 auto; padding: 0 16px; }
  .viz-actions.viz-mark-bar .btn-primary { flex: 1 1 auto; min-width: 0; padding: 0 14px; gap: 10px; justify-content: center; }
  body:has(.viz-main[data-step="mark"]) .a11y-fab { bottom: calc(10px + env(safe-area-inset-bottom)); }
  body:has(.viz-main[data-step="mark"]) .a11y-panel { bottom: calc(82px + env(safe-area-inset-bottom)); }
  body:has(.a11y-fab) .viz-actions.viz-mark-bar { padding-inline-start: 68px; }
  /* The photo's height budget: what is left under the header, the step head,
     the controls and the sticky foot. */
  .viz-mark-stage { --viz-mark-max-h: max(320px, calc(100svh - 560px)); }
  .viz-mark-layout:not(:has(.viz-mark-controls)) .viz-mark-stage { --viz-mark-max-h: max(320px, calc(100svh - 470px)); }
  @supports not (height: 100svh) {
    .viz-mark-stage { --viz-mark-max-h: max(320px, calc(100vh - 560px)); }
  }
}

@media (max-width: 880px) {
  .viz-result-grid { grid-template-columns: 1fr; gap: 28px; }
  .viz-cat-grid { grid-template-columns: 1fr; }
  .viz-hero { padding: 64px 0 36px; }
  .viz-body { padding: 36px 0 80px; }
  .viz-step-head { margin-bottom: 24px; }
}
@media (max-width: 600px) {
  .viz-tiles { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .viz-progress-card { padding: 28px 20px; }
  .viz-drop-empty { padding: 44px 18px; }
  .viz-drop-icon { width: 48px; height: 48px; font-size: 22px; margin-bottom: 10px; }
  .viz-drop-title { font-size: 18px; }
  .viz-drop-sub { font-size: 11.5px; }
  .viz-actions { flex-direction: column-reverse; align-items: stretch; gap: 10px; }
  .viz-actions .btn { width: 100%; justify-content: center; }
  .viz-cat { padding: 14px 14px 12px; }
  .viz-cat-he { font-size: 18px; }
  .viz-cat-desc { font-size: 12.5px; }
  .viz-result-meta li { grid-template-columns: 100px 1fr; font-size: 13px; }
  .viz-stepper {
    gap: 6px 8px;
    padding: 10px 12px;
    border-radius: 18px;
    margin-top: 28px;
  }
  .viz-stepper .st { font-size: 11.5px; padding: 4px 6px; gap: 6px; }
  .viz-stepper .st-badge { width: 20px; height: 20px; font-size: 11.5px; }
  .viz-stepper .st + .st::before { display: none; }

  /* The container's own side padding (styles.css drops it to 16px at ≤480). */
  .viz-main[data-step="mark"] .viz-hero .section-head { display: none; }
  .viz-main[data-step="mark"] .viz-hero { padding: 12px 0 4px; }
  /* The step head shrinks to its one-line title, so the photo and the sticky
     hint fit one screen under the site header (the entry scroll lands here). */
  .viz-mark-head { scroll-margin-top: 0; margin-bottom: 10px; padding-bottom: 10px; gap: 0; } /* html scroll-padding-top (styles.css) gives the 72px */
  .viz-mark-head .section-num, .viz-mark-head .aside { display: none; }
  .viz-mark-head .h2 { font-size: 23px; line-height: 1.2; letter-spacing: -0.02em; }
  .viz-mark-head .h2 br { display: none; }
  .viz-mark-head .h2 .italic-serif { margin-inline-start: .25em; }
  .viz-mark-stage {
    --viz-mark-max-h: max(240px, calc(100svh - 360px));
    padding: 16px var(--viz-pad);
    margin-inline: calc(-1 * var(--viz-pad));
    border-inline: 0;
  }
  .viz-mark-layout:not(:has(.viz-mark-controls)) .viz-mark-stage { --viz-mark-max-h: max(240px, calc(100svh - 300px)); }
  /* Three thumbnails and the kind chips take two rows. */
  .viz-mark-layout:has(.viz-mark-thumb:nth-child(3)):has(.viz-mark-chips) .viz-mark-stage { --viz-mark-max-h: max(220px, calc(100svh - 420px)); }
  @supports not (height: 100svh) {
    .viz-mark-stage { --viz-mark-max-h: max(240px, calc(100vh - 360px)); }
  }
  /* Controls in as few rows as fit: the strip's label is for screen readers
     (the thumbnails speak for themselves), the kind label sits beside its chips. */
  .viz-mark-controls { gap: 10px 14px; margin-bottom: 10px; align-items: center; }
  .viz-mark-group { flex-direction: row; align-items: center; gap: 8px; }
  .viz-mark-label { margin: 0; }
  #viz-mark-strip-lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .viz-mark-strip { max-width: calc(100vw - 2 * var(--viz-pad)); overflow-x: auto; }
  .viz-mark-thumb { width: 48px; height: 48px; }
  .viz-mark-chip { height: 44px; min-width: 60px; padding: 0 14px; }
  .viz-mark-tools { margin-top: 10px; }
  body:has(.a11y-fab) .viz-actions.viz-mark-bar { padding-inline-start: 64px; }
}
@media (max-width: 480px) {
  .viz-mark { --viz-pad: 16px; }
}

/* Visualizer CTA band on Home page — already uses site tokens, left intact. */
.viz-band-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 72px;
  align-items: center;
}

.viz-band-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--navy-ink);
  margin-bottom: 20px;
}
.viz-band-eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--navy);
  box-shadow: 0 0 0 4px rgba(31, 182, 193, 0.18);
}
.viz-band-title { margin: 0 0 24px; }
.viz-band-lede { max-width: 52ch; margin-bottom: 36px; }

.viz-band-actions {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}
.viz-band-link { color: var(--ink); }

.viz-band-visual {
  position: relative;
}
.viz-band-split {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 16px;
}
.viz-band-split-side {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--bone-deep);
  overflow: hidden;
  box-shadow: 0 30px 60px -40px rgba(14, 26, 34, 0.35);
}
.viz-band-split-side img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.viz-band-split-side:first-child img { filter: grayscale(0.35) saturate(0.8); }
.viz-band-split-arrow {
  align-self: center;
  color: var(--navy);
}
.viz-band-tag {
  position: absolute;
  bottom: 12px;
  inset-inline-start: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  padding: 6px 10px;
  border: 1px solid var(--line);
}
.viz-band-tag-accent {
  background: var(--navy);
  color: #0b1418;
  border-color: var(--navy);
}
.viz-band-meta {
  margin-top: 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.viz-band-meta .sep { color: var(--line); }

@media (max-width: 960px) {
  .viz-band-grid { grid-template-columns: 1fr; gap: 48px; }
  .viz-band-split-arrow { transform: rotate(90deg); }
}
@media (max-width: 560px) {
  .viz-band-split { grid-template-columns: 1fr; }
  .viz-band-split-arrow { justify-self: center; }
}

/* Visualizer retry/abandon actions on the failed-job state */
.viz-err-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 6px;
}
.viz-err-actions .btn { min-height: 44px; }
