/* ---------- Memopark Preventivatore — FASE 3 — stili nuovo flusso ----------
   Editor planimetria, misure, layout tecnico, payload OpenAI.
   Caricato dopo styles.css / styles-fase2.css. Scoping difensivo .memopark-prev-root.
*/

/* ============================================================
   HARDENING contro i temi WordPress.
   Quando il wizard è incorporato via shortcode, il tema può applicare
   regole proprie a h1/h2/h3/p/ul/button (es. ".entry-content h3 { font-size: 2.4rem }")
   con specificità superiore alle nostre classi, gonfiando i titoli e
   facendo sforare le griglie. Reset esplicito e ad alta specificità.
   ============================================================ */
.memopark-prev-root, .memopark-prev-root * { box-sizing: border-box; }
.memopark-prev-root :where(h1, h2, h3, h4, h5, p, ul, ol, li, figure, blockquote) { margin: 0; padding: 0; }
.memopark-prev-root :where(ul, ol) { list-style: none; }
.memopark-prev-root :where(h1, h2, h3, h4, h5) { font-weight: inherit; letter-spacing: normal; }
/* la tipografia delle card e degli header viene fissata sotto, con .memopark-prev-root in testa
   per battere selettori di tema tipo ".content h3". */
.memopark-prev-root .step-counter { font-size: 12px; font-weight: 600; line-height: 1.3; }
.memopark-prev-root .step-title { font-size: clamp(24px, 3vw, 32px); font-weight: 700; line-height: 1.12; }
.memopark-prev-root .step-sub { font-size: 15px; line-height: 1.55; font-weight: 400; }
.memopark-prev-root .hero-title { font-size: clamp(28px, 4vw, 48px); font-weight: 800; line-height: 1.05; }
.memopark-prev-root .hero-sub { font-size: 17px; line-height: 1.55; font-weight: 400; }
.memopark-prev-root .eyebrow { font-size: 12px; font-weight: 600; }

/* ---- Hardening CONTROLLI FORM contro i temi WP ----
   I temi stilizzano aggressivamente button/input/range. Neutralizziamo i
   default e ridichiariamo i nostri controlli con .memopark-prev-root (alta
   specificità) + !important sulle proprietà visive critiche. */
.memopark-prev-root button { font-family: inherit; line-height: normal; text-transform: none; letter-spacing: normal; box-shadow: none; }
.memopark-prev-root input, .memopark-prev-root select, .memopark-prev-root textarea { font-family: inherit; box-shadow: none; }

/* range slider */
.memopark-prev-root input[type="range"].slider {
  -webkit-appearance: none !important; -moz-appearance: none !important; appearance: none !important;
  width: 100% !important; height: 6px !important; padding: 0 !important; margin: 0 !important;
  border: 0 !important; border-radius: 99px !important; background: var(--bg-card-hover) !important;
  outline: none !important; box-shadow: none !important; min-height: 0 !important;
}
.memopark-prev-root input[type="range"].slider::-webkit-slider-runnable-track {
  -webkit-appearance: none !important; background: transparent !important; border: 0 !important; height: 6px !important; box-shadow: none !important;
}
.memopark-prev-root input[type="range"].slider::-webkit-slider-thumb {
  -webkit-appearance: none !important; appearance: none !important;
  width: 18px !important; height: 18px !important; margin-top: -6px !important;
  border: 0 !important; border-radius: 50% !important; background: var(--accent) !important;
  cursor: pointer; box-shadow: 0 0 0 4px var(--accent-soft) !important;
}
.memopark-prev-root input[type="range"].slider::-moz-range-track {
  background: var(--bg-card-hover) !important; border: 0 !important; height: 6px !important; border-radius: 99px !important;
}
.memopark-prev-root input[type="range"].slider::-moz-range-thumb {
  width: 18px !important; height: 18px !important; border: 0 !important; border-radius: 50% !important; background: var(--accent) !important; cursor: pointer; box-shadow: 0 0 0 4px var(--accent-soft) !important;
}
.memopark-prev-root input[type="range"].slider::-ms-fill-lower,
.memopark-prev-root input[type="range"].slider::-ms-fill-upper { background: var(--bg-card-hover) !important; }

/* segmento lati (Retro/Fronte/Sinistra/Destra) */
.memopark-prev-root .ms-sides { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 6px !important; }
.memopark-prev-root .ms-side {
  display: block !important; width: 100% !important; padding: 7px 4px !important; min-height: 0 !important;
  font-size: 11px !important; font-weight: 600 !important; line-height: 1.2 !important;
  border-radius: 7px !important; background: var(--bg-card) !important; border: 1px solid var(--border) !important;
  color: var(--text-dim) !important; cursor: pointer; text-transform: none !important; box-shadow: none !important;
}
.memopark-prev-root .ms-side.on { background: var(--accent-soft) !important; border-color: var(--accent) !important; color: var(--accent) !important; }

/* toggle Sì/No (vetrine, uscita emergenza) */
.memopark-prev-root .ms-switch {
  display: inline-block !important; width: 46px !important; height: 26px !important; padding: 0 !important; min-height: 0 !important;
  border-radius: 99px !important; background: var(--bg-card-hover) !important; border: 1px solid var(--border-strong) !important;
  position: relative !important; cursor: pointer; flex: none !important; box-shadow: none !important; transition: background .18s, border-color .18s;
}
.memopark-prev-root .ms-switch.on { background: var(--accent) !important; border-color: var(--accent) !important; }
.memopark-prev-root .ms-switch .ms-knob {
  position: absolute !important; left: 3px !important; top: 2px !important; right: auto !important;
  width: 20px !important; height: 20px !important; border-radius: 50% !important; background: #fff !important; transition: left .18s; box-shadow: none !important;
}
.memopark-prev-root .ms-switch.on .ms-knob { left: 22px !important; }

/* input numerici misure */
.memopark-prev-root .ms-input input { width: 74px !important; border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 7px 8px !important; min-height: 0 !important; }

/* Entrata robusta: lo stato visibile è quello base, animiamo solo il transform.
   Evita che il fill-mode "both" della fadeUp lasci il contenuto a opacity:0
   quando l'iframe di anteprima limita le animazioni. */
.memopark-prev-root .fade-up { animation-name: flowUp !important; opacity: 1 !important; }
@keyframes flowUp { from { transform: translateY(10px); } to { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  .memopark-prev-root .fade-up { animation: none !important; transform: none !important; }
}

/* rail a 7 step più compatto */
.steps-rail-7 { gap: 4px; }
.steps-rail-7 .step-pill { font-size: 12px; }
.steps-rail-7 .step-pill span:last-child { white-space: nowrap; }
.wizard-body-wide { max-width: none; }

/* ================= STEP 1 — Tipologia ================= */
.memopark-prev-root .typo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; width: 100%; }
.memopark-prev-root .typo-card,
.typo-card {
  display: flex; flex-direction: column; gap: 12px;
  padding: 22px 20px;
  min-width: 0;
  background: var(--bg-elev) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg);
  text-align: left; cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.memopark-prev-root .typo-card:hover,
.typo-card:hover { border-color: var(--border-strong) !important; transform: translateY(-3px); }
.memopark-prev-root .typo-card.selected,
.typo-card.selected {
  border-color: var(--accent) !important;
  background: linear-gradient(180deg, rgba(236,28,138,.10), rgba(236,28,138,.02)) !important;
  box-shadow: 0 0 0 1px var(--accent), 0 0 0 4px var(--accent-soft) !important;
}
.typo-card-top { display: flex; align-items: flex-start; justify-content: space-between; }
.typo-ico {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
}
.typo-card.selected .typo-ico { background: var(--accent); color: #fff; }
.opt-check {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--border-strong); flex: none; position: relative; transition: .15s;
}
.typo-card.selected .opt-check, .opt-card.selected .opt-check { border-color: var(--accent); background: var(--accent); }
.typo-card.selected .opt-check::after, .opt-card.selected .opt-check::after {
  content: ''; position: absolute; left: 6px; top: 3px; width: 6px; height: 10px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.memopark-prev-root .typo-title { margin: 0; font-size: 18px; font-weight: 800; line-height: 1.25; color: var(--text); overflow-wrap: break-word; }
.memopark-prev-root .typo-desc { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text-dim); }
.memopark-prev-root .typo-bullets { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.memopark-prev-root .typo-bullets li { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-faint); }
.typo-bullets li svg { color: var(--accent); flex: none; }

/* ================= STEP 2 — Misure ================= */
.ms-toolbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 16px; margin-bottom: 20px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
}
.ms-toolbar-lbl { font-size: 12px; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: .06em; }
.ms-mq { margin-left: auto; font-size: 13px; color: var(--text-faint); }
.ms-mq b { color: var(--accent); font-size: 18px; font-weight: 800; }
.ms-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.ms-group { display: flex; flex-direction: column; gap: 18px; }
.ms-group-title { font-size: 12px; font-weight: 700; color: var(--text); text-transform: uppercase; letter-spacing: .06em; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.ms-field { display: flex; flex-direction: column; gap: 10px; }
.ms-field-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ms-label { font-size: 13px; font-weight: 600; color: var(--text-dim); }
.ms-input { display: flex; align-items: center; gap: 0; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; background: var(--bg-card); }
.ms-input input { width: 74px; border: 0; background: transparent; color: var(--text); font-family: 'JetBrains Mono', monospace; font-size: 14px; font-weight: 600; padding: 7px 8px; text-align: right; outline: none; }
.ms-unit { padding: 0 9px 0 2px; font-size: 12px; color: var(--text-faint); font-family: 'JetBrains Mono', monospace; }
.ms-bool { flex-direction: row; align-items: center; justify-content: space-between; padding: 6px 0; }
.ms-switch { width: 46px; height: 26px; border-radius: 99px; background: var(--bg-card-hover); border: 1px solid var(--border-strong); position: relative; cursor: pointer; transition: .18s; flex: none; }
.ms-switch.on { background: var(--accent); border-color: var(--accent); }
.ms-knob { position: absolute; left: 3px; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: .18s; }
.ms-switch.on .ms-knob { left: 22px; }
.ms-sides { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ms-side { padding: 7px 4px; font-size: 11px; font-weight: 600; border-radius: 7px; background: var(--bg-card); border: 1px solid var(--border); color: var(--text-dim); cursor: pointer; }
.ms-side.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* slider riuso (se non già definito) */
.slider { -webkit-appearance: none; appearance: none; width: 100%; height: 5px; border-radius: 99px; background: var(--bg-card-hover); outline: none; }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); cursor: pointer; box-shadow: 0 0 0 4px var(--accent-soft); }
.slider::-moz-range-thumb { width: 18px; height: 18px; border: 0; border-radius: 50%; background: var(--accent); cursor: pointer; }

/* ================= STEP 3 — Editor planimetria ================= */
.pe-wrap { display: grid; grid-template-columns: 1fr 312px; gap: 18px; align-items: start; }
.pe-canvas { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pe-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pe-toolbar-group { display: flex; gap: 5px; }
.memopark-prev-root .pe-chip, .pe-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 11px; font-size: 12px; font-weight: 600; border-radius: 7px;
  background: var(--bg-elev) !important; border: 1px solid var(--border) !important; color: var(--text-dim) !important; cursor: pointer;
}
.memopark-prev-root .pe-chip.on, .pe-chip.on { background: var(--accent-soft) !important; border-color: var(--accent) !important; color: var(--accent) !important; }
.pe-svg { width: 100%; height: auto; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); display: block; touch-action: none; }
.pe-dim line { stroke: rgba(255,255,255,.35); stroke-width: 1; }
.pe-dim text { fill: var(--text-dim); font-family: 'JetBrains Mono', monospace; font-size: 11px; }
.pe-handle { fill: var(--accent); stroke: #fff; stroke-width: 1.5; }
.pe-handle.rot { fill: #fff; stroke: var(--accent); stroke-width: 2; }
.pe-hint { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--text-faint); }
.pe-hint b { color: var(--text-dim); }

.pe-side { display: flex; flex-direction: column; gap: 12px; }
.pe-panel { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.pe-panel-title { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--text); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 12px; }
.pe-palette { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.memopark-prev-root .pe-palette-btn, .pe-palette-btn {
  display: flex; align-items: center; gap: 7px; padding: 8px 9px;
  background: var(--bg-card) !important; border: 1px solid var(--border) !important; border-radius: 8px; cursor: pointer; text-align: left;
  transition: border-color .12s, background .12s;
}
.memopark-prev-root .pe-palette-btn:hover, .pe-palette-btn:hover { border-color: var(--border-strong) !important; background: var(--bg-card-hover) !important; }
.pe-pal-ico { flex: none; display: flex; }
.pe-pal-lbl { font-size: 11px; font-weight: 600; color: var(--text-dim); line-height: 1.2; }
.pe-empty { font-size: 12.5px; line-height: 1.5; color: var(--text-faint); }
.pe-props { display: flex; flex-direction: column; gap: 12px; }
.pe-prop-head { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--text); }
.pe-prop-dot { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.pe-prop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.pe-field { display: flex; flex-direction: column; gap: 5px; }
.pe-field label { font-size: 10.5px; font-weight: 600; color: var(--text-faint); text-transform: uppercase; letter-spacing: .04em; }
.pe-rot-row { display: flex; align-items: center; border: 1px solid var(--border-strong); border-radius: 7px; overflow: hidden; background: var(--bg-card); }
.pe-field input, .pe-field select {
  width: 100%; border: 0; background: transparent; color: var(--text);
  font-family: 'JetBrains Mono', monospace; font-size: 13px; padding: 7px 8px; outline: none;
}
.pe-field select { font-family: 'Inter', sans-serif; font-size: 12px; border: 1px solid var(--border-strong); border-radius: 7px; background: var(--bg-card); cursor: pointer; }
.pe-field input[type=number] { text-align: right; }
.pe-unit { padding: 0 8px; font-size: 11px; color: var(--text-faint); font-family: 'JetBrains Mono', monospace; }
.pe-prop-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.memopark-prev-root .pe-act, .pe-act {
  display: inline-flex; align-items: center; gap: 5px; padding: 7px 10px; font-size: 12px; font-weight: 600;
  border-radius: 7px; background: var(--bg-card) !important; border: 1px solid var(--border-strong) !important; color: var(--text-dim) !important; cursor: pointer;
}
.memopark-prev-root .pe-act:hover, .pe-act:hover { color: var(--text) !important; background: var(--bg-card-hover) !important; }
.memopark-prev-root .pe-act.danger, .pe-act.danger { color: #ff6a52 !important; border-color: rgba(255,106,82,.35) !important; }
.pe-count { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--text-dim); padding: 11px 14px; }
.pe-count b { color: var(--text); }
.pe-clear { font-size: 11px; color: var(--text-faint); background: none; border: 0; cursor: pointer; text-decoration: underline; }

/* ================= STEP 4 — Attrazioni ================= */
.kd-budget { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; }
.kd-budget-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.kd-budget-val { font-size: 20px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.kd-budget-scale { display: flex; align-items: baseline; justify-content: space-between; margin-top: 8px; font-size: 11px; color: var(--text-faint); font-family: 'JetBrains Mono', monospace; }
.kd-budget-cap { color: var(--text-dim); }
.kd-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.memopark-prev-root .kd-cat, .kd-cat {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 13px; border-radius: 99px;
  background: var(--bg-elev) !important; border: 1px solid var(--border) !important; color: var(--text-dim) !important; font-size: 13px; font-weight: 600; cursor: pointer;
}
.memopark-prev-root .kd-cat.on, .kd-cat.on { background: var(--accent-soft) !important; border-color: var(--accent) !important; color: var(--accent) !important; }
.kd-cat em { font-style: normal; font-size: 11px; opacity: .7; font-family: 'JetBrains Mono', monospace; }
.kd-mix-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.kd-mix-head b { color: var(--accent); font-size: 16px; }
.kd-mix-note { font-size: 11px; color: var(--text-faint); font-family: 'JetBrains Mono', monospace; }
.kd-empty { padding: 22px; text-align: center; color: var(--text-faint); font-size: 13px; border: 1px dashed var(--border-strong); border-radius: var(--radius); grid-column: 1 / -1; }

/* ================= STEP 5 — Layout gen ================= */
.lg-running { display: flex; align-items: center; gap: 16px; padding: 40px 24px; justify-content: center; }
.lg-running div { display: flex; flex-direction: column; }
.lg-running b { font-size: 15px; color: var(--text); }
.lg-running span { font-size: 12px; color: var(--text-faint); font-family: 'JetBrains Mono', monospace; margin-top: 2px; }
.lg-spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--border-strong); border-top-color: var(--accent); animation: lg-spin .8s linear infinite; flex: none; }
@keyframes lg-spin { to { transform: rotate(360deg); } }
.lg-summary { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: stretch; }
.lg-stat { flex: 1; min-width: 84px; display: flex; flex-direction: column; gap: 1px; padding: 11px 14px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.lg-stat .k { font-size: 20px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.lg-stat .l { font-size: 10px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .05em; }
.lg-regen { margin-left: auto; align-self: center; }
.lg-preview { margin-bottom: 14px; }
.lg-subs { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 14px; padding: 11px 14px; background: rgba(45,108,223,.08); border: 1px solid rgba(45,108,223,.25); border-radius: var(--radius-sm); font-size: 12.5px; line-height: 1.5; color: var(--text-dim); }
.lg-subs b { color: var(--text); font-weight: 700; }
.lg-subs-list { color: var(--text-dim); }
.rr-admin { margin: 18px 0 6px; border: 1px dashed rgba(45,108,223,.4); border-radius: var(--radius-sm); padding: 14px; background: rgba(45,108,223,.05); }
.rr-admin-h { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 12px; }
.rr-admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.rr-admin-board { min-width: 0; }
.rr-admin-cap { font-size: 12px; font-weight: 600; color: var(--text-dim); margin-bottom: 7px; }
@media (max-width: 820px) { .rr-admin-grid { grid-template-columns: 1fr; } }
.lg-quote { margin-top: 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; background: var(--bg-elev); }
.lg-quote-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.lg-quote-h span { font-size: 10.5px; font-weight: 600; color: var(--text-faint); text-transform: uppercase; letter-spacing: .04em; }
.lg-quote-row { display: flex; align-items: center; gap: 9px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.lg-q-sw { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.lg-q-n { flex: 1; font-size: 13px; font-weight: 600; color: var(--text); }
.lg-q-n em { color: var(--text-faint); font-style: normal; font-weight: 600; }
.lg-q-p { font-size: 12.5px; font-weight: 600; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.lg-quote-total { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding: 11px 13px; background: var(--text); color: var(--bg); border-radius: 9px; font-weight: 800; font-size: 14px; }
.lg-quote-total span:last-child { font-variant-numeric: tabular-nums; }
.memopark-prev-root .lg-json-toggle, .lg-json-toggle {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600;
  color: var(--text-dim) !important; background: var(--bg-elev) !important; border: 1px solid var(--border) !important; border-radius: 8px; padding: 8px 12px; cursor: pointer;
}

/* ================= STEP 6 — Anteprima tecnica ================= */
.tp-wrap { display: flex; flex-direction: column; gap: 14px; }
.tp-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tp-bar-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--text); }
.memopark-prev-root .tp-export, .tp-export {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; font-size: 12.5px; font-weight: 700;
  border-radius: 8px; background: var(--accent) !important; color: #fff !important; border: 1px solid var(--accent) !important; cursor: pointer;
}
.memopark-prev-root .tp-export:hover, .tp-export:hover { background: var(--accent-2) !important; }
.tp-svg { width: 100%; height: auto; background: #0e0e12; border: 1px solid var(--border); border-radius: var(--radius); display: block; }
.tp-svg.editable { border-color: rgba(236,28,138,.3); }
.tp-edit-hint { display: flex; align-items: center; gap: 8px; padding: 9px 13px; border-radius: var(--radius); font-size: 12.5px; color: var(--accent); background: var(--accent-soft); border: 1px solid rgba(236,28,138,.25); }
.tp-edit-hint svg { flex: none; }
.tp-warn { display: flex; align-items: center; gap: 9px; padding: 11px 14px; border-radius: var(--radius); font-size: 12.5px; color: var(--warn); background: rgba(255,176,32,.08); border: 1px solid rgba(255,176,32,.25); }
.tp-notes { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.tp-textarea { width: 100%; min-height: 70px; resize: vertical; padding: 11px 13px; border-radius: var(--radius); background: var(--bg-card); border: 1px solid var(--border-strong); color: var(--text); font-family: inherit; font-size: 13px; line-height: 1.5; outline: none; }
.tp-textarea:focus { border-color: var(--accent); }

/* ================= STEP 7 — Payload OpenAI ================= */
.ai-panel { display: flex; flex-direction: column; gap: 14px; }
.ai-banner { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius); background: linear-gradient(180deg, rgba(236,28,138,.08), rgba(236,28,138,.02)); border: 1px solid rgba(236,28,138,.25); font-size: 13px; line-height: 1.5; color: var(--text-dim); }
.ai-banner b { color: var(--text); } .ai-banner u { color: var(--accent); text-decoration-color: var(--accent); }
.ai-banner-ico { flex: none; width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); }
.ai-req { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.ai-req-head { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.ai-method { font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700; color: var(--success); background: rgba(46,204,113,.12); border: 1px solid rgba(46,204,113,.3); border-radius: 5px; padding: 3px 8px; }
.ai-endpoint { font-family: 'JetBrains Mono', monospace; font-size: 11.5px; color: var(--text-dim); }
.ai-spacer { flex: 1; }
.memopark-prev-root .ai-copy, .ai-copy { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; color: var(--text-dim) !important; background: var(--bg-card) !important; border: 1px solid var(--border-strong) !important; border-radius: 6px; padding: 5px 10px; cursor: pointer; }
.ai-copy.ok { color: var(--success) !important; border-color: rgba(46,204,113,.4) !important; }
.ai-tabs { display: flex; gap: 2px; padding: 8px 10px 0; flex-wrap: wrap; overflow-x: auto; }
.memopark-prev-root .ai-tab, .ai-tab {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; font-size: 12px; font-weight: 600; white-space: nowrap;
  color: var(--text-faint) !important; background: none !important; border: 0 !important; border-bottom: 2px solid transparent !important; cursor: pointer; font-family: 'JetBrains Mono', monospace;
}
.memopark-prev-root .ai-tab.on, .ai-tab.on { color: var(--accent) !important; border-bottom-color: var(--accent) !important; }
.ai-code { margin: 0; padding: 16px; background: #0c0c0f; color: #cdd0d6; font-family: 'JetBrains Mono', monospace; font-size: 11.5px; line-height: 1.6; max-height: 380px; overflow: auto; white-space: pre-wrap; word-break: break-word; border-radius: 0 0 var(--radius) var(--radius); }
.ai-attach { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.ai-attach-item { display: flex; align-items: center; gap: 12px; padding: 9px 11px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; }
.ai-attach-thumb { width: 48px; height: 48px; border-radius: 7px; flex: none; display: flex; align-items: center; justify-content: center; background: var(--bg-card-hover); overflow: hidden; }
.ai-attach-thumb.plan { background: var(--accent-soft); color: var(--accent); }
.ai-attach-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.ai-attach-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.ai-attach-meta b { font-size: 12.5px; color: var(--text); font-family: 'JetBrains Mono', monospace; word-break: break-all; }
.ai-attach-meta span { font-size: 11.5px; color: var(--text-faint); }
.ai-attach-tag { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-faint); border: 1px solid var(--border); border-radius: 5px; padding: 3px 7px; flex: none; }
.ai-attach-note { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--warn); padding: 4px 2px; }
.ai-fallback { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius); background: var(--bg-elev); border: 1px solid var(--border); font-size: 12.5px; line-height: 1.5; color: var(--text-dim); }
.ai-fallback svg { color: var(--success); flex: none; }
.ai-fallback b { color: var(--text); }

/* ================= STEP 7 — Dati cliente (contact) ================= */
.cf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.cf-field { display: flex; flex-direction: column; gap: 6px; }
.cf-field label { font-size: 12px; font-weight: 600; color: var(--text-dim); }
.cf-field input { padding: 11px 13px; border-radius: 9px; background: var(--bg-card); border: 1px solid var(--border-strong); color: var(--text); font-family: inherit; font-size: 14px; outline: none; }
.cf-field input:focus { border-color: var(--accent); }
.cf-field.err input { border-color: #ff6a52; }
.cf-privacy { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; color: var(--text-dim); line-height: 1.5; cursor: pointer; padding: 4px 0 2px; }
.cf-privacy input { margin-top: 2px; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.cf-privacy.err span { color: #ff6a52; }
.cf-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; }

/* ================= Render result ================= */
.rr-wrap { min-height: 360px; }
.rr-working { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 30px 20px; }
.rr-ai-orb { width: 66px; height: 66px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff;
  background: radial-gradient(circle at 30% 30%, var(--accent-2), var(--accent)); box-shadow: 0 0 0 0 var(--accent-glow); animation: rr-pulse 1.8s ease-out infinite; }
@keyframes rr-pulse { 0% { box-shadow: 0 0 0 0 var(--accent-glow); } 70% { box-shadow: 0 0 0 18px rgba(236,28,138,0); } 100% { box-shadow: 0 0 0 0 rgba(236,28,138,0); } }
.rr-working-title { margin: 18px 0 6px; font-size: 22px; font-weight: 800; color: var(--text); }
.rr-working-sub { margin: 0 0 22px; font-size: 14px; color: var(--text-dim); max-width: 48ch; }
.rr-phases { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 440px; text-align: left; }
.rr-phase { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-faint); transition: color .3s; }
.rr-phase.active { color: var(--text); }
.rr-phase.done { color: var(--text-dim); }
.rr-phase-ico { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; background: var(--bg-elev); border: 1px solid var(--border); color: var(--accent); }
.rr-phase.done .rr-phase-ico { background: var(--accent-soft); border-color: var(--accent); }
.rr-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); }
.rr-phase.active .rr-dot { background: var(--accent); animation: rr-blink 1s infinite; }
@keyframes rr-blink { 50% { opacity: .3; } }

.rr-result-head { text-align: center; margin-bottom: 20px; }
.rr-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--success); background: rgba(46,204,113,.12); border: 1px solid rgba(46,204,113,.3); border-radius: 99px; padding: 5px 12px; margin-bottom: 12px; }
.rr-result-title { margin: 0 0 6px; font-size: 24px; font-weight: 800; color: var(--text); }
.rr-result-sub { margin: 0; font-size: 14px; color: var(--text-dim); }
.rr-render { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); background: var(--bg-elev); position: relative; }
.rr-logo { position: absolute; max-width: 22%; pointer-events: none; }
.rr-logo.bottom-right { right: 3%; bottom: 4%; }
.rr-logo.bottom-left { left: 3%; bottom: 4%; }
.rr-logo.top-right { right: 3%; top: 4%; }
.rr-logo.top-left { left: 3%; top: 4%; }
.rr-logo img { width: 100%; height: auto; display: block; filter: drop-shadow(0 1px 3px rgba(0,0,0,.4)); }
.rr-logo-ph { display: inline-block; font-weight: 800; font-size: 13px; color: #fff; background: rgba(10,10,14,.55); border: 1px solid rgba(255,255,255,.35); border-radius: 6px; padding: 4px 9px; letter-spacing: .02em; backdrop-filter: blur(2px); }
.rr-render-img { width: 100%; display: block; }
.rr-render-fallback { aspect-ratio: 16/9; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--text-faint); text-align: center; padding: 20px; }
.rr-render-fallback b { color: var(--text); font-size: 16px; }
.rr-render-fallback span { font-size: 13px; max-width: 42ch; }

/* simulazione render */
.rr-sim { position: relative; aspect-ratio: 16/9; overflow: hidden; background: linear-gradient(180deg, #e7eef4 0%, #d6e0e9 56%, #c3cfd9 56.5%); }
.rr-sim-badge { position: absolute; top: 12px; left: 12px; z-index: 5; font-family: 'JetBrains Mono', monospace; font-size: 10px; color: #fff; background: rgba(10,10,14,.7); padding: 5px 10px; border-radius: 99px; }
.rr-sim-wall { position: absolute; inset: 0 0 44% 0; background: linear-gradient(180deg, #f1f5f8, #dde5ec); }
.rr-sim-floor { position: absolute; inset: 56% 0 0 0; background: linear-gradient(180deg, #9fb9c8 0%, #84a3b5 100%); }
.rr-sim-stage { position: absolute; inset: 0; }
.rr-sim-item { position: absolute; bottom: 8%; transform: translateX(-50%); display: flex; align-items: flex-end; }
.rr-sim-item img { height: 100%; width: auto; object-fit: contain; filter: drop-shadow(0 12px 10px rgba(20,40,60,.4)); }
.rr-sim-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: rgba(20,40,60,.6); font-family: 'JetBrains Mono', monospace; font-size: 12px; }

.rr-tech { margin-top: 16px; }
.rr-tech-toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--text-dim) !important; background: var(--bg-elev) !important; border: 1px solid var(--border) !important; border-radius: 8px; padding: 8px 12px; cursor: pointer; }
.rr-tech-body { margin-top: 14px; }
.rr-foot { display: flex; justify-content: center; margin-top: 22px; }
/* anteprima email */
.em-wrap { margin-top: 18px; }
.em-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.em-tag { font-family: 'JetBrains Mono', monospace; font-weight: 500; font-size: 10px; color: var(--text-faint); background: var(--bg-card); border: 1px solid var(--border); border-radius: 99px; padding: 2px 9px; }
.em-card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.em-meta { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 5px; }
.em-row { display: flex; gap: 10px; font-size: 13px; }
.em-k { flex: none; width: 58px; color: var(--text-faint); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; padding-top: 2px; }
.em-v { color: var(--text-dim); }
.em-subj { color: var(--text); font-weight: 700; }
.em-body { padding: 16px; font-size: 13.5px; line-height: 1.6; color: var(--text-dim); white-space: pre-wrap; }
.em-attach { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 16px 16px; }
.em-att { display: flex; align-items: center; gap: 10px; padding: 8px 11px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; }
.em-att-thumb { width: 40px; height: 40px; border-radius: 6px; flex: none; display: flex; align-items: center; justify-content: center; background: var(--bg-card-hover); color: var(--text-faint); overflow: hidden; }
.em-att-thumb img { width: 100%; height: 100%; object-fit: cover; }
.em-att-meta { display: flex; flex-direction: column; gap: 1px; }
.em-att-meta b { font-size: 12px; color: var(--text); font-family: 'JetBrains Mono', monospace; }
.em-att-meta span { font-size: 11px; color: var(--text-faint); }
.em-note { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--text-faint); margin: 9px 2px 0; }
.s3-wrap { display: flex; flex-direction: column; }
.s3-canvas { border-radius: var(--radius); border: 1px solid var(--border); background: #eef1f4; display: block; }
.rr-3d-block { margin-bottom: 16px; }
.rr-3d-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.rr-3d-tag { font-family: 'JetBrains Mono', monospace; font-weight: 500; font-size: 10px; color: var(--warn); background: rgba(255,176,32,.1); border: 1px solid rgba(255,176,32,.3); border-radius: 99px; padding: 2px 9px; }

/* ================= responsive ================= */
@media (max-width: 1040px) {
  .pe-wrap { grid-template-columns: 1fr; }
  .pe-palette { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 820px) {
  .typo-grid { grid-template-columns: 1fr; }
  .ms-cols { grid-template-columns: 1fr; }
  .pe-palette { grid-template-columns: 1fr 1fr; }
  .steps-rail-7 { overflow-x: auto; }
}
