/* ============================================================
   Form Editor — WYSIWYG view of the live form + right action tray
   See docs/superpowers/plans/2026-04-30-form-editor-redesign-pr1.md Task 4.
   ============================================================ */

@import "brand_tokens.css";

.form-editor-body { margin: 0; padding: 0; height: 100%; overflow: hidden; font-family: var(--font-sans); color: var(--fg-1); background: var(--bg-2); }
.form-editor-body * { box-sizing: border-box; }
.form-editor-body button { font-family: inherit; cursor: pointer; }

/* ---------------- App shell ---------------- */
.app {
  display: grid;
  grid-template-rows: 56px 1fr;
  height: 100vh;
}

/* ---------------- Top bar ---------------- */
.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 20px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border-1);
  z-index: 5;
}
.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-right { justify-content: flex-end; }

.topbar-title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 15px;
  color: var(--fg-1);
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-title .meta {
  color: var(--fg-3);
  font-weight: 400;
  font-size: 13px;
}
.dot-sep {
  width: 3px; height: 3px; border-radius: 999px; background: var(--zw-line);
}

.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px;
  background: transparent; color: var(--fg-2);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  text-decoration: none;
  transition: all var(--dur-2) var(--ease-out);
}
.btn-ghost:hover { background: var(--bg-3); color: var(--fg-1); }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 14px;
  background: var(--bg-1); color: var(--fg-1);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  transition: all var(--dur-2) var(--ease-out);
}
.btn-secondary:hover { background: var(--bg-2); border-color: var(--zw-ink-3); }

.btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 16px;
  background: var(--zw-blue-700); color: #fff;
  border: 1px solid var(--zw-blue-700);
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  transition: all var(--dur-2) var(--ease-out);
}
.btn-primary:hover { background: var(--zw-blue-800); border-color: var(--zw-blue-800); }
.btn-primary:active { transform: scale(0.98); }

.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  background: var(--zw-green-50); color: var(--zw-green-900);
  border: 1px solid var(--zw-green-100);
  border-radius: 999px;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.02em;
}
.status-pill .live-dot {
  width: 6px; height: 6px; border-radius: 999px;
  background: var(--zw-green-700);
  box-shadow: 0 0 0 3px rgba(0, 168, 129, 0.15);
}

/* segmented view switcher */
.view-switch {
  display: inline-flex;
  background: var(--bg-3);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}
.view-switch button, .view-switch a {
  height: 26px; padding: 0 12px;
  background: transparent; border: none;
  color: var(--fg-3); font-size: 12px; font-weight: 600;
  border-radius: 6px;
  display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none;
}
.view-switch button.active, .view-switch a.active {
  background: var(--bg-1); color: var(--fg-1);
  box-shadow: var(--shadow-xs);
}

/* ---------------- Main split ---------------- */
.main {
  display: grid;
  grid-template-columns: 1fr 360px;
  height: 100%;
  overflow: hidden;
}

/* ---------------- Canvas (the editable live form) ---------------- */
.canvas {
  position: relative;
  overflow: auto;
  background:
    radial-gradient(circle, rgba(15,26,38,0.06) 1px, transparent 1px) 0 0 / 18px 18px,
    var(--bg-2);
}

.canvas-inner {
  min-height: 100%;
  padding: 36px 32px 80px;
  display: flex;
  justify-content: center;
}

.form-frame {
  width: 100%;
  max-width: 720px;
  position: relative;
  padding-bottom: 60px;
}

.form-header-band {
  height: 96px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  position: relative;
  transition: background var(--dur-3) var(--ease-out);
}

.form-logo {
  position: absolute;
  left: 50%;
  top: 48px;
  transform: translateX(-50%);
  width: 88px; height: 88px;
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
  cursor: pointer;
  border: none;
  transition: box-shadow var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out);
}
.form-logo:hover { box-shadow: var(--shadow-md); }
.form-logo.editing { outline: 2px solid var(--zw-blue-700); outline-offset: 4px; }
.form-logo img { width: 56px; height: 56px; object-fit: contain; }
.form-logo-empty {
  color: var(--fg-3);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.form-logo-empty svg { color: var(--fg-3); }

.form-card {
  background: #fff;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 64px 40px 28px;
  position: relative;
}

.form-title-row { margin-bottom: 6px; position: relative; }
.form-title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--fg-1);
  margin: 0;
  outline: none;
  border-radius: 4px;
  padding: 2px 4px;
  margin-left: -4px;
  transition: background var(--dur-2) var(--ease-out);
}
.form-title:hover { background: var(--bg-3); }
.form-title:focus { background: var(--zw-blue-50); box-shadow: var(--shadow-ring); }

.form-description {
  font-size: 14px;
  color: var(--fg-3);
  margin: 0 0 20px;
  outline: none;
  border-radius: 4px;
  padding: 2px 4px;
  margin-left: -4px;
  min-height: 22px;
  transition: background var(--dur-2) var(--ease-out);
}
.form-description:hover { background: var(--bg-3); }
.form-description:focus { background: var(--zw-blue-50); box-shadow: var(--shadow-ring); }
.form-description:empty::before {
  content: attr(data-placeholder);
  color: var(--zw-line);
}

/* --- editable field rows --- */
.field-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.field {
  position: relative;
  padding: 12px 12px 12px 36px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  transition: background var(--dur-2) var(--ease-out),
              border-color var(--dur-2) var(--ease-out);
}
.field:hover {
  background: var(--bg-2);
  border-color: var(--border-2);
}
.field.selected {
  background: var(--zw-blue-50);
  border-color: var(--zw-blue-300);
}
.field.dragging { opacity: 0.4; }
.field.drop-above::before {
  content: ""; position: absolute;
  left: 4px; right: 4px; top: -3px;
  height: 2px; background: var(--zw-blue-700);
  border-radius: 999px; z-index: 3;
  box-shadow: 0 0 0 2px rgba(51,102,153,0.18);
}
.field.drop-below::after {
  content: ""; position: absolute;
  left: 4px; right: 4px; bottom: -3px;
  height: 2px; background: var(--zw-blue-700);
  border-radius: 999px; z-index: 3;
  box-shadow: 0 0 0 2px rgba(51,102,153,0.18);
}

.field-handle {
  position: absolute;
  left: 8px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  color: var(--zw-line);
  opacity: 0;
  cursor: grab;
  transition: opacity var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out);
}
.field-handle:active { cursor: grabbing; }
.field:hover .field-handle, .field.selected .field-handle {
  opacity: 1; color: var(--fg-3);
}

.field-actions {
  position: absolute;
  right: 8px; top: 8px;
  display: flex; gap: 2px;
  opacity: 0;
  transition: opacity var(--dur-2) var(--ease-out);
}
.field:hover .field-actions, .field.selected .field-actions { opacity: 1; }
.field-actions form { display: inline; margin: 0; padding: 0; }
.field-actions button {
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-1);
  border: 1px solid var(--border-1);
  color: var(--fg-3);
  border-radius: 6px;
  padding: 0;
  transition: all var(--dur-2) var(--ease-out);
}
.field-actions button:hover { color: var(--zw-blue-700); border-color: var(--zw-blue-300); background: var(--zw-blue-50); }
.field-actions button.danger:hover { color: var(--zw-danger); border-color: var(--zw-danger); background: #fdecec; }

.field-label-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
}
.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-1);
  outline: none;
  border-radius: 3px;
  padding: 1px 3px; margin-left: -3px;
}
.field-label:hover { background: var(--bg-3); }
.field-label:focus { background: var(--zw-blue-100); }
.field-required { color: var(--zw-danger); font-size: 13px; }
.field-binding {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--zw-green-900);
  background: var(--zw-green-50);
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--zw-green-100);
}

.field-input {
  position: relative;
  display: flex;
  align-items: center;
  height: 42px;
  border: 1px solid var(--border-1);
  border-radius: var(--radius-sm);
  background: var(--bg-1);
  padding: 0 12px;
  font-size: 14px;
  color: var(--fg-3);
  pointer-events: none;
  user-select: none;
}
.field-input.tall { height: 88px; align-items: flex-start; padding: 12px; }
.field-input .leading-icon { margin-right: 8px; color: var(--zw-line); display: inline-flex; }
.field-input .trailing-icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--zw-line); display: inline-flex; }
.field-help { font-size: 12px; color: var(--fg-3); margin-top: 6px; }

/* turnstile stand-in */
.turnstile {
  margin-top: 18px;
  height: 56px;
  border: 1px solid var(--border-1);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px;
  font-size: 13px; color: var(--fg-3);
}
.turnstile[hidden] { display: none; }
.turnstile .verifying { display: flex; align-items: center; gap: 10px; }
.turnstile .spinner {
  width: 14px; height: 14px;
  border: 2px dotted var(--fg-3);
  border-radius: 999px;
  animation: zw-spin 1.6s linear infinite;
}
.turnstile .cf { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.turnstile .cf-mark { font-family: var(--font-display); font-weight: 800; font-size: 10px; letter-spacing: 0.06em; color: var(--zw-clay); }
.turnstile .cf-meta { font-size: 9px; color: var(--fg-3); }
@keyframes zw-spin { to { transform: rotate(360deg); } }

/* submit row */
.form-submit-row { display: flex; justify-content: flex-end; margin-top: 24px; }
.form-submit-btn {
  height: 40px; padding: 0 22px;
  background: var(--zw-green-600);
  color: #fff; border: none;
  border-radius: var(--radius-pill);
  font-weight: 600; font-size: 14px;
  box-shadow: var(--shadow-sm);
  transition: all var(--dur-2) var(--ease-out);
  pointer-events: none;
}

.form-footer {
  display: flex; justify-content: space-between;
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--border-2);
  font-size: 12px;
  color: var(--fg-3);
}
.form-footer[hidden] { display: none; }
.form-footer a { color: var(--fg-3); text-decoration: none; }

.add-field-btn {
  margin-top: 8px;
  width: 100%;
  height: 44px;
  border: 1px dashed var(--border-1);
  background: transparent;
  border-radius: var(--radius-sm);
  color: var(--fg-3);
  font-size: 13px; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: all var(--dur-2) var(--ease-out);
}
.add-field-btn:hover {
  border-color: var(--zw-blue-300);
  background: var(--zw-blue-50);
  color: var(--zw-blue-700);
}

/* ---------------- Right tray ---------------- */
.tray {
  display: flex;
  flex-direction: column;
  background: var(--bg-1);
  border-left: 1px solid var(--border-1);
  overflow: hidden;
}

.tray-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-1);
  padding: 0 8px;
  background: var(--bg-1);
  height: 44px;
  flex-shrink: 0;
}
.tray-tab {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-3);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out);
}
.tray-tab:hover { color: var(--fg-1); }
.tray-tab.active {
  color: var(--zw-blue-700);
  border-bottom-color: var(--zw-blue-700);
  font-weight: 600;
}
.tray-tab .count {
  background: var(--bg-3);
  color: var(--fg-3);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
}
.tray-tab.active .count {
  background: var(--zw-blue-100);
  color: var(--zw-blue-700);
}

.tray-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 18px 80px;
}

.tray-section + .tray-section { margin-top: 24px; }
.tray-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin: 0 0 8px;
}
.tray-help {
  font-size: 12px;
  color: var(--fg-3);
  margin: 0 0 14px;
  line-height: 1.5;
}

/* Quick add list */
.qa-list { display: flex; flex-direction: column; gap: 2px; }
.qa-list form { margin: 0; padding: 0; display: block; width: 100%; }
.qa-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--dur-2) var(--ease-out);
  text-align: left;
  width: 100%;
  font-family: inherit;
}
.qa-item:hover:not(.added) {
  background: var(--bg-2);
  border-color: var(--border-2);
}
.qa-item.added {
  opacity: 0.55;
  cursor: default;
}
.qa-item .qa-icon {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--fg-3);
  border-radius: 6px;
  background: var(--bg-3);
}
.qa-item .qa-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.qa-item .qa-name { font-size: 13px; font-weight: 600; color: var(--fg-1); }
.qa-item .qa-binding { font-family: var(--font-mono); font-size: 11px; color: var(--fg-3); }
.qa-item .qa-status { color: var(--zw-green-700); }

/* New field types grid */
.types-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.types-grid form { margin: 0; padding: 0; display: block; width: 100%; }
.type-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 10px 12px;
  background: var(--bg-1);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  width: 100%;
  transition: all var(--dur-2) var(--ease-out);
}
.type-btn:hover { border-color: var(--zw-blue-300); background: var(--zw-blue-50); }
.type-btn .type-icon { color: var(--fg-3); }
.type-btn .type-name { font-size: 12px; font-weight: 600; color: var(--fg-1); }

/* Logic tab */
.logic-empty {
  padding: 32px 12px;
  text-align: center;
  border: 1px dashed var(--border-1);
  border-radius: var(--radius-md);
  background: var(--bg-2);
}
.logic-empty .icon-wrap {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--zw-blue-50);
  color: var(--zw-blue-700);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.logic-empty h4 { margin: 0 0 6px; font-size: 14px; font-weight: 600; }
.logic-empty p { margin: 0; font-size: 12px; color: var(--fg-3); line-height: 1.5; }

.logic-rule {
  border: 1px solid var(--border-1);
  border-radius: var(--radius-md);
  padding: 12px;
  background: var(--bg-1);
  margin-bottom: 8px;
}
.logic-rule-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.logic-rule-name { font-size: 13px; font-weight: 600; }
.logic-rule-body { font-size: 12px; color: var(--fg-2); line-height: 1.5; }
.logic-rule-body code {
  background: var(--bg-3);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11px;
  color: var(--zw-blue-800);
}

.add-rule-btn {
  width: 100%;
  height: 36px;
  border: 1px dashed var(--border-1);
  background: transparent;
  border-radius: var(--radius-sm);
  color: var(--fg-3);
  font-size: 12px; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: all var(--dur-2) var(--ease-out);
}
.add-rule-btn:hover { border-color: var(--zw-blue-300); background: var(--zw-blue-50); color: var(--zw-blue-700); }

/* Settings tab */
.tray-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.tray-field label { font-size: 12px; font-weight: 600; color: var(--fg-2); }
.tray-field .help { font-size: 11px; color: var(--fg-3); }
.tray-input, .tray-select, .tray-textarea {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  background: var(--bg-1);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  color: var(--fg-1);
  transition: all var(--dur-2) var(--ease-out);
}
.tray-textarea { height: 70px; padding: 8px 10px; resize: none; }
.tray-input:focus, .tray-select:focus, .tray-textarea:focus {
  outline: none;
  border-color: var(--zw-blue-700);
  box-shadow: var(--shadow-ring);
}
.tray-select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23566676' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }

.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-2);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-row .label { font-size: 13px; font-weight: 500; color: var(--fg-1); }
.toggle-row .sub { font-size: 11px; color: var(--fg-3); margin-top: 2px; }
.toggle-row .text { display: flex; flex-direction: column; }

.toggle {
  position: relative;
  width: 32px; height: 18px;
  background: var(--zw-line);
  border-radius: 999px;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background var(--dur-2) var(--ease-out);
  flex-shrink: 0;
}
.toggle::after {
  content: ""; position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  background: #fff;
  border-radius: 999px;
  transition: transform var(--dur-2) var(--ease-out);
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.toggle.on { background: var(--zw-green-600); }
.toggle.on::after { transform: translateX(14px); }

/* swatch grid for header color */
.swatch {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  position: relative;
  transition: transform var(--dur-2) var(--ease-out);
  background-clip: padding-box;
}
.swatch:hover { transform: scale(1.06); }
.swatch.selected { border-color: var(--fg-1); }
.swatch.selected::after {
  content: ""; position: absolute;
  inset: -5px;
  border-radius: 12px;
  border: 1.5px solid var(--zw-blue-700);
}
.swatch.transparent {
  background: repeating-conic-gradient(#f0f0f0 0% 25%, #fff 0% 50%) 0 0 / 12px 12px;
}

/* color input pair */
.color-input {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--border-1);
  border-radius: var(--radius-sm);
  background: var(--bg-1);
}
.color-input .swatch-mini {
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 1px solid var(--border-1);
  flex-shrink: 0;
}
.color-input input {
  border: none; background: transparent;
  font-family: var(--font-mono);
  font-size: 12px; color: var(--fg-1);
  outline: none;
  flex: 1;
  width: 100%;
  padding: 0;
}

.option-list { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.option-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px;
  color: var(--fg-2);
}

/* Empty placeholder when no fields */
.empty-fields {
  padding: 32px;
  text-align: center;
  border: 1px dashed var(--border-1);
  border-radius: var(--radius-md);
  color: var(--fg-3);
  font-size: 13px;
  background: var(--bg-2);
}

/* Selected indicator strip on selected field */
.field.selected::before {
  content: ""; position: absolute;
  left: -3px; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--zw-blue-700);
  border-radius: 999px;
}

/* Selected state in tray for field properties */
.tray-selected-strip {
  background: var(--zw-blue-50);
  border: 1px solid var(--zw-blue-100);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px;
}
.tray-selected-strip .icon {
  width: 28px; height: 28px;
  background: var(--bg-1);
  border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--zw-blue-700);
  flex-shrink: 0;
}
.tray-selected-strip .label { font-size: 13px; font-weight: 600; }
.tray-selected-strip .meta { font-size: 11px; color: var(--fg-3); font-family: var(--font-mono); }

/* Subtle scrollbars */
.canvas::-webkit-scrollbar, .tray-body::-webkit-scrollbar { width: 8px; height: 8px; }
.canvas::-webkit-scrollbar-thumb, .tray-body::-webkit-scrollbar-thumb {
  background: rgba(15,26,38,0.12);
  border-radius: 999px;
}

/* Brand-color swatch presets specifically for header band */
.preset-swatches {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}
.preset-swatches form { margin: 0; padding: 0; }

/* ------------------------------------------------------------------
   Specificity + contrast hardening
   ------------------------------------------------------------------
   Tailwind v4's preflight (`@layer base`) resets `button { border-radius: 0 }`
   and other defaults. Plain class selectors like `.form-submit-btn` lose to
   layered base rules in some browsers' cascade ordering, so we re-assert the
   critical editor visuals under the editor body to bump specificity.

   The off-state toggle track and tray-input borders were also too light
   (`--zw-line: #d9e0e8`) on the white tray surface — barely visible. Bumped to
   a darker neutral that still reads as "subtle". */

:root { --zw-control: #b4bdc7; }

.form-editor-body .form-submit-btn { border-radius: var(--radius-pill); }

.form-editor-body .toggle           { background: var(--zw-control); }
.form-editor-body .toggle.on        { background: var(--zw-green-600); }

.form-editor-body .tray-input,
.form-editor-body .tray-select,
.form-editor-body .tray-textarea,
.form-editor-body .color-input { border-color: var(--zw-control); }

.form-editor-body .tray-input:focus,
.form-editor-body .tray-select:focus,
.form-editor-body .tray-textarea:focus { border-color: var(--zw-blue-700); }

