/* The character creator (wizard) stage panel. #wizardModal is mounted as a
   .stage-panel (see layout.css) instead of a centered overlay dialog — same
   id and JS logic as before, new chrome. Everything below .creator-inner
   (rail, chips, questions, refine diff, review) is ported unchanged from the
   original wizard.css. */

#wizardModal { overflow-y: auto; background: var(--bg); }
#wizardModal h1, #wizardModal h2 { letter-spacing: -.015em; }
.creator-inner {
  display: flex; flex-direction: column; gap: var(--sp-4);
  max-width: 720px; width: 100%; margin: 0 auto; padding: var(--sp-6) var(--sp-5);
}

.wiz-saved { font-size: 12.5px; color: var(--muted); min-height: 1.2em; margin-top: 2px; }
.wiz-saved.ok { color: var(--accent2); }

/* --- Step rail ---------------------------------------------------------- */
.wiz-rail { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; }
.wiz-rail li { flex: 1 1 auto; min-width: 0; display: flex; }
.wiz-rail button {
  flex: 1; min-width: 0; font-size: 12.5px; font-weight: 500; text-align: center;
  color: var(--muted); padding: 7px 10px; border-radius: 999px;
  border: 1px solid var(--border); background: transparent;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* These are <button>s, so the global button hover (a solid accent fill with
   --accent-ink text) has to be overridden with something at least as specific,
   or hovering a step pill turns it into a primary button. */
.wiz-rail button:hover:not(:disabled) {
  color: var(--text); border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.wiz-rail li.done button { color: var(--text); border-color: color-mix(in srgb, var(--accent2) 45%, var(--border)); }
.wiz-rail li.current button,
.wiz-rail li.current button:hover:not(:disabled) {
  color: var(--text); border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, var(--panel2));
}

/* --- Choice chips ------------------------------------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 999px; cursor: pointer; font-size: 14px;
  color: var(--text); background: var(--panel2); border: 1px solid var(--border);
}
.chip input { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; }
.chip:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.chip:has(input:checked) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, var(--panel2));
}
.chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip .chip-hint { color: var(--muted); font-size: 11px; }

/* --- Questions ---------------------------------------------------------- */
.wiz-body { display: flex; flex-direction: column; gap: 16px; }
.wiz-q { display: flex; flex-direction: column; gap: 6px; }
.wiz-q > .q-label { font-size: 15px; color: var(--text); font-weight: 600; }
.wiz-q > .q-label .req { color: var(--accent-text); }
.wiz-q > .q-hint { font-size: 13.5px; color: var(--muted); }
.wiz-q .q-free { margin-top: 2px; gap: 4px; }

.q-box-head { display: flex; align-items: baseline; gap: 8px; }
.q-box-head label { flex: 1; min-width: 0; }
.q-count { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.q-count.near { color: var(--accent-text); }

.wiz-q input, .wiz-q textarea { width: 100%; }
.wiz-q textarea { resize: vertical; line-height: 1.5; overflow-y: auto; min-height: 2.8em; }

/* --- Mode picker -------------------------------------------------------- */
/* A <button> drawn as a card: its own text colours (not the primary button's
   --accent-ink, which is white on one theme and near-black on the next), and a
   hover that outlines it instead of flooding it with the accent. */
.mode-card, .mode-card:disabled {
  text-align: left; display: flex; flex-direction: column; gap: 4px; align-items: flex-start;
  color: var(--text); background: var(--panel2); border-color: var(--border); font-weight: 400;
}
.mode-card b { font-size: 16px; font-weight: 600; color: var(--text); }
.mode-card .hint { font-weight: 400; color: var(--muted); }
.mode-card:hover:not(:disabled) {
  color: var(--text); background: color-mix(in srgb, var(--accent) 8%, var(--panel2)); border-color: var(--accent);
}
.mode-card.locked { opacity: .65; }
.mode-card .lock { font-size: 12px; color: var(--muted); display: block; margin-top: 6px; }

/* --- Refinement --------------------------------------------------------- */
.wiz-refine { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--border); padding-top: 14px; }
.wiz-diff { display: flex; flex-direction: column; gap: 4px; }
.wiz-diff .was {
  margin: 0; font-size: 12px; color: var(--muted); text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, var(--muted) 50%, transparent);
}
.wiz-diff .now { margin: 0; font-size: 13px; color: var(--text); border-left: 2px solid var(--accent); padding-left: 8px; }

.wiz-offer .hint { font-size: 12px; }
.wiz-explain { font-size: 12px; color: var(--muted); }
.wiz-explain summary { cursor: pointer; color: var(--text); font-size: 12px; }
.wiz-explain summary:hover { color: var(--accent-text); }
.wiz-explain ul { margin: 8px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.wiz-explain b { color: var(--text); font-weight: 600; }

.wiz-pass { border: 1px solid var(--border); border-radius: 10px; background: var(--panel2); padding: 8px 11px; }
.wiz-pass + .wiz-pass { margin-top: 6px; }
.wiz-pass summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.wiz-pass[open] summary { color: var(--text); margin-bottom: 8px; }
.wiz-pass .wiz-diff + .wiz-diff { margin-top: 8px; }
.wiz-pass ul { margin: 4px 0 0; padding-left: 18px; }

/* --- Review ------------------------------------------------------------- */
.wiz-review { display: flex; flex-direction: column; gap: 12px; }
.wiz-answer { display: flex; flex-direction: column; gap: 3px; }
.wiz-answer p { margin: 0; font-size: 13px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.wiz-prompt {
  max-height: 200px; overflow-y: auto; white-space: pre-wrap; font-size: 12px;
  color: var(--muted); background: var(--panel2); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px;
}

@media (max-width: 560px) {
  .wiz-rail li { flex: 1 1 100%; }
}

/* --- 🧪 Tracked stats on the review step (experimental) ----------------- */
.wiz-stat {
  display: flex; flex-direction: column; gap: 6px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--panel2); padding: 10px;
}
.wiz-stat label { display: flex; flex-direction: column; gap: 3px; }
.wiz-stat input { width: 100%; }

/* --- Scene editor (views/scene-editor.js; the creator's review step and the admin editor) --- */
.wiz-scenes { display: flex; flex-direction: column; gap: 10px; }
.sc-row { border: 1px solid var(--border); border-radius: 12px; background: var(--panel2); padding: 10px 14px; }
.sc-row summary { cursor: pointer; font-weight: 600; font-size: 14px; list-style: none; display: flex; align-items: center; gap: 8px; }
.sc-row summary::-webkit-details-marker { display: none; }
.sc-row summary::after { content: "+"; margin-left: auto; color: var(--muted); font-weight: 400; font-size: 18px; line-height: 1; }
.sc-row[open] summary::after { content: "–"; }
.sc-row[open] { display: flex; flex-direction: column; gap: 10px; }
.sc-row label { display: flex; flex-direction: column; gap: 3px; }
.sc-row input, .sc-row textarea { width: 100%; }
.sc-row textarea { resize: vertical; }
.sc-examples { display: flex; flex-direction: column; gap: 6px; }
.sc-actions { align-items: center; flex-wrap: wrap; }
.sc-actions button { flex: 0 0 auto; }
.sc-idea { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--muted); }
.sc-idea input { width: 100%; }
