
.wf-field-card {
  background: var(--wf-card);
  border: 1px solid var(--wf-border);
  border-radius: 10px;
  overflow: visible;
  transition: border-color 150ms ease, box-shadow 150ms ease;
  width: 100%;
}
.wf-field-card:hover {
  border-color: rgba(56, 69, 81, 0.25);
}
.wf-field-card.expanded {
  border-color: rgba(56, 69, 81, 0.35);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.wf-field-card.dragging {
  opacity: 0.5;
  box-shadow: 0 4px 16px rgba(34, 48, 62, 0.15);
}

.wf-field-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  min-height: 44px;
}

.wf-field-drag {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  opacity: 0.4;
  color: var(--wf-text-secondary);
  flex-shrink: 0;
  padding: 2px;
  transition: opacity 150ms ease, color 150ms ease;
}
.wf-field-drag:hover { opacity: 1; color: var(--color-text-primary, #384551); }
.wf-field-drag:active { cursor: grabbing; }

@media (pointer: coarse) {
  .wf-field-drag { opacity: 0.6; }
}

.wf-field-card.wf-dragging {
  opacity: 0.4;
  outline: 2px dashed var(--color-text-primary, #384551);
  outline-offset: -2px;
}
.wf-field-card.wf-drag-over-top {
  box-shadow: 0 -2px 0 0 var(--color-text-primary, #384551);
}
.wf-field-card.wf-drag-over-bottom {
  box-shadow: 0 2px 0 0 var(--color-text-primary, #384551);
}

.wf-field-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--wf-neutral-bg-hover);
  color: var(--wf-text-secondary);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.wf-field-label-input {
  flex: 1;
  min-width: 0;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: var(--wf-text);
  background: transparent;
  transition: border-color 150ms ease, background 150ms ease;
}
.wf-field-label-input:hover {
  border-color: var(--wf-border);
  background: var(--wf-bg);
}
.wf-field-label-input::placeholder {
  color: var(--wf-text-secondary);
  font-weight: 400;
  opacity: 0.6;
}

.wf-type-pill-wrap {
  position: relative;
  flex-shrink: 0;
}
.wf-type-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px 4px 8px;
  border: 1px solid var(--wf-border);
  border-radius: 6px;
  background: var(--wf-neutral-bg);
  color: var(--wf-text-secondary);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
  white-space: nowrap;
  min-height: 28px;
  line-height: 1;
}
.wf-type-pill:hover {
  border-color: rgba(56, 69, 81, 0.35);
  color: var(--wf-text);
}
.wf-type-pill svg:first-child { flex-shrink: 0; }
.wf-pill-arrow {
  flex-shrink: 0;
  opacity: 0.5;
  transition: transform 150ms ease;
}
.wf-type-pill[aria-expanded="true"] .wf-pill-arrow {
  transform: rotate(180deg);
}

.wf-type-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 200;
  background: var(--wf-card);
  border: 1px solid var(--wf-border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
  padding: 4px;
  min-width: 170px;
}
.wf-type-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--wf-text);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border-radius: 6px;
  width: 100%;
  text-align: left;
  transition: background 100ms ease;
}
.wf-type-option:hover {
  background: var(--wf-neutral-bg);
}
.wf-type-option.active {
  background: rgba(56,69,81,0.06);
  color: var(--color-text-primary, #384551);
  font-weight: 600;
}
.wf-type-option svg { flex-shrink: 0; }

.wf-field-type-select { display: none; }

.wf-field-toggle,
.wf-field-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--wf-text-secondary);
  cursor: pointer;
  font-size: 14px;
  flex-shrink: 0;
  transition: background 150ms ease, color 150ms ease;
  padding: 0;
  opacity: 0.5;
}

@media (pointer: coarse) {
  .wf-field-toggle,
  .wf-field-remove {
    width: 44px;
    height: 44px;
    min-width: 44px;
  }
  .wf-field-drag {
    min-width: 44px;
    min-height: 44px;
  }
}
.wf-field-card:hover .wf-field-toggle,
.wf-field-card:hover .wf-field-remove,
.wf-field-card.expanded .wf-field-toggle,
.wf-field-card.expanded .wf-field-remove {
  opacity: 1;
}
.wf-field-toggle:hover {
  background: var(--wf-neutral-bg-hover);
  color: var(--wf-text);
}
.wf-field-remove:hover {
  background: rgba(255, 62, 29, 0.08);
  color: var(--color-error, #ff3e1d);
}

.wf-field-card.expanded .wf-field-toggle .wf-chevron-icon {
  transform: rotate(180deg);
}

.wf-field-card-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 200ms ease;
  overflow: hidden;
}
.wf-field-card-body > * {
  overflow: hidden;
}
.wf-field-card.expanded .wf-field-card-body {
  grid-template-rows: 1fr;
  border-top: 1px solid var(--wf-border);
}

.wf-field-body-row,
.wf-options-editor,
.wf-field-reorder,
.wf-condition-add,
.wf-field-condition {
  padding: 0 12px;
}
.wf-field-card.expanded .wf-field-body-row:first-child {
  padding-top: 12px;
}
.wf-field-card.expanded .wf-field-reorder {
  padding-bottom: 12px;
}

.wf-field-card-body label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--wf-text-secondary);
  margin-bottom: 4px;
}

.wf-field-placeholder-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--wf-border);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  color: var(--wf-text);
  background: var(--wf-bg);
  transition: border-color 150ms ease;
  box-sizing: border-box;
  margin-bottom: 8px;
}

.wf-field-required-check {
  accent-color: var(--color-text-primary, #384551);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.wf-field-reorder {
  display: flex;
  gap: 6px;
  padding-top: 8px;
}
.wf-field-move-up,
.wf-field-move-down {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
  border: 1px solid var(--wf-border);
  border-radius: 6px;
  background: var(--wf-card);
  color: var(--wf-text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  transition: color 150ms ease, border-color 150ms ease;
}
.wf-field-move-up:hover,
.wf-field-move-down:hover {
  color: var(--color-text-primary, #384551);
  border-color: rgba(56,69,81,0.3);
}

.wf-add-field-inline {
  margin-top: 6px;
}
.wf-add-field-input {
  width: 100%;
  padding: 12px 14px;
  border: 2px dashed color-mix(in srgb, var(--wf-border) 80%, transparent);
  border-radius: 10px;
  background: transparent;
  color: var(--wf-text);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  transition: border-color 200ms ease, background 200ms ease;
  box-sizing: border-box;
}
.wf-add-field-input:hover {
  border-color: rgba(56, 69, 81, 0.3);
}
.wf-add-field-input:focus {
  border-color: var(--wf-border);
  background: var(--wf-bg);
  border-style: solid;
  outline: none;
}
.wf-add-field-input::placeholder {
  color: var(--wf-text-secondary);
  font-weight: 400;
  opacity: 0.6;
}

.wf-add-field-btn { display: none; }

.wf-section-card {
  background: transparent;
  border: none;
  box-shadow: none;
  border-bottom: 2px solid var(--wf-border);
  border-radius: 0;
  padding: 0;
  margin-top: 8px;
}
.wf-section-card:hover {
  border-color: rgba(56,69,81,0.25);
}
.wf-section-card .wf-field-card-header {
  padding: 8px 0;
}
.wf-section-card .wf-section-label {
  font-weight: 700;
  font-size: 15px;
}
.wf-section-card .wf-section-label::placeholder {
  font-weight: 500;
  opacity: 0.5;
}
.wf-section-card.wf-dragging {
  opacity: 0.4;
  outline: 2px dashed var(--color-text-primary, #384551);
  outline-offset: -2px;
}

.wf-form .wf-section-heading {
  font-size: 16px;
  font-weight: 700;
  color: var(--wf-text);
  margin: 24px 0 8px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--wf-border);
}
.wf-form .wf-section-heading:first-child { margin-top: 0; }

.wf-preview-section-heading {
  font-size: 14px;
  font-weight: 700;
  color: var(--wf-text);
  margin: 12px 0 4px;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--wf-border);
}

.wf-add-section-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--wf-muted);
  background: none;
  border: 1px dashed var(--wf-border);
  border-radius: 8px;
  padding: 6px 14px;
  cursor: pointer;
  margin-top: 8px;
  transition: color 0.15s, border-color 0.15s;
}
.wf-add-section-btn:hover {
  color: var(--color-text-primary, #384551);
  border-color: var(--color-text-primary, #384551);
}
.wf-add-section-btn svg {
  opacity: 0.6;
}

.wf-template-mode .wf-field-drag {
  opacity: 0;
  transition: opacity 150ms ease;
}
.wf-template-mode .wf-field-card:hover .wf-field-drag {
  opacity: 0.4;
}

.wf-template-mode .wf-type-pill-wrap {
  opacity: 0;
  transition: opacity 150ms ease;
}
.wf-template-mode .wf-field-card:hover .wf-type-pill-wrap,
.wf-template-mode .wf-field-card.expanded .wf-type-pill-wrap {
  opacity: 1;
}

.wf-template-mode .wf-field-remove {
  opacity: 0;
}
.wf-template-mode .wf-field-card:hover .wf-field-remove {
  opacity: 0.5;
}

.wf-template-mode .wf-add-field-inline {
  opacity: 0.6;
  transition: opacity 200ms ease;
}
.wf-template-mode .wf-add-field-inline:hover,
.wf-template-mode .wf-add-field-inline:focus-within {
  opacity: 1;
}

.wf-template-mode .wf-condition-add {
  display: none;
}

.wf-template-mode .wf-add-section-btn {
  display: none;
}
