/* ============================================================
 FormForge Admin — Forge Design System v2
 Scoped: .ff-admin, .formforge-editor-grid, .formforge-*
 ============================================================ */

/* ============================================================
 1. DESIGN TOKENS
 ============================================================ */

:root {
    /* ── Shared tokens (same across all Forge plugins) ── */
    --bg-light:       #F8F9FC;
    --surface:        #FFFFFF;
    --border:         #E5E7EB;
    --text-primary:   #1A1A2E;
    --text-secondary: #4B5563;
    --text-muted:     #6B7280;
    --status-success: #10B981;
    --status-warning: #F59E0B;
    --status-error:   #EF4444;
    --status-success-light: #ECFDF5;
    --status-warning-light: #FFFBEB;
    --status-error-light:   #FEF2F2;
    --radius-sm:   6px;
    --radius-md:   12px;
    --radius-lg:   14px;
    --radius-xl:   16px;
    --radius-pill: 100px;
    --shadow-sm:   0 1px 3px rgba(0,0,0,0.08);
    --shadow-md:   0 4px 16px rgba(0,0,0,0.08);
    --shadow-card: 0 24px 64px rgba(0,0,0,0.08);
    --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
    --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
    --font-sans:   'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-base:   'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.ff-admin {
    /* ── FormForge accent palette (scoped — won't leak to other plugins) ── */
    --accent:           #3B82F6;
    --accent-hover:     #2D74E8;
    --accent-active:    #2563EB;
    --accent-light:     #60A5FA;
    --accent-muted:     #BFDBFE;
    --accent-subtle:    #EFF6FF;
    --on-accent:        #FFFFFF;
    --shadow-btn:       0 4px 24px color-mix(in srgb, #3B82F6 35%, transparent);
    /* Legacy aliases */
    --ff-primary:           #3B82F6;
    --ff-primary-hover:     #2D74E8;
    --ff-primary-light:     #EFF6FF;
    --ff-primary-lighter:   #EFF6FF;
    --ff-text:              #1A1A2E;
    --ff-text-secondary:    #4B5563;
    --ff-border:            #E5E7EB;
    --ff-bg:                #F8F9FC;
    --ff-white:             #FFFFFF;
    --ff-danger:            #EF4444;
    --ff-danger-light:      #FEF2F2;
    --ff-success:           #10B981;
    --ff-radius:            16px;
    --ff-radius-md:         12px;
    --ff-radius-sm:         8px;
    --ff-radius-xs:         6px;
    --ff-shadow:            0 1px 4px rgba(0,0,0,0.06);
    --ff-shadow-md:         0 4px 16px rgba(0,0,0,0.08);
    --ff-shadow-lg:         0 8px 32px rgba(0,0,0,0.10);
}


/* ============================================================
 2. BASE FONT SCOPE
 ============================================================ */

.ff-admin .wrap,
.formforge-editor-grid {
    font-family: var(--font-base);
}


/* ============================================================
 3. EDITOR LAYOUT
 ============================================================ */

.formforge-editor-grid {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(420px, 720px) minmax(460px, 500px);
    gap: 20px;
    margin-top: 16px;
    align-items: start;
    justify-content: start;
}

.formforge-builder {
    /* v2: vertical breathing room + clamp width to grid track. */
    max-width: 100%;
    margin: 0;
    padding: 32px 28px;
}

/* Field Settings (right column) layout polish — labels stack
 above inputs, inputs span full width, Availability fieldset breathes. */
.formforge-inspector {
    position: sticky;
    top: 42px;
    height: auto;
    max-height: none;
    overflow: visible;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-self: start;
}
.ff-inspector-panel,
.formforge-field-settings {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0;
    box-shadow: var(--ff-shadow);
}
.formforge-inspector .formforge-field-settings {
    position: static;
    max-height: none;
    overflow-y: visible;
}
.ff-inspector-panel-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
    padding: 16px 18px 14px;
}
.ff-inspector-panel-head .dashicons {
    width: 18px;
    height: 18px;
    font-size: 18px;
    color: var(--accent);
}
.ff-inspector-panel-head h3 {
    margin: 0;
}
.ff-inspector-panel-body {
    padding: 0 18px 22px;
}
.ff-inspector-collapse {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin-left: auto;
    padding: 0;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}
.ff-inspector-collapse:hover,
.ff-inspector-collapse:focus {
    border-color: #bfdbfe;
    background: #eff6ff;
    outline: none;
}
.ff-inspector-collapse .dashicons {
    width: 16px;
    height: 16px;
    font-size: 16px;
    color: #64748b;
    transition: transform .18s ease;
}
.ff-inspector-panel.is-collapsed > .ff-inspector-panel-body,
.ff-preview-card.is-collapsed > .ff-preview-frame {
    display: none;
}
.ff-inspector-panel.is-collapsed .ff-inspector-collapse .dashicons {
    transform: rotate(-90deg);
}
.formforge-field-settings h3 {
    margin: 0 0 14px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: .5px;
}
.ff-style-empty {
    margin: 0;
    padding: 12px 14px;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    color: #64748b;
    font-size: 13px;
    line-height: 1.5;
}
.ff-selected-style-target {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--accent-subtle);
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 700;
}
.ff-style-target-switcher {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin: -4px 0 12px;
}
.ff-style-target-switch {
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #fff;
    color: #334155;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    padding: 8px 10px;
    text-align: center;
}
.ff-style-target-switch.is-active {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #1d4ed8;
}
.ff-style-global-targets {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin: 0 0 12px;
}
.ff-style-empty + .ff-style-global-targets {
    margin-top: 10px;
}
.ff-style-global-target {
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #fff;
    color: #334155;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    min-height: 36px;
    padding: 8px 10px;
    text-align: center;
}
.ff-style-global-target.is-active,
.ff-style-global-target:hover,
.ff-style-global-target:focus {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #1d4ed8;
    outline: none;
}
.ff-selected-style-fields {
    display: grid;
    gap: 12px;
}
.ff-style-control {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
    gap: 6px;
    margin: 0;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.ff-admin .wrap .ff-style-control {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
    gap: 6px;
}
.ff-style-color-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    gap: 12px;
}
.ff-style-control-label {
    display: block;
    white-space: nowrap;
    overflow: visible;
}
.ff-style-color-row .ff-style-control {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 6px;
}
.ff-admin .wrap .ff-style-color-row .ff-style-control {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 6px;
}
.ff-style-control input,
.ff-style-control select,
.ff-style-control textarea {
    width: 100%;
    margin-top: 0;
    box-sizing: border-box;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    color: #0f172a;
    font-size: 13px;
}
.ff-style-control input[type="color"] {
    display: block;
    width: 56px;
    min-width: 56px;
    min-height: 38px;
    padding: 3px;
}
.ff-style-control--textarea {
    align-items: start;
}
.ff-style-control--textarea .ff-style-control-label {
    padding-top: 0;
}
.ff-preview-frame .ff-preview-selectable {
    cursor: pointer;
    outline-offset: 3px;
}
.ff-preview-frame .ff-preview-selectable:hover {
    outline: 2px solid #bfdbfe;
}
.ff-preview-frame .ff-preview-selected {
    outline: 2px solid #3b82f6 !important;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, .14);
}
.formforge-field-settings label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.formforge-field-settings label > input[type="text"],
.formforge-field-settings label > input[type="number"],
.formforge-field-settings label > textarea {
    width: 100%;
    margin-top: 4px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: var(--surface);
    color: var(--text-primary);
    box-sizing: border-box;
}
.formforge-field-settings label > textarea { resize: vertical; }
.formforge-field-settings fieldset {
    margin-top: 8px;
    padding: 12px 14px 14px;
}
.formforge-field-settings fieldset legend {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
}
.formforge-field-settings fieldset > div[style*="grid-template-columns"] {
    display: grid;
    /* v3: auto-fit so the two-column Availability grid collapses to a
 single column when the panel narrows (≤460px ≈ each cell <220px),
 keeping label text + input from being squeezed onto one line. */
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}
.formforge-field-settings fieldset label {
    margin-bottom: 0;
    font-weight: 600;
    font-size: 12px;
}

/* Round 1 (2026-04-28): Validation / Advanced collapsible-styled sections
 for per-field settings. Layout mirrors the existing Availability fieldset
 so visual parity is automatic. */
.formforge-field-settings .aifs-section {
    margin-top: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px 14px;
    background: rgba(248, 250, 252, 0.5);
}
.formforge-field-settings .aifs-section legend {
    padding: 0 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
}
.formforge-field-settings .aifs-section label {
    display: block;
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}
.formforge-field-settings .aifs-section label > input[type="text"],
.formforge-field-settings .aifs-section label > input[type="number"],
.formforge-field-settings .aifs-section label > input[type="color"],
.formforge-field-settings .aifs-section label > select,
.formforge-field-settings .aifs-section label > textarea {
    width: 100%;
    margin-top: 4px;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    background: var(--surface);
    color: var(--text-primary);
    box-sizing: border-box;
}
.formforge-field-settings .aifs-section label > input[type="color"] {
    width: 56px;
    min-width: 56px;
    min-height: 34px;
    padding: 3px;
}
.formforge-field-settings .aifs-section label > textarea {
    resize: vertical;
}
.formforge-field-settings .aifs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
}
.formforge-field-settings .aifs-file-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}
.ff-calc-token-label {
    margin: 4px 0 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .4px;
}
.ff-calc-token-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 12px;
}
.ff-calc-token-list .ff-calc-token {
    min-height: 28px;
    padding: 3px 9px;
    border-color: #bfdbfe;
    color: #1d4ed8;
    background: #eff6ff;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
}
.ff-calc-help {
    margin: 6px 0 0;
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.5;
}
.aifs-layout-note {
    margin: 8px 0 12px;
    padding: 10px 12px;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    background: #eff6ff;
    color: #1e3a8a;
    font-size: 12px;
    line-height: 1.5;
}
.formforge-field-settings .aifs-checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 0;
    padding: 4px 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-weight: 500;
    font-size: 12px;
    cursor: pointer;
}
.formforge-field-settings .aifs-checkbox-inline input[type="checkbox"] {
    margin: 0;
}
/* the Payment field's "Fixed amount" / "Dynamic" choices use radios
 inside `.aifs-checkbox-inline` labels. Two things broke the radio:
 1. The generic `.formforge-field-settings .aifs-section label` +
 `.ff-admin .wrap .formforge-field-settings label` rules (display:block,
 higher specificity) overrode `.aifs-checkbox-inline { display:inline-flex }`,
 so the radio + its text no longer shared a centered row.
 2. Only `input[type="checkbox"]` got a reset here — the radio fell through
 to whichever generic `.ff-admin` radio rule won, and inside the grid
 column it could be squeezed off-square / misaligned.
 Restore the inline-flex label and pin the radio to a clean fixed circle
 that matches the other `.ff-admin` controls. */
.ff-admin .wrap .formforge-field-settings label.aifs-checkbox-inline,
.formforge-field-settings .aifs-section label.aifs-checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: auto !important;
    height: auto !important;
    min-height: 28px;
    border: 1px solid #e2e8f0 !important;
    border-radius: 4px !important;
    transform: none !important;
    box-sizing: border-box;
}
.formforge-field-settings .aifs-checkbox-inline input[type="radio"] {
    -webkit-appearance: none !important;
    appearance: none !important;
    aspect-ratio: 1 / 1;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    flex: 0 0 18px !important;
    display: inline-block !important;
    line-height: 18px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 1.5px solid var(--border) !important;
    border-radius: 50% !important;
    background: var(--surface) !important;
    box-sizing: border-box !important;
    vertical-align: middle;
    position: relative;
    cursor: pointer;
}
.formforge-field-settings .aifs-checkbox-inline input[type="radio"]:checked {
    border-color: var(--accent) !important;
}
.formforge-field-settings .aifs-checkbox-inline input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    transform: translate(-50%, -50%);
}

/* v3: the broader `.ff-admin .wrap label { display: inline-flex }`
 rule below (search "ff-admin .wrap label") wins over .formforge-field-
 settings label by specificity, which forced text + input to share a line.
 At narrow Availability grid columns labels visually merged. Force the
 standard "label text on top, input below" stack inside the settings panel
 regardless of source rule. */
.ff-admin .wrap .formforge-field-settings label,
.ff-admin .wrap .formforge-field-settings fieldset label {
    display: block;
    align-items: stretch;
    gap: 0;
}

/* Round 3 (2026-04-28): in-builder Conditional Logic editor. */
.formforge-field-settings .ff-cl-section {
    border-color: #c7d2fe;
    background: rgba(238, 242, 255, 0.55);
}
.formforge-field-settings .ff-cl-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    background: #3B82F6;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 4px;
    letter-spacing: .3px;
    text-transform: uppercase;
}
.formforge-field-settings .ff-cl-toggle {
    display: flex !important;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px !important;
    font-size: 13px !important;
    color: var(--text-primary) !important;
    cursor: pointer;
}

.ff-preview-card {
    margin-bottom: 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}
.formforge-inspector .ff-preview-card {
    margin-bottom: 0;
    overflow: hidden;
    box-shadow: var(--ff-shadow);
}
.ff-preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}
.ff-preview-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}
.ff-preview-note {
    margin: 0;
    padding: 10px 16px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #64748b;
    font-size: 12px;
    line-height: 1.45;
}
.ff-preview-frame {
    padding: 0;
    background: #f8fafc;
    min-height: 160px;
}
.formforge-inspector .ff-preview-frame {
    min-height: 160px;
    max-height: none;
    overflow: visible;
    padding: 0;
}
.ff-preview-iframe {
    display: block;
    width: 100%;
    min-height: 160px;
    border: 0;
    background: #f8fafc;
}
.ff-preview-error {
    margin: 0;
    padding: 18px;
    color: #b91c1c;
}
.formforge-field-settings .ff-cl-toggle input[type="checkbox"] {
    margin: 0;
}
.formforge-field-settings .ff-cl-locked {
    margin: 4px 0 0;
    font-size: 12px;
    color: #475569;
    line-height: 1.5;
}
.formforge-field-settings .ff-cl-locked a {
    color: #3B82F6;
    font-weight: 600;
    text-decoration: none;
}
.formforge-field-settings .ff-cl-locked a:hover { text-decoration: underline; }

#aifs-cl-rules {
    margin: 10px 0;
    padding: 10px;
    background: #fff;
    border: 1px dashed #c7d2fe;
    border-radius: 8px;
    min-height: 36px;
}
#aifs-cl-rules .ff-cl-rule {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: stretch;
    margin-bottom: 12px;
    padding: 0 0 12px;
    border-bottom: 1px dashed #e2e8f0;
}
#aifs-cl-rules .ff-cl-rule:last-child {
    border-bottom: 0;
    margin-bottom: 0;
    padding-bottom: 0;
}
#aifs-cl-rules .ff-cl-rule label {
    min-width: 0;
    font-size: 11px !important;
    font-weight: 600 !important;
    color: var(--text-muted) !important;
    text-transform: uppercase;
    letter-spacing: .3px;
    margin-bottom: 0 !important;
}
#aifs-cl-rules .ff-cl-rule select,
#aifs-cl-rules .ff-cl-rule input[type="text"] {
    width: 100%;
    margin-top: 4px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
    box-sizing: border-box;
    background: #fff;
}
#aifs-cl-rules .ff-cl-rule input[disabled] {
    background: #f1f5f9;
    color: #94a3b8;
}
.ff-cl-remove-rule {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    background: #fff;
    color: #94a3b8;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0;
    transition: all .15s;
    justify-self: start;
    align-self: start;
}
.ff-cl-remove-rule:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #ef4444;
}
.ff-cl-add-rule {
    margin-top: 4px;
}
.ff-cl-summary {
    margin: 10px 0 0;
    padding: 8px 10px;
    border: 1px solid #dbeafe;
    border-radius: 7px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.45;
}
.ff-cl-help {
    margin: 8px 0 0;
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.5;
}

/* Layout the action+match selectors side-by-side at narrow widths too. */
.formforge-field-settings .ff-cl-section .aifs-grid select {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    background: var(--surface);
    box-sizing: border-box;
}

/* ============================================================
 4. SIDEBAR PALETTE
 ============================================================ */

.formforge-palette {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px 16px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    position: sticky;
    top: 42px;
    box-shadow: var(--ff-shadow);
}

.formforge-palette h3 {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-base);
}

.formforge-palette h4 {
    font-size: 14px;
    color: var(--text-muted);
    margin: 14px 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    font-weight: 700;
    font-family: var(--font-base);
}

/* Field button list */
.formforge-field-buttons {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Draggable sidebar items */
.formforge-sidebar-draggable,
.formforge-sidebar-locked {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-light);
    border: 1px solid transparent;
    cursor: grab;
    transition: background 0.3s var(--ease-spring),
                border-color 0.3s var(--ease-spring),
                color 0.3s var(--ease-spring),
                box-shadow 0.3s var(--ease-spring);
    user-select: none;
    font-family: var(--font-base);
}

.formforge-sidebar-locked {
    color: #94a3b8;
    background: #f8fafc;
    border-color: #e2e8f0;
    cursor: not-allowed;
}

.formforge-sidebar-locked .dashicons {
    color: #94a3b8;
}

.formforge-pro-chip {
    margin-left: auto;
    padding: 2px 5px;
    border-radius: 5px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

.formforge-sidebar-draggable:hover {
    background: var(--accent-subtle);
    border-color: var(--accent-muted);
    color: var(--accent);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 10%, transparent);
}

.formforge-sidebar-draggable:active {
    cursor: grabbing;
}

.formforge-sidebar-draggable .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    color: var(--accent);
    opacity: 0.65;
    transition: opacity 0.2s;
}

.formforge-sidebar-draggable:hover .dashicons {
    opacity: 1;
}


/* ============================================================
 5. DRAG GHOST
 ============================================================ */

.formforge-drag-ghost,
.formforge-sidebar-draggable.ui-draggable-dragging {
    background: var(--surface) !important;
    border: 2px solid var(--accent) !important;
    border-radius: 12px !important;
    padding: 8px 14px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    box-shadow: 0 8px 32px color-mix(in srgb, var(--accent) 30%, transparent) !important;
    white-space: nowrap;
    display: flex !important;
    align-items: center;
    gap: 6px;
    width: auto !important;
    max-width: 220px;
    opacity: 0.96;
    font-family: var(--font-base);
}


/* ============================================================
 6. BUILDER CANVAS (CENTER)
 ============================================================ */

.formforge-builder {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    min-height: 500px;
    box-shadow: var(--ff-shadow);
}

/* Form title */
.formforge-form-title-wrap {
    margin-bottom: 16px;
}

.formforge-form-title-wrap input {
    font-family: var(--font-base);
    font-size: 18px;
    font-weight: 600;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    width: 100%;
    color: var(--text-primary);
    background: var(--surface);
    transition: border-color 0.3s var(--ease-spring),
                box-shadow 0.3s var(--ease-spring);
}

.formforge-form-title-wrap input:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent);
}

/* Sortable drop area */
.formforge-fields-sortable {
    min-height: 300px;
    border-radius: 12px;
    padding: 4px;
    transition: background 0.3s var(--ease-spring);
}

/* Drop zone active */
.formforge-drop-active {
    background: var(--accent-subtle) !important;
    border: 2px dashed var(--accent-muted) !important;
}

/* Drop placeholder / sortable placeholder */
.formforge-drop-indicator,
.ui-sortable-placeholder {
    height: 52px !important;
    background: var(--accent-subtle) !important;
    border: 2px dashed var(--accent-muted) !important;
    border-radius: 10px !important;
    margin: 6px 0 !important;
    visibility: visible !important;
    transition: height 0.2s var(--ease-spring);
    position: relative;
}

.formforge-drop-indicator::after,
.ui-sortable-placeholder::after {
    content: 'Drop here';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-light);
    letter-spacing: 0.5px;
    font-family: var(--font-base);
}


/* ============================================================
 7. FIELD CARDS
 ============================================================ */

.formforge-field-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: box-shadow 0.4s var(--ease-spring),
                border-color 0.3s var(--ease-spring),
                transform 0.4s var(--ease-spring);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.formforge-field-card:hover {
    box-shadow: var(--ff-shadow-md);
    border-color: #D1D5DB;
}

/* While being sorted */
.formforge-field-card.ui-sortable-helper {
    box-shadow: 0 12px 36px rgba(0,0,0,0.14);
    border-color: var(--accent-muted);
}

/* Pop-in animation on add */
.formforge-field-card--just-added {
    animation: formforge-pop 0.35s var(--ease-spring);
}

/* Editing state — accent border highlight */
.formforge-field-card--editing {
    border-color: var(--accent);
    background: var(--accent-subtle);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}

.formforge-field-card--ai-target {
    border-color: #93c5fd;
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.35),
                0 10px 24px rgba(37, 99, 235, 0.12);
    animation: ff-ai-target-pulse 1.3s ease-in-out 0s 2;
}

.formforge-field-card--ai-target.formforge-field-card--editing {
    border-color: #60a5fa;
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.38),
                0 10px 24px rgba(37, 99, 235, 0.16);
}

.ff-ai-target-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid #bfdbfe;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0;
}

.ff-ai-editor-note {
    margin: 0 0 14px;
    padding: 12px 14px;
    border: 1px solid #bfdbfe;
    border-left: 4px solid var(--accent);
    border-radius: 10px;
    background: #eff6ff;
    color: #1e293b;
    font-size: 13px;
    line-height: 1.45;
}

.ff-ai-editor-note__eyebrow {
    margin-bottom: 4px;
    color: #2563eb;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.ff-ai-editor-note strong {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
}

.ff-ai-editor-note p {
    margin: 0 0 8px;
    color: #475569;
}

.ff-ai-editor-note span {
    color: #1d4ed8;
    font-weight: 700;
}

.ff-ai-editor-note__status {
    display: inline-flex;
    align-items: center;
    margin: 0 0 8px;
    padding: 6px 8px;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 800;
}

@keyframes ff-ai-target-pulse {
    0% { box-shadow: 0 0 0 0 rgba(96, 165, 250, 0.38), 0 10px 24px rgba(37, 99, 235, 0.12); }
    70% { box-shadow: 0 0 0 8px rgba(96, 165, 250, 0), 0 10px 24px rgba(37, 99, 235, 0.14); }
    100% { box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.35), 0 10px 24px rgba(37, 99, 235, 0.12); }
}

@keyframes formforge-pop {
    0%   { transform: scale(0.94); opacity: 0.4; }
    55%  { transform: scale(1.025); }
    100% { transform: scale(1); opacity: 1; }
}

/* Card header row */
.formforge-field-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 14px;
}

/* Drag handle */
.formforge-field-drag-handle {
    cursor: grab;
    color: #D1D5DB;
    font-size: 14px;
    transition: color 0.2s var(--ease-spring);
    flex-shrink: 0;
}

.formforge-field-drag-handle:active {
    cursor: grabbing;
}

.formforge-field-card:hover .formforge-field-drag-handle {
    color: var(--text-muted);
}

/* Type badge */
.formforge-field-type-badge {
    background: var(--accent-subtle);
    color: var(--accent);
    padding: 2px 9px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-family: var(--font-base);
}

/* Actions (right side of header) */
.formforge-field-actions {
    margin-left: auto;
    display: flex;
    gap: 2px;
}

.formforge-field-actions button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #D1D5DB;
    padding: 4px 6px;
    border-radius: 6px;
    transition: color 0.2s var(--ease-spring),
                background 0.2s var(--ease-spring);
}

.formforge-field-actions button:hover {
    color: var(--text-primary);
    background: var(--bg-light);
}

.formforge-delete-field:hover {
    color: var(--status-error) !important;
    background: #FEF2F2 !important;
}


/* ============================================================
 8. EMPTY STATE
 ============================================================ */

.formforge-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--accent-muted);
    border: 2px dashed var(--accent-muted);
    border-radius: 14px;
    background: var(--accent-subtle);
    font-size: 14px;
    min-height: 280px;
    font-family: var(--font-base);
}

.formforge-empty-state p {
    margin: 0;
}


/* ============================================================
 9. SAVE BAR
 ============================================================ */

.formforge-save-bar {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.formforge-save-bar--dirty::before {
    content: "";
    display: inline-flex;
    align-items: center;
    width: 10px;
    height: 10px;
    background: #2563eb;
    border-radius: 50%;
    box-shadow: 0 0 0 4px #dbeafe;
}

/* Override WordPress default button styles on the save button */
.formforge-save-bar .button,
.formforge-save-bar .button-primary,
.formforge-save-bar .button-hero,
#formforge-save {
    position: relative;
    overflow: hidden;
    background: var(--accent) !important;
    background-image: none !important;
    border: none !important;
    border-color: var(--accent) !important;
    border-radius: 14px !important;
    padding: 10px 28px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    font-family: var(--font-base) !important;
    color: var(--on-accent) !important;
    box-shadow: 0 4px 24px color-mix(in srgb, var(--accent) 35%, transparent) !important;
    transition: background 0.3s var(--ease-spring),
                box-shadow 0.4s var(--ease-spring),
                transform 0.3s var(--ease-spring) !important;
    text-shadow: none !important;
    height: auto !important;
    line-height: 1.4 !important;
    cursor: pointer;
}

/* Shimmer pseudo-element */
#formforge-save::after,
.formforge-save-bar .button-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255,255,255,0.28) 50%,
        transparent 100%
    );
    transform: skewX(-15deg);
    transition: left 0.55s var(--ease-spring);
    pointer-events: none;
}

#formforge-save:hover::after,
.formforge-save-bar .button-primary:hover::after {
    left: 140%;
}

#formforge-save:hover,
.formforge-save-bar .button-primary:hover {
    background: var(--accent-hover) !important;
    box-shadow: 0 6px 28px color-mix(in srgb, var(--accent) 45%, transparent) !important;
    transform: translateY(-2px) !important;
    color: var(--on-accent) !important;
}

#formforge-save:active,
.formforge-save-bar .button-primary:active {
    background: var(--accent-active) !important;
    transform: translateY(0) !important;
}


/* ============================================================
 10. FIELD SETTINGS PANEL (RIGHT)
 ============================================================ */

.formforge-field-settings {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    position: sticky;
    top: 42px;
    box-shadow: var(--ff-shadow);
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.formforge-field-settings h3 {
    margin: 0 0 14px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-base);
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent);
}

.formforge-field-settings label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin: 12px 0 4px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.45px;
    font-family: var(--font-base);
}

.formforge-field-settings input[type="text"],
.formforge-field-settings textarea,
.formforge-field-settings select {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-size: 14px;
    font-family: var(--font-base);
    color: var(--text-primary);
    background: var(--surface);
    transition: border-color 0.3s var(--ease-spring),
                box-shadow 0.3s var(--ease-spring);
    box-sizing: border-box;
}

.formforge-field-settings input:focus,
.formforge-field-settings textarea:focus,
.formforge-field-settings select:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent);
}

.formforge-field-settings input[type="checkbox"] {
    accent-color: var(--accent);
}

/* Apply / Cancel buttons inside settings panel */
.formforge-field-settings .button,
.formforge-field-settings .button-primary {
    background: var(--accent) !important;
    background-image: none !important;
    border: none !important;
    border-radius: 12px !important;
    color: var(--on-accent) !important;
    padding: 8px 18px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    font-family: var(--font-base) !important;
    text-shadow: none !important;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 25%, transparent) !important;
    cursor: pointer;
    transition: background 0.3s var(--ease-spring),
                box-shadow 0.3s var(--ease-spring),
                transform 0.3s var(--ease-spring) !important;
    height: auto !important;
    line-height: 1.4 !important;
}

.formforge-field-settings .button-primary:hover {
    background: var(--accent-hover) !important;
    box-shadow: 0 4px 16px color-mix(in srgb, var(--accent) 35%, transparent) !important;
    transform: translateY(-1px);
}

.formforge-field-settings .button:not(.button-primary) {
    background: var(--surface) !important;
    color: var(--text-primary) !important;
    border: 1.5px solid var(--border) !important;
    box-shadow: none !important;
}

.formforge-field-settings .button:not(.button-primary):hover {
    background: var(--bg-light) !important;
    border-color: var(--accent-muted) !important;
}

.formforge-inspector .formforge-field-settings {
    position: static;
    top: auto;
    max-height: none;
    overflow-y: visible;
    border-radius: 12px;
    padding: 0;
}

.formforge-inspector #ff-selected-style-panel {
    max-height: none;
    overflow-y: visible;
}

.formforge-inspector .ff-inspector-panel-head h3 {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: .5px;
}


/* ============================================================
 11. SHORTCODE COPY WIDGET
 ============================================================ */

.ff-shortcode-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.ff-shortcode-cluster {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: 12px;
    flex-wrap: wrap;
    min-width: 0;
}

.ff-shortcode-help {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 220px;
    max-width: 520px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.35;
}

.ff-shortcode-help-text {
    white-space: normal;
}

.ff-shortcode-help .forge-tip {
    flex: 0 0 auto;
    margin-left: 0;
}

.ff-shortcode-code {
    padding: 7px 12px;
    border: 0 !important;
    box-shadow: none !important;
    outline: 0;
    border-radius: 0;
    font-size: 14px;
    color: var(--accent);
    font-weight: 600;
    background: transparent;
    user-select: all;
    font-family: var(--font-base);
}

.ff-shortcode-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: none;
    border-left: 1px solid var(--border);
    padding: 7px 10px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: background 0.25s var(--ease-spring),
                color 0.25s var(--ease-spring);
}

.ff-shortcode-copy:hover {
    background: var(--accent-subtle);
    color: var(--accent);
}

.ff-shortcode-copy.copied {
    background: #ECFDF5;
    color: var(--status-success);
}

.ff-shortcode-copy .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}


/* ============================================================
 12. TOAST NOTIFICATION
 ============================================================ */

.formforge-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--status-success);
    color: #fff;
    padding: 13px 26px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-base);
    box-shadow: 0 8px 24px rgba(0,0,0,0.16);
    z-index: 100000;
    animation: formforge-toast-in 0.4s var(--ease-spring);
}
.formforge-toast--error {
    background: var(--status-error);
}

@keyframes formforge-toast-in {
    from { transform: translateY(24px); opacity: 0; }
    to   { transform: translateY(0);   opacity: 1; }
}


/* ============================================================
 13. SPINNER
 ============================================================ */

.spin {
    animation: formforge-spin 1s linear infinite;
}

@keyframes formforge-spin {
    to { transform: rotate(360deg); }
}


/* ============================================================
 14. RESPONSIVE
 ============================================================ */

@media (max-width: 1200px) {
    .formforge-editor-grid {
        grid-template-columns: 1fr;
    }
    .formforge-palette,
    .formforge-inspector,
    .formforge-field-settings {
        position: static;
        height: auto;
        max-height: none;
        overflow: visible;
    }
    .ff-style-control {
        grid-template-columns: 1fr;
    }
    .ff-admin .wrap .ff-style-control {
        grid-template-columns: 1fr;
    }
    .ff-style-control--textarea .ff-style-control-label {
        padding-top: 0;
    }
    .ff-style-control-label {
        white-space: normal;
    }
}


/* ============================================================
 15. FORGE BUTTON — PRIMARY (.forge-btn--primary)
 ============================================================ */

.forge-btn--primary {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent);
    color: var(--on-accent);
    border: none;
    border-radius: 14px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-base);
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 4px 24px color-mix(in srgb, var(--accent) 35%, transparent);
    transition: background 0.35s var(--ease-spring),
                box-shadow 0.4s var(--ease-spring),
                transform 0.35s var(--ease-spring);
}

/* Shimmer sweep */
.forge-btn--primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255,255,255,0.28) 50%,
        transparent 100%
    );
    transform: skewX(-15deg);
    transition: left 0.55s var(--ease-spring);
    pointer-events: none;
}

.forge-btn--primary:hover::after {
    left: 140%;
}

.forge-btn--primary:hover {
    background: var(--accent-hover);
    color: var(--on-accent);
    box-shadow: 0 6px 28px color-mix(in srgb, var(--accent) 45%, transparent);
    transform: translateY(-2px);
    text-decoration: none;
}

.forge-btn--primary:active {
    background: var(--accent-active);
    transform: translateY(0);
}

/* Secondary variant */
.forge-btn--secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    color: var(--accent);
    border: 1.5px solid var(--accent-muted);
    border-radius: 14px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-base);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.3s var(--ease-spring),
                border-color 0.3s var(--ease-spring),
                transform 0.3s var(--ease-spring);
}

.forge-btn--secondary:hover {
    background: var(--accent-subtle);
    border-color: var(--accent);
    transform: translateY(-1px);
    text-decoration: none;
    color: var(--accent);
}


/* ============================================================
 16. FORGE TABS
 ============================================================ */

.forge-tabs {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 4px;
}

.forge-tabs__tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 18px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font-base);
    color: var(--text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 0.3s var(--ease-spring),
                color 0.3s var(--ease-spring),
                box-shadow 0.3s var(--ease-spring);
    white-space: nowrap;
}

.forge-tabs__tab:hover {
    color: var(--text-primary);
    background: rgba(0,0,0,0.04);
}

.forge-tabs__tab--active {
    background: var(--surface);
    color: var(--accent);
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.forge-tabs__tab--active:hover {
    background: var(--surface);
    color: var(--accent);
}


/* ============================================================
 17. FORGE BADGES
 ============================================================ */

.forge-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-base);
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.forge-badge--blue {
    background: var(--accent-subtle);
    color: var(--accent);
    border: 1px solid var(--accent-muted);
}

.forge-badge--green {
    background: #ECFDF5;
    color: var(--status-success);
    border: 1px solid #A7F3D0;
}

.forge-badge--yellow {
    background: #FFFBEB;
    color: var(--status-warning);
    border: 1px solid #FDE68A;
}

.forge-badge--red {
    background: #FEF2F2;
    color: var(--status-error);
    border: 1px solid #FECACA;
}

.forge-badge--gray {
    background: var(--bg-light);
    color: var(--text-muted);
    border: 1px solid var(--border);
}


/* ============================================================
 18. FORGE ALERTS
 ============================================================ */

.forge-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 14px;
    font-family: var(--font-base);
    border: 1.5px solid transparent;
    margin-bottom: 12px;
}

.forge-alert__icon {
    flex-shrink: 0;
    margin-top: 1px;
}

.forge-alert__body {
    flex: 1;
    min-width: 0;
}

.forge-alert__title {
    font-weight: 600;
    margin: 0 0 2px;
    font-size: 14px;
}

.forge-alert__message {
    margin: 0;
    color: inherit;
    opacity: 0.85;
    font-size: 14px;
}

/* Variants */
.forge-alert--info {
    background: var(--accent-subtle);
    border-color: var(--accent-muted);
    color: var(--accent-active);
}

.forge-alert--success {
    background: #ECFDF5;
    border-color: #A7F3D0;
    color: #065F46;
}

.forge-alert--warning {
    background: #FFFBEB;
    border-color: #FDE68A;
    color: #92400E;
}

.forge-alert--error {
    background: #FEF2F2;
    border-color: #FECACA;
    color: #991B1B;
}


/* ============================================================
 19. FORGE CARD
 ============================================================ */

.forge-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--ff-shadow);
    transition: transform 0.4s var(--ease-spring),
                box-shadow 0.4s var(--ease-spring);
}

.forge-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--ff-shadow-lg);
}

.forge-card__header {
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.forge-card__title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    font-family: var(--font-base);
}

.forge-card__subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin: 4px 0 0;
    font-family: var(--font-base);
}

.forge-card__body {
    font-size: 14px;
    color: var(--text-secondary);
    font-family: var(--font-base);
}

.forge-card__footer {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}


/* ============================================================
 20. FORGE PROGRESS BAR
 ============================================================ */

.forge-progress {
    width: 100%;
    height: 8px;
    background: var(--bg-light);
    border-radius: 100px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.forge-progress__bar {
    height: 100%;
    background: var(--accent);
    border-radius: 100px;
    transition: width 0.5s var(--ease-spring);
}

.forge-progress--success .forge-progress__bar { background: var(--status-success); }
.forge-progress--warning .forge-progress__bar { background: var(--status-warning); }
.forge-progress--error   .forge-progress__bar { background: var(--status-error); }

.forge-progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    font-family: var(--font-base);
}


/* ============================================================
 21. FORGE TOGGLE
 ============================================================ */

.forge-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.forge-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.forge-toggle__track {
    position: absolute;
    inset: 0;
    background: var(--border);
    border-radius: 100px;
    cursor: pointer;
    transition: background 0.35s var(--ease-spring);
}

.forge-toggle__track::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--surface);
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    transition: transform 0.35s var(--ease-spring),
                box-shadow 0.35s var(--ease-spring);
}

.forge-toggle input:checked + .forge-toggle__track {
    background: var(--accent);
}

.forge-toggle input:checked + .forge-toggle__track::before {
    transform: translateX(20px);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 35%, transparent);
}

.forge-toggle input:focus + .forge-toggle__track {
    outline: 3px solid color-mix(in srgb, var(--accent) 25%, transparent);
    outline-offset: 2px;
}


/* ============================================================
 22. FF-ADMIN SCOPED GLOBAL STYLES
 Applies to all FormForge admin pages (body.ff-admin)
 ============================================================ */

/* --- 22a. Font scope --- */
.ff-admin .wrap {
    font-family: var(--font-base);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.55;
}

.ff-admin .wrap p {
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 12px;
}

/* Muted helper text — Settings API description, form hints. Slightly smaller
 than body but generous line-height so stacked hints stay readable. */
.ff-admin .wrap .description,
.ff-admin .wrap p.description,
.ff-admin .form-table .description {
    font-size: 14px;
    line-height: 1.55;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Form-table rows — breathe a bit so labels + inputs aren't cramped. */
.ff-admin .wrap .form-table th {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    padding: 18px 10px 18px 0;
    color: var(--text-primary);
}
.ff-admin .wrap .form-table td {
    padding: 14px 10px;
    font-size: 14px;
    line-height: 1.55;
}

/* --- 22b. Selects --- */
.ff-admin .wrap select,
.ff-admin .form-table select {
    padding: 12px 36px 12px 16px !important;
    border-radius: 12px !important;
    border: 1.5px solid var(--border) !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%236B7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M4 6l4 4 4-4'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-color: var(--surface) !important;
    font-size: 14px;
    font-family: var(--font-base);
    color: var(--text-primary);
    transition: border-color 0.3s var(--ease-spring),
                box-shadow 0.3s var(--ease-spring) !important;
}

.ff-admin .wrap select:focus,
.ff-admin .form-table select:focus {
    border-color: var(--accent) !important;
    outline: none !important;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent) !important;
}

/* --- 22c. Text inputs & textareas --- */
.ff-admin .wrap input[type="text"],
.ff-admin .wrap input[type="url"],
.ff-admin .wrap input[type="password"],
.ff-admin .wrap input[type="number"],
.ff-admin .wrap input[type="email"],
.ff-admin .wrap input[type="search"],
.ff-admin .wrap textarea,
.ff-admin .form-table input[type="text"],
.ff-admin .form-table input[type="url"],
.ff-admin .form-table textarea {
    border-radius: 12px !important;
    border: 1.5px solid var(--border) !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
    font-family: var(--font-base) !important;
    color: var(--text-primary) !important;
    background: var(--surface) !important;
    transition: border-color 0.3s var(--ease-spring),
                box-shadow 0.3s var(--ease-spring) !important;
}

.ff-admin .wrap input[type="text"]:focus,
.ff-admin .wrap input[type="url"]:focus,
.ff-admin .wrap input[type="password"]:focus,
.ff-admin .wrap input[type="number"]:focus,
.ff-admin .wrap input[type="email"]:focus,
.ff-admin .wrap input[type="search"]:focus,
.ff-admin .wrap textarea:focus {
    border-color: var(--accent) !important;
    outline: none !important;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent) !important;
}

/* --- 22d. Custom Checkboxes --- */
.ff-admin .wrap input[type="checkbox"] {
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 20px !important;
    height: 20px !important;
    border: 1.5px solid var(--border) !important;
    border-radius: 6px !important;
    background: var(--surface) !important;
    cursor: pointer;
    transition: background 0.25s var(--ease-spring),
                border-color 0.25s var(--ease-spring),
                box-shadow 0.25s var(--ease-spring) !important;
    vertical-align: middle;
    position: relative;
    margin: 0 8px 0 0 !important;
    flex-shrink: 0;
}

.ff-admin .wrap input[type="checkbox"]:hover {
    border-color: var(--accent) !important;
}

.ff-admin .wrap input[type="checkbox"]:checked {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
}

.ff-admin .wrap input[type="checkbox"]::before {
    display: none !important;
}

.ff-admin .wrap input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 5px;
    width: 6px;
    height: 10px;
    border: solid var(--on-accent);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.ff-admin .wrap input[type="checkbox"]:focus {
    outline: none !important;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent) !important;
}

/* --- 22e. Custom Radios --- */
.ff-admin .wrap input[type="radio"] {
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 20px !important;
    height: 20px !important;
    border: 1.5px solid var(--border) !important;
    border-radius: 50% !important;
    background: var(--surface) !important;
    cursor: pointer;
    transition: border-color 0.25s var(--ease-spring),
                box-shadow 0.25s var(--ease-spring) !important;
    vertical-align: middle;
    position: relative;
    margin: 0 8px 0 0 !important;
    flex-shrink: 0;
}

.ff-admin .wrap input[type="radio"]:hover {
    border-color: var(--accent) !important;
}

.ff-admin .wrap input[type="radio"]:checked {
    border-color: var(--accent) !important;
    background: var(--surface) !important;
}

.ff-admin .wrap input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
}

.ff-admin .wrap input[type="radio"]:focus {
    outline: none !important;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent) !important;
}

/* --- 22f. Labels --- */
.ff-admin .wrap label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-family: var(--font-base);
    font-size: 14px;
    line-height: 1.5;
}

.ff-admin .form-table label {
    margin-bottom: 4px;
}

/* --- 22g. Primary Buttons --- */
.ff-admin .wrap .button-primary,
.ff-admin .wrap input[type="submit"].button-primary {
    position: relative;
    overflow: hidden;
    background: var(--accent) !important;
    background-image: none !important;
    border-color: var(--accent) !important;
    color: var(--on-accent) !important;
    border-radius: 14px !important;
    text-shadow: none !important;
    box-shadow: 0 4px 24px color-mix(in srgb, var(--accent) 35%, transparent) !important;
    padding: 10px 24px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    font-family: var(--font-base) !important;
    transition: background 0.35s var(--ease-spring),
                box-shadow 0.4s var(--ease-spring),
                transform 0.35s var(--ease-spring) !important;
    height: auto !important;
    line-height: 1.4 !important;
    cursor: pointer;
}

.ff-admin .wrap .button-primary:hover,
.ff-admin .wrap input[type="submit"].button-primary:hover {
    background: var(--accent-hover) !important;
    box-shadow: 0 6px 28px color-mix(in srgb, var(--accent) 45%, transparent) !important;
    transform: translateY(-2px);
    color: var(--on-accent) !important;
}

.ff-admin .wrap .button-primary:active {
    background: var(--accent-active) !important;
    transform: translateY(0) !important;
}

/* --- 22h. Secondary Buttons --- */
.ff-admin .wrap .button:not(.button-primary) {
    border-radius: 14px !important;
    border: 1.5px solid var(--accent-muted) !important;
    color: var(--accent) !important;
    background: var(--surface) !important;
    padding: 10px 20px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    font-family: var(--font-base) !important;
    text-shadow: none !important;
    box-shadow: none !important;
    height: auto !important;
    line-height: 1.4 !important;
    transition: background 0.3s var(--ease-spring),
                border-color 0.3s var(--ease-spring),
                transform 0.3s var(--ease-spring) !important;
    cursor: pointer;
}

.ff-admin .wrap .button:not(.button-primary):hover {
    background: var(--accent-subtle) !important;
    border-color: var(--accent) !important;
    transform: translateY(-1px);
}

/* --- 22i. Tables --- */
.ff-admin .wrap table {
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--ff-shadow);
    width: 100%;
}

.ff-admin .wrap table thead th {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.55px;
    color: var(--text-secondary);
    background: var(--bg-light);
    border-bottom: 1.5px solid var(--border);
    padding: 13px 18px;
    text-align: left;
    font-family: var(--font-base);
}

.ff-admin .wrap table tbody td {
    padding: 16px 18px;
    border-bottom: 1px solid #F3F4F6;
    vertical-align: middle;
    font-size: 14px;
    line-height: 1.5;
    font-family: var(--font-base);
    color: var(--text-primary);
}

.ff-admin .wrap table tbody tr:last-child td {
    border-bottom: none;
}

.ff-admin .wrap table tbody tr {
    transition: background 0.25s var(--ease-spring);
}

.ff-admin .wrap table tbody tr:hover {
    background: var(--accent-subtle);
}

.ff-admin .wrap table tbody td a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.ff-admin .wrap table tbody td a:hover {
    text-decoration: underline;
}

/* form-table overrides — keep unstyled */
.ff-admin .wrap table.form-table {
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    background: transparent !important;
}

.ff-admin .wrap table.form-table td,
.ff-admin .wrap table.form-table th {
    border-bottom: 1px solid #F3F4F6;
    padding: 14px 10px;
}

.ff-admin .wrap table.form-table tbody tr:hover {
    background: transparent !important;
}

/* --- 22j. Page & section titles --- */
.ff-admin .wrap > h1:first-child {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    font-family: var(--font-base);
    color: var(--text-primary);
    padding-bottom: 14px;
    border-bottom: 2px solid var(--accent);
    margin: 0 0 24px;
}

.ff-admin .wrap > h2 {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
    font-family: var(--font-base);
    color: var(--text-primary);
    margin: 32px 0 12px;
}

.ff-admin .wrap > h3 {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    font-family: var(--font-base);
    color: var(--text-primary);
    margin: 24px 0 10px;
}

/* --- 22k. Notices / alerts --- */
.ff-admin .wrap .notice {
    border-radius: 10px;
    border-left-width: 4px;
    font-family: var(--font-base);
}

/* --- 22l. Postboxes --- */
.ff-admin .postbox {
    border-radius: 16px !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--ff-shadow) !important;
    font-family: var(--font-base);
}

/* --- 22m. Inline code --- */
.ff-admin .wrap code {
    background: var(--bg-light);
    padding: 2px 7px;
    border-radius: 5px;
    font-size: 14px;
    color: var(--accent);
    border: 1px solid var(--border);
}

/* --- 22n. File inputs --- */
.ff-admin .wrap input[type="file"] {
    padding: 12px 16px;
    border: 2px dashed var(--border);
    border-radius: 12px;
    background: var(--bg-light);
    cursor: pointer;
    transition: border-color 0.3s var(--ease-spring),
                background 0.3s var(--ease-spring) !important;
    font-size: 14px;
    font-family: var(--font-base);
    color: var(--text-secondary);
    width: 100%;
    max-width: 420px;
}

.ff-admin .wrap input[type="file"]:hover {
    border-color: var(--accent);
    background: var(--accent-subtle);
    color: var(--accent);
}

.ff-admin .wrap input[type="file"]::file-selector-button {
    background: var(--accent);
    color: var(--on-accent);
    border: none;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-base);
    cursor: pointer;
    margin-right: 12px;
    transition: background 0.25s var(--ease-spring);
}

.ff-admin .wrap input[type="file"]::file-selector-button:hover {
    background: var(--accent-hover);
}

/* --- 22o. General links --- */
.ff-admin .wrap a {
    cursor: pointer;
}

.ff-admin .wrap a:hover {
    text-decoration: underline;
}

/* WP/3rd-party notices: full width, normal WP styling — scoped to FF pages */
.ff-admin .wrap > .notice:not(.forge-upgrade-notice),
.ff-admin .wrap > .error:not(.forge-upgrade-notice),
.ff-admin .wrap > .updated:not(.forge-upgrade-notice),
.ff-admin .wrap > div[class*="wpml-"] {
    max-width: none !important;
    margin: 5px 0 10px !important;
}

/* Forge upgrade notice: match plugin content width */
.forge-upgrade-notice {
    max-width: inherit !important;
    box-sizing: border-box !important;
}

/* Make .wrap a flex column so we can reorder children — scoped to FF pages */
.ff-admin .wrap {
    display: flex !important;
    flex-direction: column !important;
}

/* Hidden h1 for WP notice insertion point */
.ff-admin .wrap > .wp-heading-inline { order: -10; }

/* WP/3rd-party notices: order 1 (first) */
.ff-admin .wrap > .notice:not(.forge-upgrade-notice),
.ff-admin .wrap > .error:not(.forge-upgrade-notice),
.ff-admin .wrap > .updated:not(.forge-upgrade-notice),
.ff-admin .wrap > div[class*="wpml-"],
.ff-admin .wrap > div[id*="wpml-"],
.ff-admin .wrap > div[id*="setting-error"] {
    order: 1 !important;
}

/* Forge upgrade notice: order 2 (after WP notices, before content) */
.ff-admin .wrap > .forge-upgrade-notice {
    order: 2 !important;
}

/* All other content: order 3 */
.ff-admin .wrap > *:not(.notice):not(.error):not(.updated):not(.forge-upgrade-notice):not(.wp-heading-inline):not(div[class*="wpml-"]):not(div[id*="wpml-"]):not(div[id*="setting-error"]) {
    order: 3 !important;
}

/* =============================================================================
 Branded admin header (shared pattern across Forge plugins)
 Background uses --accent / --accent-active vars from the per-plugin scope.
 ============================================================================= */
/* Guard against horizontal scroll on our admin pages. */
.lf-admin.wrap, .sf-admin.wrap, .ff-admin.wrap, .fdf-admin.wrap,
.lf-admin .wrap, .sf-admin .wrap, .ff-admin .wrap, .fdf-admin .wrap { overflow-x: hidden; max-width: 100%; box-sizing: border-box; }
.lf-admin table, .sf-admin table, .ff-admin table, .fdf-admin table { max-width: 100%; }

.sf-brand-header { display: none; }
.lf-admin .sf-brand-header,
.ff-admin .sf-brand-header,
.fdf-admin .sf-brand-header,
.sf-admin .sf-brand-header {
    display: block;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-active) 100%);
    margin: 10px 20px 18px 0;
    border-radius: 12px;
    padding: 14px 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.10);
    position: relative;
    overflow: hidden;
}
.lf-admin .sf-brand-header::after,
.ff-admin .sf-brand-header::after,
.fdf-admin .sf-brand-header::after,
.sf-admin .sf-brand-header::after {
    content: '';
    position: absolute;
    top: -30%;
    right: 0;
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(255,255,255,0.18), transparent 70%);
    pointer-events: none;
}
.sf-brand-header__inner {
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: 1400px;
    position: relative;
    z-index: 1;
}
.sf-brand-header__logo {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    background: #fff;
    border-radius: 10px;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    object-fit: contain;
    display: block;
}
.sf-brand-header__text { flex: 1; color: #fff; min-width: 0; }
.sf-brand-header__title { font-size: 17px; font-weight: 700; letter-spacing: 0.2px; line-height: 1.2; }
.sf-brand-header__tagline { font-size: 14px; opacity: 0.88; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-brand-header__version { font-size: 14px; color: #fff; background: rgba(255,255,255,0.20); padding: 3px 10px; border-radius: 100px; font-weight: 600; letter-spacing: 0.3px; flex-shrink: 0; }
.fs-full-size-wrapper ~ .sf-brand-header,
.fs-full-size-wrapper .sf-brand-header { display: none; }

/* =============================================================================
 follow-up: design-system checkboxes
 Applied to every checkbox inside our admin scopes. Uses --accent so each
 plugin gets its own brand color.
 ============================================================================= */
.sf-admin input[type="checkbox"]:not(.sf-raw):not([role]),
.lf-admin input[type="checkbox"]:not(.sf-raw):not([role]),
.ff-admin input[type="checkbox"]:not(.sf-raw):not([role]),
.fdf-admin input[type="checkbox"]:not(.sf-raw):not([role]) {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    margin: 0;
    border: 1.5px solid #cbd5e1;
    border-radius: 5px;
    background: #fff;
    cursor: pointer;
    position: relative;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    flex-shrink: 0;
    vertical-align: middle;
}
.sf-admin input[type="checkbox"]:not(.sf-raw):not([role]):hover,
.lf-admin input[type="checkbox"]:not(.sf-raw):not([role]):hover,
.ff-admin input[type="checkbox"]:not(.sf-raw):not([role]):hover,
.fdf-admin input[type="checkbox"]:not(.sf-raw):not([role]):hover {
    border-color: var(--accent);
}
.sf-admin input[type="checkbox"]:not(.sf-raw):not([role]):focus-visible,
.lf-admin input[type="checkbox"]:not(.sf-raw):not([role]):focus-visible,
.ff-admin input[type="checkbox"]:not(.sf-raw):not([role]):focus-visible,
.fdf-admin input[type="checkbox"]:not(.sf-raw):not([role]):focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}
.sf-admin input[type="checkbox"]:not(.sf-raw):not([role]):checked,
.lf-admin input[type="checkbox"]:not(.sf-raw):not([role]):checked,
.ff-admin input[type="checkbox"]:not(.sf-raw):not([role]):checked,
.fdf-admin input[type="checkbox"]:not(.sf-raw):not([role]):checked {
    background: var(--accent);
    border-color: var(--accent);
}
.sf-admin input[type="checkbox"]:not(.sf-raw):not([role]):checked::after,
.lf-admin input[type="checkbox"]:not(.sf-raw):not([role]):checked::after,
.ff-admin input[type="checkbox"]:not(.sf-raw):not([role]):checked::after,
.fdf-admin input[type="checkbox"]:not(.sf-raw):not([role]):checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.sf-admin input[type="checkbox"]:not(.sf-raw):not([role]):disabled,
.lf-admin input[type="checkbox"]:not(.sf-raw):not([role]):disabled,
.ff-admin input[type="checkbox"]:not(.sf-raw):not([role]):disabled,
.fdf-admin input[type="checkbox"]:not(.sf-raw):not([role]):disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
/* Radios — same style, circular */
.sf-admin input[type="radio"]:not(.sf-raw),
.lf-admin input[type="radio"]:not(.sf-raw),
.ff-admin input[type="radio"]:not(.sf-raw),
.fdf-admin input[type="radio"]:not(.sf-raw) {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    min-width: 18px;
    border: 1.5px solid #cbd5e1;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    position: relative;
    transition: border-color 0.15s, box-shadow 0.15s;
    flex-shrink: 0;
    vertical-align: middle;
    margin: 0;
}
.sf-admin input[type="radio"]:not(.sf-raw):hover,
.lf-admin input[type="radio"]:not(.sf-raw):hover,
.ff-admin input[type="radio"]:not(.sf-raw):hover,
.fdf-admin input[type="radio"]:not(.sf-raw):hover {
    border-color: var(--accent);
}
.sf-admin input[type="radio"]:not(.sf-raw):checked,
.lf-admin input[type="radio"]:not(.sf-raw):checked,
.ff-admin input[type="radio"]:not(.sf-raw):checked,
.fdf-admin input[type="radio"]:not(.sf-raw):checked {
    border-color: var(--accent);
}
.sf-admin input[type="radio"]:not(.sf-raw):checked::after,
.lf-admin input[type="radio"]:not(.sf-raw):checked::after,
.ff-admin input[type="radio"]:not(.sf-raw):checked::after,
.fdf-admin input[type="radio"]:not(.sf-raw):checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}
.sf-admin input[type="radio"]:not(.sf-raw):focus-visible,
.lf-admin input[type="radio"]:not(.sf-raw):focus-visible,
.ff-admin input[type="radio"]:not(.sf-raw):focus-visible,
.fdf-admin input[type="radio"]:not(.sf-raw):focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}

/* Credit-cost badge (AI-triggering buttons) */
.ff-credits-badge{display:inline-block;font-size:14px;font-weight:600;padding:1px 5px;border-radius:3px;background:rgba(0,0,0,0.15);color:inherit;vertical-align:middle;margin-left:3px;letter-spacing:0.3px;line-height:1.4;opacity:0.9;}
button .ff-credits-badge,.button .ff-credits-badge,a.button .ff-credits-badge{background:rgba(255,255,255,0.25);color:#fff;}

.ff-credits-badge svg {
  width: 11px;
  height: 11px;
  fill: currentColor;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: -1px;
}
.ff-credits-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* ─── Forge button polish (no hover underline + dashicon vertical-center) ───
 * Applied 2026-04-29 to all 4 Forge plugins. Three goals:
 * 1. Buttons never underline on hover — they're buttons, not links.
 * 2. Dashicon + text inside a button share the same baseline (the WP
 * dashicons font has a 1-line-height that's slightly above the
 * button's text baseline by default).
 * 3. Inline-style "danger" buttons (red text + red border) keep their
 * colors regardless of cascade — see the !important inline styles
 * on Disconnect Google / Clear buttons. */
.ff-admin.wrap .button,
.ff-admin.wrap .button:hover,
.ff-admin.wrap .button:focus,
.ff-admin.wrap .button-primary,
.ff-admin.wrap .button-primary:hover,
.ff-admin.wrap .button-primary:focus,
.ff-admin.wrap a.button,
.ff-admin.wrap a.button-primary {
  text-decoration: none !important;
}
.ff-admin.wrap .button,
.ff-admin.wrap .button-primary {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  vertical-align: middle;
}
.ff-admin.wrap .button .dashicons,
.ff-admin.wrap .button-primary .dashicons {
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin-top: 0 !important;
}
/* End Forge button polish */

/* ─── Forge admin-notice positioning fix ───
 * Freemius and WP-core notices ("Yee-haw! Your plan was successfully
 * upgraded.", license callouts, etc.) sometimes get caught inside
 * flex H1 wrappers, ending up rendered to the right of the page
 * title rather than as a proper banner. Force them block-level, full
 * width, with normal margin — same behaviour as on stock WP screens.
 */
.ff-admin.wrap .notice,
.ff-admin.wrap .fs-notice,
.ff-admin.wrap .updated,
.ff-admin.wrap .update-nag,
.ff-admin.wrap .error {
  display: block !important;
  position: relative !important;
  float: none !important;
  width: auto !important;
  clear: both !important;
  margin: 12px 0 !important;
  padding: 12px 16px !important;
  box-sizing: border-box;
}
.ff-admin.wrap > h1 {
  /* Notices are sometimes injected as siblings of the H1 by JS — keep
 the H1 block-level so they don't get pulled into a flex row. */
  display: block !important;
}
/* End Forge admin-notice positioning fix */

/* ============================================================
 Free-plan: visually disable Pro-only settings cards in editor
 ============================================================
 On free plan (body.ff-admin--free), Pro integration cards have
 a `.formforge-pro-chip` chip in their head. Backend save handler
 strips these settings server-side, but the UI lets the user fill
 them in — which is confusing. Block interaction client-side and
 add a small lock overlay so it's clear they're locked.
 bug 3, 2026-05-27.
*/
.ff-admin--free .ff-settings-card:has(.formforge-pro-chip) > .ff-settings-card-body,
.ff-admin--free .ff-settings-card:has(.formforge-pro-chip) > div:not(.ff-settings-card-head):not(.ff-card-head) {
  pointer-events: none;
  opacity: 0.5;
  filter: grayscale(0.4);
  user-select: none;
}
.ff-admin--free .ff-settings-card:has(.formforge-pro-chip) input,
.ff-admin--free .ff-settings-card:has(.formforge-pro-chip) select,
.ff-admin--free .ff-settings-card:has(.formforge-pro-chip) textarea,
.ff-admin--free .ff-settings-card:has(.formforge-pro-chip) button:not(.ff-settings-toggle):not([data-toggle]) {
  pointer-events: none !important;
  cursor: not-allowed !important;
  background: #f1f5f9 !important;
}
.ff-admin--free .ff-settings-card:has(.formforge-pro-chip) {
  position: relative;
}
.ff-admin--free .ff-settings-card:has(.formforge-pro-chip)::after {
  content: 'Install Form Forge Pro to enable';
  position: absolute;
  top: 12px;
  right: 16px;
  background: #fff7ed;
  color: #b45309;
  border: 1px solid #fed7aa;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  pointer-events: none;
}

/* JS-applied marker for Pro integration cards (bug 3) */
.ff-admin--free .ff-settings-card--pro-locked {
  position: relative;
}
.ff-admin--free .ff-settings-card--pro-locked > *:not(:first-child) {
  pointer-events: none;
  opacity: 0.45;
  filter: grayscale(0.5);
  user-select: none;
}
.ff-admin--free .ff-settings-card--pro-locked input,
.ff-admin--free .ff-settings-card--pro-locked select,
.ff-admin--free .ff-settings-card--pro-locked textarea,
.ff-admin--free .ff-settings-card--pro-locked button {
  pointer-events: none !important;
  cursor: not-allowed !important;
}
.ff-admin--free .ff-settings-card--pro-locked::after {
  content: '🔒 Install Form Forge Pro to enable';
  position: absolute;
  top: 12px;
  right: 16px;
  background: #fff7ed;
  color: #b45309;
  border: 1px solid #fed7aa;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  pointer-events: none;
  z-index: 5;
}

/* Settings page cards + sticky save bar — moved here from an inline <style>
 in render_settings so they load in <head> and no longer flash unstyled
 (FOUC) on load/after save. */
        .ff-settings-card{background:#fff;border:1px solid #e2e8f0;border-radius:12px;overflow:hidden;box-shadow:0 1px 3px rgba(0,0,0,0.06);}
        .ff-settings-card--pro-locked{border-color:#fed7aa;}
        .ff-settings-card--pro-locked .ff-settings-card-head{background:#fff7ed;}
        .ff-settings-card--pro-locked .ff-settings-card-head h2:after{content:'PRO';display:inline-flex;align-items:center;margin-left:8px;padding:2px 6px;border-radius:4px;background:#ffedd5;color:#c2410c;border:1px solid #fed7aa;font-size:10px;font-weight:800;letter-spacing:.04em;vertical-align:middle;}
        .ff-settings-card--pro-locked .ff-settings-card-body{opacity:.62;}
        .ff-settings-card--pro-locked input:disabled,
        .ff-settings-card--pro-locked select:disabled,
        .ff-settings-card--pro-locked textarea:disabled,
        .ff-settings-card--pro-locked button:disabled{cursor:not-allowed;}
        /* Dashicons inside the integration cards: WP's default
 font-size:20px / line-height:1 box gives a 1-2px baseline drift
 against text in flex-row headers. Force a square inline-flex
 container so they centre cleanly with <strong> / <h2> labels. */
        .ff-settings-card .dashicons{display:inline-flex;align-items:center;justify-content:center;line-height:1;}
        .ff-settings-card-head{display:flex;align-items:center;gap:10px;padding:16px 20px;border-bottom:1px solid #e2e8f0;background:#f8fafc;}
        .ff-settings-card-head .dashicons{color:#3B82F6;font-size:18px;width:18px;height:18px;}
        .ff-settings-card-head h2{margin:0;font-size:15px;font-weight:600;}
        .ff-settings-card-body{padding:20px;}
        .ff-settings-grid3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:16px;}
        .ff-settings-label{display:block;font-size:14px;font-weight:600;color:#64748b;text-transform:uppercase;letter-spacing:0.4px;margin-bottom:6px;}
        .ff-settings-select,.ff-settings-input{width:100%;padding:9px 12px;border:1px solid #e2e8f0;border-radius:8px;font-size:14px;transition:border-color 0.15s;}
        .ff-settings-select:focus,.ff-settings-input:focus{border-color:#3B82F6;outline:none;box-shadow:0 0 0 3px rgba(59,130,246,0.1);}
        .ff-settings-save{background:#3B82F6;color:#fff;border:none;border-radius:10px;padding:12px 32px;font-size:14px;font-weight:600;cursor:pointer;box-shadow:0 2px 8px rgba(59,130,246,0.2);transition:all 0.2s;}
        .ff-settings-save:hover{background:#2D74E8;transform:translateY(-1px);box-shadow:0 4px 16px rgba(59,130,246,0.3);}
	        .ff-settings-dirty-bar{position:fixed;left:180px;right:20px;bottom:20px;max-width:860px;z-index:10000;display:none;align-items:center;justify-content:flex-end;gap:12px;padding:12px 14px;background:#fff;border:1px solid #bfdbfe;border-radius:12px;box-shadow:0 12px 32px rgba(15,23,42,0.16);}
	        .ff-settings-dirty-bar.is-visible{display:flex;}
	        .ff-settings-dirty-copy{margin-right:auto;color:#1e3a8a;font-weight:600;font-size:14px;}
	        .ff-settings-save--sticky{padding:9px 18px;border-radius:8px;box-shadow:none;}
	        @media(max-width:960px){.ff-settings-dirty-bar{left:36px;right:20px;}}
	        @media(max-width:782px){.ff-settings-grid3{grid-template-columns:1fr;}.ff-settings-dirty-bar{left:12px;right:12px;bottom:12px;flex-wrap:wrap;align-items:stretch;}.ff-settings-dirty-copy{width:100%;margin-right:0;}.ff-settings-dirty-bar .button,.ff-settings-dirty-bar .ff-settings-save{flex:1;}}

/* Submissions toolbar button-links ("Export CSV" / "Print / PDF") no-underline
 on hover/focus is handled by the scoped `.ff-admin.wrap .button:hover` block
 above — the Submissions wrapper now carries `ff-admin` like the rest of the
 suite, so no unscoped `a.button:hover` override is needed. */
