/* ELD Forms Admin Styles */

/* =====================================================================
 * LEGACY STYLES — for the forms list, settings page, and any pre-v2
 * admin screens. Kept untouched so existing screens keep working.
 * The new v2 editor styles are at the bottom of this file under "v2 admin
 * editor".
 * ===================================================================== */

/* Plugin Header */
.eld-forms-plugin-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 10px;
}

.eld-forms-plugin-header .eld-forms-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.eld-forms-plugin-header span {
    font-size: 23px;
    font-weight: 400;
    line-height: 1.3;
}

/* Instructions Notice */
.eld-forms-notice {
    background: #f0f6fc;
    border-left: 4px solid #2563eb;
    padding: 12px;
    margin: 20px 0;
}

.eld-forms-notice strong {
    color: #2563eb;
    font-size: 16px;
}

.eld-forms-admin {
    margin-top: 20px;
}

.eld-forms-admin .wp-header-end {
    margin-bottom: 0;
}

/* Empty State */
.eld-forms-empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    margin-top: 20px;
}

.eld-forms-empty-icon {
    font-size: 80px;
    color: #c3c4c7;
    margin-bottom: 20px;
}

.eld-forms-empty-icon .dashicons {
    width: 80px;
    height: 80px;
    font-size: 80px;
}

.eld-forms-empty-state h2 {
    font-size: 24px;
    margin-bottom: 10px;
}

.eld-forms-empty-state p {
    color: #646970;
    font-size: 14px;
    margin-bottom: 30px;
}

/* Status indicators */
.eld-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.eld-status.active,
.eld-status.connected,
.eld-status.success {
    background: #edfaef;
    color: #00a32a;
}

.eld-status.inactive,
.eld-status.not-connected {
    background: #f0f0f1;
    color: #646970;
}

.eld-status.error {
    background: #fcf0f1;
    color: #d63638;
}

.eld-status.paused {
    background: #fef3cd;
    color: #856404;
}

.eld-status .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* Shortcode display */
.eld-shortcode {
    padding: 4px 8px;
    background: #f0f0f1;
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
}

.eld-copy-shortcode {
    margin-left: 8px;
    vertical-align: middle;
}

/* Form Editor (legacy) */
.eld-editor-container {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.eld-editor-main {
    flex: 1;
    background: #fff;
    padding: 20px;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
}

.eld-editor-sidebar {
    width: 280px;
    flex-shrink: 0;
}

.eld-editor-section {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #dcdcde;
}

.eld-editor-section:last-child {
    border-bottom: none;
}

.eld-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.eld-section-header h2 {
    margin: 0;
}

/* Field Types Sidebar */
.eld-sidebar-section {
    background: #fff;
    padding: 20px;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    margin-bottom: 20px;
}

.eld-sidebar-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 14px;
    font-weight: 600;
}

.eld-field-types {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.eld-field-type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    background: #f0f0f1;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
}

.eld-field-types.eld-highlight {
    box-shadow: 0 0 0 3px #2271b1;
    border-radius: 4px;
    transition: box-shadow 0.3s ease;
}

.eld-field-type-btn:hover {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

.eld-field-type-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Fields List (legacy) */
.eld-fields-list {
    min-height: 200px;
}

.eld-no-fields {
    text-align: center;
    padding: 40px;
    color: #646970;
    background: #f6f7f7;
    border: 2px dashed #c3c4c7;
    border-radius: 4px;
}

.eld-field-item {
    background: #f6f7f7;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 15px;
    transition: all 0.2s;
}

.eld-field-item:hover {
    border-color: #2271b1;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.eld-field-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.eld-field-item-title {
    font-weight: 600;
    font-size: 14px;
}

.eld-field-item-actions {
    display: flex;
    gap: 8px;
}

.eld-field-item-body .form-table {
    margin: 0;
}

.eld-field-item-body .form-table th {
    padding: 8px 10px 8px 0;
    width: 120px;
}

.eld-field-item-body .form-table td {
    padding: 8px 0;
}

/* Shortcode input */
.eld-shortcode-input {
    width: 100%;
    padding: 8px;
    font-family: monospace;
    font-size: 12px;
    background: #f0f0f1;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    margin-bottom: 10px;
}

/* Editor Actions */
.eld-editor-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-top: 20px;
    border-top: 1px solid #dcdcde;
}

.eld-editor-actions .spinner {
    float: none;
    margin: 0;
}

/* Submissions */
.eld-submissions-filter {
    background: #fff;
    padding: 15px;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    margin: 20px 0;
    /* Lay out the filter form and the retention note on a single row,
       form on the left, note pushed to the right. Falls back to a
       stacked layout on narrow screens (e.g. mobile admin view). */
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.eld-submissions-filter label {
    margin-right: 10px;
    font-weight: 600;
}

.eld-submissions-filter select {
    min-width: 200px;
}

.eld-submissions-retention {
    margin-left: auto;
    font-size: 12px;
    color: #646970;
    font-style: italic;
}

/* Modal */
#eld-submission-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
}

.eld-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
}

.eld-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 30px;
    border-radius: 4px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.eld-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #646970;
}

.eld-modal-close:hover {
    color: #000;
}

/* Plugin Footer */
.eld-plugin-footer {
    text-align: center;
    padding: 30px 0 10px;
    margin-top: 30px;
    border-top: 1px solid #ddd;
    color: #666;
    font-size: 13px;
    line-height: 2;
}

.eld-plugin-footer a {
    color: #2563eb;
    text-decoration: none;
}

.eld-plugin-footer a:hover {
    text-decoration: underline;
}

.eld-plugin-footer .eld-copyright {
    color: #999;
    font-size: 12px;
}

/* Responsive (legacy) */
@media (max-width: 782px) {
    .eld-editor-container {
        flex-direction: column;
    }

    .eld-editor-sidebar {
        width: 100%;
    }

    .eld-field-types {
        grid-template-columns: repeat(3, 1fr);
    }
}


/* =====================================================================
 * V2 ADMIN EDITOR — the new React-mounted form editor.
 *
 * Lives inside the WP admin page, fills the area below WP's own admin
 * bar / sidebar / page wrap. Two-pane layout with sections on the left
 * and a live preview on the right.
 *
 * Design tokens use the --wp-* / --eld-brand prefix so the variables
 * don't collide with the public form's --eld-* tokens (which are scoped
 * to .eld-form-card and inherit through the preview pane unchanged).
 * ===================================================================== */

.eld-admin-app {
    --wp-bg: #f0f0f1;
    --wp-card: #ffffff;
    --wp-border: #dcdcde;
    --wp-border-strong: #c3c4c7;
    --wp-border-light: #f0f0f1;
    --wp-text: #1d2327;
    --wp-text-muted: #50575e;
    --wp-text-faint: #787c82;
    --wp-text-soft: #50575e;
    --wp-blue: #2271b1;
    --wp-blue-hover: #135e96;
    --wp-blue-soft: #f0f6fc;
    --eld-brand: #1e4ae0;
    --eld-brand-soft: #e8eeff;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(15,23,42,0.04);
    --shadow-lg: 0 8px 24px rgba(15,23,42,0.08);

    color: var(--wp-text);
    font-size: 13px;
    line-height: 1.4;
    margin: 0;
    /* Pull flush with the top of the WP admin content area, ignoring
       the default .wrap padding. */
    margin-left: -20px;
    margin-right: -20px;
    margin-top: 0;
}

/* ============================================================
 * Two-pane editor
 * ============================================================ */
.eld-admin-editor {
    display: grid;
    grid-template-columns: minmax(360px, 460px) 1fr;
    /* WP admin bar takes 32px at the top; we fill the rest. */
    min-height: calc(100vh - 32px);
}
@media (max-width: 960px) {
    .eld-admin-editor { grid-template-columns: 1fr; }
    .eld-admin-pane-right { display: none; }
}

/* Loading & error states */
.eld-admin-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 80px 20px;
    color: var(--wp-text-faint);
    font-size: 14px;
}
.eld-admin-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--wp-border);
    border-top-color: var(--wp-blue);
    border-radius: 50%;
    animation: eld-admin-spin 0.7s linear infinite;
}
@keyframes eld-admin-spin {
    to { transform: rotate(360deg); }
}
.eld-admin-error {
    margin: 24px;
    padding: 16px 20px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 4px solid #d63638;
    border-radius: 4px;
    color: #7f1d1d;
}
.eld-admin-error strong { display: block; margin-bottom: 4px; }

/* Left pane — sections column with sticky save bar at the bottom */
.eld-admin-pane-left {
    background: var(--wp-bg);
    border-right: 1px solid var(--wp-border);
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 32px);
}
.eld-admin-sections {
    flex: 1;
    overflow-y: auto;
    /* No top padding — the first section card sits flush at the top of
       the left pane, aligning with the preview bar's top edge on the
       right pane. Side and bottom padding inset normally. */
    padding: 0 16px;
}

/* Right pane — preview, sticky so it stays in view as left pane scrolls */
.eld-admin-pane-right {
    background: #e9eaee;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: sticky;
    /* Pin top to right under the WP admin bar. */
    top: 32px;
    height: calc(100vh - 32px);
}

/* ============================================================
 * Onboarding banner — dismissible "Getting started" card at the top
 * of the left pane. Always stacks vertically: intro → 4-step flow →
 * ELD-app upsell card.
 *
 * Note: the original Claude Design banner used a 3-zone horizontal
 * layout at >= 1280px viewport. In the plugin the banner lives inside
 * the editor's left pane, which is much narrower than the viewport,
 * so the horizontal layout doesn't fit cleanly across all sizes —
 * we keep the stacked layout at all widths for predictability.
 *
 * Source of truth: easy-lead-distribution-forms-onboarding-banner/
 * banner.css from Claude Design — stacked layout only.
 * ============================================================ */
.wp-onb {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 44px 20px 20px;
  margin: 0 0 16px;
  background:
    radial-gradient(900px 320px at 100% -10%, rgba(30, 74, 224, 0.07) 0%, transparent 65%),
    linear-gradient(180deg, #f7faff 0%, #eef3ff 100%);
  border: 1px solid rgba(30, 74, 224, 0.16);
  border-radius: 10px;
  box-shadow: 0 1px 0 rgba(30, 74, 224, 0.05);
}

.wp-onb-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 0;
  background: transparent;
  color: var(--wp-text-muted);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.wp-onb-close:hover {
  background: rgba(30, 74, 224, 0.08);
  color: var(--wp-blue);
}

/* ---- Top: intro ---- */
.wp-onb-intro { min-width: 0; }
.wp-onb-eyebrow {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--wp-blue);
  margin-bottom: 6px;
}
.wp-onb-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--wp-text);
  margin: 0 0 8px;
  line-height: 1.25;
}
.wp-onb-sub {
  font-size: 12.5px;
  color: var(--wp-text-muted);
  line-height: 1.5;
  margin: 0;
}

/* ---- Middle: 4-step horizontal flow (4 cols by default, 2 on narrow) ---- */
.wp-onb-flow {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-content: center;
  position: relative;
}
.wp-onb-flow::before {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  top: 13px;
  height: 1px;
  background: repeating-linear-gradient(
    90deg,
    rgba(30, 74, 224, 0.28) 0 4px,
    transparent 4px 8px
  );
  z-index: 0;
}
.wp-onb-step {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  position: relative;
  z-index: 1;
}
.wp-onb-step .wp-onb-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--wp-blue);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
  box-shadow: 0 0 0 4px #f3f6ff;
}
.wp-onb-step-body { min-width: 0; }
.wp-onb-step-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--wp-text);
  line-height: 1.3;
  margin-bottom: 2px;
}
.wp-onb-step-text {
  font-size: 12px;
  color: var(--wp-text-muted);
  line-height: 1.45;
}
.wp-onb-step-text strong {
  font-weight: 600;
  color: var(--wp-text);
}

/* ---- Bottom: optional ELD app upsell ---- */
.wp-onb-upsell {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid rgba(30, 74, 224, 0.18);
  border-radius: 8px;
}
.wp-onb-upsell-icon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: linear-gradient(180deg, #2a5cee 0%, #1e4ae0 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.wp-onb-upsell-body { min-width: 0; }
.wp-onb-upsell-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--wp-text);
  margin-bottom: 3px;
  line-height: 1.3;
}
.wp-onb-upsell-text {
  font-size: 12px;
  color: var(--wp-text-muted);
  line-height: 1.5;
}
.wp-onb-upsell-text a {
  color: var(--wp-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
  word-break: break-word;
}
.wp-onb-upsell-text strong {
  font-weight: 600;
  color: var(--wp-text);
}

/* ---- Narrow: 4-step grid drops to 2 cols, hide connector ---- */
@media (max-width: 820px) {
  .wp-onb-flow { grid-template-columns: repeat(2, 1fr); }
  .wp-onb-flow::before { display: none; }
}

/* ============================================================
 * Sections (collapsible cards in the left pane)
 * ============================================================ */
.wp-section {
    background: var(--wp-card);
    border: 1px solid var(--wp-border);
    border-radius: 6px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.wp-section-head {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    cursor: pointer;
    user-select: none;
    background: var(--wp-card);
    border: none;
    text-align: left;
    font-family: inherit;
    color: inherit;
    transition: background 0.1s;
}
.wp-section-head:hover { background: #fafbfc; }
.wp-section-head:focus { outline: 1px solid var(--wp-blue); outline-offset: -1px; }
.wp-section-chev {
    width: 14px; height: 14px;
    transition: transform 0.18s;
    color: var(--wp-text-faint);
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.wp-section.is-open .wp-section-chev { transform: rotate(90deg); }
.wp-section-icon {
    width: 22px; height: 22px;
    border-radius: 5px;
    background: var(--eld-brand-soft);
    color: var(--eld-brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.wp-section-title {
    font-weight: 600;
    font-size: 13.5px;
    color: var(--wp-text);
}
.wp-section-meta {
    margin-left: auto;
    font-size: 11.5px;
    color: var(--wp-text-faint);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60%;
}
.wp-section-body {
    padding: 4px 18px 18px 18px;
    border-top: 1px solid var(--wp-border);
    background: #fafbfc;
}

/* ============================================================
 * Form fields (label + input) — used by all sections
 * ============================================================ */
.wp-field { margin-top: 14px; }
.wp-field:first-child { margin-top: 8px; }
.wp-field-label {
    display: block;
    font-weight: 600;
    font-size: 12.5px;
    color: var(--wp-text);
    margin-bottom: 5px;
}
.wp-field-required {
    color: #d63638;
    margin-left: 2px;
    font-weight: 700;
}
.wp-field-hint {
    display: block;
    font-size: 12px;
    color: var(--wp-text-faint);
    margin-top: 4px;
    line-height: 1.5;
}
.wp-field-error {
    display: block;
    font-size: 12px;
    color: #d63638;
    margin-top: 4px;
}
.wp-field-help {
    margin: 6px 0 0;
    font-size: 11.5px;
    color: var(--wp-text-faint);
    line-height: 1.5;
}
.wp-divider {
    border: none;
    border-top: 1px solid var(--wp-border);
    margin: 16px 0;
}

.wp-input,
.wp-textarea,
.wp-select {
    width: 100%;
    font-family: inherit;
    font-size: 13px;
    color: var(--wp-text);
    background: #fff;
    border: 1px solid var(--wp-border-strong);
    border-radius: 4px;
    padding: 6px 9px;
    line-height: 1.4;
    box-shadow: 0 0 0 transparent;
    transition: border-color 0.1s, box-shadow 0.1s;
    box-sizing: border-box;
}
.wp-input:focus,
.wp-textarea:focus,
.wp-select:focus {
    outline: none;
    border-color: var(--wp-blue);
    box-shadow: 0 0 0 1px var(--wp-blue);
}
.wp-textarea { min-height: 64px; resize: vertical; font-family: inherit; }
.wp-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231d2327' d='M3 4.5L6 7.5L9 4.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 28px;
}

/* Toggle */
.wp-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    cursor: pointer;
    user-select: none;
    position: relative;
}
.wp-toggle-track {
    position: relative;
    width: 36px;
    height: 20px;
    background: #c3c4c7;
    border-radius: 999px;
    transition: background 0.15s;
    flex-shrink: 0;
}
.wp-toggle-thumb {
    position: absolute;
    top: 2px; left: 2px;
    width: 16px; height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.15s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.wp-toggle.is-on .wp-toggle-track { background: var(--wp-blue); }
.wp-toggle.is-on .wp-toggle-thumb { transform: translateX(16px); }
.wp-toggle-label {
    font-size: 13px;
    color: var(--wp-text);
}

/* Segmented */
.wp-seg {
    display: inline-flex;
    background: #f6f7f7;
    border: 1px solid var(--wp-border-strong);
    border-radius: 4px;
    padding: 2px;
    gap: 2px;
}
.wp-seg-item {
    padding: 5px 12px;
    border-radius: 3px;
    font-size: 12.5px;
    color: var(--wp-text-muted);
    cursor: pointer;
    border: none;
    background: transparent;
    font-family: inherit;
    font-weight: 500;
}
.wp-seg-item:hover { color: var(--wp-text); }
.wp-seg-item.is-on {
    background: #fff;
    color: var(--wp-blue);
    box-shadow: var(--shadow-sm);
}

/* Color swatches (Appearance) */
.wp-swatches {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    margin-top: 6px;
}
.wp-swatch {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    padding: 0;
    position: relative;
}
.wp-swatch.is-on::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 8px;
    border: 2px solid var(--wp-text);
    pointer-events: none;
}

/* ============================================================
 * Field list (drag-and-drop, with inline editor expansion)
 * ============================================================ */
.wp-fields-hint {
    font-size: 12px;
    color: var(--wp-text-faint);
    margin-top: 8px;
}
.wp-fields-empty {
    text-align: center;
    padding: 32px 20px;
    color: var(--wp-text-faint);
    background: #fff;
    border: 2px dashed var(--wp-border-strong);
    border-radius: 6px;
    font-size: 13px;
}
.wp-field-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}
.wp-field-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid var(--wp-border);
    border-radius: 4px;
    font-size: 13px;
    flex-wrap: wrap;
}
.wp-field-row:hover { border-color: var(--wp-border-strong); }
.wp-field-row.is-dragging {
    opacity: 0.4;
    cursor: grabbing;
}
.wp-field-row.is-drop-target {
    border-color: var(--eld-brand);
    box-shadow: 0 -2px 0 0 var(--eld-brand) inset;
    background: #f0f5ff;
}
.wp-field-grip {
    color: var(--wp-text-faint);
    font-size: 14px;
    cursor: grab;
    line-height: 1;
    user-select: none;
    letter-spacing: -2px;
}
.wp-field-grip:active { cursor: grabbing; }

.wp-field-row-icon {
    width: 22px; height: 22px;
    background: #f6f7f7;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--wp-text-muted);
    flex-shrink: 0;
}
.wp-field-row-name {
    font-weight: 500;
    color: var(--wp-text);
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 3px;
}
.wp-field-row-name-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.wp-field-row-asterisk {
    color: #d63638;
    font-weight: 600;
    flex-shrink: 0;
}
.wp-field-row-type {
    font-size: 11px;
    color: var(--wp-text-faint);
    margin-left: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}
.wp-field-row-actions {
    margin-left: auto;
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

/* Icon buttons (edit / delete / require) */
.wp-icon-btn {
    width: 26px;
    height: 26px;
    border: none;
    background: transparent;
    color: var(--wp-text-faint);
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 14px;
    line-height: 1;
}
.wp-icon-btn:hover { background: #f0f0f1; color: var(--wp-text); }
.wp-icon-btn.danger:hover { color: #d63638; background: #fef2f2; }
.wp-icon-btn.is-active { background: var(--wp-blue-soft); color: var(--wp-blue); }

/* Field row's inline editor */
.wp-field-row.is-editing {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom-color: transparent;
    border-color: var(--wp-blue);
    box-shadow: 0 0 0 1px var(--wp-blue);
}
.wp-field-editor {
    background: #fafbfc;
    border: 1px solid var(--wp-blue);
    border-top: none;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
    padding: 14px 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: -7px;
}
.wp-field-editor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 14px;
}
@media (max-width: 760px) {
    .wp-field-editor-grid { grid-template-columns: 1fr; }
}
.wp-field-editor .wp-field { margin-top: 0; }
.wp-field-editor-foot {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--wp-border);
}
.wp-btn-link {
    background: none;
    border: none;
    color: var(--wp-blue);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    padding: 4px 8px;
    font-family: inherit;
}
.wp-btn-link:hover { text-decoration: underline; }

/* "Add field" toolbar */
.wp-add-field {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    padding: 12px;
    background: #fff;
    border: 1px dashed var(--wp-border-strong);
    border-radius: 6px;
}
.wp-add-field-label {
    font-size: 11px;
    color: var(--wp-text-faint);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    width: 100%;
    margin-bottom: 2px;
}
.wp-add-field-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: #f6f7f7;
    border: 1px solid var(--wp-border);
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    color: var(--wp-text);
    font-family: inherit;
}
.wp-add-field-btn:hover {
    background: var(--eld-brand-soft);
    border-color: var(--eld-brand);
    color: var(--eld-brand);
}

/* "Add step break" / "Add hidden field" — separate dashed buttons */
.wp-add-step {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.wp-add-step-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px dashed var(--eld-brand);
    color: var(--eld-brand);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
}
.wp-add-step-btn:hover {
    background: var(--eld-brand-soft);
    border-style: solid;
}
.wp-add-step-hint {
    font-size: 11.5px;
    color: var(--wp-text-faint);
}

/* Step break row */
.wp-step-row {
    background: #f0f5ff;
    border: 1px dashed var(--eld-brand);
    padding: 8px 10px;
    gap: 10px;
}
.wp-step-row:hover { background: #e8eeff; }
.wp-step-divider {
    flex: 1;
    height: 0;
    border-top: 1px dashed var(--eld-brand);
    opacity: 0.55;
    min-width: 12px;
}
.wp-step-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    color: var(--eld-brand);
    border: 1px solid var(--eld-brand);
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}
.wp-step-meta {
    font-size: 11.5px;
    color: var(--wp-text-faint);
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}
.wp-step-row .wp-field-grip {
    color: var(--eld-brand);
    opacity: 0.7;
}
.wp-step-row.is-editing {
    border-style: solid;
    background: #e8eeff;
}

/* Hidden tracking field */
.wp-field-row-hidden {
    background: repeating-linear-gradient(
        -45deg,
        #fafbfc, #fafbfc 6px,
        #f3f4f6 6px, #f3f4f6 12px
    );
    border-style: dashed;
}
.wp-field-row-hidden .wp-field-row-icon {
    background: #eef0f3;
    color: var(--wp-text-faint);
}
.wp-field-row-name-hidden .wp-field-row-name-text {
    color: var(--wp-text-faint);
}
.wp-hidden-pill {
    display: inline-flex;
    align-items: center;
    height: 18px;
    padding: 0 7px;
    border-radius: 9px;
    background: #1f2937;
    color: #fff;
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}
.wp-hidden-info {
    display: flex;
    gap: 12px;
    padding: 12px 14px;
    background: var(--wp-blue-soft);
    border-left: 4px solid var(--wp-blue);
    border-radius: 0 4px 4px 0;
}
.wp-hidden-info-icon {
    flex-shrink: 0;
    width: 28px; height: 28px;
    border-radius: 6px;
    background: rgba(34,113,177,0.12);
    color: var(--wp-blue);
    display: flex; align-items: center; justify-content: center;
}
.wp-hidden-info-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--wp-text);
    margin-bottom: 2px;
}
.wp-hidden-info-body {
    font-size: 12.5px;
    color: var(--wp-text-faint);
    line-height: 1.5;
}
.wp-hidden-keys {
    margin-top: 12px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid var(--wp-border);
    border-radius: 6px;
}
.wp-hidden-keys-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--wp-text-faint);
    margin-bottom: 8px;
}
.wp-hidden-keys-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.wp-hidden-key {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 11.5px;
    background: #f3f4f6;
    border: 1px solid var(--wp-border);
    padding: 3px 8px;
    border-radius: 4px;
    color: var(--wp-text);
}

/* ============================================================
 * Conditional logic editor (per-field)
 * ============================================================ */
.wp-cond-block {
    margin-top: 14px;
    padding: 12px;
    border: 1px solid var(--wp-border);
    border-radius: 6px;
    background: #fff;
}
.wp-cond-toggle {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}
.wp-cond-toggle input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
}
.wp-cond-toggle-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.wp-cond-toggle-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 13px;
    color: var(--wp-text);
}
.wp-cond-toggle-title svg { color: var(--eld-brand); }
.wp-cond-toggle-meta {
    font-size: 11.5px;
    color: var(--wp-text-faint);
    line-height: 1.4;
}
.wp-cond-rule {
    margin-top: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}
@media (max-width: 760px) {
    .wp-cond-rule { grid-template-columns: 1fr; }
}
.wp-cond-input { width: 100%; min-width: 0; font-size: 12.5px; }
.wp-cond-input-spacer { visibility: hidden; }
.wp-cond-preview {
    margin-top: 10px;
    padding: 8px 10px;
    background: #f6f7f7;
    border-radius: 4px;
    font-size: 12px;
    color: var(--wp-text-soft);
    line-height: 1.5;
}
.wp-cond-preview strong { color: var(--wp-text); font-weight: 600; }
.wp-cond-preview-label {
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 10.5px;
    font-weight: 600;
    color: var(--wp-text-faint);
}
.wp-cond-empty {
    margin-top: 10px;
    padding: 10px 12px;
    background: #fff8e1;
    border: 1px solid #f0c969;
    border-radius: 4px;
    font-size: 12px;
    color: #6b5300;
    line-height: 1.5;
}

/* ============================================================
 * Trust strip editor (in ContentSection)
 * ============================================================ */
.wp-trust-editor {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    background: #fff;
    border: 1px solid var(--wp-border);
    border-radius: 6px;
    margin-top: 8px;
}
.wp-trust-row {
    display: grid;
    grid-template-columns: 32px 1fr 26px;
    gap: 8px;
    align-items: center;
}
.wp-trust-row .wp-input { padding: 5px 8px; font-size: 12.5px; }

.wp-icon-pick { position: relative; }
.wp-icon-pick-btn {
    width: 32px;
    height: 32px;
    background: #fff;
    border: 1px solid var(--wp-border-strong);
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--wp-text);
    padding: 0;
}
.wp-icon-pick-btn:hover { border-color: var(--wp-blue); color: var(--wp-blue); }
.wp-icon-pick-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 30;
    background: #fff;
    border: 1px solid var(--wp-border-strong);
    border-radius: 6px;
    padding: 6px;
    display: grid;
    grid-template-columns: repeat(4, 30px);
    gap: 4px;
    box-shadow: var(--shadow-lg);
}
.wp-icon-pick-opt {
    width: 30px;
    height: 30px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--wp-text);
    padding: 0;
}
.wp-icon-pick-opt:hover { background: #f6f7f7; }
.wp-icon-pick-opt.is-on { border-color: var(--wp-blue); color: var(--wp-blue); }
.wp-trust-add {
    border: 1px dashed var(--wp-border-strong);
    background: transparent;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 12px;
    color: var(--wp-text-muted);
    cursor: pointer;
    font-family: inherit;
    align-self: flex-start;
}
.wp-trust-add:hover { border-color: var(--wp-blue); color: var(--wp-blue); }

/* ============================================================
 * Routing / display surface toggle cards
 * Used by DisplaySection AND RoutingSection — both share the same
 * checkbox-headed expandable card pattern.
 * ============================================================ */
.wp-routing-toggle {
    border: 1px solid var(--wp-border);
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.wp-routing-toggle:has(input:checked) {
    border-color: var(--wp-blue);
    box-shadow: 0 0 0 1px var(--wp-blue) inset;
}
.wp-routing-toggle-row {
    display: grid;
    grid-template-columns: 18px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    cursor: pointer;
    user-select: none;
}
.wp-routing-toggle-row:hover { background: #f8f9fb; }
.wp-routing-toggle-row input[type="checkbox"] {
    margin: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--wp-blue);
}
.wp-routing-toggle-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--wp-text);
}
.wp-routing-toggle-meta {
    font-size: 11.5px;
    color: var(--wp-text-faint);
    font-weight: 400;
}
.wp-routing-body {
    padding: 4px 14px 14px 42px;
    border-top: 1px solid var(--wp-border-light);
    background: #fafbfc;
}
.wp-routing-body .wp-field:last-child { margin-bottom: 0; }
.wp-routing-toggle-meta code {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 11.5px;
    background: rgba(0,0,0,0.04);
    padding: 1px 5px;
    border-radius: 3px;
    color: var(--wp-text);
}

/* ============================================================
 * Conversion section
 * ============================================================ */
.wp-conv-platforms {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}
.wp-conv-platform {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 12px;
    align-items: start;
    padding: 10px 12px;
    border: 1px solid var(--wp-border);
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.wp-conv-platform:hover { background: #f8f9fb; }
.wp-conv-platform:has(input:checked) {
    border-color: var(--wp-blue);
    background: var(--wp-blue-soft);
}
.wp-conv-platform input[type="checkbox"] {
    margin: 2px 0 0 0;
    width: 16px;
    height: 16px;
    accent-color: var(--wp-blue);
}
.wp-conv-platform-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.wp-conv-platform-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--wp-text);
}
.wp-conv-platform-meta {
    font-size: 12px;
    color: var(--wp-text-faint);
}
.wp-conv-platform-meta code {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 11.5px;
    background: rgba(0,0,0,0.04);
    padding: 1px 5px;
    border-radius: 3px;
    color: var(--wp-text);
}
.wp-conv-preview {
    margin-top: 14px;
    border: 1px solid var(--wp-border);
    border-radius: 6px;
    background: #0d1220;
    overflow: hidden;
}
.wp-conv-preview-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255,255,255,0.55);
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
}
.wp-conv-preview-code {
    margin: 0;
    padding: 12px 14px;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 12px;
    line-height: 1.55;
    color: #e7ecf5;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ============================================================
 * Embed section — copyable code blocks
 * ============================================================ */
.wp-embed-block {
    background: #1d2327;
    color: #c3c4c7;
    border-radius: 4px;
    padding: 10px 12px;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 12px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    overflow-x: auto;
}
.wp-embed-block code {
    color: #c3c4c7;
    background: transparent;
    padding: 0;
    white-space: nowrap;
    user-select: all;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wp-embed-copy {
    background: transparent;
    border: 1px solid #50575e;
    /* !important on color across all link states. WordPress admin
       and themes apply :visited / :active / :focus rules to anchors
       (the "Open" button is an <a>) that turn them blue or purple.
       We're inside a dark code block; the link must stay light gray. */
    color: #c3c4c7 !important;
    padding: 4px 10px;
    font-size: 11.5px;
    border-radius: 3px;
    cursor: pointer;
    font-family: inherit;
    flex-shrink: 0;
    text-decoration: none;
}
.wp-embed-copy:link,
.wp-embed-copy:visited,
.wp-embed-copy:active,
.wp-embed-copy:focus {
    color: #c3c4c7 !important;
    text-decoration: none;
}
.wp-embed-copy:hover,
.wp-embed-copy:focus-visible {
    background: #2c3338;
    color: #ffffff !important;
    text-decoration: none;
}

/* ============================================================
 * Notices
 * ============================================================ */
.wp-notice {
    background: var(--wp-blue-soft);
    border-left: 4px solid var(--wp-blue);
    padding: 10px 14px;
    font-size: 12.5px;
    color: var(--wp-text);
    border-radius: 0 4px 4px 0;
    margin-top: 10px;
}
.wp-notice-title {
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--wp-text);
}
.wp-notice-body { line-height: 1.5; }
.wp-notice-warn {
    background: #fff8e1;
    border-left-color: #d97706;
}
.wp-notice-warn .wp-notice-title { color: #92400e; }
.wp-notice-success {
    background: #d1fae5;
    border-left-color: #059669;
}
.wp-notice-success .wp-notice-title { color: #065f46; }
.wp-notice code {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 12px;
    background: rgba(0,0,0,0.05);
    padding: 1px 5px;
    border-radius: 3px;
}

/* ============================================================
 * Save bar — sticky at the bottom of the left pane
 * ============================================================ */
.eld-admin-savebar {
    position: sticky;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #fff;
    border-top: 1px solid var(--wp-border);
    box-shadow: 0 -1px 3px rgba(0,0,0,0.04);
    z-index: 5;
    flex-shrink: 0;
}
.eld-admin-savebar-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--wp-text-muted);
    flex: 1;
}
.eld-admin-savebar-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    flex-shrink: 0;
}
.eld-admin-savebar.is-dirty .eld-admin-savebar-dot {
    background: #f59e0b;
    animation: eld-admin-pulse 1.6s ease-in-out infinite;
}
.eld-admin-savebar.is-saving .eld-admin-savebar-dot {
    background: var(--wp-blue);
}
.eld-admin-savebar.is-saved .eld-admin-savebar-dot {
    background: #10b981;
}
.eld-admin-savebar.is-error .eld-admin-savebar-dot {
    background: #d63638;
}
.eld-admin-savebar.is-dirty .eld-admin-savebar-status,
.eld-admin-savebar.is-saving .eld-admin-savebar-status {
    color: var(--wp-text);
}
.eld-admin-savebar.is-error .eld-admin-savebar-status {
    color: #d63638;
}
@keyframes eld-admin-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.5; transform: scale(1.3); }
}
.eld-admin-savebar-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 3px;
    border: 1px solid var(--wp-blue);
    background: var(--wp-blue);
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    line-height: 1;
}
.eld-admin-savebar-btn:hover:not(:disabled) {
    background: var(--wp-blue-hover);
    border-color: var(--wp-blue-hover);
}
.eld-admin-savebar-btn:disabled {
    background: #c3c4c7;
    border-color: #c3c4c7;
    cursor: not-allowed;
}

/* ============================================================
 * Live preview pane
 *
 * Layout: bar on top, scaled stage filling the rest, foot at the bottom.
 * The stage holds a fixed-size canvas (720x1000) that's transformed via
 * scale() to fit the available pane width. ResizeObserver in JS keeps
 * the scale factor in sync as the pane width changes.
 * ============================================================ */
.eld-admin-preview {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}
.eld-admin-preview[data-bg="dark"] {
    background:
        radial-gradient(900px 500px at 80% -10%, rgba(30,74,224,0.18) 0%, transparent 60%),
        radial-gradient(700px 400px at -10% 110%, rgba(245,158,11,0.10) 0%, transparent 55%),
        #0d1220;
}
.eld-admin-preview[data-bg="light"] {
    background:
        radial-gradient(900px 500px at 80% -10%, #e8eeff 0%, transparent 60%),
        radial-gradient(700px 400px at -10% 110%, #fff4e6 0%, transparent 55%),
        #ffffff;
}

/* Preview top bar — label + tabs (when 2+ surfaces) + live indicator */
.eld-admin-preview-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: #fff;
    border-bottom: 1px solid var(--wp-border);
    flex-shrink: 0;
}
.eld-admin-preview-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--wp-text-muted);
}
.eld-admin-preview-tabs {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px;
    background: #f0f0f1;
    border-radius: 4px;
}
.eld-admin-preview-tab {
    appearance: none;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 12px;
    font-weight: 500;
    color: var(--wp-text-muted);
    padding: 4px 10px;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}
.eld-admin-preview-tab:hover {
    color: var(--wp-text);
}
.eld-admin-preview-tab.is-active {
    background: #fff;
    color: var(--wp-text);
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.eld-admin-preview-live {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    color: #059669;
}
.eld-admin-preview-live-dot {
    width: 7px;
    height: 7px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(16,185,129,0.5);
    animation: eld-live-pulse 2s infinite;
}
@keyframes eld-live-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(16,185,129,0.5); }
    70%  { box-shadow: 0 0 0 6px rgba(16,185,129,0); }
    100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

/* Stage — sized container that the scaled frame lives inside */
.eld-admin-preview-stage {
    flex: 1;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 12px;
    background: transparent;
}

/* Scaled frame — fixed design dimensions, transformed by JS-computed scale */
.eld-admin-preview-frame {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    transform-origin: top center;
    flex-shrink: 0;
}

/* Inner surface that lays out optional bar + the form card */
.eld-admin-preview-surface {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    position: relative;
}
.eld-admin-preview-form-wrap {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 24px;
    min-height: 0;
}

/* Popup preview — same form position as inline mode, but the page
   background goes neutral gray to indicate "this is over a dimmed page."
   We override the data-bg gradients with a flat gray when in popup mode. */
.eld-admin-preview-stage[data-mode="popup"][data-bg="light"],
.eld-admin-preview-stage[data-mode="popup"][data-bg="dark"] {
    background: #b9bcc4;
}

/* Bar-mode chrome shown above/below the form in preview */
.eld-admin-preview-barchrome {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 12px 20px;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.eld-admin-preview-barchrome button {
    background: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
}

/* Foot — hint strip below the stage */
.eld-admin-preview-foot {
    font-size: 11.5px;
    color: var(--wp-text-faint);
    text-align: center;
    padding: 8px;
    background: #fff;
    border-top: 1px solid var(--wp-border);
    flex-shrink: 0;
}

/* ============================================================
 * Misc utilities
 * ============================================================ */
.wp-shortcode {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 12.5px;
}

/* =====================================================================
 * ELD APP UPSELL BANNER
 *
 * Rendered at the top of the legacy admin pages (All Forms, Submissions)
 * by admin/views/partials/eld-upsell-banner.php. Pitches the ELD app as
 * the distribution layer that pairs with the WordPress forms plugin.
 *
 * Visual language matches the editor onboarding banner (.wp-onb-*) —
 * blue accent, soft gradient background, white CTA card — but uses its
 * own .eld-upsell-* namespace so the two banners can coexist without
 * style collisions.
 *
 * Layout:
 *   Wide (>=1280px): three-zone horizontal grid — intro | 4-feature
 *     stack | CTA card. Sized assuming the standard WP-admin .wrap
 *     gives us roughly 1200–1600px of room.
 *   Mid (820–1279px): intro on top, features grid below in 2x2, CTA
 *     card below that, full width.
 *   Narrow (<820px): everything stacks single-column.
 *
 * Always visible — no dismiss button, by design. Sits as a quiet
 * persistent reminder of the ELD app on pages the seller revisits.
 * ===================================================================== */
.eld-upsell {
    position: relative;
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(0, 2.2fr) minmax(260px, 1.1fr);
    gap: 28px;
    align-items: stretch;
    padding: 22px 24px;
    margin: 16px 0 20px;
    background:
        radial-gradient(900px 320px at 100% -10%, rgba(30, 74, 224, 0.07) 0%, transparent 65%),
        linear-gradient(180deg, #f7faff 0%, #eef3ff 100%);
    border: 1px solid rgba(30, 74, 224, 0.16);
    border-radius: 10px;
    box-shadow: 0 1px 0 rgba(30, 74, 224, 0.05);
}

/* ---- Left: intro ---- */
.eld-upsell-intro { min-width: 0; }
.eld-upsell-eyebrow {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #1e4ae0;
    margin-bottom: 6px;
}
.eld-upsell-title {
    font-size: 19px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #1d2327;
    margin: 0 0 8px;
    line-height: 1.25;
    padding: 0;
}
.eld-upsell-sub {
    font-size: 13px;
    color: #50575e;
    line-height: 1.55;
    margin: 0;
    max-width: 38ch;
}

/* ---- Middle: 4-feature grid (2x2 on wide, then collapses) ---- */
.eld-upsell-flow {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 24px;
    align-content: center;
}
.eld-upsell-step {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 12px;
    align-items: start;
    min-width: 0;
}
.eld-upsell-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(180deg, #2a5cee 0%, #1e4ae0 100%);
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(30, 74, 224, 0.25);
}
.eld-upsell-step-body { min-width: 0; }
.eld-upsell-step-title {
    font-size: 13.5px;
    font-weight: 600;
    color: #1d2327;
    line-height: 1.3;
    margin-bottom: 3px;
}
.eld-upsell-step-text {
    font-size: 12.5px;
    color: #50575e;
    line-height: 1.5;
}

/* ---- Right: CTA card ---- */
.eld-upsell-cta {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    background: #ffffff;
    border: 1px solid rgba(30, 74, 224, 0.18);
    border-radius: 8px;
    align-self: center;
}
.eld-upsell-cta-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(180deg, #2a5cee 0%, #1e4ae0 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.eld-upsell-cta-body { min-width: 0; }
.eld-upsell-cta-title {
    font-size: 13.5px;
    font-weight: 600;
    color: #1d2327;
    margin-bottom: 4px;
    line-height: 1.3;
}
.eld-upsell-cta-text {
    font-size: 12.5px;
    color: #50575e;
    line-height: 1.55;
}
.eld-upsell-cta-text a {
    color: #1e4ae0;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 500;
    word-break: break-word;
}
.eld-upsell-cta-text a:hover {
    color: #1538a8;
}

/* ---- Mid screens: intro on top, features 2x2, CTA below ---- */
@media (max-width: 1279px) {
    .eld-upsell {
        grid-template-columns: 1fr;
        gap: 18px;
        padding: 20px;
    }
    .eld-upsell-sub { max-width: none; }
    .eld-upsell-cta { align-self: stretch; }
}

/* ---- Narrow screens: stack the 4 features into a single column ---- */
@media (max-width: 820px) {
    .eld-upsell-flow { grid-template-columns: 1fr; }
}
