/* ==========================================================================
   EasyFeedManager — Admin Styles
   ========================================================================== */

#toplevel_page_efmpf-feeds .wp-menu-image .dashicons-list-view {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

:root {
    --efmpf-primary:    #2271b1;
    --efmpf-primary-dk: #135e96;
    --efmpf-success:    #00a32a;
    --efmpf-warning:    #dba617;
    --efmpf-error:      #d63638;
    --efmpf-bg:         #f0f0f1;
    --efmpf-card-bg:    #fff;
    --efmpf-border:     #c3c4c7;
    --efmpf-radius:     8px;
    --efmpf-shadow:     0 1px 3px rgba(0,0,0,.08);
    --efmpf-text:       #1d2327;
    --efmpf-muted:      #6b7280;
}

/* ---- Layout ---------------------------------------------------------------- */

.efmpf-wrap {
    max-width: 1100px;
}

.efmpf-hidden {
    display: none !important;
}

/* ---- Two-column page layout (main + sidebar) ------------------------------- */

.efmpf-page-layout {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.efmpf-page-layout__main {
    flex: 1;
    min-width: 0;
}

.efmpf-page-layout__sidebar {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 32px;
}

/* ---- Support sidebar card -------------------------------------------------- */

.efmpf-support-card {
    background: #fff;
    border: 1px solid var(--efmpf-border);
    border-top: 3px solid var(--efmpf-primary);
    border-radius: var(--efmpf-radius);
    padding: 20px;
    box-shadow: var(--efmpf-shadow);
}

.efmpf-support-card__header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.efmpf-support-card__icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--efmpf-primary);
}

.efmpf-support-card__title {
    font-size: 14px;
    font-weight: 700;
    margin: 0;
    color: var(--efmpf-text);
}

.efmpf-support-card__body {
    font-size: 13px;
    color: var(--efmpf-muted);
    margin: 0 0 16px;
    line-height: 1.6;
}

.efmpf-support-card__btn {
    display: block;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
    margin-bottom: 0 !important;
}

.efmpf-support-card__docs-link {
    display: block;
    text-align: center;
    font-size: 13px;
    color: var(--efmpf-primary);
    text-decoration: none;
    margin-top: 10px;
}

.efmpf-support-card__docs-link:hover {
    text-decoration: underline;
}

/* ---- Mapping legend card --------------------------------------------------- */

.efmpf-legend-card {
    display: none;
    background: #fff;
    border: 1px solid var(--efmpf-border);
    border-radius: var(--efmpf-radius);
    padding: 16px 20px;
    box-shadow: var(--efmpf-shadow);
    margin-top: 16px;
}

.efmpf-legend-card__title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--efmpf-muted);
    margin: 0 0 12px;
}

.efmpf-legend-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.efmpf-legend-list__item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--efmpf-text);
}

.efmpf-legend-swatch {
    display: block;
    width: 3px;
    height: 16px;
    border-radius: 2px;
    flex-shrink: 0;
}

.efmpf-legend-swatch--required { background: var(--efmpf-error); }
.efmpf-legend-swatch--optional { background: var(--efmpf-border); }
.efmpf-legend-swatch--custom   { background: #a78bfa; }

/* ---- Page header ----------------------------------------------------------- */

.efmpf-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin: 16px 0 24px;
    gap: 12px;
}

.efmpf-page-header__title h1 {
    margin: 4px 0 0;
    padding: 0;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--efmpf-text);
}

.efmpf-breadcrumb {
    display: inline-block;
    font-size: 13px;
    color: var(--efmpf-primary);
    text-decoration: none;
    margin-bottom: 2px;
}

.efmpf-breadcrumb:hover { text-decoration: underline; }

/* ---- Empty state ----------------------------------------------------------- */

.efmpf-empty-state {
    background: var(--efmpf-card-bg);
    border: 1px solid var(--efmpf-border);
    border-radius: var(--efmpf-radius);
    padding: 60px 32px 40px;
    text-align: center;
    box-shadow: var(--efmpf-shadow);
    max-width: 720px;
}

.efmpf-empty-state__icon-wrap {
    width: 72px;
    height: 72px;
    background: #eff6ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    color: var(--efmpf-primary);
}

.efmpf-empty-state__icon-wrap svg {
    width: 36px;
    height: 36px;
}

.efmpf-empty-state h2 {
    margin: 0 0 10px;
    font-size: 22px;
    color: var(--efmpf-text);
}

.efmpf-empty-state > p {
    color: var(--efmpf-muted);
    margin: 0 auto 28px;
    max-width: 420px;
    line-height: 1.6;
}


/* ---- Row actions dropdown -------------------------------------------------- */

.efmpf-col-actions-hd {
    width: 80px;
}

.efmpf-col-actions {
    width: 80px;
}

.efmpf-row-actions {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.efmpf-btn-refresh-icon {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 7px !important;
    min-width: 30px;
    height: 28px;
    color: var(--efmpf-muted) !important;
}

.efmpf-btn-refresh-icon:hover {
    color: var(--efmpf-accent) !important;
}

.efmpf-btn-refresh-icon svg {
    display: block;
    flex-shrink: 0;
}

.efmpf-btn-refresh-icon.is-loading {
    pointer-events: none;
}

.efmpf-btn-refresh-icon.is-loading svg {
    animation: efmpf-spin 0.7s linear infinite;
}

@keyframes efmpf-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.efmpf-actions-trigger {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 28px;
    padding: 0 8px !important;
    font-size: 18px !important;
    line-height: 1 !important;
    letter-spacing: 1px;
}

.efmpf-actions-menu {
    display: none;
    position: fixed;
    min-width: 160px;
    background: #fff;
    border: 1px solid var(--efmpf-border);
    border-radius: var(--efmpf-radius);
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    z-index: 9999;
    padding: 4px 0;
}

.efmpf-row-actions.is-open .efmpf-actions-menu {
    display: block;
}

.efmpf-action-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 7px 14px;
    font-size: 13px;
    color: var(--efmpf-text);
    background: none;
    border: none;
    border-radius: 0;
    cursor: pointer;
    line-height: 1.4;
    white-space: nowrap;
    box-shadow: none;
}

.efmpf-action-item:hover {
    background: var(--efmpf-bg);
    color: var(--efmpf-primary);
}

.efmpf-action-item--danger {
    color: var(--efmpf-error);
}

.efmpf-action-item--danger:hover {
    background: #fff5f5;
    color: var(--efmpf-error);
}

.efmpf-action-separator {
    height: 1px;
    background: var(--efmpf-border);
    margin: 4px 0;
    border: none;
}

/* ---- Add a Feed — form ------------------------------------------------------ */

.efmpf-add-form-card {
    background: var(--efmpf-card-bg);
    border: 1px solid var(--efmpf-border);
    border-radius: var(--efmpf-radius);
    box-shadow: var(--efmpf-shadow);
    max-width: 720px;
    padding: 28px 32px 24px;
}

.efmpf-form-field {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.efmpf-form-field > label {
    flex: 0 0 130px;
    font-weight: 600;
    font-size: 13px;
    color: var(--efmpf-text);
    padding-top: 6px;
}

.efmpf-form-field__control {
    flex: 1;
}

.efmpf-form-field__control select,
.efmpf-form-field__control input[type="text"] {
    width: 100%;
    max-width: 340px;
}

/* ---- Searchable select widget (#efmpf-feed-template) ------------------------- */

.efmpf-searchable-select {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 340px;
    vertical-align: top;
}

.efmpf-ss-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 30px;
    padding: 0 8px;
    font-size: 14px;
    line-height: 1;
    color: #2c3338;
    background: #fff;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    box-shadow: none;
    text-align: left;
    cursor: pointer;
    gap: 6px;
}

.efmpf-ss-trigger:disabled {
    opacity: .6;
    cursor: default;
}

.efmpf-ss-trigger__label {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: inherit;
}

.efmpf-ss-trigger--placeholder .efmpf-ss-trigger__label {
    color: #646970;
}

.efmpf-ss-trigger__arrow {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    color: #646970;
}

.efmpf-ss-dropdown {
    display: none;
    position: absolute;
    top: calc( 100% + 2px );
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    z-index: 9999;
    overflow: hidden;
}

.efmpf-searchable-select.is-open .efmpf-ss-dropdown {
    display: block;
}

.efmpf-ss-search {
    display: block;
    width: 100%;
    padding: 6px 10px;
    font-size: 13px;
    border: none;
    border-bottom: 1px solid var(--efmpf-border);
    border-radius: 0;
    box-shadow: none;
    outline: none;
    box-sizing: border-box;
}

.efmpf-ss-list {
    max-height: 200px;
    overflow-y: auto;
}

.efmpf-ss-item {
    padding: 7px 10px;
    font-size: 13px;
    color: var(--efmpf-text);
    cursor: pointer;
    white-space: nowrap;
}

.efmpf-ss-item:hover,
.efmpf-ss-item:focus {
    background: var(--efmpf-bg);
    color: var(--efmpf-primary);
    outline: none;
}

.efmpf-ss-item.is-selected {
    font-weight: 600;
    color: var(--efmpf-primary);
}

.efmpf-ss-empty {
    padding: 8px 10px;
    font-size: 13px;
    color: var(--efmpf-muted);
    font-style: italic;
}

/* ---- Add a Feed — form ------------------------------------------------------ */

.efmpf-form-section-divider {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--efmpf-muted);
    border-top: 1px solid var(--efmpf-border);
    padding-top: 20px;
    margin: 8px 0 20px;
}

.efmpf-preview-bar--inline {
    margin: 0 0 14px;
}

.efmpf-form-actions {
    border-top: 1px solid var(--efmpf-border);
    padding-top: 20px;
    margin-top: 8px;
}

.efmpf-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.efmpf-tag--quick {
    background: #dcfce7;
    color: #166534;
}

/* ---- Add a Feed — mapping panel -------------------------------------------- */

.efmpf-screen-nav {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.efmpf-screen-nav__title {
    font-weight: 600;
    font-size: 15px;
    color: var(--efmpf-text);
}

.efmpf-btn-back-screen {
    background: none;
    border: none;
    color: var(--efmpf-primary);
    cursor: pointer;
    font-size: 13px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.efmpf-btn-back-screen:hover { text-decoration: underline; }

.efmpf-mapping-panel {
    background: var(--efmpf-card-bg);
    border: 1px solid var(--efmpf-border);
    border-radius: var(--efmpf-radius);
    box-shadow: var(--efmpf-shadow);
    max-width: 780px;
}

.efmpf-mapping-panel__intro {
    margin: 0;
    padding: 16px 20px;
    font-size: 13px;
    color: var(--efmpf-muted);
    border-bottom: 1px solid var(--efmpf-border);
    background: #fafafa;
    border-radius: var(--efmpf-radius) var(--efmpf-radius) 0 0;
}

.efmpf-mapping-panel #efmpf-custom-mapping-table {
    padding: 4px 0;
}

.efmpf-mapping-panel .efmpf-mapping-table {
    border-collapse: collapse;
    width: 100%;
}

.efmpf-mapping-panel .efmpf-mapping-table th,
.efmpf-mapping-panel .efmpf-mapping-table td {
    padding: 10px 20px;
    border-bottom: 1px solid var(--efmpf-border);
}

.efmpf-mapping-panel .efmpf-mapping-table tr:last-child td {
    border-bottom: none;
}

.efmpf-mapping-panel__footer {
    padding: 16px 20px;
    border-top: 1px solid var(--efmpf-border);
    background: #fafafa;
    border-radius: 0 0 var(--efmpf-radius) var(--efmpf-radius);
}

/* ---- Add a Feed — generating state ----------------------------------------- */

.efmpf-generating-state {
    text-align: center;
    padding: 60px 40px;
    background: var(--efmpf-card-bg);
    border: 1px solid var(--efmpf-border);
    border-radius: var(--efmpf-radius);
    max-width: 480px;
}

.efmpf-generating-state .efmpf-spinner {
    margin: 0 auto 24px;
}

.efmpf-generating-state h2 {
    margin: 0 0 8px;
    font-size: 20px;
    color: var(--efmpf-text);
}

/* ---- Add a Feed — success card --------------------------------------------- */

.efmpf-success-card {
    background: var(--efmpf-card-bg);
    border: 1px solid var(--efmpf-border);
    border-top: 3px solid var(--efmpf-success);
    border-radius: var(--efmpf-radius);
    box-shadow: var(--efmpf-shadow);
    padding: 28px 32px 24px;
    max-width: 720px;
    margin-bottom: 16px;
}

.efmpf-success-card__hero {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--efmpf-border);
}

.efmpf-success-card__icon-wrap {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: #dcfce7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--efmpf-success);
}

.efmpf-success-card__icon-wrap svg {
    width: 24px;
    height: 24px;
}

.efmpf-success-card__hero-text h2 {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 600;
    color: var(--efmpf-text);
}

.efmpf-success-card__hero-text p {
    margin: 0;
    font-size: 13px;
    color: var(--efmpf-muted);
}

.efmpf-success-card__meta {
    display: flex;
    gap: 32px;
    margin-bottom: 20px;
}

.efmpf-success-meta-item__label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--efmpf-muted);
    margin-bottom: 4px;
}

.efmpf-success-meta-item__value {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--efmpf-text);
}

.efmpf-success-card__url-section {
    background: #f0f6fc;
    border: 1px solid #c5d9ed;
    border-radius: var(--efmpf-radius);
    padding: 16px 20px;
    margin-bottom: 20px;
}

.efmpf-success-card__url-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--efmpf-muted);
    margin-bottom: 8px;
}

.efmpf-success-card__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 20px;
    border-top: 1px solid var(--efmpf-border);
}

/* ---- Wizard (legacy — keep for backward compat) ---------------------------- */

.efmpf-wizard {
    background: var(--efmpf-card-bg);
    border: 1px solid var(--efmpf-border);
    border-radius: var(--efmpf-radius);
    box-shadow: var(--efmpf-shadow);
    padding: 40px;
    max-width: 820px;
}

.efmpf-wizard__step {
    display: none;
}

.efmpf-wizard__step.efmpf-step--active {
    display: block;
}

.efmpf-wizard__hero {
    text-align: center;
    padding: 20px 0 32px;
}

.efmpf-wizard__hero-icon {
    font-size: 56px;
    line-height: 1;
    margin-bottom: 16px;
}

.efmpf-wizard__hero h2 {
    font-size: 26px;
    margin: 0 0 10px;
    color: var(--efmpf-text);
}

.efmpf-wizard__subtitle {
    color: var(--efmpf-muted);
    font-size: 15px;
}

.efmpf-wizard__header {
    margin-bottom: 28px;
}

.efmpf-wizard__header h2 {
    margin: 8px 0 6px;
    font-size: 20px;
}

.efmpf-wizard__header p {
    margin: 0;
    color: var(--efmpf-muted);
}

.efmpf-wizard__footer {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--efmpf-border);
}

.efmpf-btn-back {
    background: none;
    border: none;
    color: var(--efmpf-primary);
    cursor: pointer;
    font-size: 13px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.efmpf-btn-back:hover { text-decoration: underline; }

/* ---- Option Cards ---------------------------------------------------------- */

.efmpf-wizard__options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 10px;
}

@media (max-width: 640px) {
    .efmpf-wizard__options { grid-template-columns: 1fr; }
}

.efmpf-option-card {
    border: 2px solid var(--efmpf-border);
    border-radius: var(--efmpf-radius);
    padding: 28px 24px;
    text-align: center;
    position: relative;
    background: var(--efmpf-card-bg);
    transition: border-color .15s, box-shadow .15s;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.efmpf-option-card:hover {
    border-color: var(--efmpf-primary);
    box-shadow: 0 2px 8px rgba(34,113,177,.12);
}

.efmpf-option-card--recommended {
    border-color: var(--efmpf-primary);
    background: #f0f6fc;
}

.efmpf-option-card__badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--efmpf-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.efmpf-option-card__icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.efmpf-option-card h3 {
    margin: 0 0 8px;
    font-size: 17px;
    color: var(--efmpf-text);
}

.efmpf-option-card p {
    margin: 0 0 20px;
    color: var(--efmpf-muted);
    font-size: 13px;
    line-height: 1.5;
    flex: 1;
}

/* ---- Template Grid --------------------------------------------------------- */

.efmpf-template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}

.efmpf-template-card {
    border: 2px solid var(--efmpf-border);
    border-radius: var(--efmpf-radius);
    cursor: pointer;
    transition: border-color .15s;
    display: block;
}

.efmpf-template-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.efmpf-template-card__inner {
    padding: 20px 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.efmpf-template-card__icon {
    font-size: 28px;
}

.efmpf-template-card strong {
    display: block;
    font-size: 13px;
    color: var(--efmpf-text);
}

.efmpf-template-card span {
    font-size: 12px;
    color: var(--efmpf-muted);
}

.efmpf-template-card--selected {
    border-color: var(--efmpf-primary);
    background: #f0f6fc;
}

.efmpf-template-card--pro {
    opacity: .6;
    cursor: default;
}

.efmpf-template-card--pro:hover {
    border-color: var(--efmpf-border);
}

.efmpf-template-picker-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.efmpf-template-search {
    flex: 0 0 260px;
    padding: 6px 10px;
    border: 1px solid var(--efmpf-border);
    border-radius: var(--efmpf-radius);
    font-size: 13px;
    line-height: 1.4;
    outline: none;
    transition: border-color .15s;
}

.efmpf-template-search:focus {
    border-color: var(--efmpf-primary);
    box-shadow: 0 0 0 1px var(--efmpf-primary);
}

.efmpf-cat-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.efmpf-cat-tab {
    background: none;
    border: 1px solid var(--efmpf-border);
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 13px;
    color: var(--efmpf-text);
    cursor: pointer;
    transition: background .12s, border-color .12s, color .12s;
    line-height: 1.5;
}

.efmpf-cat-tab:hover {
    border-color: var(--efmpf-primary);
    color: var(--efmpf-primary);
}

.efmpf-cat-tab--active {
    background: var(--efmpf-primary);
    border-color: var(--efmpf-primary);
    color: #fff;
}

.efmpf-cat-tab--active:hover {
    color: #fff;
}

.efmpf-template-no-results {
    color: var(--efmpf-muted);
    font-size: 13px;
    padding: 20px 0;
}

.efmpf-template-picker__footer {
    margin-top: 24px;
}

.efmpf-pro-badge {
    display: inline-block;
    background: #f6c90e;
    color: #1d2327;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: .4px;
}

/* ---- Preview bar ----------------------------------------------------------- */

.efmpf-preview-bar {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 16px;
    background: #f0f6fc;
    border: 1px solid #c5d9ed;
    border-radius: var(--efmpf-radius);
    margin-bottom: 14px;
}

.efmpf-preview-bar--panel {
    margin: 12px 20px;
}

.efmpf-preview-bar label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--efmpf-muted);
}

.efmpf-preview-bar__row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.efmpf-preview-bar__row .regular-text {
    flex: 1;
    min-width: 200px;
    font-size: 13px !important;
}

.efmpf-preview-hint {
    margin: 0 0 8px;
    font-size: 12px;
    color: var(--efmpf-muted);
    font-style: italic;
}

.efmpf-preview-status {
    flex-basis: 100%;
    font-size: 12px;
    color: var(--efmpf-success);
}

.efmpf-preview-status--error {
    color: var(--efmpf-error);
}

/* Value cell inner wrapper — anchor for the absolutely-positioned preview tooltip */
.efmpf-col-value-inner {
    position: relative;
    width: 100%;
}

.efmpf-col-value-inner select,
.efmpf-col-value-inner .efmpf-custom-inline-field {
    width: 100%;
    box-sizing: border-box;
}

/* Preview value chip — always hidden; shown all at once when table enters preview mode */
.efmpf-preview-val {
    display: none;
    font-size: 11px;
    line-height: 1.3;
    margin-top: 4px;
    padding: 2px 7px;
    border-radius: 3px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: top;
}

/* Show ALL preview chips at once when the table is in preview mode */
.efmpf-mapping-table.efmpf-preview-active .efmpf-preview-val--has-value {
    display: inline-block;
    background: #e8f0fe;
    color: var(--efmpf-primary);
    font-weight: 500;
}

.efmpf-mapping-table.efmpf-preview-active .efmpf-preview-val--empty {
    display: inline-block;
    color: var(--efmpf-muted);
    font-style: italic;
}

/* Preview bar — active state when a product is loaded */
.efmpf-preview-bar--active {
    background: #f0f9f0;
    border-color: #a8d4a4;
}

/* Clear preview button */
.efmpf-preview-clear-btn {
    flex-shrink: 0;
    background: none;
    border: 1px solid var(--efmpf-border);
    border-radius: 3px;
    font-size: 11px;
    color: var(--efmpf-muted);
    cursor: pointer;
    padding: 2px 8px;
    line-height: 1.6;
    transition: color .12s, border-color .12s;
}
.efmpf-preview-clear-btn:hover {
    color: var(--efmpf-error);
    border-color: var(--efmpf-error);
}

/* ---- Mapping Table --------------------------------------------------------- */

.efmpf-mapping-table {
    width: 100%;
    border-collapse: collapse;
}

.efmpf-mapping-table th,
.efmpf-mapping-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--efmpf-border);
    font-size: 13px;
    vertical-align: top;
}

.efmpf-mapping-table th {
    background: #f9fafb;
    font-weight: 600;
    color: var(--efmpf-text);
}

.efmpf-col-attr-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--efmpf-text);
}

.efmpf-mapping-table {
    table-layout: fixed;
}

/* 5-column layout: Attributes | Prefix | Value | Suffix | Delete
   Attributes and Value are equal width; Prefix/Suffix/Delete are equal. */
.efmpf-mapping-table th:first-child,
.efmpf-mapping-table td:first-child {
    width: 38%;
}

.efmpf-mapping-table th:nth-child(2),
.efmpf-mapping-table td:nth-child(2) {
    width: 8%;
    padding-left: 6px;
    padding-right: 6px;
}

.efmpf-mapping-table th:nth-child(3),
.efmpf-mapping-table td:nth-child(3) {
    width: 38%;
}

.efmpf-mapping-table th:nth-child(4),
.efmpf-mapping-table td:nth-child(4) {
    width: 8%;
    padding-left: 6px;
    padding-right: 6px;
}

.efmpf-mapping-table th:last-child,
.efmpf-mapping-table td:last-child {
    width: 8%;
    text-align: center;
}

.efmpf-th-meta {
    font-size: 11px;
    color: var(--efmpf-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .4px;
    text-align: center;
}

.efmpf-col-prefix,
.efmpf-col-suffix {
    text-align: center;
}

.efmpf-prefix-input,
.efmpf-suffix-input {
    width: 100%;
    box-sizing: border-box;
    font-size: 12px !important;
    text-align: center;
}

.efmpf-col-value select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.efmpf-mapping-table select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Left accent on every row — gray by default, red for required */
.efmpf-mapping-table tbody tr td:first-child {
    box-shadow: inset 3px 0 0 var(--efmpf-border);
}

.efmpf-mapping-table tbody tr.efmpf-required-row td:first-child {
    box-shadow: inset 3px 0 0 var(--efmpf-error);
}

/* Custom attribute rows — left accent only, no background */
.efmpf-mapping-table tbody tr.efmpf-custom-row td:first-child {
    box-shadow: inset 3px 0 0 #a78bfa;
}

/* Contextual identifier rows (gtin, mpn) — gray accent */
.efmpf-mapping-table tbody tr.efmpf-contextual-row td:first-child {
    box-shadow: inset 3px 0 0 var(--efmpf-border);
}

/* Inline custom-field row: text input + switch-back icon button */
.efmpf-custom-inline-field {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    box-sizing: border-box;
}

.efmpf-custom-inline-field input[type="text"] {
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
}

.efmpf-custom-key-switch,
.efmpf-custom-val-switch {
    flex-shrink: 0;
    background: none;
    border: 1px solid var(--efmpf-border);
    border-radius: 3px;
    cursor: pointer;
    padding: 1px 5px;
    font-size: 12px;
    line-height: 1.6;
    color: var(--efmpf-muted);
    white-space: nowrap;
    title: attr(title);
}

.efmpf-custom-key-switch:hover,
.efmpf-custom-val-switch:hover {
    color: var(--efmpf-primary);
    border-color: var(--efmpf-primary);
}

/* Add attribute row */
.efmpf-add-row-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--efmpf-border);
    background: #fafafa;
}

.efmpf-attr-key-select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.efmpf-btn-remove-row {
    background: none;
    border: none;
    color: var(--efmpf-muted);
    font-size: 18px;
    line-height: 1;
    padding: 2px 6px;
    cursor: pointer;
    border-radius: 4px;
    transition: color .15s, background .15s;
}

.efmpf-btn-remove-row:hover {
    color: var(--efmpf-error);
    background: #fef2f2;
}

/* ---- Result Card ----------------------------------------------------------- */

.efmpf-result-card {
    background: #f0f6fc;
    border: 1px solid #c5d9ed;
    border-radius: var(--efmpf-radius);
    padding: 20px 24px;
    margin: 24px 0;
}

.efmpf-result-card label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--efmpf-text);
    font-size: 13px;
}

.efmpf-url-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.efmpf-url-row a.button-small {
    min-width: 48px;
    box-sizing: border-box;
    text-align: center;
}

.efmpf-btn-download-icon {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 7px !important;
    height: 28px;
    color: var(--efmpf-muted) !important;
}

.efmpf-btn-download-icon:hover {
    color: var(--efmpf-accent) !important;
}

.efmpf-btn-download-icon svg {
    display: block;
    flex-shrink: 0;
}

.efmpf-url-input {
    flex: 1;
    font-family: monospace;
    font-size: 13px !important;
    background: #fff !important;
}

.efmpf-url-input--sm {
    max-width: 160px;
}

.efmpf-result-meta {
    margin-top: 10px;
    font-size: 12px;
    color: var(--efmpf-muted);
}

.efmpf-result-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
}

/* ---- Warning List ---------------------------------------------------------- */

.efmpf-warning-list {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--efmpf-radius);
    padding: 16px 20px;
    margin-top: 16px;
}

.efmpf-warning-list h4 {
    margin: 0 0 10px;
    color: #92400e;
    font-size: 13px;
}

.efmpf-warning-list ul {
    margin: 0;
    padding-left: 20px;
}

.efmpf-warning-list li {
    font-size: 12px;
    color: #78350f;
    margin-bottom: 4px;
}

/* ---- Bulk actions toolbar -------------------------------------------------- */

.efmpf-table-toolbar {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    min-height: 30px;
}

.efmpf-bulk-bar__count {
    display: none;
    font-size: 13px;
    color: #646970;
}

.efmpf-bulk-actions-bar {
    display: none;
    align-items: center;
    gap: 6px;
}

.efmpf-bulk-only {
    display: none;
}

.efmpf-feed-list.efmpf-bulk-mode .efmpf-bulk-only {
    display: table-cell;
}

.efmpf-feed-list.efmpf-bulk-mode .efmpf-normal-only {
    display: none;
}

.efmpf-feed-list.efmpf-bulk-mode .efmpf-bulk-bar__count {
    display: inline;
}

.efmpf-feed-list.efmpf-bulk-mode .efmpf-bulk-actions-bar {
    display: flex;
    margin-left: auto;
}

.efmpf-feed-list.efmpf-bulk-mode .efmpf-btn-add-feed {
    display: none !important;
}

.efmpf-col-check {
    width: 32px !important;
    text-align: center !important;
    vertical-align: middle !important;
    position: relative;
}

.efmpf-check-center {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.efmpf-col-check input[type="checkbox"] {
    margin: 0;
}

.efmpf-btn-bulk-toggle {
    min-width: 82px;
    text-align: center;
}

.efmpf-btn-add-feed {
    margin-left: auto !important;
    min-width: 82px;
    text-align: center;
    font-weight: 600 !important;
}

.efmpf-bulk-action {
    min-width: 82px;
    text-align: center;
}

.efmpf-bulk-actions-bar.efmpf-no-selection .efmpf-bulk-action {
    pointer-events: none;
    cursor: default;
}

.efmpf-btn-danger {
    background: #dc2626 !important;
    border-color: #dc2626 !important;
    color: #fff !important;
}

.efmpf-btn-danger:hover:not(:disabled) {
    background: #b91c1c !important;
    border-color: #b91c1c !important;
    color: #fff !important;
}

.efmpf-btn-danger:disabled {
    opacity: 0.5;
}

/* ---- Feed List Table ------------------------------------------------------- */

.efmpf-table {
    border-radius: var(--efmpf-radius);
    overflow: hidden;
    box-shadow: var(--efmpf-shadow);
    table-layout: fixed;
    width: 100%;
}

.efmpf-table th {
    background: #f9fafb;
    font-weight: 600;
}

.efmpf-table td {
    vertical-align: middle;
}

/* Column widths (fixed layout — set on <th> via classes added in markup) */
.efmpf-col-name-hd,
.efmpf-col-name     { width: 155px; }
.efmpf-col-type-hd,
.efmpf-col-type     { width: 162px; }
.efmpf-col-count-hd { width: 65px;  }
.efmpf-col-date-hd  { width: 160px; }
/* .efmpf-col-refresh → 70px already set below */
/* Feed URL → fills remaining space                */
/* .efmpf-col-actions-hd → 80px already set below   */

/* Row highlight — applied after add or save to identify the active feed.
   Uses box-shadow inset (not background-color) so it paints uniformly on top
   of any existing cell backgrounds (WP striped rows, badges, inputs, buttons). */
@keyframes efmpf-row-flash {
    0%   { box-shadow: inset 0 0 0 9999px rgba(255, 185, 0, 0.32); }
    100% { box-shadow: inset 0 0 0 9999px rgba(255, 185, 0, 0); }
}

table.efmpf-table tr.efmpf-row-highlighted > td {
    animation: efmpf-row-flash 3.5s ease-out forwards;
}

.efmpf-col-refresh {
    white-space: nowrap;
    width: 70px;
}

.efmpf-refresh-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    color: var(--efmpf-accent);
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    padding: 1px 8px;
    line-height: 1.6;
}


.efmpf-col-count {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* ---- Feed status dot (passive indicator) ----------------------------------- */

.efmpf-col-name {
    /* No display:flex here — keeping display:table-cell so the box-shadow
       highlight animation fills the full row height, same as all other cells. */
}

.efmpf-col-name__inner {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
}

.efmpf-col-name strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.efmpf-status-dot {
    flex-shrink: 0;
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.efmpf-status-dot--enabled {
    background-color: #16a34a;
    box-shadow: 0 0 0 2px #dcfce7;
}

.efmpf-status-dot--disabled {
    background-color: #dc2626;
    box-shadow: 0 0 0 2px #fee2e2;
}


.efmpf-btn-destructive {
    color: #b91c1c !important;
    border-color: #fca5a5 !important;
    background: #fff5f5 !important;
}

.efmpf-btn-destructive:hover {
    background: #fee2e2 !important;
    border-color: #f87171 !important;
}

.efmpf-badge {
    display: inline-block;
    width: 148px;
    max-width: 100%;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: .4px;
    background: #dbeafe;
    color: #1e40af;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
    box-sizing: border-box;
}

/* Google family — green */
.efmpf-badge--google,
.efmpf-badge--google_drm,
.efmpf-badge--google_local,
.efmpf-badge--google_manufacturer,
.efmpf-badge--google_promotions,
.efmpf-badge--google_product_reviews,
.efmpf-badge--google_vehicle_ads {
    background: #dcfce7;
    color: #166534;
}

/* Facebook / META — blue */
.efmpf-badge--facebook {
    background: #dbeafe;
    color: #1e3a8a;
}

/* TikTok — dark */
.efmpf-badge--tiktok {
    background: #374151;
    color: #f3f4f6;
}

/* Bing / Microsoft — blue */
.efmpf-badge--bing {
    background: #e0f2fe;
    color: #075985;
}

/* Pinterest — red */
.efmpf-badge--pinterest,
.efmpf-badge--pinterest_rss {
    background: #fce7f3;
    color: #9d174d;
}

/* Amazon — orange */
.efmpf-badge--amazon {
    background: #fef3c7;
    color: #92400e;
}

/* eBay — blue */
.efmpf-badge--ebay {
    background: #eff6ff;
    color: #1d4ed8;
}

/* Snapchat — yellow */
.efmpf-badge--snapchat {
    background: #fefce8;
    color: #713f12;
}

/* X / Twitter — dark */
.efmpf-badge--twitter {
    background: #e2e8f0;
    color: #0f172a;
}

/* Yandex — red */
.efmpf-badge--yandex {
    background: #fee2e2;
    color: #991b1b;
}

/* OpenAI — neutral dark */
.efmpf-badge--openai {
    background: #f1f5f9;
    color: #1e293b;
}

/* Idealo — red */
.efmpf-badge--idealo {
    background: #fee2e2;
    color: #991b1b;
}

/* Price comparison platforms — orange */
.efmpf-badge--pricerunner,
.efmpf-badge--pricespy,
.efmpf-badge--shopzilla,
.efmpf-badge--kelkoo {
    background: #fff7ed;
    color: #9a3412;
}

/* Marketplaces */
.efmpf-badge--fruugo {
    background: #d1fae5;
    color: #065f46;
}

.efmpf-badge--wish {
    background: #ede9fe;
    color: #4c1d95;
}

.efmpf-badge--shopee {
    background: #fff3e0;
    color: #bf360c;
}

.efmpf-badge--connexity {
    background: #dbeafe;
    color: #1e40af;
}

/* Affiliate networks — purple */
.efmpf-badge--awin,
.efmpf-badge--admitad {
    background: #ede9fe;
    color: #5b21b6;
}

/* Polish platforms */
.efmpf-badge--ceneo {
    background: #fdecd4;
    color: #7c3200;
}

.efmpf-badge--allegro {
    background: #fde3d4;
    color: #7a2600;
}

.efmpf-badge--custom {
    background: #e5e7eb;
    color: #374151;
}

/* Searchable select — optgroup header */
.efmpf-ss-group-label {
    padding: 6px 10px 3px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--efmpf-muted);
    user-select: none;
}

.efmpf-muted {
    color: var(--efmpf-muted);
    font-style: italic;
}

/* ---- Edit Feed full-page overlay ------------------------------------------- */
/*
 * Positioned to fill the WP admin content area only.
 * Left offset matches the WP admin menu (160px expanded, 36px collapsed).
 * Top offset matches the WP admin bar (32px). z-index stays below the admin
 * bar (99999) so the bar remains visible.
 */
.efmpf-modal-overlay {
    position: fixed;
    top: 32px;        /* WP admin bar height */
    right: 0;
    bottom: 0;
    left: 160px;      /* WP admin menu expanded */
    padding-left: 20px; /* matches #wpbody-content padding-left */
    background: var(--efmpf-bg);
    z-index: 9999;
    overflow-y: auto;
}

/* Collapsed WP admin menu */
body.folded .efmpf-modal-overlay {
    left: 36px;
}

/* Prevent the underlying page from scrolling while the overlay is open */
body.efmpf-modal-open #wpcontent {
    overflow: hidden;
    height: calc(100vh - 32px);
}

/* Button-reset for breadcrumb used as button inside the overlay */
button.efmpf-breadcrumb {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--efmpf-primary);
    font-family: inherit;
}

/* Intro text above mapping table */
.efmpf-modal__intro {
    margin: 0 0 16px;
    color: var(--efmpf-muted);
    font-size: 13px;
}

/* Actions row inside the edit card */
.efmpf-form-actions--edit {
    display: flex;
    align-items: center;
    gap: 12px;
}

.efmpf-modal-status {
    font-size: 12px;
    color: var(--efmpf-success);
}

/* ---- Spinner --------------------------------------------------------------- */

.efmpf-spinner-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.efmpf-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--efmpf-border);
    border-top-color: var(--efmpf-primary);
    border-radius: 50%;
    animation: efmpf-spin .8s linear infinite;
}

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

.efmpf-loading {
    text-align: center;
    color: var(--efmpf-muted);
    padding: 20px;
}

/* ---- Notifications --------------------------------------------------------- */

.efmpf-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--efmpf-radius);
    font-size: 13px;
    margin: 12px 0;
}

.efmpf-notice--success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.efmpf-notice--error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.efmpf-notice--warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

/* ---- Inline toast ---------------------------------------------------------- */

.efmpf-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--efmpf-text);
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--efmpf-radius);
    font-size: 13px;
    z-index: 999999;
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
    transition: opacity .3s;
}

.efmpf-toast.efmpf-toast--success { background: var(--efmpf-success); }
.efmpf-toast.efmpf-toast--error   { background: var(--efmpf-error); }

/* ---- Add-feed tab nav (reuses .efmpf-tab-btn styles) ------------------------ */

.efmpf-addfeed-tabs-nav {
    display: flex;
    border-bottom: 1px solid var(--efmpf-border);
    margin: -28px -32px 0;
    padding: 0 32px;
    border-radius: var(--efmpf-radius) var(--efmpf-radius) 0 0;
    background: #fafafa;
}

/* ---- Modal Tabs ------------------------------------------------------------ */

.efmpf-modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--efmpf-border);
    padding: 0 24px;
    background: #fafafa;
}

.efmpf-tab-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--efmpf-muted);
    cursor: pointer;
    margin-bottom: -1px;
    transition: color .15s, border-color .15s;
    white-space: nowrap;
}

.efmpf-tab-btn:hover { color: var(--efmpf-text); }

.efmpf-tab-btn--active {
    color: var(--efmpf-primary);
    border-bottom-color: var(--efmpf-primary);
    font-weight: 600;
}

/* ---- Filter Count Bar ------------------------------------------------------ */

.efmpf-filter-count-bar {
    background: #f0f6fc;
    border: 1px solid #c5d9ed;
    border-radius: var(--efmpf-radius);
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--efmpf-primary);
    margin-bottom: 20px;
}

/* ---- Filter Section -------------------------------------------------------- */

.efmpf-filter-section {
    margin-bottom: 24px;
}

.efmpf-filter-section__title {
    font-size: 11px;
    font-weight: 700;
    color: var(--efmpf-muted);
    margin: 0 0 4px;
    text-transform: uppercase;
    letter-spacing: .6px;
}

.efmpf-filter-section__desc {
    font-size: 12px;
    color: var(--efmpf-muted);
    margin: 0 0 12px;
}

/* ---- Preset Buttons -------------------------------------------------------- */

.efmpf-preset-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ---- Filter Group ---------------------------------------------------------- */

.efmpf-filter-group {
    border: 1px solid var(--efmpf-border);
    border-radius: var(--efmpf-radius);
    background: var(--efmpf-card-bg);
    overflow: hidden;
}

/* Root group — invisible container; child groups are the visible cards */
.efmpf-filter-group--root {
    border: none;
    background: transparent;
    border-radius: 0;
    overflow: visible;
}

.efmpf-filter-group--root > .efmpf-filter-group__children {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    counter-reset: efmpf-group;
}

/* Top-level group cards — no extra margin; connector provides visual spacing */
.efmpf-filter-group--root > .efmpf-filter-group__children > .efmpf-filter-group--nested {
    margin: 0;
}

/* ---- Group connector (AND/OR pill between top-level groups) -------------- */

.efmpf-group-connector {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 0;
    position: relative;
}

.efmpf-group-connector::before,
.efmpf-group-connector::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #d0e3f5;
}

.efmpf-and-or-toggle--connector {
    margin: 0 10px;
    flex-shrink: 0;
}

.efmpf-group-number::before {
    content: "Group " counter(efmpf-group);
    font-size: 11px;
    font-weight: 700;
    color: #2271b1;
    background: #dce9f5;
    border-radius: 3px;
    padding: 1px 6px;
    margin-right: 8px;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.efmpf-filter-group--root > .efmpf-filter-group__footer,
.efmpf-filter-group__footer--root {
    background: transparent;
    border-top: none;
    padding: 10px 0 0;
}

.efmpf-filter-group--nested {
    counter-increment: efmpf-group;
    margin: 6px 0;
    border-color: #c5d9ed;
    background: #f6fafd;
}

/* Sub-group (depth 2) — visually indented inside a group */
.efmpf-filter-group--subgroup {
    border-color: #b0c8e2;
    background: #eef4fb;
    margin: 8px 0 4px 16px;
    counter-increment: efmpf-subgroup;
}

.efmpf-filter-group--subgroup > .efmpf-filter-group__header {
    background: #ddeaf6;
    border-bottom-color: #b0c8e2;
}

.efmpf-filter-group--subgroup > .efmpf-filter-group__footer {
    background: #ddeaf6;
    border-top-color: #b0c8e2;
}

/* Reset sub-group counter for each top-level group's children */
.efmpf-filter-group--nested > .efmpf-filter-group__children {
    counter-reset: efmpf-subgroup;
}

.efmpf-subgroup-number::before {
    content: "Sub-group " counter(efmpf-subgroup);
    font-size: 11px;
    font-weight: 700;
    color: #1a5e90;
    background: #c2d8ed;
    border-radius: 3px;
    padding: 1px 6px;
    margin-right: 8px;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.efmpf-filter-group__header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    background: #f9fafb;
    border-bottom: 1px solid var(--efmpf-border);
    flex-wrap: wrap;
}

.efmpf-filter-group--nested > .efmpf-filter-group__header {
    background: #eef5fb;
    border-bottom-color: #c5d9ed;
}

.efmpf-filter-group__label {
    font-size: 11px;
    font-weight: 600;
    color: var(--efmpf-muted);
    text-transform: uppercase;
    letter-spacing: .4px;
    white-space: nowrap;
}

/* AND / OR toggle */

.efmpf-and-or-toggle {
    display: inline-flex;
    border: 1px solid var(--efmpf-border);
    border-radius: 4px;
    overflow: hidden;
}

.efmpf-and-or-btn {
    background: #fff;
    border: none;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    color: var(--efmpf-muted);
    transition: background .12s, color .12s;
    line-height: 1.6;
    letter-spacing: .3px;
}

.efmpf-and-or-btn + .efmpf-and-or-btn {
    border-left: 1px solid var(--efmpf-border);
}

.efmpf-and-or-btn:hover {
    background: #f0f6fc;
    color: var(--efmpf-primary);
}

.efmpf-and-or-btn--active {
    background: var(--efmpf-primary);
    color: #fff;
}

.efmpf-and-or-btn--active:hover {
    background: var(--efmpf-primary-dk);
    color: #fff;
}

.efmpf-filter-remove--group {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 15px;
    color: var(--efmpf-muted);
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    border-radius: 4px;
    transition: color .15s, background .15s;
}

.efmpf-filter-remove--group:hover {
    color: var(--efmpf-error);
    background: #fef2f2;
}

/* Children container */

.efmpf-filter-group__children {
    padding: 4px 12px;
    min-height: 8px;
}

.efmpf-filter-group__children:empty {
    padding: 4px 12px;
}

/* Footer */

.efmpf-filter-group__footer {
    padding: 8px 12px;
    border-top: 1px solid var(--efmpf-border);
    background: #fafafa;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.efmpf-filter-group--nested > .efmpf-filter-group__footer {
    background: #eef5fb;
    border-top-color: #c5d9ed;
}

/* ---- Filter Condition Row -------------------------------------------------- */

.efmpf-filter-condition {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 0;
    border-bottom: 1px solid #f3f4f6;
    flex-wrap: nowrap;
}

.efmpf-filter-condition:last-child {
    border-bottom: none;
}

.efmpf-filter-condition .efmpf-cond-field,
.efmpf-filter-condition .efmpf-ss {
    flex: 2 1 0;
    min-width: 0;
    width: auto;
    display: block;
}

.efmpf-filter-condition .efmpf-cond-operator {
    flex: 1.4 1 0;
    min-width: 0;
}

.efmpf-filter-condition .efmpf-cond-value {
    flex: 1.4 1 0;
    min-width: 0;
}

/* Between operator — two number inputs with a separator */
.efmpf-between-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
}

.efmpf-between-from,
.efmpf-between-to {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
}

.efmpf-between-sep {
    flex-shrink: 0;
    color: var(--efmpf-muted);
    font-size: 13px;
    padding: 0 2px;
    user-select: none;
}

.efmpf-filter-remove--cond {
    flex-shrink: 0;
    background: none;
    border: none;
    font-size: 15px;
    color: var(--efmpf-muted);
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    border-radius: 4px;
    transition: color .15s, background .15s;
}

.efmpf-filter-remove--cond:hover {
    color: var(--efmpf-error);
    background: #fef2f2;
}

/* ---- Rule Builder --------------------------------------------------------- */

.efmpf-rule-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    counter-reset: efmpf-rule;
}

.efmpf-rule {
    display: flex;
    flex-direction: column;
    border: 1px solid #c5d9ed;
    border-radius: var(--efmpf-radius);
    background: #f6fafd;
    overflow: hidden;
    counter-increment: efmpf-rule;
}

.efmpf-rule__header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    background: #eef5fb;
    border-bottom: 1px solid #c5d9ed;
    cursor: default;
}

.efmpf-rule-drag {
    color: #b0c4d8;
    cursor: grab;
    font-size: 13px;
    line-height: 1;
    flex-shrink: 0;
    user-select: none;
}

.efmpf-rule-drag:active {
    cursor: grabbing;
}

.efmpf-rule-placeholder {
    border: 2px dashed #c5d9ed;
    border-radius: var(--efmpf-radius);
    background: #f0f6fc;
    height: 60px;
    margin-bottom: 0;
}

.efmpf-rule-number::before {
    content: "Rule " counter(efmpf-rule);
    font-size: 11px;
    font-weight: 700;
    color: #2271b1;
    background: #dce9f5;
    border-radius: 3px;
    padding: 1px 6px;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.efmpf-rule-remove {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 15px;
    color: var(--efmpf-muted);
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    border-radius: 4px;
    transition: color .15s, background .15s;
}

.efmpf-rule-remove:hover {
    color: var(--efmpf-error);
    background: #fef2f2;
}

.efmpf-rule__body {
    padding: 0 12px;
}

.efmpf-rule__if,
.efmpf-rule__then {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 0;
    flex-wrap: nowrap;
}

.efmpf-rule__if {
    border-bottom: 1px solid #dce9f5;
}

.efmpf-rule__label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .7px;
    text-transform: uppercase;
    width: 34px;
    flex-shrink: 0;
}

.efmpf-rule__label--if {
    color: #2271b1;
}

.efmpf-rule__label--then {
    color: #2a7a3b;
}

.efmpf-rule__if select,
.efmpf-rule__if input,
.efmpf-rule__then select,
.efmpf-rule__then input.efmpf-rule-then-val {
    flex: 1;
    min-width: 0;
}

.efmpf-rule__if .efmpf-ss,
.efmpf-rule__then .efmpf-ss {
    flex: 1;
    min-width: 0;
    width: auto;
    display: block;
}

/* Count bar */

.efmpf-rule-count-bar {
    background: #f0f6fc;
    border: 1px solid #c5d9ed;
    border-radius: var(--efmpf-radius);
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--efmpf-primary);
    margin-bottom: 20px;
}

.efmpf-rules-footer {
    margin-top: 10px;
}

/* ---- Add-feed tab body ----------------------------------------------------- */

.efmpf-addfeed-tab-body {
    padding-top: 20px;
}

/* ---- Field description text ----------------------------------------------- */

.efmpf-field-desc {
    font-size: 12px;
    color: var(--efmpf-muted);
    margin: 4px 0 0;
}

/* ---- Mapping "no template" notice ----------------------------------------- */

.efmpf-mapping-notice {
    margin-top: 0;
    padding: 20px 0 4px;
    font-style: italic;
}

/* ---- Schedule sub-options -------------------------------------------------- */

.efmpf-schedule-sub {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.efmpf-schedule-sub__label {
    font-size: 12px;
    font-weight: 600;
    color: var(--efmpf-text);
    white-space: nowrap;
}

.efmpf-schedule-sub__unit {
    font-size: 12px;
    color: var(--efmpf-muted);
}

.efmpf-schedule-sub__sep {
    font-size: 12px;
    color: var(--efmpf-muted);
    margin: 0 2px;
}

/* Freq select — same width as other form controls */
#efmpf-schedule-freq {
    width: 100%;
    max-width: 340px;
}

/* Weekly and monthly rows: same total width as the freq select above */
#efmpf-schedule-sub-weekday,
#efmpf-schedule-sub-monthday {
    width: 340px;
    max-width: 100%;
    flex-wrap: nowrap;
}

/* Day-of-week and day-of-month selects grow to fill available space */
#efmpf-schedule-weekday,
#efmpf-schedule-monthday {
    flex: 1;
    min-width: 0;
}

/* Time inputs in weekly/monthly rows: fixed width so they end at same X */
#efmpf-schedule-time-weekly,
#efmpf-schedule-time-monthly {
    width: 90px;
    flex-shrink: 0;
}

.efmpf-monthday-select {
    max-width: none;
}

#efmpf-format-sub-separator {
    margin-top: 6px;
    width: 100%;
    max-width: 340px;
}

#efmpf-csv-separator {
    flex: 1;
    min-width: 0;
    width: auto;
    max-width: none;
}

/* ---- Days-of-week checkboxes ---------------------------------------------- */

.efmpf-weekdays {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.efmpf-weekday-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
    color: var(--efmpf-text);
    background: #f0f0f1;
    border: 1px solid var(--efmpf-border);
    border-radius: 4px;
    padding: 3px 8px;
    cursor: pointer;
    user-select: none;
    transition: background .12s, border-color .12s;
}

.efmpf-weekday-label:has(input:checked) {
    background: #dce9f5;
    border-color: #90b4d4;
    color: var(--efmpf-primary);
}

.efmpf-weekday-label input[type="checkbox"] {
    display: none;
}

/* ---- Custom schedule (per-day) -------------------------------------------- */

.efmpf-custom-schedule-wrap {
    margin-top: 8px;
    width: 100%;
}

.efmpf-custom-schedule {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.efmpf-custom-schedule__day {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    background: var(--efmpf-bg);
    border-radius: 6px;
    flex-wrap: wrap;
}

.efmpf-custom-schedule__day.efmpf-day-disabled .efmpf-custom-times {
    opacity: 0.38;
    pointer-events: none;
}

.efmpf-weekday-label--full {
    min-width: 110px;
    flex-shrink: 0;
}

.efmpf-custom-times {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.efmpf-custom-time-remove {
    color: var(--efmpf-error);
    font-size: 16px;
    line-height: 1;
    padding: 0 2px;
    cursor: pointer;
    background: none;
    border: none;
    text-decoration: none;
}

.efmpf-custom-time-remove:hover {
    color: var(--efmpf-error);
    text-decoration: none;
}

.efmpf-custom-time-add {
    font-size: 12px;
    padding: 0;
    cursor: pointer;
    background: none;
    border: none;
    white-space: nowrap;
    color: var(--efmpf-primary);
    text-decoration: none;
}

.efmpf-custom-time-add:hover {
    color: var(--efmpf-primary-dk);
    text-decoration: underline;
}

/* ---- Settings tab --------------------------------------------------------- */

.efmpf-inline-check {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--efmpf-text);
    flex-wrap: wrap;
    cursor: pointer;
}

.efmpf-inline-check input[type="number"] {
    width: 64px;
}

.efmpf-utm-fields {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 420px;
}

.efmpf-utm-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.efmpf-utm-label {
    flex: 0 0 110px;
    font-size: 12px;
    font-weight: 600;
    color: var(--efmpf-muted);
    font-family: monospace;
}

.efmpf-utm-row input[type="text"] {
    flex: 1;
}

/* ---- Custom Searchable Select (mapping table) ------------------------------ */

/* Keep native <select> in the DOM but invisible so jQuery can still read/set it */
.efmpf-ss-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
    overflow: hidden !important;
}

.efmpf-ss {
    position: relative;
    display: inline-block;
    width: 100%;
    vertical-align: middle;
    box-sizing: border-box;
}

.efmpf-ss__btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    background: #fff;
    border: 1px solid #8c8f94;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.8;
    min-height: 30px;
    white-space: nowrap;
    overflow: hidden;
    user-select: none;
    box-sizing: border-box;
}

.efmpf-ss__btn:hover,
.efmpf-ss--open .efmpf-ss__btn {
    border-color: #2271b1;
    outline: none;
}

.efmpf-ss__label {
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.efmpf-ss__caret {
    flex-shrink: 0;
    margin-left: 6px;
    color: #50575e;
    font-size: 10px;
}

.efmpf-ss__panel {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    min-width: 100%;
    width: max-content;
    max-width: 320px;
    background: #fff;
    border: 1px solid #2271b1;
    border-radius: 3px;
    box-shadow: 0 3px 10px rgba(0,0,0,.15);
    z-index: 9999;
}

.efmpf-ss__search {
    display: block;
    width: 100%;
    padding: 6px 8px;
    border: none;
    border-bottom: 1px solid #dcdcde;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
}

.efmpf-ss__list {
    max-height: 220px;
    overflow-y: auto;
}

.efmpf-ss__group {
    padding: 4px 8px 2px;
    font-size: 11px;
    font-weight: 600;
    color: #50575e;
    text-transform: uppercase;
    letter-spacing: .04em;
    background: #f6f7f7;
    border-top: 1px solid #dcdcde;
    cursor: default;
}

.efmpf-ss__group:first-child {
    border-top: none;
}

.efmpf-ss__opt {
    padding: 5px 12px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.efmpf-ss__opt:hover {
    background: #f0f0f1;
}

.efmpf-ss__opt--selected {
    background: #ddeeff;
    font-weight: 500;
}

.efmpf-ss__opt--selected:hover {
    background: #cce4ff;
}

.efmpf-ss__opt--hidden,
.efmpf-ss__group--hidden {
    display: none;
}

/* ==========================================================================
   Checker tab
   ========================================================================== */

/* Not-applicable state */
.efmpf-checker-na {
    text-align: center;
    padding: 48px 24px;
    color: #50575e;
}
.efmpf-checker-na svg {
    display: block;
    margin: 0 auto 12px;
    width: 36px;
    height: 36px;
    color: #c3c4c7;
}
.efmpf-checker-na p {
    margin: 4px 0;
    font-size: 13px;
}

/* Run-check row */
.efmpf-checker-run-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 14px 0 0;
}
.efmpf-checker-run-status {
    font-size: 13px;
    color: #6b7280;
}
.efmpf-checker-run-status.is-loading::before {
    content: '';
    display: inline-block;
    width: 11px;
    height: 11px;
    border: 2px solid #c3c4c7;
    border-top-color: #2271b3;
    border-radius: 50%;
    animation: efmpf-spin 0.7s linear infinite;
    margin-right: 6px;
    vertical-align: middle;
}

/* Summary stat cards */
.efmpf-checker-stats {
    display: flex;
    gap: 10px;
    margin: 16px 0 20px;
    flex-wrap: wrap;
}
.efmpf-checker-stat {
    flex: 1;
    min-width: 80px;
    border: 1px solid #dcdcde;
    border-radius: 6px;
    padding: 14px 12px;
    text-align: center;
    background: #fafafa;
}
.efmpf-checker-stat--error   { background: #fef2f2; border-color: #fca5a5; }
.efmpf-checker-stat--warning { background: #fffbeb; border-color: #fcd34d; }
.efmpf-checker-stat--info    { background: #eff6ff; border-color: #93c5fd; }
.efmpf-checker-stat--ok      { background: #f0fdf4; border-color: #86efac; }

.efmpf-checker-stat__num {
    display: block;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.1;
}
.efmpf-checker-stat--error   .efmpf-checker-stat__num { color: #dc2626; }
.efmpf-checker-stat--warning .efmpf-checker-stat__num { color: #d97706; }
.efmpf-checker-stat--info    .efmpf-checker-stat__num { color: #2563eb; }
.efmpf-checker-stat--ok      .efmpf-checker-stat__num { color: #16a34a; }

.efmpf-checker-stat__label {
    display: block;
    font-size: 11px;
    color: #6b7280;
    margin-top: 4px;
}

/* All-clear success banner */
.efmpf-checker-success {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 6px;
    color: #16a34a;
    font-weight: 600;
    font-size: 13px;
    margin: 16px 0 4px;
}

/* Issue cards */
.efmpf-checker-issues {
    margin-top: 4px;
}
.efmpf-checker-issue {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-bottom: 7px;
    overflow: hidden;
}
.efmpf-checker-issue__hd {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    background: #f9fafb;
    user-select: none;
    -webkit-user-select: none;
}
.efmpf-checker-issue__hd:hover { background: #f3f4f6; }
.efmpf-checker-issue--error          .efmpf-checker-issue__hd { border-left: 3px solid #ef4444; }
.efmpf-checker-issue--warning        .efmpf-checker-issue__hd { border-left: 3px solid #f59e0b; }
.efmpf-checker-issue--recommendation .efmpf-checker-issue__hd { border-left: 3px solid #3b82f6; }

.efmpf-checker-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    line-height: 1;
}
.efmpf-checker-badge--error          { background: #fef2f2; color: #ef4444; border: 1.5px solid #ef4444; }
.efmpf-checker-badge--warning        { background: #fffbeb; color: #f59e0b; border: 1.5px solid #f59e0b; }
.efmpf-checker-badge--recommendation { background: #eff6ff; color: #3b82f6; border: 1.5px solid #3b82f6; }
.efmpf-checker-badge--ok             { background: #f0fdf4; color: #16a34a; border: 1.5px solid #16a34a; }
.efmpf-checker-badge--neutral        { background: #f3f4f6; color: #9ca3af; border: 1.5px solid #d1d5db; }

.efmpf-checker-issue__title {
    flex: 1;
    font-weight: 600;
    font-size: 13px;
    color: #1f2937;
}
.efmpf-checker-issue__count {
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
}
.efmpf-checker-issue__chevron {
    color: #9ca3af;
    font-size: 18px;
    line-height: 1;
    transition: transform 0.15s ease;
    font-style: normal;
}
.efmpf-checker-issue.is-open .efmpf-checker-issue__chevron { transform: rotate(90deg); }

.efmpf-checker-issue__bd {
    padding: 12px 16px 14px;
    border-top: 1px solid #e5e7eb;
    background: #fff;
}
.efmpf-checker-issue__msg {
    color: #374151;
    font-size: 13px;
    margin: 0 0 10px;
    line-height: 1.55;
}
.efmpf-checker-issue__msg code { font-size: 12px; background: #f3f4f6; padding: 1px 4px; border-radius: 3px; }
.efmpf-checker-examples {
    margin: 0;
    padding: 0;
    list-style: none;
}
.efmpf-checker-examples li {
    padding: 4px 0;
    font-size: 12px;
    color: #6b7280;
    border-bottom: 1px solid #f3f4f6;
}
.efmpf-checker-examples li:last-child { border-bottom: none; }
.efmpf-checker-examples li.efmpf-checker-more { color: #9ca3af; font-style: italic; }

/* Field-coverage table */
.efmpf-checker-fields {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}
.efmpf-checker-fields td {
    padding: 6px 10px;
    border-bottom: 1px solid #f0f0f1;
    font-size: 13px;
    vertical-align: middle;
}
.efmpf-checker-fields tr:last-child td { border-bottom: none; }
.efmpf-checker-field-status { width: 30px; }
.efmpf-checker-field-code {
    font-family: Consolas, Monaco, monospace;
    font-size: 11.5px;
    color: #50575e;
    width: 180px;
}
.efmpf-checker-field-name { font-weight: 600; color: #1f2937; width: 120px; }
.efmpf-checker-field-val  { color: #374151; font-size: 12px; }
.efmpf-checker-field-val code { font-size: 11.5px; background: #f3f4f6; padding: 1px 4px; border-radius: 3px; }
.efmpf-checker-field-note { color: #9ca3af; font-size: 11px; width: 200px; }

/* ---- License page ---------------------------------------------------------- */

.efmpf-license-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: .3px;
}

.efmpf-license-badge--success {
    background: #dcfce7;
    color: #166534;
}

.efmpf-license-badge--warning {
    background: #fef9c3;
    color: #854d0e;
}

.efmpf-license-badge--error {
    background: #fee2e2;
    color: #991b1b;
}

.efmpf-license-expires {
    font-size: 13px;
    color: var(--efmpf-muted);
}

/* ── Pro upsell overlay — used on Rules tab when Pro addon is not active ── */
.efmpf-rules-locked {
    position: relative;
    min-height: 360px;
}

.efmpf-rules-locked .efmpf-rule-count-bar,
.efmpf-rules-locked .efmpf-filter-section {
    opacity: 0.35;
    pointer-events: none;
    user-select: none;
    filter: grayscale(1);
}

.efmpf-pro-upsell-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    padding: 40px 20px;
    pointer-events: none;
}

.efmpf-pro-upsell-card {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 10px;
    padding: 32px 36px;
    max-width: 480px;
    text-align: center;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
    pointer-events: auto;
}

.efmpf-pro-upsell-card .dashicons {
    font-size: 42px;
    width: 42px;
    height: 42px;
    color: #2271b1;
    margin-bottom: 8px;
}

.efmpf-pro-upsell-card h3 {
    margin: 0 0 10px;
    font-size: 18px;
}

.efmpf-pro-upsell-card p {
    margin: 0 0 20px;
    color: #555;
    line-height: 1.5;
}

/* ── Pro upsell banner — shown above the Manage Feeds list ─────────────── */
.efmpf-pro-banner {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin: 16px 0 24px;
    padding: 20px 48px 20px 24px;
    background: linear-gradient(135deg, #f0f7ff 0%, #e6f0ff 100%);
    border: 1px solid #bcd4ff;
    border-left: 4px solid #2271b1;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.efmpf-pro-banner__dismiss {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    border: 0;
    font-size: 24px;
    line-height: 24px;
    color: #50575e;
    cursor: pointer;
    border-radius: 4px;
}

.efmpf-pro-banner__dismiss:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #1d2327;
}

.efmpf-pro-banner__icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2271b1;
    border-radius: 50%;
    color: #fff;
}

.efmpf-pro-banner__icon .dashicons {
    font-size: 26px;
    width: 26px;
    height: 26px;
}

.efmpf-pro-banner__body {
    flex: 1 1 auto;
    min-width: 0;
}

.efmpf-pro-banner__title {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
}

.efmpf-pro-banner__features {
    margin: 0;
    padding: 0;
    list-style: none;
    color: #3c434a;
    font-size: 13px;
    line-height: 1.6;
}

.efmpf-pro-banner__features li {
    margin: 0 0 2px;
}

.efmpf-pro-banner__features strong {
    color: #1d2327;
}

.efmpf-pro-banner__cta {
    flex-shrink: 0;
    align-self: center;
}


/* ============================================================================
   Responsive / mobile rules — consolidated block.

   All rules live inside @media queries. Desktop (>=783px) rendering is
   untouched. !important is used liberally because:
     - WP admin ships many heavy-specificity rules that we need to override
     - desktop rules in this file use hardcoded px widths (340px, 420px, 160px)
       that cannot be beaten by specificity alone without refactoring desktop
   ============================================================================ */

/* -- Pro upsell banner — stack vertically on tablets and phones -- */
@media (max-width: 782px) {
    .efmpf-pro-banner {
        flex-direction: column !important;
        gap: 14px !important;
        padding: 16px 44px 16px 16px !important;
    }

    .efmpf-pro-banner__icon {
        width: 40px !important;
        height: 40px !important;
    }

    .efmpf-pro-banner__icon .dashicons {
        font-size: 22px !important;
        width: 22px !important;
        height: 22px !important;
    }

    .efmpf-pro-banner__body {
        width: 100% !important;
    }

    .efmpf-pro-banner__title {
        font-size: 15px !important;
    }

    .efmpf-pro-banner__features {
        font-size: 13px !important;
    }

    .efmpf-pro-banner__cta {
        align-self: stretch !important;
        width: 100% !important;
    }

    .efmpf-pro-banner__cta .button,
    .efmpf-pro-banner__cta .button-hero {
        width: 100% !important;
        text-align: center !important;
    }
}

/* -- Primary mobile block (<= 782px — WP admin mobile breakpoint) -- */
@media (max-width: 782px) {

    /* Global: kill horizontal scroll at document level */
    .efmpf-wrap,
    .efmpf-wrap * {
        box-sizing: border-box;
    }

    .efmpf-wrap {
        padding: 0 !important;
        margin: 0 !important;
        overflow-x: hidden;
    }

    /* Page header */
    .efmpf-page-header {
        flex-wrap: wrap !important;
        gap: 8px !important;
        padding: 10px 4px !important;
    }

    .efmpf-page-header__title h1 {
        font-size: 20px !important;
        margin: 0 !important;
        line-height: 1.3 !important;
    }

    .efmpf-breadcrumb {
        font-size: 13px !important;
    }

    /* Two-column page layout (main + sidebar) to single column */
    .efmpf-page-layout {
        flex-direction: column !important;
        gap: 12px !important;
    }

    .efmpf-page-layout__main,
    .efmpf-page-layout__sidebar {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        flex: 1 1 100% !important;
    }

    .efmpf-page-layout__sidebar {
        position: static !important;
        top: auto !important;
    }

    /* Form card: full-bleed, tighter padding */
    .efmpf-add-form-card {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 12px !important;
        border-radius: 6px !important;
        box-sizing: border-box !important;
    }

    /* Tab navigation: horizontal-scroll strip */
    .efmpf-addfeed-tabs-nav,
    .efmpf-modal-tabs {
        margin: -12px -12px 0 !important;
        padding: 0 8px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        flex-wrap: nowrap !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: thin;
    }

    .efmpf-addfeed-tabs-nav .efmpf-tab-btn,
    .efmpf-modal-tabs .efmpf-tab-btn {
        flex-shrink: 0 !important;
        padding: 10px 12px !important;
        font-size: 13px !important;
    }

    /* Form fields: stack label above control */
    .efmpf-form-field {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 6px !important;
        margin-bottom: 16px !important;
    }

    .efmpf-form-field > label {
        flex: 0 0 auto !important;
        width: 100% !important;
        padding-top: 0 !important;
        margin-bottom: 0 !important;
    }

    .efmpf-form-field__control {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        flex: 1 1 100% !important;
    }

    /* Force every input/select/textarea inside the plugin wrapper to fill
       the column — kills hardcoded 340px / 420px / 160px widths. */
    .efmpf-wrap input[type="text"],
    .efmpf-wrap input[type="url"],
    .efmpf-wrap input[type="search"],
    .efmpf-wrap input[type="email"],
    .efmpf-wrap input[type="number"],
    .efmpf-wrap input[type="time"],
    .efmpf-wrap input[type="date"],
    .efmpf-wrap select,
    .efmpf-wrap textarea {
        box-sizing: border-box !important;
        max-width: 100% !important;
    }

    .efmpf-form-field__control input[type="text"],
    .efmpf-form-field__control input[type="url"],
    .efmpf-form-field__control input[type="number"],
    .efmpf-form-field__control select,
    .efmpf-form-field__control textarea,
    .efmpf-form-field__control .regular-text,
    .efmpf-form-field__control .efmpf-searchable-select {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Form action bar stacks */
    .efmpf-form-actions {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
    }

    .efmpf-form-actions .button {
        width: 100% !important;
        text-align: center !important;
        justify-content: center !important;
    }

    /* Schedule (Refresh Frequency) rows */
    #efmpf-schedule-freq,
    #efmpf-schedule-sub-time,
    #efmpf-schedule-sub-weekday,
    #efmpf-schedule-sub-monthday,
    #efmpf-format-sub-separator {
        width: 100% !important;
        max-width: 100% !important;
        flex-wrap: wrap !important;
    }

    #efmpf-schedule-weekday,
    #efmpf-schedule-monthday,
    #efmpf-csv-separator {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    #efmpf-schedule-time,
    #efmpf-schedule-time-weekly,
    #efmpf-schedule-time-monthly {
        width: auto !important;
        min-width: 90px !important;
        flex: 0 0 auto !important;
    }

    .efmpf-schedule-sub {
        flex-wrap: wrap !important;
        gap: 6px !important;
        row-gap: 6px !important;
    }

    /* Custom schedule — per-day rows */
    .efmpf-custom-schedule__day {
        flex-direction: column !important;
        align-items: stretch !important;
        padding: 10px 8px !important;
        gap: 8px !important;
    }

    .efmpf-weekday-label,
    .efmpf-weekday-label--full {
        width: 100% !important;
        min-width: 0 !important;
    }

    .efmpf-custom-times {
        width: 100% !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
    }

    .efmpf-custom-times input[type="time"] {
        flex: 1 1 auto !important;
        min-width: 90px !important;
    }

    /* UTM fields */
    .efmpf-utm-fields {
        max-width: 100% !important;
        width: 100% !important;
    }

    .efmpf-utm-row {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 4px !important;
    }

    .efmpf-utm-label {
        flex: 0 0 auto !important;
        width: 100% !important;
    }

    .efmpf-utm-row input[type="text"] {
        width: 100% !important;
        max-width: 100% !important;
    }

    .efmpf-inline-check {
        flex-wrap: wrap !important;
        gap: 6px !important;
    }

    /* Feed list toolbar */
    .efmpf-table-toolbar {
        flex-wrap: wrap !important;
        gap: 6px !important;
        align-items: stretch !important;
    }

    .efmpf-table-toolbar .button {
        flex: 1 1 auto !important;
    }

    .efmpf-btn-add-feed {
        margin-left: auto !important;
    }

    .efmpf-bulk-actions-bar {
        flex-wrap: wrap !important;
        gap: 6px !important;
        width: 100% !important;
        margin-left: 0 !important;
    }

    .efmpf-feed-list.efmpf-bulk-mode .efmpf-bulk-actions-bar {
        margin-left: 0 !important;
    }

    /* Feed list table: horizontal scroll wrapper.
       Desktop uses table-layout:fixed with per-column pixel widths that total
       well over 700px. Turn it into a scrollable block on mobile. */
    .efmpf-feed-list .wp-list-table,
    .efmpf-feed-list .efmpf-table {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .efmpf-feed-list .wp-list-table thead,
    .efmpf-feed-list .wp-list-table tbody,
    .efmpf-feed-list .wp-list-table tr {
        display: table !important;
        width: max-content !important;
        min-width: 100% !important;
        table-layout: fixed !important;
    }

    /* URL cell: keep copy + view buttons on a second line if needed */
    .efmpf-url-row {
        flex-wrap: wrap !important;
        gap: 4px !important;
    }

    .efmpf-url-input,
    .efmpf-url-input--sm {
        max-width: 100% !important;
        min-width: 120px !important;
        flex: 1 1 140px !important;
    }

    /* Empty state */
    .efmpf-empty-state {
        padding: 32px 16px !important;
    }

    .efmpf-empty-state h2 {
        font-size: 18px !important;
    }

    .efmpf-empty-state > p {
        max-width: 100% !important;
    }

    /* Mapping table: horizontal scroll wrapper */
    #efmpf-custom-mapping-table,
    .efmpf-mapping-panel #efmpf-custom-mapping-table,
    .efmpf-mapping-table {
        display: block !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        max-width: 100% !important;
    }

    .efmpf-mapping-table th,
    .efmpf-mapping-table td {
        padding: 6px 4px !important;
        font-size: 12px !important;
    }

    .efmpf-mapping-table select,
    .efmpf-mapping-table input {
        min-width: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Preview bar (above mapping table) */
    .efmpf-preview-bar,
    .efmpf-preview-bar--inline,
    .efmpf-preview-bar--panel {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
    }

    .efmpf-preview-bar__row {
        flex-wrap: wrap !important;
        gap: 6px !important;
    }

    .efmpf-preview-bar__row .regular-text,
    .efmpf-preview-bar .select2-container,
    #efmpf-preview-product,
    #efmpf-preview-product + .select2-container {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    /* Filter builder */
    .efmpf-filter-group {
        padding: 8px !important;
    }

    .efmpf-filter-group__header {
        flex-wrap: wrap !important;
        gap: 6px !important;
    }

    .efmpf-filter-group--nested {
        margin-left: 0 !important;
    }

    .efmpf-filter-group--nested > .efmpf-filter-group__children {
        padding-left: 8px !important;
    }

    .efmpf-filter-condition {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
    }

    .efmpf-filter-condition .efmpf-cond-field,
    .efmpf-filter-condition .efmpf-cond-operator,
    .efmpf-filter-condition .efmpf-cond-value,
    .efmpf-filter-condition .efmpf-ss,
    .efmpf-filter-condition select,
    .efmpf-filter-condition input {
        flex: 1 1 100% !important;
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Rule builder */
    .efmpf-rule {
        padding: 10px 8px !important;
    }

    .efmpf-rule__if,
    .efmpf-rule__then {
        flex-wrap: wrap !important;
        gap: 6px !important;
    }

    .efmpf-rule__if select,
    .efmpf-rule__if input,
    .efmpf-rule__then select,
    .efmpf-rule__then input,
    .efmpf-rule__then input.efmpf-rule-then-val,
    .efmpf-rule__if .efmpf-ss,
    .efmpf-rule__then .efmpf-ss {
        flex: 1 1 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    .efmpf-rule__label {
        width: auto !important;
        flex: 0 0 auto !important;
    }

    .efmpf-rule__header {
        flex-wrap: wrap !important;
        gap: 4px !important;
    }

    /* Edit Feed modal overlay: fill the viewport.
       Desktop rule is: position:fixed; top:32px; left:160px; right:0; bottom:0.
       On mobile the admin menu is off-canvas, so we span the full viewport
       and move the top offset to 46px (WP mobile admin-bar height). */
    .efmpf-modal-overlay {
        position: fixed !important;
        top: 46px !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: calc(100vh - 46px) !important;
        max-width: none !important;
        max-height: none !important;
        padding: 0 !important;
        margin: 0 !important;
        border-radius: 0 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        z-index: 99998 !important;
    }

    body.folded .efmpf-modal-overlay {
        left: 0 !important;
    }

    /* Inner .wrap inside the overlay should also be full-bleed */
    .efmpf-modal-overlay .wrap.efmpf-wrap {
        padding: 10px !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Feed Checker */
    .efmpf-checker-stats {
        flex-wrap: wrap !important;
        gap: 6px !important;
    }

    .efmpf-checker-stat {
        flex: 1 1 calc(50% - 6px) !important;
        min-width: 0 !important;
        padding: 10px 6px !important;
    }

    .efmpf-checker-stat__num {
        font-size: 22px !important;
    }

    .efmpf-checker-run-row {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
    }

    .efmpf-checker-run-row .button {
        width: 100% !important;
    }

    /* Searchable select dropdown stays within viewport */
    .efmpf-ss-dropdown,
    .efmpf-ss__panel {
        max-width: calc(100vw - 16px) !important;
        min-width: 0 !important;
    }

    /* Support sidebar card */
    .efmpf-support-card__header {
        flex-wrap: wrap !important;
        gap: 10px !important;
    }

    .efmpf-support-card__title {
        font-size: 15px !important;
    }

    /* Legend (mapping chips) */
    .efmpf-legend-list {
        flex-wrap: wrap !important;
        gap: 6px 10px !important;
    }

    /* Row actions dropdown — align to right edge */
    .efmpf-actions-menu {
        right: 0 !important;
        left: auto !important;
    }

    /* Pro upsell overlay (Rules tab lock) */
    .efmpf-pro-upsell-card {
        max-width: 100% !important;
        padding: 20px !important;
    }

    .efmpf-pro-upsell-card h3 {
        font-size: 16px !important;
    }

    /* Settings page form-section-divider */
    .efmpf-form-section-divider {
        font-size: 13px !important;
    }

    /* Success card (after generating) */
    .efmpf-success-card__hero {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }

    .efmpf-success-card__meta {
        flex-direction: column !important;
        gap: 8px !important;
    }

    .efmpf-success-card__actions {
        flex-direction: column !important;
        gap: 8px !important;
    }

    .efmpf-success-card__actions .button {
        width: 100% !important;
        text-align: center !important;
    }

    /* Generating (spinner) state */
    .efmpf-generating-state {
        padding: 40px 20px !important;
        max-width: 100% !important;
    }

    /* Screen nav / breadcrumb */
    .efmpf-screen-nav {
        flex-wrap: wrap !important;
        gap: 8px !important;
        margin-bottom: 14px !important;
    }

    .efmpf-screen-nav__title {
        font-size: 14px !important;
        width: 100% !important;
    }
}

/* -- Phone <= 600px: tighter typography, edge-to-edge cards -- */
@media (max-width: 600px) {
    .efmpf-page-header__title h1 {
        font-size: 18px !important;
    }

    .efmpf-add-form-card {
        padding: 10px 8px !important;
    }

    .efmpf-addfeed-tabs-nav,
    .efmpf-modal-tabs {
        margin: -10px -8px 0 !important;
    }

    .efmpf-addfeed-tabs-nav .efmpf-tab-btn,
    .efmpf-modal-tabs .efmpf-tab-btn {
        padding: 8px 10px !important;
        font-size: 13px !important;
    }

    .efmpf-filter-section {
        padding: 8px !important;
    }

    .efmpf-rule__header {
        gap: 4px !important;
    }

    .efmpf-rule-drag {
        display: none !important;
    }
}

/* -- Narrow phone <= 480px: ultra-tight layout -- */
@media (max-width: 480px) {
    .efmpf-checker-stat {
        flex: 1 1 100% !important;
    }

    .efmpf-page-header__title h1 {
        font-size: 17px !important;
    }

    .efmpf-pro-banner {
        padding: 14px 40px 14px 14px !important;
    }

    .efmpf-pro-banner__title {
        font-size: 14px !important;
    }

    .efmpf-pro-banner__features {
        font-size: 12px !important;
    }

    .efmpf-pro-banner__features li {
        line-height: 1.5 !important;
    }

    .efmpf-custom-times input[type="time"] {
        flex: 1 1 calc(50% - 6px) !important;
    }

    /* Feed list URL cell — let Copy/View wrap below */
    .efmpf-url-input,
    .efmpf-url-input--sm {
        flex: 1 1 100% !important;
    }

    /* Generate/Save button labels wrap on tiny screens */
    .efmpf-form-actions .button {
        font-size: 13px !important;
        padding: 8px 10px !important;
    }
}
