/* ══════════════════════════════════════════════════════════════════
   FORMS — Workspace "Forms" tab + form builder modal
   ──────────────────────────────────────────────────────────────────
   Shared pill-colour palette (7 swatches) lives at the bottom of this
   file and is used both by the builder's colour-cycling dots and by
   the Abstract Screen answer pills/buttons (abstract-screen.css),
   so a colour picked here renders identically wherever the form is
   actually answered.
══════════════════════════════════════════════════════════════════ */

/* ── Forms tab: list ─────────────────────────────────────────────── */
.ws-forms-list {
  padding: 12px 18px 18px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.ws-forms-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 38px 20px;
  color: var(--ink-muted);
}
.ws-forms-empty i { font-size: 2rem; opacity: 0.3; margin-bottom: 4px; }
.ws-forms-empty h4 { font-size: 0.86rem; font-weight: 700; color: var(--ink); margin: 0; }
.ws-forms-empty p { font-size: 0.72rem; max-width: 360px; line-height: 1.5; margin: 0 0 6px; }

/* ── Forms tab — stage sections (Abstract Screen / Full Text Screen) ──
   Each section is itself a nested grid using the same card sizing as the
   old flat list, so grouping by stage doesn't change how the cards lay
   out — it just adds a labelled seam between the two groups. */
.ws-forms-section {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}
.ws-forms-section + .ws-forms-section {
  margin-top: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.ws-forms-section-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.ws-forms-section-head h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}
.ws-stage-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ws-stage-dot--abstract { background: var(--teal, #0da79a); }
.ws-stage-dot--fulltext { background: var(--purple, #7c3aed); }
.ws-forms-empty--section {
  grid-column: 1 / -1;
  align-items: flex-start;
  text-align: left;
  padding: 16px 4px;
}
.ws-forms-empty--section p { max-width: none; margin: 0; }

.ws-form-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: var(--r-card, 10px);
  background: var(--bg-page, #f7f4f1);
  border: 1px solid var(--border, #e8e3df);
  transition: background 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}
.ws-form-card:hover {
  background: var(--bg-hover, #f0ece8);
  border-color: var(--border-hover);
  box-shadow: 0 2px 10px rgba(43,24,23,0.06);
}

.ws-form-card-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.ws-form-card-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--teal-soft);
  color: var(--teal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.ws-form-card-body { min-width: 0; flex: 1; }
.ws-form-card-name {
  font-size: var(--text-sm, 0.76rem);
  font-weight: var(--fw-semi, 600);
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ws-form-card-desc {
  font-size: 0.68rem;
  color: var(--ink-soft);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ws-form-card-meta {
  font-size: 0.64rem;
  color: var(--ink-muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.ws-form-card-dot { opacity: 0.5; }

.ws-form-card-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* ── "Assign to projects" panel — expands under a form card ─────────── */
.ws-form-card-wrap { display: flex; flex-direction: column; }

.ws-form-assign-panel {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 6px;
  padding: 8px;
  border-radius: var(--r-card, 10px);
  background: var(--bg-surface, #fff);
  border: 1px solid var(--border, #e8e3df);
  box-shadow: 0 4px 16px rgba(43,24,23,0.05);
  max-height: 260px;
  overflow-y: auto;
}
.ws-form-assign-panel::-webkit-scrollbar { width: 5px; }
.ws-form-assign-panel::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 3px; }

.ws-form-assign-empty {
  padding: 10px 6px;
  font-size: 0.7rem;
  color: var(--ink-muted);
  text-align: center;
}

.ws-form-assign-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 7px;
  transition: background 0.12s ease;
}
.ws-form-assign-row:hover { background: var(--bg-page, #f7f4f1); }

.ws-form-assign-name {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ws-form-assign-toggle {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--r-pill, 20px);
  border: 1px solid var(--border);
  background: var(--bg-page, #f7f4f1);
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s;
}
.ws-form-assign-toggle:hover { border-color: var(--border-focus); color: var(--ink); }
.ws-form-assign-toggle.active {
  background: var(--teal-soft);
  border-color: var(--teal);
  color: var(--teal);
}

/* ── Form builder modal ──────────────────────────────────────────── */
#formBuilderModal .modal {
  max-width: 660px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
}
.fb-body {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2px 4px 2px 2px;
  margin: 4px 0 6px;
}
.fb-body::-webkit-scrollbar { width: 5px; }
.fb-body::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 3px; }

.fb-questions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}

.fb-question {
  border: 1px solid var(--border, #e8e3df);
  border-radius: var(--r-card, 12px);
  padding: 13px 14px 14px;
  background: var(--bg-page, #f7f4f1);
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}
.fb-question:focus-within {
  border-color: var(--border-teal);
  box-shadow: 0 0 0 3px var(--teal-soft);
}

.fb-question-head {
  display: flex;
  align-items: center;
  gap: 9px;
}

/* Grip handle — the only part of the card that initiates a drag (see
   the onmousedown/onmouseup wiring in _renderBuilderQuestions,
   forms.js), so clicking/selecting text elsewhere in the card behaves
   normally. */
.fb-drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 5px;
  color: var(--ink-muted);
  cursor: grab;
  transition: background 0.14s ease, color 0.14s ease;
}
.fb-drag-handle:hover { background: var(--bg-surface); color: var(--ink-soft); }
.fb-drag-handle:active { cursor: grabbing; }
.fb-drag-handle i { font-size: 1.05rem; }

/* Dragged card dims in place; the card currently under the cursor gets a
   teal top rail as the drop-position indicator — box-shadow rather than
   a border so nothing shifts height mid-drag. */
.fb-question--dragging { opacity: 0.4; }
.fb-question--drag-over { box-shadow: 0 -3px 0 0 var(--teal, #0da79a); }

.fb-question-num {
  font-size: 0.62rem;
  font-weight: var(--fw-black, 800);
  color: var(--ink-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-pill, 30px);
  padding: 3px 8px;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.fb-question-label {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: var(--text-base, 0.82rem);
  font-weight: var(--fw-semi, 600);
  color: var(--ink);
  padding: 5px 4px;
  border-radius: 6px;
  transition: background 0.12s ease;
}
.fb-question-label:hover { background: var(--bg-surface); }
.fb-question-label:focus { outline: none; background: var(--bg-surface); }
.fb-question-label::placeholder { color: var(--ink-muted); font-weight: 500; }

/* ── Locked, non-removable built-in question (Full Text's Device Data
   Matrix) — rendered by _formsLockedBlockHtml, inline with the form's
   own editable questions and numbered the same way (see
   _renderBuilderQuestions). Same card shape, border, and background as a
   regular question — the muted page background is the only visual cue
   that it's locked, so an author sees exactly what reviewers will see
   without it reading as a separate, oddly-highlighted block. ── */
.fb-question--locked {
  border: 1px solid var(--border, #e8e3df);
  border-radius: var(--r-card, 12px);
  padding: 13px 14px 14px;
  background: var(--bg-page, #f7f4f1);
}
.fb-question-label--locked {
  flex: 1;
  min-width: 0;
  font-size: var(--text-base, 0.82rem);
  font-weight: var(--fw-semi, 600);
  color: var(--ink);
  padding: 5px 4px;
}
.fb-locked-note {
  margin-top: 6px;
  padding-left: 31px; /* aligns with the label above, past the Q-number pill */
  font-size: 0.72rem;
  color: var(--ink-soft);
  line-height: 1.4;
}

/* ── Locked block wrapper — the single merged Device Data Matrix
   question (see _formsLockedBlockHtml, forms.js). Kept as its own
   wrapper (rather than folding straight into `.fb-question--locked`)
   so drag/drop styling has a stable target regardless of what's
   rendered inside. */
.fb-locked-block {
  display: flex;
  flex-direction: column;
  border-radius: var(--r-card, 12px);
  transition: box-shadow 0.14s ease, opacity 0.14s ease;
}
.fb-locked-block.fb-question--dragging { opacity: 0.4; }
.fb-locked-block.fb-question--drag-over { box-shadow: 0 -3px 0 0 var(--teal, #0da79a); }

/* Short explainer at the top of the locked block's "Show only if" menu —
   this one has no earlier-answer options of its own to skip via, so a
   one-line pointer to the exclusion pattern (tick an Exclude-tagged
   answer below) is more useful here than on a real question's menu. */
.fb-showif-hint {
  font-size: 0.68rem;
  line-height: 1.45;
  color: var(--ink-soft);
  padding: 2px 4px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2px;
}

/* Small Include/Exclude tag next to an answer option inside a "Show only
   if" menu — lets an author spot the exclusion-tagged option at a glance
   instead of having to remember which answers were tagged back in the
   question that owns them. */
.fb-showif-option-label { flex: 1; min-width: 0; }
.fb-showif-decision {
  flex-shrink: 0;
  font-size: 0.56rem;
  font-weight: var(--fw-black, 800);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: var(--r-pill, 30px);
}
.fb-showif-decision--include { background: var(--green-soft); color: var(--green); }
.fb-showif-decision--exclude { background: var(--red-soft); color: var(--red); }

/* Read-only answer pills showing the preset options a locked question
   will actually offer (workspace preset devices, then the data/
   benchmark chip set) — same pill shape and colour as a regular
   (non-active) answer pill, minus the remove button/decision badge and
   any hover/focus affordance, since nothing here is interactive. */
.fb-answers--locked { margin-top: 6px; }

/* Groups within the merged locked panel (e.g. "Device(s)" then "Data
   present" for the Device Data Matrix) — a small label above each set
   of read-only pills so the two stay visually distinct inside one card. */
.fb-answers-group { margin-top: 10px; }
.fb-answers-group:first-of-type { margin-top: 12px; }
.fb-answers-group-label {
  font-size: 0.68rem;
  font-weight: var(--fw-semi, 600);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink-muted);
  padding-left: 31px; /* aligns with the label above, past the Q-number pill */
}
.fb-answer-pill--locked {
  background: var(--bg-surface);
  border-color: var(--border);
}
.fb-answer-input--locked {
  color: var(--ink-soft);
  font-weight: 600;
  cursor: default;
}

/* ── "⚙" control collapsing multi-select · required · delete into one
   dropdown (see _formsQuestionSettingsHtml in forms.js). "Show only if"
   keeps its own dedicated button below. ── */
.fb-question-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.fb-settings-wrap { position: relative; flex-shrink: 0; }

.fb-settings-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--r-pill, 30px);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--ink-muted);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.14s ease;
}
.fb-settings-btn:hover { border-color: var(--border-hover); color: var(--ink-soft); }
/* Signals "something in here isn't default" without needing the menu open. */
.fb-settings-btn.active {
  background: var(--teal-soft);
  border-color: var(--teal);
  color: var(--teal);
}

.fb-settings-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  flex-direction: column;
  gap: 2px;
  width: 260px;
  max-height: 340px;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(43,24,23,0.16);
  padding: 8px;
}
.fb-settings-menu.open { display: flex; }
.fb-settings-menu::-webkit-scrollbar { width: 5px; }
.fb-settings-menu::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 3px; }

.fb-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  border: none;
  background: transparent;
  border-radius: 7px;
  padding: 7px 6px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s ease;
}
.fb-settings-row:hover { background: var(--bg-page); }
.fb-settings-row-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--ink);
}
.fb-settings-row-label i { font-size: 0.9rem; color: var(--ink-muted); flex-shrink: 0; }

/* Small pill-shaped on/off switch, styled rather than a native checkbox so
   it matches the rest of the builder's pill/toggle language. */
.fb-settings-switch {
  flex-shrink: 0;
  position: relative;
  width: 30px;
  height: 17px;
  border-radius: 20px;
  background: var(--border-hover, rgba(43,24,23,0.18));
  transition: background 0.16s ease;
}
.fb-settings-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--bg-surface, #fff);
  box-shadow: 0 1px 3px rgba(43,24,23,0.25);
  transition: transform 0.16s ease;
}
.fb-settings-switch.on { background: var(--teal); }
.fb-settings-switch.on::after { transform: translateX(13px); }

.fb-settings-divider { height: 1px; background: var(--border); margin: 6px 2px; flex-shrink: 0; }

.fb-settings-delete {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  border: none;
  background: transparent;
  border-radius: 7px;
  padding: 8px 6px;
  color: var(--red);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.12s ease;
}
.fb-settings-delete:hover:not(:disabled) { background: var(--red-soft); }
.fb-settings-delete:disabled { color: var(--ink-muted); cursor: default; opacity: 0.6; }

/* ── "Show only if" — its own icon button (next to the settings gear)
   that opens a checkbox dropdown; several earlier answers can be selected
   at once (OR logic), so the question shows if ANY of them was given. ── */
.fb-showif-wrap { position: relative; flex-shrink: 0; }

.fb-showif-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--r-pill, 30px);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--ink-muted);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.14s ease;
}
.fb-showif-btn:hover { border-color: var(--border-hover); color: var(--ink-soft); }
.fb-showif-btn.active {
  background: var(--amber-soft);
  border-color: var(--amber);
  color: var(--amber);
}

.fb-showif-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  flex-direction: column;
  gap: 8px;
  width: 260px;
  max-height: 280px;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(43,24,23,0.16);
  padding: 10px;
}
.fb-showif-menu.open { display: flex; }
.fb-showif-menu::-webkit-scrollbar { width: 5px; }
.fb-showif-menu::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 3px; }

.fb-showif-group + .fb-showif-group { margin-top: 2px; padding-top: 8px; border-top: 1px solid var(--border); }

.fb-showif-group-label {
  font-size: 0.62rem;
  font-weight: var(--fw-black, 800);
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fb-showif-option {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s ease;
}
.fb-showif-option:hover { background: var(--bg-page); }
.fb-showif-option input[type="checkbox"] {
  width: 13px;
  height: 13px;
  accent-color: var(--teal);
  flex-shrink: 0;
  cursor: pointer;
}
.fb-showif-option-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fb-showif-empty {
  padding: 8px 4px;
  font-size: 0.68rem;
  color: var(--ink-muted);
  text-align: center;
  line-height: 1.5;
}

.fb-showif-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 2px;
  padding: 8px 6px 2px;
  border: none;
  border-top: 1px solid var(--border);
  background: transparent;
  color: var(--red);
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.12s ease;
}
.fb-showif-clear:hover { background: var(--red-soft); }

.fb-answers {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}

.fb-answers-empty {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px dashed var(--border-hover, rgba(43,24,23,0.2));
  background: var(--bg-surface);
  color: var(--ink-muted);
  font-size: 0.7rem;
  font-style: italic;
  margin-bottom: 2px;
}

.fb-answer-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 4px 3px 3px;
  border-radius: var(--r-pill, 20px);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  transition: border-color 0.14s ease;
}
.fb-answer-pill:focus-within { border-color: var(--border-teal); }

.fb-answer-input {
  /* Width is driven natively via the `size` attribute (kept in sync with
     the value by forms.js, on render + oninput), so the box always tracks
     the actual text: short answers collapse the pill down, long answers
     stay fully visible instead of being clipped at a fixed max-width.
     field-sizing is layered on top purely as a nicety for browsers that
     support it — harmless where it isn't, `size` covers the rest. */
  field-sizing: content;
  min-width: 22px;
  max-width: 100%;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
  padding: 2px 4px;
}
.fb-answer-input:focus { outline: none; }
.fb-answer-input::placeholder { color: var(--ink-muted); font-weight: 500; }

/* The pill itself must be free to shrink/grow with its input rather than
   stretching to fill leftover row width, or a short answer would still
   sit inside an oversized box. */
.fb-answer-pill { flex: 0 0 auto; max-width: 100%; }
.fb-answer-pill .fb-answer-input { flex: 0 1 auto; }


.fb-decision-badge {
  flex-shrink: 0;
  border: none;
  border-radius: var(--r-pill, 20px);
  padding: 3px 8px;
  font-family: inherit;
  font-size: 0.62rem;
  font-weight: 700;
  cursor: pointer;
  background: var(--bg-page, #f7f4f1);
  color: var(--ink-muted);
  transition: all 0.14s;
}
.fb-decision-badge:hover { background: var(--bg-elevated); }
.fb-decision-badge.fb-decision-include { background: var(--green-soft); color: var(--green); }
.fb-decision-badge.fb-decision-exclude { background: var(--red-soft); color: var(--red); }

.fb-answer-remove {
  width: 16px;
  height: 16px;
  border: none;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
  transition: all 0.12s ease;
}
.fb-answer-remove:hover { background: var(--red-soft); color: var(--red); }

.fb-add-answer {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: var(--r-pill, 20px);
  border: 1px dashed var(--border-hover, rgba(43,24,23,0.2));
  background: transparent;
  color: var(--ink-muted);
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s;
}
.fb-add-answer:hover { border-color: var(--teal); color: var(--teal); background: var(--teal-soft); }

.fb-add-question {
  display: flex;
  width: 100%;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 9px 14px;
  border-radius: var(--r-card, 10px);
  border: 1px dashed var(--border-hover, rgba(43,24,23,0.2));
  background: transparent;
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s;
  margin-top: 5px;
}
.fb-add-question:hover { border-color: var(--teal); color: var(--teal); background: var(--teal-soft); }
.fb-add-question i { font-size: 0.95rem; }

/* ── Stage toggle (Abstract Screen / Full Text Screen) — top of the Form
   Builder modal. Two-way segmented control, same visual weight as the
   fb-settings-switch elsewhere in this file but horizontal, since both
   options need to stay visible/comparable rather than being a single
   on/off toggle. */
.fb-stage-toggle {
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: var(--r-card, 10px);
  background: var(--bg-page);
  border: 1px solid var(--border);
}
.fb-stage-btn {
  flex: 1;
  padding: 8px 12px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.fb-stage-btn:hover { color: var(--ink); }
.fb-stage-btn.active { background: var(--bg-elevated, #fff); color: var(--ink) }

/* Read-only stand-in for the stage toggle above, shown instead of it once
   a form already exists (see openBuilder, forms.js) — "Applies to" is a
   one-time, up-front choice for a brand-new form only; an existing form
   still needs its stage visible, just not editable inline here. */
.fb-stage-static {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  border-radius: var(--r-card, 10px);
  background: var(--bg-page);
  border: 1px solid var(--border);
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 600;
}
.fb-stage-static i { font-size: 0.85rem; color: var(--ink-muted); }
.fb-stage-static strong { color: var(--ink); font-weight: var(--fw-black, 800); }