/* CartCue for WooCommerce — Admin Design System
   Brand: Deep Purple #534AB7 | Tint #EEEDFE | Text #1a1830
   --------------------------------------------------------- */

/* ---- Wrap & typography ------------------------------------------- */
.ap-wrap { max-width: 1200px; color: #1a1830; margin:3rem auto; }
.ap-back-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: #666; text-decoration: none; margin-bottom: 12px; }
.ap-back-link:hover { color: #534AB7; }

#ap-play-status-filter,
.ap-plays-toolbar__search-form input{
    border-radius: 4px;
    border-color:#c0c0c0;
}

/* ---- Page header ------------------------------------------------- */
.ap-page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 28px; gap: 16px; }
.ap-page-title { font-size: 22px; font-weight: 500; margin: 0 0 4px; display: flex; align-items: center; gap: 10px; color: #1a1830; }
.ap-logo-icon { font-size: 20px; }
.ap-play-count { font-size: 13px; font-weight: 400; color: #6b7280; background: #f1f0f8; border-radius: 20px; padding: 2px 10px; }
.ap-page-sub { font-size: 14px; color: #666; margin: 0; }

/* ---- Buttons ----------------------------------------------------- */
.ap-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; padding: 8px 16px; border-radius: 6px; cursor: pointer; border: 1px solid #d0cfe8; background: #fff; color: #1a1830; text-decoration: none; line-height: 1; }
.ap-btn:hover { border-color: #534AB7; color: #534AB7; text-decoration: none; }
.ap-btn-primary { background: #534AB7; color: #fff !important; border-color: #534AB7; }
.ap-btn-primary:hover { background: #4339a8; border-color: #4339a8; color: #fff !important; }
.ap-btn-ghost { background: transparent; border: 1.5px dashed #c5c3e0; color: #534AB7; }
.ap-btn-ghost:hover { background: #EEEDFE; border-color: #534AB7; }
.ap-btn-sm { padding: 5px 10px; font-size: 12px; }
.ap-btn-lg { padding: 10px 22px; font-size: 14px; }
.ap-btn-disabled { opacity: .5; pointer-events: none; }
.ap-icon-btn { background: none; border: none; cursor: pointer; color: #6b7280; font-size: 14px; padding: 6px 10px; min-width: 32px; min-height: 32px; border-radius: 6px; }
.ap-icon-btn:hover { color: #e53e3e; background: #fff0f0; }
.ap-btn:focus-visible,
.ap-icon-btn:focus-visible,
.ap-timing-pill:focus-visible,
.ap-status-toggle__btn:focus-visible,
.ap-action-type-card:focus-visible,
.ap-play-overflow__btn:focus-visible,
.ap-guided-stepper__item:focus-visible,
.ap-var-item:focus-visible {
	outline: 2px solid #534AB7;
	outline-offset: 2px;
}

/* ---- Upgrade bar ------------------------------------------------- */
.ap-upgrade-link { color: #534AB7; font-weight: 500; text-decoration: none; }
.ap-upgrade-link:hover { text-decoration: underline; }

/* Reports tabs */
.ap-reports-tabs { display: flex; gap: 4px; margin-bottom: 24px; border-bottom: 1px solid #e5e4f0; }
.ap-reports-tab { padding: 10px 16px; font-size: 13px; font-weight: 500; color: #666; text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.ap-reports-tab:hover { color: #534AB7; }
.ap-reports-tab.is-active { color: #534AB7; border-bottom-color: #534AB7; }

/* Pro trigger picker */
.ap-trigger-more-pro { margin: 12px 0 0; font-size: 13px; }
.ap-trigger-upsell { margin-top: 12px; padding: 12px 14px; background: #f5f3ff; border: 1px solid #e0ddf5; border-radius: 8px; font-size: 13px; }
.ap-trigger-upsell p { margin: 0; color: #444; line-height: 1.5; }

/* ---- Empty state ------------------------------------------------- */
.ap-empty-state { text-align: center; padding: 80px 40px; }
.ap-empty-icon { font-size: 48px; margin-bottom: 16px; display: block; }
.ap-empty-state h2 { font-size: 20px; font-weight: 500; margin: 0 0 10px; color: #1a1830; }
.ap-empty-state p { font-size: 14px; color: #666; max-width: 440px; margin: 0 auto 24px; line-height: 1.6; }

/* ---- Plays list -------------------------------------------------- */
.ap-plays-list { display: flex; flex-direction: column; gap: 8px; }
.ap-play-card { background: #fff; border: 1px solid #e5e4f0; border-radius: 10px; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; transition: border-color .15s; }
.ap-play-card:hover { border-color: #b8b3e0; }
.ap-play-card__left { flex: 1; min-width: 0; }
.ap-play-trigger-tag { display: inline-block; font-size: 11px; font-weight: 500; background: #EEEDFE; color: #534AB7; border-radius: 20px; padding: 2px 9px; margin-bottom: 5px; text-transform: uppercase; letter-spacing: .4px; }
.ap-play-name {
    font-size: 18px;
    font-weight: 500;
    color: #1a1830;
    text-decoration: none;
    display: block;
    margin-bottom: 1rem;
    margin-top: 1rem;
}
.ap-play-name:hover { color: #534AB7; }
.ap-play-card__right { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.ap-run-count { font-size: 12px; color: #6b7280; white-space: nowrap; }
.ap-play-actions { display: flex; gap: 12px; font-size: 12px; }
.ap-play-actions a { color: #666; text-decoration: none; }
.ap-play-actions a:hover { color: #534AB7; }
.ap-play-actions .ap-delete-form { display: inline; margin: 0; }
.ap-play-actions .ap-btn-link { background: none; border: none; padding: 0; font-size: 12px; color: #666; cursor: pointer; font-family: inherit; text-decoration: none; }
.ap-play-actions .ap-btn-link:hover { color: #e53e3e; }
.ap-delete-link:hover { color: #e53e3e !important; }
.ap-play-meta { display: flex; align-items: center; gap: 10px; margin-top: 6px; font-size: 12px; }
.ap-play-status { font-weight: 500; }
.ap-play-status--success { color: #2f855a; }
.ap-play-status--error { color: #c53030; }
.ap-play-status--skipped { color: #b7791f; }
.ap-play-status--none { color: #999; }
.ap-play-cap-badge { display: inline-block; font-size: 12px; font-weight: 600; color: #b7791f; background: #fffaf0; border: 1px solid #f6e05e; border-radius: 4px; padding: 2px 6px; }
.ap-play-cap-upgrade { font-size: 12px; margin-left: 6px; }
.ap-play-last-run { color: #6b7280; }

/* ---- Quick start checklist --------------------------------------- */
.ap-quickstart-card { background: #f8f7ff; border: 1px solid #d8d4f0; border-radius: 10px; padding: 16px 20px; margin-bottom: 20px; }
.ap-quickstart-card__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.ap-quickstart-dismiss { font-size: 12px; color: #666; text-decoration: none; }
.ap-quickstart-dismiss:hover { color: #534AB7; }
.ap-quickstart-list { margin: 0; padding: 0; list-style: none; }
.ap-quickstart-item { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 13px; }
.ap-quickstart-item.is-done { color: #666; }
.ap-quickstart-item.is-done a { pointer-events: none; color: inherit; text-decoration: line-through; }
.ap-quickstart-check { width: 18px; text-align: center; color: #534AB7; font-weight: 600; }

/* ---- Admin notice cards ------------------------------------------ */
.ap-notice-card { border-radius: 10px; padding: 14px 18px; margin-bottom: 20px; font-size: 13px; line-height: 1.5; }
.ap-notice-card--warning { background: #fffbeb; border: 1px solid #f6e05e; }
.ap-notice-card--editor { margin-top: 0; margin-bottom: 16px; }
.ap-notice-card p { margin: 6px 0 0; color: #555; }
.ap-overlap-list { margin: 8px 0 0 18px; padding: 0; }
.ap-overlap-trigger { display: inline-block; font-size: 11px; font-weight: 600; background: #EEEDFE; color: #534AB7; border-radius: 20px; padding: 1px 8px; margin-right: 6px; }

/* ---- Email preview modal ----------------------------------------- */
.ap-modal[hidden] { display: none !important; }
.ap-modal.is-open { display: block; position: fixed; inset: 0; z-index: 100100; }
.ap-modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.ap-modal__panel { position: relative; max-width: 720px; margin: 40px auto; background: #fff; border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.2); max-height: calc(100vh - 80px); display: flex; flex-direction: column; }
.ap-modal__header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid #eee; }
.ap-modal__header h2 { margin: 0; font-size: 16px; font-weight: 500; }
.ap-modal__note { margin: 10px 20px 0; }
.ap-modal__note--warn { background: #faeeda; border: 1px solid #ef9f27; border-radius: 6px; padding: 8px 12px; color: #633806; font-size: 13px; }
.ap-modal__subject { margin: 8px 20px 0; font-size: 13px; }
.ap-modal__frame-wrap { margin: 12px 20px; flex: 1; min-height: 280px; border: 1px solid #e5e4f0; border-radius: 8px; overflow: hidden; }
.ap-modal__iframe { width: 100%; height: 360px; border: 0; background: #f5f5f5; }
.ap-modal__footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid #eee; }
body.ap-modal-open { overflow: hidden; }

/* ---- Toggle switch ----------------------------------------------- */
.ap-toggle-link { display: block; }
.ap-toggle-track { display: inline-flex; width: 36px; height: 20px; border-radius: 10px; background: #d0cfe8; position: relative; border: 1.5px solid #c0bfe0; transition: background .2s; }
.ap-toggle-thumb { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: left .2s; }
.is-on .ap-toggle-track { background: #534AB7; border-color: #534AB7; }
.is-on .ap-toggle-thumb { left: 18px; }

/* ---- Recipe grid ------------------------------------------------- */
.ap-recipe-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 900px) { .ap-recipe-grid { grid-template-columns: repeat(2, 1fr); } }

.ap-type-picker {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 16px;
	margin-top: 24px;
}
.ap-type-card {
	background: #fff;
	display: block;
	border: 1px solid #e5e5ef;
	border-radius: 12px;
	padding: 24px 20px;
	cursor: pointer;
	text-decoration: none;
	color: inherit;
	transition: border-color 0.15s, box-shadow 0.15s;
	position: relative;
}
.ap-type-card:hover {
	border-color: #2271b1;
	box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.08);
	text-decoration: none;
}
.ap-type-card--locked {
	opacity: 0.65;
	cursor: default;
	pointer-events: none;
}
.ap-type-card--locked .ap-type-card__upgrade {
	pointer-events: all;
	display: inline-block;
	margin-top: 10px;
	font-size: 12px;
	color: #2271b1;
}
.ap-type-card .ti {
	font-size: 28px;
	color: #2271b1;
	display: block;
	margin-bottom: 12px;
}
.ap-type-card__title {
	font-size: 15px;
	font-weight: 600;
	margin-bottom: 8px;
	color: #1d2327;
}
.ap-type-card p {
	font-size: 13px;
	color: #888;
	margin: 0 0 10px;
	line-height: 1.5;
}
.ap-type-card__example {
	font-size: 12px;
	color: #2271b1;
	background: #f0f6fc;
	border-radius: 6px;
	padding: 5px 10px;
	font-style: italic;
}
.ap-automation-type-badge {
	display: inline-flex;
	align-items: center;
	font-size: 11px;
	font-weight: 600;
	border-radius: 20px;
	padding: 2px 8px;
	margin-left: 8px;
	vertical-align: middle;
}
.ap-automation-type-event { background: #f0f6fc; color: #0a4b87; }
.ap-automation-type-drip { background: #edfaef; color: #0a4b1f; }
.ap-automation-type-campaign { background: #fdf6e3; color: #7a4f00; }
.ap-recipe-card { background: #fff; border: 1px solid #e5e4f0; border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 0; cursor: pointer; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s; position: relative; }
.ap-recipe-card:hover { border-color: #534AB7; box-shadow: 0 0 0 3px #EEEDFE; text-decoration: none; color: inherit; }
.ap-recipe-card--popular { border-color: #534AB7; }
.ap-recipe-popular { position: absolute; top: 12px; right: 12px; font-size: 10px; font-weight: 600; background: #534AB7; color: #fff; border-radius: 20px; padding: 2px 8px; text-transform: uppercase; letter-spacing: .5px; }
.ap-recipe-icon-wrap { width: 40px; height: 40px; background: #EEEDFE; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.ap-recipe-icon-wrap i { font-size: 20px; color: #534AB7; }
.ap-recipe-icon-wrap--blank { background: #f5f5f5; }
.ap-recipe-icon-wrap--blank i { color: #aaa; }
.ap-recipe-title { font-size: 14px; font-weight: 500; margin-bottom: 6px; color: #1a1830; }
.ap-recipe-desc { font-size: 12px; color: #666; line-height: 1.5; flex: 1; margin: 0 0 12px; }
.ap-recipe-trigger { font-size: 11px; font-weight: 500; color: #534AB7; background: #EEEDFE; border-radius: 20px; padding: 2px 9px; width: auto; display: inline-block; margin: 2px 4px 0 0; }
.ap-recipe-card--blank { border-style: dashed; border-color: #c5c3e0; }
.ap-recipe-card--blank:hover { border-style: dashed; border-color: #534AB7; }
.ap-recipe-card--blank .ap-recipe-title { color: #666; }

/* ---- Story bar --------------------------------------------------- */
.ap-story-bar { position: sticky; top: 32px; z-index: 20; background: #f7f6ff; border: 1px solid #d9d5f5; border-radius: 10px; padding: 14px 20px; margin-bottom: 24px; box-shadow: 0 5px 14px rgba(83, 74, 183, 0.04); }
.ap-story-sentence { font-size: 14px; line-height: 1.8; color: #3C3489; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ap-story-segment { font-weight: 500; color: #1a1830; border-bottom: 2px dashed #AFA9EC; padding-bottom: 1px; }
.ap-story-segment--clickable { cursor: pointer; }
.ap-story-segment--clickable:focus-visible { outline: 2px solid #534AB7; outline-offset: 2px; border-radius: 3px; }
.ap-story-segment--muted { color: #8b88c0; font-weight: 400; border-bottom-color: transparent; }
.ap-story-segment--filled { border-bottom-color: #534AB7; color: #26215C; }
.ap-story-arrow { color: #534AB7; font-size: 16px; font-weight: 500; }
.ap-story-hint { margin-top: 8px; font-size: 12px; color: #5c56a3; }
#ss-when.ap-story-segment--filled { color: #1f4db9;}
#ss-wait.ap-story-segment--filled { color: #b86318;}
#ss-then.ap-story-segment--filled { color: #0e7a4d;}

/* ---- Play name input --------------------------------------------- */
.ap-name-row { margin-bottom: 24px; }
.ap-name-input { width: 100%; font-size: 18px; font-weight: 500; padding: 10px 14px; border: 1.5px solid #e5e4f0; border-radius: 8px; color: #1a1830; background: #fff; }
.ap-name-input:focus { border-color: #534AB7; outline: none; box-shadow: 0 0 0 3px #EEEDFE; }

/* ---- Basic/advanced mode ----------------------------------------- */
.ap-mode-toggle { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -10px 0 20px; }
.ap-mode-toggle__btn { border: 1px solid #d8d6ef; background: #fff; color: #555; border-radius: 20px; font-size: 12px; padding: 6px 12px; cursor: pointer; }
.ap-mode-toggle__btn.is-active { border-color: #534AB7; color: #534AB7; background: #EEEDFE; font-weight: 600; }
.ap-mode-toggle__hint { font-size: 12px; color: #666; }
.ap-setup-checklist { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -6px 0 18px; }
.ap-setup-checklist__label { font-size: 12px; color: #666; margin-right: 4px; }
.ap-setup-checklist__item { font-size: 12px; border: 1px solid #d8d6ef; border-radius: 20px; padding: 3px 10px; color: #777; background: #fff; transition: border-color .14s ease, background-color .14s ease, color .14s ease, transform .1s ease; }
.ap-setup-checklist__item.is-done { border-color: #8dc99b; background: #e9f6ed; color: #216b35; }
.ap-setup-checklist__item.is-done { transform: translateY(-0.5px); }
.ap-setup-checklist__item.is-done::before { content: '✓ '; font-weight: 600; }

/* ---- Step panels ------------------------------------------------- */
.ap-step-panel { background: #fff; border: 1px solid #ecebf4; border-radius: 12px; padding: 24px; transition: border-color .16s ease, box-shadow .16s ease; }
.ap-step-panel:focus-within { border-color: #d2cdf1; box-shadow: 0 5px 14px rgba(83, 74, 183, 0.05); }
.ap-step-header { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 20px; }
.ap-step-num { width: 24px; height: 24px; border-radius: 999px; border: 1px solid #d8d6ef; background: #f7f7fb; color: #7c79a8; font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; }
.ap-step-num--optional { color: #9b97be; border-color: #e1dfef; }
.ap-step-label { font-size: 15px; font-weight: 500; color: #1a1830; }
.ap-optional-tag { font-size: 11px; font-weight: 400; color: #6b7280; background: #f1f0f8; border-radius: 20px; padding: 1px 8px; margin-left: 6px; }
.ap-optional-tag--common { color: #534AB7; background: #EEEDFE; }
.ap-optional-tag--advanced { color: #666; background: #f5f5f5; font-style: italic; }
.ap-step-sub { font-size: 13px; color: #5f5b78; margin-top: 2px; }
.ap-collapse-btn { margin-left: auto; font-size: 12px; color: #534AB7; background: none; border: 1px solid #c5c3e0; border-radius: 20px; padding: 4px 12px; cursor: pointer; flex-shrink: 0; }
.ap-collapse-btn:hover { background: #EEEDFE; }
.ap-advanced-body { display: block; max-height: 0; opacity: 0; overflow: hidden; transform: translateY(-3px); pointer-events: none; transition: max-height .22s ease, opacity .18s ease, transform .18s ease; }
.ap-advanced-body.is-open { max-height: 5000px; opacity: 1; transform: translateY(0); pointer-events: auto; }

/* ---- Step connector ---------------------------------------------- */
.ap-step-connector { display: flex; justify-content: center; padding: 4px 0; }
.ap-step-connector-line { display: block; width: 2px; height: 24px; background: #534AB7; opacity: .15; border-radius: 2px; }

/* ---- Trigger grid ------------------------------------------------ */
.ap-trigger-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (max-width: 800px) { .ap-trigger-grid { grid-template-columns: repeat(2, 1fr); } }
.ap-trigger-card { border: 1.5px solid #e5e4f0; border-radius: 8px; padding: 12px 14px; cursor: pointer; transition: border-color .15s; position: relative; }
.ap-trigger-card:hover { border-color: #534AB7; background: #faf9ff; }
.ap-trigger-card.is-selected { border-color: #534AB7; background: #EEEDFE; }
.ap-trigger-card:focus-within {
	border-color: #534AB7;
	box-shadow: 0 0 0 3px rgba(83, 74, 183, 0.35);
	outline: none;
}
button.ap-trigger-card.is-pro {
	display: block;
	width: 100%;
	text-align: left;
	font: inherit;
	color: inherit;
	background: #fff;
}
.ap-trigger-radio { position: absolute; opacity: 0; }
.ap-trigger-label { display: block; font-size: 13px; font-weight: 500; color: #1a1830; margin-bottom: 3px; }
.ap-trigger-desc { display: block; font-size: 11px; color: #6b7280; line-height: 1.4; }
.ap-trigger-card.is-selected .ap-trigger-label { color: #3C3489; }

/* ---- Trigger settings panel -------------------------------------- */
.ap-trigger-settings-panel { margin-top: 16px; }
.ap-tsettings-group { display: none; }
.ap-tsettings-group.is-visible { display: block; }
.ap-inline-conditions { margin-top: 18px; padding-top: 16px; border-top: 1px solid #ecebf4; }
.ap-inline-conditions__header { display: flex; align-items: flex-start; gap: 12px; }
.ap-inline-conditions__header .ap-collapse-btn { margin-left: auto; }

/* ---- Timing pills ------------------------------------------------ */
.ap-timing-pills { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ap-timing-pill { border: 1.5px solid #e5e4f0; border-radius: 20px; padding: 6px 14px; font-size: 13px; cursor: pointer; background: #fff; color: #1a1830; transition: border-color .14s ease, color .14s ease, transform .1s ease, box-shadow .14s ease; }
.ap-timing-pill:hover { border-color: #534AB7; color: #534AB7; transform: translateY(-0.5px); box-shadow: 0 2px 7px rgba(83, 74, 183, 0.08); }
.ap-timing-pill.is-selected { border-color: #534AB7; background: #EEEDFE; color: #3C3489; font-weight: 500; }
.ap-timing-custom-wrap { display: flex; align-items: center; gap: 6px; padding-left: 8px; border-left: 1px solid #e5e4f0; }

/* ---- Conditions -------------------------------------------------- */
.ap-conditions-body { display: block; margin-top: 4px; max-height: 0; opacity: 0; overflow: hidden; transform: translateY(-3px); pointer-events: none; transition: max-height .22s ease, opacity .18s ease, transform .18s ease; }
.ap-conditions-body.is-open { max-height: 5000px; opacity: 1; transform: translateY(0); pointer-events: auto; }
.ap-rule-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; background: #faf9ff; border: 1px solid #e5e4f0; border-radius: 8px; padding: 10px 12px; }
.ap-rule-row select, .ap-rule-row input { flex: 1; min-width: 0; }

/* ---- Actions ----------------------------------------------------- */
.ap-action-card { border: 1px solid #e5e4f0; border-radius: 10px; margin-bottom: 10px; overflow: hidden; transition: border-color .16s ease, box-shadow .16s ease; }
.ap-action-card:focus-within { border-color: #cfc9f0; box-shadow: 0 3px 12px rgba(83, 74, 183, 0.06); }
.ap-action-card__header { display: flex; align-items: center; gap: 8px; padding: 12px 14px; background: #faf9ff; border-bottom: 1px solid #e5e4f0; }
.ap-action-card__header select { flex: 1; }
.ap-action-fields { padding: 14px;background-color: #faf9ff;}
.ap-field-hint { margin: 6px 0 0; font-size: 12px; color: #7a769f; line-height: 1.4; }

.ap-email-advanced { margin-top: 8px; border: 1px solid #e5e4f0; border-radius: 8px; background: #faf9ff; overflow: hidden; }
.ap-email-advanced summary { cursor: pointer; padding: 10px 12px; font-size: 12px; color: #534ab7; font-weight: 500; list-style: none; }
.ap-email-advanced summary::-webkit-details-marker { display: none; }
.ap-email-advanced summary::before { content: '\25B6'; margin-right: 8px; font-size: 10px; opacity: .8; }
.ap-email-advanced[open] summary::before { content: '\25BC'; }
.ap-email-advanced__body { padding: 0 12px 10px; border-top: 1px solid #ecebf4; }

/* ---- Form fields ------------------------------------------------- */
.ap-field-row { margin-bottom: 14px; }
.ap-field-row:last-child { margin-bottom: 0; }
.ap-field-label { display: block; font-size: 12px; font-weight: 500; color: #555; margin-bottom: 5px; text-transform: uppercase; letter-spacing: .4px; }
.ap-input { width: 100%; max-width: 520px; padding: 7px 10px; border: 1px solid #d8d6ef; border-radius: 6px; font-size: 13px; color: #1a1830; background: #fff; }
.ap-input:focus { border-color: #534AB7; outline: none; box-shadow: 0 0 0 3px #EEEDFE; }
.ap-input--tiny { width: 64px; text-align: center; }
.ap-select { padding: 7px 10px; border: 1px solid #d8d6ef; border-radius: 6px; font-size: 13px; color: #1a1830; background: #fff; }
.ap-select:focus { border-color: #534AB7; outline: none; }
.ap-select--sm { padding: 5px 8px; font-size: 12px; }
.ap-textarea { width: 100%; max-width: 600px; padding: 8px 10px; border: 1px solid #d8d6ef; border-radius: 6px; font-size: 13px; color: #1a1830; background: #fff; font-family: inherit; line-height: 1.5; resize: vertical; }
.ap-textarea:focus { border-color: #534AB7; outline: none; box-shadow: 0 0 0 3px #EEEDFE; }

/* ---- Variables panel --------------------------------------------- */
.ap-vars-panel { margin-top: 20px; border: 1px solid #e5e4f0; border-radius: 10px; overflow: hidden; }
.ap-vars-summary { font-size: 13px; font-weight: 500; color: #534AB7; cursor: pointer; padding: 12px 16px; background: #faf9ff; list-style: none; }
.ap-vars-summary::-webkit-details-marker { display: none; }
.ap-vars-summary::before { content: '▶ '; font-size: 10px; }
details[open] .ap-vars-summary::before { content: '▼ '; }
.ap-vars-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; padding: 14px 16px; }
.ap-var-item { display: flex; align-items: baseline; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.ap-var-item:hover { background: #EEEDFE; }
.ap-var-item { width: 100%; border: none; background: transparent; text-align: left; font-family: inherit; }
.ap-var-token { background: #534AB7; color: #fff; padding: 2px 6px; border-radius: 4px; font-size: 11px; font-family: monospace; white-space: nowrap; flex-shrink: 0; }
.ap-var-desc { font-size: 12px; color: #666; }

/* ---- Save row ---------------------------------------------------- */
.ap-save-row { display: flex; align-items: center; justify-content: space-between; margin-top: 24px; padding: 14px 0 10px; border-top: 1px solid #e5e4f0; position: sticky; bottom: 0; background: linear-gradient(180deg, rgba(255,255,255,0.92) 0%, #fff 30%); z-index: 12; backdrop-filter: blur(2px); }
.ap-save-status-wrap label { font-size: 13px; color: #555; }

/* ---- Logs -------------------------------------------------------- */
.ap-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.ap-badge--success { background: #EAF3DE; color: #3B6D11; }
.ap-badge--skipped { background: #F1EFE8; color: #5F5E5A; }
.ap-badge--error   { background: #FCE8E8; color: #9B2929; }

/* ---- Reports: stat cards ----------------------------------------- */
.ap-stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
@media (max-width: 900px) { .ap-stats-grid { grid-template-columns: repeat(2, 1fr); } }
.ap-stat-card { background: #fff; border: 1px solid #e5e4f0; border-radius: 10px; padding: 20px; }
.ap-stat-card__val { font-size: 30px; font-weight: 600; color: #534AB7; line-height: 1; margin-bottom: 6px; }
.ap-stat-card__lbl { font-size: 12px; color: #666; }
.ap-stat-card--warn .ap-stat-card__val { color: #c0392b; }
.ap-stat-card--ok   .ap-stat-card__val { color: #2e7d32; }

.ap-reports-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
@media (max-width: 800px) { .ap-reports-cols { grid-template-columns: 1fr; } }

/* ---- Card (generic) --------------------------------------------- */
.ap-card { background: #fff; border: 1px solid #e5e4f0; border-radius: 10px; overflow: hidden; }
.ap-card__header { padding: 12px 18px; font-size: 14px; font-weight: 500; border-bottom: 1px solid #e5e4f0; color: #1a1830; background: #faf9ff; }
h2.ap-card__header { margin: 0; line-height: 1.4; }
.ap-card__body { padding: 16px 18px; }

/* ============================================================
   v1.3 additions
   ============================================================ */

/* ---- Play editor header (name + test button) */
.ap-play-editor-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; gap:12px; flex-wrap:wrap; }
.ap-play-editor-header__actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-left:auto; }
.ap-test-to-input { width:200px; max-width:100%; font-size:13px; padding:6px 10px; }

/* ---- Test Play button */
.ap-btn-test { background:#fff; border:1.5px solid #534AB7; color:#534AB7; }
.ap-btn-test:hover { background:#EEEDFE; }

.ap-test-result { border-radius:8px; padding:12px 16px; font-size:13px; margin-bottom:16px; }
.ap-test-result--success { background:#EAF3DE; color:#3B6D11; border:1px solid #c3e0a0; }
.ap-test-result--error   { background:#FCE8E8; color:#9B2929; border:1px solid #f0bbbb; }
.ap-test-toast { border-radius:8px; padding:10px 14px; font-size:13px; margin-bottom:16px; background:#EEEDFE; color:#3B3480; border:1px solid #c8c4ef; }
.ap-test-toast--visible { display:block !important; }
.ap-never-fired-badge { display:inline-flex; align-items:center; padding:4px 10px; border-radius:999px; font-size:11px; font-weight:600; letter-spacing:0.03em; text-transform:uppercase; background:#FEF3C7; color:#92400E; border:1px solid #FCD34D; }
.ap-skip-diagnostics { border:1px solid #e5e7eb; border-radius:8px; padding:14px 16px; margin-bottom:16px; background:#fafafa; }
.ap-skip-diagnostics__header { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:10px; font-size:13px; }
.ap-skip-diagnostics__header a { font-size:12px; text-decoration:none; }
.ap-skip-diagnostics__list { margin:0; padding:0; list-style:none; }
.ap-skip-diagnostics__list li { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; padding:8px 0; border-top:1px solid #ececec; font-size:13px; }
.ap-skip-diagnostics__list li:first-child { border-top:0; padding-top:0; }
.ap-skip-diagnostics__reason { color:#374151; }
.ap-skip-diagnostics__meta { color:#6b7280; font-size:12px; white-space:nowrap; }

/* ---- Re-verify checkbox */
.ap-recheck-row { background:#faf9ff; border:1px solid #e5e4f0; border-radius:8px; padding:12px 14px; margin-top:12px; }
.ap-recheck-label { display:flex; flex-direction:column; gap:4px; cursor:pointer; }
.ap-recheck-label input { align-self:flex-start; }
.ap-recheck-hint { font-size:12px; color:#888; line-height:1.4; }

/* ---- Ghost trigger styles */
.ap-trigger-card.is-pro { position:relative; cursor:pointer; }
.ap-trigger-card.is-pro:hover { border-color:#534AB7; background:#faf9ff; transform:translateY(-1px); box-shadow:0 2px 8px rgba(83,74,183,.12); }
.ap-trigger-learn { display:block; font-size:10px; font-weight:500; color:#534AB7; margin-top:6px; }
.ap-trigger-grid-divider { display:flex; align-items:center; gap:12px; margin:16px 0 10px; color:#888; font-size:11px; font-weight:500; text-transform:uppercase; letter-spacing:.4px; }
.ap-trigger-grid-divider::before, .ap-trigger-grid-divider::after { content:''; flex:1; height:1px; background:#e5e4f0; }
.ap-trigger-grid-divider span { white-space:nowrap; }
.ap-pro-badge { position:absolute; top:8px; right:8px; font-size:10px; font-weight:600; background:#534AB7; color:#fff; border-radius:20px; padding:2px 7px; text-transform:uppercase; letter-spacing:.4px; }
.ap-timing-custom-panel { display:block; margin-top:12px; padding:12px 0 0; border-top:1px solid #e5e4f0; max-height:0; opacity:0; overflow:hidden; transform:translateY(-4px); pointer-events:none; transition:max-height .25s ease, opacity .2s ease, transform .2s ease; }
.ap-timing-custom-panel.is-open { max-height:420px; opacity:1; transform:translateY(0); pointer-events:auto; }
.ap-timing-custom-presets { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:10px; }
.ap-timing-pill.is-pro-locked { opacity:.65; cursor:not-allowed; border-style:dashed; }
.ap-timing-pill.is-pro-locked .ap-pro-badge { position:static; display:inline-block; margin-left:4px; vertical-align:middle; }
.ap-rules-empty { font-size:13px; color:#666; background:#faf9ff; border:1px dashed #e5e4f0; border-radius:8px; padding:12px 14px; margin:0 0 10px; display:flex; align-items:center; gap:8px; }
.ap-rules-empty::before { content:'💡'; font-size:14px; line-height:1; }
.ap-var-item--pro { opacity:.85; }
.ap-var-pro-note { font-size:11px; color:#534AB7; font-style:normal; }
.ap-pro-reminder--inline { margin:0 0 20px; }
.ap-ghost-gate { margin-top:16px; }
.ap-action-pro-upsell { margin-top:12px; padding:14px 16px; background:#faf9ff; border:1px dashed #c5c3e0; border-radius:8px; }
.ap-action-pro-upsell__title { margin:0 0 8px; font-size:13px; font-weight:600; color:#1a1830; }
.ap-action-pro-upsell__list { margin:0 0 12px 18px; padding:0; font-size:12px; color:#555; }
.ap-action-pro-upsell__list li { margin-bottom:4px; }
.ap-pro-gate { background:#faf9ff; border:1.5px dashed #c5c3e0; border-radius:10px; padding:24px; text-align:center; }
.ap-pro-gate__icon { font-size:28px; margin-bottom:10px; }
.ap-pro-gate__title { font-size:15px; font-weight:500; color:#1a1830; margin-bottom:8px; }
.ap-pro-gate__desc { font-size:13px; color:#666; line-height:1.5; margin-bottom:16px; }
.ap-action-inserter-progate { padding:16px; }

/* ---- Frequency pills */
.ap-freq-pills { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 16px; }
.ap-freq-pill { border: 1.5px solid #e5e4f0; border-radius: 20px; padding: 6px 14px; font-size: 13px; cursor: pointer; background: #fff; color: #1a1830; display: inline-flex; align-items: center; gap: 6px; }
.ap-freq-pill:hover { border-color: #534ab7; }
.ap-freq-pill.is-selected { border-color: #534AB7; background: #EEEDFE; color: #3C3489; font-weight: 500; }

/* ---- Subsection label inside collapsed section */
.ap-subsection-label { font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.5px; color:#534AB7; margin-bottom:10px; }

/* ---- Story bar update: includes 'When' label */
.ap-story-label { font-size:12px; font-weight:600; text-transform:uppercase; letter-spacing:.5px; color:#534AB7; padding-right:6px; }

/* ---- Revenue headline card */
.ap-revenue-headline { background:linear-gradient(135deg,#EEEDFE 0%,#fff 100%); border:1.5px solid #c5c3e0; border-radius:10px; padding:20px 24px; display:flex; align-items:center; gap:16px; margin-bottom:20px; }
.ap-revenue-headline__emoji { font-size:36px; flex-shrink:0; }
.ap-revenue-headline__num { font-size:28px; font-weight:600; color:#534AB7; line-height:1; }
.ap-revenue-headline__lbl { font-size:13px; color:#666; margin-top:4px; }

/* ============================================================
   v1.4 additions
   ============================================================ */

/* ---- Payment failed trigger: warning accent on trigger card */
.ap-trigger-card[data-slug="payment_failed"] .ap-trigger-label::after {
	content: ' ';
}

/* ---- New variable highlight: payment_url stands out */
.ap-var-item[data-token="{{order.payment_url}}"] .ap-var-token {
	background: #854F0B;
}

.ap-mail-delivery-status {
	margin: 12px 0;
	padding: 10px 14px;
	border-radius: 6px;
	border-left: 4px solid #c3c4c7;
	background: #f6f7f7;
}
.ap-mail-status--ok {
	border-left-color: #00a32a;
	background: #edfaef;
}
.ap-mail-status--fail {
	border-left-color: #d63638;
	background: #fcf0f1;
}
.ap-var-item[data-token="{{order.tracking_link}}"] .ap-var-token,
.ap-var-item[data-token="{{order.cross_sells}}"] .ap-var-token,
.ap-var-item[data-token="{{order.related_products}}"] .ap-var-token {
	background: #1d4ed8;
	color: #fff;
}

/* ---- Low-star review: amber accent */
.ap-var-item[data-token="{{review.rating}}"] .ap-var-token,
.ap-var-item[data-token="{{review.content}}"] .ap-var-token {
	background: #BA7517;
}

/* ---- Recipe card: popular badge for payment_failed recipe */
.ap-recipe-card--popular .ap-recipe-icon-wrap {
	background: #EEEDFE;
}

/* ============================================================
   v1.5 — Play editor: sequence UX & flow clarity
   ============================================================ */

.ap-step-sub--tight { margin: 0; max-width: 640px; line-height: 1.45; }

.ap-seq-help { margin: 0 0 16px; border: 1px solid #e5e4f0; border-radius: 8px; background: #faf9ff; overflow: hidden; }
.ap-seq-help__summary { cursor: pointer; padding: 10px 14px; font-size: 12px; font-weight: 500; color: #534AB7; list-style: none; }
.ap-seq-help__summary::-webkit-details-marker { display: none; }
.ap-seq-help__summary::before { content: '\25B6  '; font-size: 9px; opacity: 0.7; }
.ap-seq-help[open] .ap-seq-help__summary::before { content: '\25BC  '; }
.ap-seq-help__body { padding: 0 14px 12px; font-size: 12px; color: #666; line-height: 1.55; border-top: 1px solid #e8e6f4; }

.ap-step-panel--sequence-active { border-color: #AFA9EC; box-shadow: 0 0 0 1px rgba(83, 74, 183, 0.12); }

.ap-step-panel--library-mode { border-left: 4px solid #534AB7; padding-left: 20px; margin-left: 0; }
.is-focus-target { box-shadow: 0 0 0 2px rgba(83, 74, 183, 0.2); transition: box-shadow 0.2s ease; }

.ap-seq-step-details { border: 1px solid #e5e4f0; border-radius: 12px; background: #fff; margin-bottom: 0; }
.ap-seq-step-details > summary { list-style: none; cursor: pointer; padding: 16px 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ap-seq-step-details > summary::-webkit-details-marker { display: none; }
.ap-seq-step-details > summary::before { content: '\25B6'; font-size: 10px; color: #534AB7; margin-right: 4px; transition: transform .15s; }
.ap-seq-step-details[open] > summary::before { transform: rotate(90deg); }
.ap-seq-toggle-title { font-size: 15px; font-weight: 500; color: #1a1830; }
.ap-seq-toggle-hint { font-size: 12px; color: #666; flex: 1 1 100%; padding-left: 44px; margin-top: -4px; }
.ap-seq-step-body { padding: 0 20px 20px; border-top: 1px solid #e8e6f4; }
.ap-pro-gate--sequence { margin-top: 8px; }
.ap-pro-gate--branch { margin-top: 12px; text-align: left; }
.ap-pro-gate--birthday {
	background: linear-gradient(135deg, #fff8e8 0%, #faf9ff 55%, #fff 100%);
	border: 1.5px solid #e8c96a;
	border-radius: 14px;
	padding: 28px 24px;
	text-align: center;
	box-shadow: 0 8px 24px rgba(232, 201, 106, 0.18);
}
.ap-pro-gate--birthday .ap-pro-gate__stat {
	display: inline-block;
	margin-bottom: 10px;
	padding: 4px 12px;
	border-radius: 999px;
	background: #fff3cd;
	color: #854f0b;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.02em;
}
.ap-pro-gate--birthday .ap-pro-gate__icon--birthday {
	font-size: 40px;
	line-height: 1;
	margin-bottom: 8px;
}
.ap-trigger-featured-pro { margin-top: 18px; }
.ap-trigger-grid--featured { margin-top: 8px; }
.ap-trigger-card--featured,
.ap-trigger-card--birthday {
	border-color: #e8c96a;
	background: linear-gradient(180deg, #fffdf6 0%, #fff 100%);
}
.ap-trigger-card--birthday:hover,
.ap-trigger-card--birthday.is-selected {
	border-color: #d4a017;
	box-shadow: 0 4px 16px rgba(212, 160, 23, 0.16);
}
.ap-trigger-stat {
	display: inline-block;
	margin-bottom: 6px;
	padding: 2px 8px;
	border-radius: 999px;
	background: #fff3cd;
	color: #854f0b;
	font-size: 11px;
	font-weight: 600;
}
.ap-field-row--locked { opacity: 0.72; }
.ap-field-row--locked .ap-field-label { color: #888; }
.ap-pro-lock {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 12px;
	font-weight: 500;
	color: #534AB7;
	background: #EEEDFE;
	border: 0.5px solid #d6d1f8;
	border-radius: 6px;
	padding: 7px 10px;
}
.ap-pro-lock i { font-size: 12px; }
.ap-sequence-builder { margin-top: 4px; }
.ap-seq-empty { margin: 0 0 8px; display:flex; align-items:center; gap:8px; color:#6f699f; background:#faf9ff; border:1px dashed #e5e4f0; border-radius:8px; padding:10px 12px; }
.ap-seq-empty::before { content:'✨'; font-size:14px; line-height:1; }
.ap-basic-followup-cta { display: none; margin-top: 8px; }
#ap-play-form.ap-editor-mode-basic .ap-basic-followup-cta { display: inline-flex; }
#ap-play-form.ap-editor-mode-basic #ap-step-5-sequence { display: none; }
#ap-play-form.ap-editor-mode-basic.ap-show-sequence-in-basic #ap-step-5-sequence { display: block; }
#ap-play-form.ap-editor-mode-basic.ap-show-sequence-in-basic .ap-basic-followup-cta { display: none; }

.ap-sequence-step { margin-bottom: 12px; border: 1px solid #e5e4f0; border-radius: 10px; overflow: hidden; }
.ap-seq-step__body { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.ap-seq-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ap-seq-line--action .ap-select.ap-seq-action { flex: 1; min-width: 180px; max-width: 100%; }
.ap-seq-line--wait .ap-seq-delay { max-width: 72px; }
.ap-seq-badge { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; background: #EEEDFE; color: #534AB7; border-radius: 20px; padding: 2px 10px; flex-shrink: 0; }
.ap-seq-muted { font-size: 12px; color: #666; flex-shrink: 0; }

@media (max-width: 600px) {
	.ap-seq-line--wait { align-items: flex-start; }
}

/* ============================================================
   v1.6 — Integration cards
   ============================================================ */

.ap-integrations-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	gap: 16px;
}

.ap-int-card {
	background: #fff;
	border: 1px solid #e5e4f0;
	border-radius: 12px;
	overflow: hidden;
	transition: border-color .15s;
}

.ap-int-card--active {
	border-color: #b8b3e0;
}

.ap-int-card__header {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 16px 18px;
	border-bottom: 1px solid #f0eff8;
}

.ap-int-icon {
	width: 40px;
	height: 40px;
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.ap-int-icon i { font-size: 20px; }

.ap-int-icon--purple { background: #EEEDFE; color: #534AB7; }
.ap-int-icon--yellow { background: #FEF9E7; color: #C8A415; }
.ap-int-icon--blue   { background: #E8F4FD; color: #1A6FA8; }
.ap-int-icon--green  { background: #E4F5EC; color: #166534; }
.ap-int-icon--pink   { background: #FDE8F0; color: #9D174D; }

.ap-int-icon--purple i { color: #534AB7; }
.ap-int-icon--yellow i { color: #C8A415; }
.ap-int-icon--blue   i { color: #1A6FA8; }

.ap-int-name { font-size: 14px; font-weight: 500; color: #1a1830; }
.ap-int-desc { font-size: 12px; color: #888; margin-top: 2px; }

.ap-int-status { margin-left: auto; flex-shrink: 0; }

.ap-badge--off { background: #f1f0f8; color: #6b7280; }

.ap-int-card__body { padding: 16px 18px; }

.ap-int-detail {
	font-size: 13px;
	color: #555;
	line-height: 1.5;
	margin-bottom: 10px;
}

.ap-int-actions {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.ap-int-actions li {
	font-size: 12px;
	color: #534AB7;
	padding: 4px 0;
	padding-left: 16px;
	position: relative;
}

.ap-int-actions li::before {
	content: '✓';
	position: absolute;
	left: 0;
	color: #534AB7;
	font-weight: 500;
}

.ap-int-form { margin-top: 4px; }

.ap-int-key-row {
	display: flex;
	gap: 8px;
	align-items: center;
	flex-wrap: wrap;
}

.ap-input--key {
	flex: 1;
	min-width: 200px;
	font-family: monospace;
	font-size: 12px;
}

/* ============================================================
   v1.7 additions
   ============================================================ */

/* Campaign page */
.ap-segment-preview { background:#EEEDFE; border-radius:8px; padding:10px 14px; font-size:13px; color:#534AB7; font-weight:500; margin-bottom:4px; }

/* Queue page */
.ap-queue-table { font-size:12px; }
.ap-queue-table .ap-cancel-btn { color:#c0392b; cursor:pointer; border:0; background:none; padding:0; text-decoration:underline; }

.ap-field-row { position: relative; }
.ap-async-menu {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	z-index: 30;
	max-height: 220px;
	overflow: auto;
	padding: 6px;
	border: 1px solid #dcdcde;
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.ap-async-menu__item {
	display: block;
	width: 100%;
	margin: 0;
	padding: 7px 8px;
	border: 0;
	border-radius: 6px;
	background: transparent;
	text-align: left;
	cursor: pointer;
}
.ap-async-menu__item:hover {
	background: #f5f6ff;
}
.ap-async-picked {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 6px;
}
.ap-async-picked__item {
	display: inline-block;
	padding: 3px 8px;
	border-radius: 999px;
	background: #eef1ff;
	color: #2f3a8f;
	font-size: 12px;
	line-height: 1.4;
}

/* Smart timing day selector */
.ap-day-pills { display:flex; gap:4px; flex-wrap:wrap; margin-top:6px; }
.ap-day-pill { padding:4px 10px; border:1px solid #e0dff0; border-radius:20px; font-size:11px; font-weight:500; cursor:pointer; user-select:none; }
.ap-day-pill.is-on { background:#534AB7; color:#fff; border-color:#534AB7; }
.ap-time-row { display:flex; gap:8px; align-items:center; margin-top:8px; }

/* Preview email btn */
.ap-plays-toolbar,
.ap-import-form,
.ap-logs-filter {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 0 0 16px;
}

.ap-plays-search { min-width: 220px; }

.ap-import-file-input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	overflow: hidden;
}

.ap-import-form label.ap-btn { position: relative; cursor: pointer; }

.ap-logs-table { margin-top: 10px; }

.ap-logs-empty,
.ap-log-detail { font-size: 12px; color: #666; }

.cb-history-group { display: flex; gap: 4px; margin-left: auto; }

.cb-vars-fallback-hint {
	font-size: 11px;
	color: #888;
	margin-bottom: 8px;
	line-height: 1.4;
}
.ap-preview-btn { background:#fff; border:1.5px solid #534AB7; color:#534AB7; margin-right:8px; }
.ap-preview-btn:hover { background:#EEEDFE; }

/* ============================================================
   Free plan / Pro upgrade UI (added for WP.org free release)
   ============================================================ */

/* Upgrade bar on plays list (at limit) */
.ap-upgrade-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	background: linear-gradient(135deg, #EEEDFE 0%, #f5f3ff 100%);
	border: 1px solid #c5c3e0;
	border-radius: 10px;
	padding: 14px 18px;
	margin-bottom: 16px;
}
.ap-upgrade-bar__left { display: flex; flex-direction: column; gap: 3px; }
.ap-upgrade-bar__left strong { font-size: 13px; color: #1a1830; }
.ap-upgrade-bar__left span { font-size: 12px; color: #666; }
.ap-btn-sm { padding: 6px 14px; font-size: 12px; }

/* Ghost trigger Pro badge */
.ap-pro-badge {
	position: absolute;
	top: 8px;
	right: 8px;
	font-size: 10px;
	font-weight: 600;
	background: #534AB7;
	color: #fff;
	border-radius: 20px;
	padding: 2px 7px;
	text-transform: uppercase;
	letter-spacing: .4px;
}

/* Pro upgrade reminder bar in play editor */
.ap-pro-reminder {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	background: #faf9ff;
	border: 1.5px dashed #c5c3e0;
	border-radius: 10px;
	padding: 14px 18px;
	margin: 16px 0 24px;
}
.ap-pro-reminder__text { font-size: 13px; color: #555; line-height: 1.5; }
.ap-pro-reminder__text strong { display: block; color: #1a1830; margin-bottom: 3px; }
.ap-btn-pro {
	flex-shrink: 0;
	background: #534AB7;
	color: #fff;
	border: none;
	border-radius: 6px;
	padding: 8px 16px;
	font-size: 13px;
	font-weight: 500;
	text-decoration: none;
	white-space: nowrap;
}
.ap-btn-pro:hover { background: #433ba0; color: #fff; }

/* Pro gate inside ghost trigger */
.ap-pro-gate {
	background: #faf9ff;
	border: 1.5px dashed #c5c3e0;
	border-radius: 10px;
	padding: 24px;
	text-align: center;
}
.ap-pro-gate__icon { font-size: 28px; margin-bottom: 10px; }
.ap-pro-gate__title { font-size: 15px; font-weight: 500; color: #1a1830; margin-bottom: 8px; }
.ap-pro-gate__desc { font-size: 13px; color: #666; line-height: 1.5; margin-bottom: 16px; }

/* Pro features showcase grid (settings page) */
.ap-pro-features-showcase { border-color: #534AB7 !important; margin-top: 24px; }
.ap-pro-features-showcase .ap-card__header {
	background: linear-gradient(135deg, #534AB7, #6e62d4);
	color: #fff;
}
.ap-pro-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 16px;
}
.ap-pro-feature { display: flex; gap: 12px; align-items: flex-start; }
.ap-pro-feature__icon { font-size: 20px; flex-shrink: 0; width: 26px; text-align: center; }
.ap-pro-feature strong { display: block; font-size: 13px; color: #1a1830; margin-bottom: 2px; }
.ap-pro-feature p { margin: 0; font-size: 12px; color: #666; line-height: 1.4; }
.ap-pro-cta-row { margin-top: 20px; text-align: center; }
.ap-btn-lg { padding: 12px 28px; font-size: 14px; }

.ap-draft-toast {
	position: fixed;
	bottom: 24px;
	right: 24px;
	z-index: 100001;
	background: #1a1830;
	color: #fff;
	padding: 10px 16px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 500;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
	opacity: 0;
	transform: translateY(8px);
	transition: opacity .2s ease, transform .2s ease;
	pointer-events: none;
}
.ap-draft-toast.is-visible {
	opacity: 1;
	transform: translateY(0);
}

.ap-wrap--play-editor { max-width: 1320px; }
.ap-play-editor-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	gap: 24px;
	align-items: start;
}
.ap-play-editor-main { min-width: 0; }

/* ---- UX refresh (automations editor & list) ---- */
.ap-story-hero {
	background: #fbfbfb;
	border: 1px solid #dcdcde;
	border-radius: 8px;
	padding: 24px 16px;
	margin-bottom: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
	position: sticky;
	top: 32px;
	z-index: 100;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
	align-self: start;
	width: 100%;
	max-height: calc(100vh - 48px);
	overflow-y: auto;
}
.ap-story-flow {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	width: 100%;
	max-width: none;
}
.ap-story-step {
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
}
.ap-story-step--last .ap-story-connector { display: none; }
.ap-story-card {
	appearance: none;
	width: 100%;
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 4px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 12px;
	padding: 12px;
	text-align: left;
	cursor: pointer;
	line-height: 1.4;
	font: inherit;
	color: inherit;
}
.ap-story-card:focus-visible {
	outline: none;
	box-shadow: 0 0 0 1px #fbfbfb, 0 0 0 calc(2px + 1px) #534AB7, 0 1px 2px rgba(0, 0, 0, 0.05);
}
.ap-story-card:hover {
	border-color: #c3c4c7;
}
.ap-story-card__icon {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
.ap-story-card__icon svg {
	width: 20px;
	height: 20px;
	fill: currentColor;
}
.ap-story-card__icon--trigger { background: #e8f0fe; color: #1f4db9; }
.ap-story-card__icon--timing { background: #fef3e8; color: #b86318; }
.ap-story-card__icon--action { background: #e8f5ef; color: #0e7a4d; }
.ap-story-card__body {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}
.ap-story-card__title {
	font-size: 12px;
	color: #787c82;
	line-height: 1.3;
}
.ap-story-card__text {
	font-size: 14px;
	font-weight: 600;
	color: #1a1830;
	line-height: 1.4;
	word-break: break-word;
}
.ap-story-segment--muted .ap-story-card__text {
	color: #8b88c0;
	font-weight: 500;
}
#ss-when.ap-story-segment--filled .ap-story-card__text { color: #1f4db9; }
#ss-wait.ap-story-segment--filled .ap-story-card__text { color: #b86318; }
#ss-then.ap-story-segment--filled .ap-story-card__text { color: #0e7a4d; }
.ap-story-connector {
	width: 2px;
	height: 24px;
	background: #dcdcde;
	margin: 4px 0;
	flex-shrink: 0;
}
.ap-story-revenue {
	background: #ecfdf5;
	border: 1px solid #a7f3d0;
	color: #047857;
	padding: 6px 14px;
	border-radius: 20px;
	font-size: 13px;
	font-weight: 600;
	white-space: normal;
	text-align: center;
}
@media (max-width: 960px) {
	.ap-play-editor-layout {
		grid-template-columns: 1fr;
	}
	.ap-story-hero {
		position: static;
		max-height: none;
		order: -1;
		margin-bottom: 20px;
	}
}
.ap-play-revenue { font-size: 22px; font-weight: 700; color: #059669; line-height: 1.2; text-align: right; }
.ap-play-revenue__label { font-size: 11px; font-weight: 400; color: #6b7280; display: block; text-transform: uppercase; letter-spacing: 0.06em; }
.ap-play-revenue--zero { font-size: 13px; color: #6b7280; font-style: italic; font-weight: 400; }
.ap-play-last-sent { font-size: 12px; color: #6b7280; margin-top: 4px; text-align: right; }
.ap-play-last-sent--waiting { color: #d97706; font-style: italic; }
.ap-overlap-badge {
	display: inline-flex; align-items: center; gap: 4px; background: #fef3c7; color: #92400e;
	border: 1px solid #fcd34d; border-radius: 999px; font-size: 11px; font-weight: 600; padding: 2px 8px; margin-top: 4px; cursor: help;
}
.ap-play-overflow { position: relative; display: inline-block; }
.ap-play-overflow__btn {
	background: none; border: none; cursor: pointer; padding: 4px 8px; font-size: 18px;
	color: #6b7280; border-radius: 4px; line-height: 1;
}
.ap-play-overflow__btn { min-width: 32px; min-height: 32px; }
.ap-play-overflow__btn:hover { background: #f3f4f6; color: #111827; }
.ap-play-overflow__menu {
	position: absolute; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid #e5e7eb;
	border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); min-width: 160px; z-index: 100; overflow: hidden;
}
.ap-overflow-item {
	display: block; width: 100%; padding: 9px 14px; font-size: 13px; color: #374151; text-align: left;
	background: none; border: none; cursor: pointer; text-decoration: none;
}
.ap-overflow-item:hover { background: #f9fafb; color: #111827; }
.ap-overflow-item--danger { color: #dc2626; }
.ap-overflow-item--danger:hover { background: #fef2f2; }
.ap-overflow-item--import { cursor: pointer; }
.ap-overflow-item--filter { padding-bottom: 12px; }
.ap-plays-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.ap-plays-toolbar__search-form { flex: 1; max-width: 400px; }
.ap-plays-toolbar__filters { margin: 0; }
.ap-plays-toolbar__filters .ap-select { min-width: 150px; }
.ap-pro-actions-gate {
	margin-top: 16px; padding: 16px; background: #f8f7ff; border: 1px dashed #a5b4fc; border-radius: 10px;
}
.ap-pro-actions-gate__label { font-size: 12px; font-weight: 600; color: #6366f1; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 10px; }
.ap-pro-actions-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.ap-pro-action-pill {
	display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid #e0e7ff;
	border-radius: 20px; padding: 5px 12px; font-size: 13px; color: #6b7280;
}
.ap-template-group { margin-bottom: 40px; }
.ap-template-group__header { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 2px solid #e5e7eb; }
.ap-template-group__title { font-size: 18px; font-weight: 700; color: #111827; margin: 0 0 4px; }
.ap-template-group__desc { font-size: 13px; color: #6b7280; margin: 0; }
.ap-recipe-cta { margin-top: auto; padding-top: 12px; font-size: 13px; font-weight: 600; color: #6366f1; }
.ap-recipe-card:hover .ap-recipe-cta { color: #4f46e5; }
.ap-recipe-trigger-tag {
	font-size: 11px; color: #6b7280; background: #f3f4f6; border-radius: 4px;
	padding: 2px 8px; display: inline-block; margin-top: 8px;
}
.ap-template-scratch { text-align: center; padding: 24px 0 40px; border-top: 1px solid #e5e7eb; margin-top: 24px; }
.ap-template-scratch__hint { display: block; font-size: 12px; color: #6b7280; margin-top: 6px; }
button.ap-recipe-card {
	width: 100%; text-align: left; cursor: pointer; font: inherit; color: inherit;
}
.ap-recipe-modal { position: fixed; inset: 0; z-index: 999999; display: flex; align-items: center; justify-content: center; }
.ap-recipe-modal[hidden] { display: none; }
.ap-recipe-modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(2px); }
.ap-recipe-modal__panel {
	position: relative; background: #fff; border-radius: 16px; padding: 36px 40px;
	max-width: 520px; width: 90%; box-shadow: 0 24px 64px rgba(0,0,0,0.2); text-align: center;
}
.ap-recipe-modal__close {
	position: absolute; top: 16px; right: 16px; background: none; border: none; cursor: pointer;
	font-size: 18px; color: #6b7280; padding: 8px; min-width: 36px; min-height: 36px; border-radius: 6px;
}
.ap-recipe-modal__story {
	display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
	background: #f8f7ff; border-radius: 8px; padding: 12px 16px; font-size: 14px; margin-bottom: 16px;
}
.ap-recipe-modal__email-preview { text-align: left; margin-bottom: 20px; }
.ap-recipe-modal__email-preview[hidden] { display: none; }
.ap-recipe-modal__email-preview-label {
	margin: 0 0 8px; font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
	text-transform: uppercase; color: #6b7280;
}
.ap-recipe-modal__email-thumb {
	background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 14px 16px;
	box-shadow: 0 4px 12px rgba(0,0,0,0.06); max-height: 120px; overflow: hidden;
}
.ap-recipe-modal__email-subject {
	font-size: 14px; font-weight: 600; color: #111827; margin-bottom: 6px;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ap-recipe-modal__email-snippet { font-size: 13px; color: #4b5563; line-height: 1.45; }
.ap-recipe-modal__actions { display: flex; flex-direction: column; gap: 10px; }
.ap-field-row { position: relative; }
.ap-tags-btn {
	display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; background: none;
	border: 1px solid #e5e7eb; border-radius: 6px; padding: 7px 12px; min-height: 34px; font-size: 12px; color: #4f46e5; cursor: pointer;
}
.ap-tags-popover {
	position: absolute; z-index: 200; background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
	box-shadow: 0 8px 24px rgba(0,0,0,0.12); padding: 8px; min-width: 240px; top: calc(100% + 4px); left: 0;
}
.ap-tags-popover[hidden] { display: none; }
.ap-tag-insert-btn {
	display: flex; align-items: center; justify-content: space-between; width: 100%;
	background: none; border: none; padding: 7px 10px; border-radius: 6px; cursor: pointer; gap: 8px;
}
.ap-tag-insert-btn code { font-size: 12px; color: #4f46e5; background: #eef2ff; padding: 2px 6px; border-radius: 4px; }
.ap-tags-see-all { display: block; padding: 6px 10px; font-size: 12px; color: #6366f1; text-align: center; border-top: 1px solid #f3f4f6; margin-top: 4px; }
.ap-quickwin-card {
	display: flex; align-items: center; gap: 20px;
	background: linear-gradient(135deg, #eef2ff 0%, #f0fdf4 100%);
	border: 1px solid #c7d2fe; border-radius: 14px; padding: 24px 28px; margin-bottom: 20px; flex-wrap: wrap;
}
.ap-quickwin-card__icon { font-size: 40px; flex-shrink: 0; }
.ap-quickwin-card__body { flex: 1; min-width: 200px; }
.ap-empty-state-secondary { display: flex; gap: 12px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.ap-review-section {
	background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 10px; padding: 20px 24px; margin-bottom: 20px;
}
.ap-review-section__label { font-size: 14px; font-weight: 600; color: #374151; margin-bottom: 14px; }
.ap-review-upgrade-nudge {
	background: #f8f7ff; border: 1px dashed #a5b4fc; border-radius: 10px; padding: 16px 20px; margin-bottom: 16px;
}
.ap-collapse-btn::after { content: ' ▼'; font-size: 10px; }
.ap-collapse-btn[aria-expanded="true"]::after { content: ' ▲'; }

/* Play UX enhancements */
.ap-name-in-step { margin-bottom: 18px; }
.ap-timing-timeline { margin-top: 16px; font-size: 13px; }
.ap-tl-label { color: #666; font-size: 12px; margin-bottom: 6px; }
.ap-tl-track { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.ap-tl-node { padding: 3px 9px; border-radius: 4px; font-weight: 500; font-size: 12px; }
.ap-tl-node--trigger { background: #f0f0f0; color: #444; }
.ap-tl-node--wait { background: #fff3cd; color: #856404; }
.ap-tl-node--action { background: #cfe2ff; color: #084298; }
.ap-tl-sep { color: #aaa; font-size: 12px; }
.ap-timeline-node { font-weight: 500; color: #3C3489; }
.ap-timeline-node--trigger { color: #534AB7; }
.ap-timeline-arrow { color: #9ca3af; margin: 0 2px; }
.ap-timing-sequence-wrap { margin-top: 16px; }
.ap-timing-sequence-wrap.is-expanded .ap-timing-followup-cta { display: none; }
.ap-timing-sequence-body { display: none; margin-top: 12px; }
.ap-timing-sequence-body.is-open,
#ap-sequence-body.is-open { display: block; }
body.is-ap-action-inserter-open::before {
	content: '';
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.12);
	z-index: 100000;
	pointer-events: none;
}
.ap-action-inserter-popover {
	position: fixed;
	z-index: 100001;
	width: min(365px, calc(100vw - 16px));
	max-height: min(420px, calc(100vh - 24px));
	overflow: auto;
	background: #fff;
	border: 1px solid #e5e4f0;
	border-radius: 10px;
	box-shadow: 0 8px 32px rgba(15, 23, 42, 0.14);
}
.ap-automation-inserter .block-editor-inserter__search-wrap {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px;
	border-bottom: 1px solid #e5e4f0;
}
.ap-automation-inserter .block-editor-inserter__search {
	flex: 1;
	border: 1px solid #e5e4f0;
	border-radius: 6px;
	padding: 8px 10px;
	font-size: 13px;
}
.ap-automation-inserter .ap-action-inserter-list {
	padding-bottom: 12px;
}
.ap-automation-inserter .block-editor-inserter__panel-title {
	margin: 0;
	padding: 12px 12px 6px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #6b7280;
}
.ap-automation-inserter .block-editor-inserter__panel-content:last-child .block-editor-block-types-list {
	padding-bottom: 4px;
}
.ap-automation-inserter .block-editor-block-types-list {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 0 8px 8px;
}
.ap-automation-inserter .block-editor-block-types-list__list-item {
	margin: 0;
}
.ap-automation-inserter .block-editor-block-types-list__item {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 8px 10px;
	border: none;
	border-radius: 6px;
	background: transparent;
	cursor: pointer;
	font-size: 13px;
	color: #374151;
	text-align: left;
}
.ap-automation-inserter .block-editor-block-types-list__item:hover {
	background: #f3f0ff;
	color: #534AB7;
}
.ap-automation-inserter .block-editor-block-types-list__item-icon {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
}
.ap-automation-inserter .block-editor-block-types-list__item .ti {
	font-size: 18px;
	color: #534AB7;
}
.ap-automation-inserter .block-editor-block-types-list__item-title {
	line-height: 1.35;
}
.ap-action-inserter-back {
	padding: 8px 12px 0;
}
.ap-action-inserter-slot {
	margin-bottom: 12px;
}
.ap-action-type-grid {
	display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 12px;
}
.ap-action-type-grid[hidden],
body.is-ap-action-inserter-open .ap-action-type-grid {
	display: none !important;
}
.ap-action-type-card {
	display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 10px;
	border: 1.5px solid #e5e4f0; border-radius: 10px; background: #fff; cursor: pointer; font-size: 13px; color: #374151;
	transition: border-color .14s, background .14s;
}
.ap-action-type-card:hover { border-color: #534AB7; background: #faf9ff; }
.ap-action-type-card .ti { font-size: 22px; color: #534AB7; }
.ap-message-channel-picker {
	grid-column: 1 / -1;
	display: none;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	margin-top: -2px;
	padding: 10px;
	border: 1px solid #e5e4f0;
	border-radius: 10px;
	background: #faf9ff;
}
.ap-message-channel-picker.is-open { display: flex; }
.ap-message-channel-btn.is-selected {
	background: #EEEDFE;
	border-color: #534AB7;
	color: #3C3489;
	box-shadow: 0 0 0 1px #534AB7 inset;
}
.ap-action-card--has-type .ap-action-type-grid[hidden] { display: none; }
.ap-action-card__header { display: flex; align-items: center; gap: 10px; }
.ap-action-type-label { font-weight: 600; flex: 1; }
.ap-pro-actions-callout { font-size: 13px; color: #666; margin-top: 12px; }
.ap-review-settings { margin-top: 20px; border-top: 0.5px solid #e5e4f0; padding-top: 16px; }
.ap-review-settings__title { font-size: 15px; margin: 0 0 14px; }
.ap-review-settings__block { margin-bottom: 18px; }
.ap-review-settings__block--tertiary { opacity: .9; }
.ap-rule-row--sentence { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.ap-rule-prefix { font-size: 13px; color: #666; }
.ap-audience-count { margin-top: 8px; font-size: 13px; color: #666; min-height: 20px; }
.ap-status-toggle { display: inline-flex; border: 1.5px solid #e5e4f0; border-radius: 8px; overflow: hidden; }
.ap-status-toggle__btn {
	border: none; background: #fff; padding: 10px 24px; font-size: 14px; cursor: pointer; color: #666;
}
.ap-status-toggle__btn.is-selected { background: #534AB7; color: #fff; font-weight: 500; }
.ap-status-toggle__btn[disabled] { opacity: .45; cursor: not-allowed; }
.ap-save-row--review { flex-direction: column; align-items: stretch; margin-top: 20px; padding-top: 16px; border-top: 0.5px solid #e5e4f0; }
.ap-save-row--review .ap-save-submit { width: 100%; justify-content: center; }
.ap-notice-card--inline { margin-bottom: 14px; }
.ap-timing-pill.is-recommended { box-shadow: 0 0 0 2px #534AB7; position: relative; }
.ap-timing-pill.is-recommended::after {
	content: 'Recommended'; position: absolute; top: -8px; right: 6px; font-size: 9px; background: #534AB7; color: #fff;
	padding: 1px 5px; border-radius: 4px; font-weight: 600;
}
.ap-tags-slide-panel { position: fixed; inset: 0; z-index: 100100; }
.ap-tags-slide-panel[hidden] { display: none; }
.ap-tags-slide-panel__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.35); }
.ap-tags-slide-panel__drawer {
	position: absolute; top: 0; right: 0; width: min(360px, 92vw); height: 100%; background: #fff;
	box-shadow: -8px 0 32px rgba(0,0,0,.12); display: flex; flex-direction: column;
}
.ap-tags-slide-panel__header {
	display: flex; align-items: center; justify-content: space-between; padding: 16px; border-bottom: 0.5px solid #e5e4f0;
}
.ap-vars-grid.ap-vars-grid--panel {
	overflow: auto;
	padding: 12px 14px 16px;
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 14px;
	grid-template-columns: unset;
}
.ap-tags-panel-group__title {
	margin: 0 0 8px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #534AB7;
}
.ap-tags-panel-group__chips {
	display: grid;
	grid-template-columns: 1fr;
	gap: 6px;
}
.ap-tag-insert-btn.ap-tags-panel-tag {
	flex-direction: column;
	align-items: flex-start;
	justify-content: flex-start;
	gap: 4px;
	width: 100%;
	min-width: 0;
	text-align: left;
	padding: 8px 10px;
	border: 1px solid #e5e4f0;
	border-radius: 8px;
	background: #faf9ff;
}
.ap-tag-insert-btn.ap-tags-panel-tag:hover {
	background: #EEEDFE;
	border-color: #c8c4ef;
}
.ap-tag-insert-btn.ap-tags-panel-tag code {
	font-size: 11px;
	line-height: 1.35;
	word-break: break-all;
	white-space: normal;
	max-width: 100%;
}
.ap-tag-insert-btn.ap-tags-panel-tag span {
	font-size: 12px;
	color: #666;
	line-height: 1.3;
}
.ap-tags-slide-panel__header h2 {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	color: #1a1830;
}
body.ap-tags-panel-open { overflow: hidden; }
.ap-quickstart-progress { font-size: 12px; color: #666; margin-left: 8px; font-weight: 400; }
.ap-quickstart-item.is-done { opacity: .55; }
.ap-play-activate-btn { margin-right: 8px; }
.ap-settings-import { margin-top: 12px; }
.ap-orchestration-hint { margin-top: 6px; color: #534AB7; font-size: 12px; }
.ap-action-condition { margin-top: 10px; padding: 10px 12px; border: 1px dashed #d8d6eb; border-radius: 8px; background: #faf9ff; }
.ap-action-condition .ap-checkbox-label { display: flex; align-items: center; gap: 8px; margin-bottom: 0; font-weight: 500; }
.ap-action-condition__body { display: none; margin-top: 10px; gap: 8px; align-items: center; }
.ap-action-condition.is-open .ap-action-condition__body { display: flex; }

@media (max-width: 782px) {
	.ap-play-card {
		flex-direction: column;
		align-items: flex-start;
		padding: 14px;
	}
	.ap-play-card__right {
		width: 100%;
		flex-wrap: wrap;
		gap: 10px;
		align-items: center;
	}
	.ap-play-actions {
		width: 100%;
		flex-wrap: wrap;
		gap: 10px;
	}
	.ap-toggle {
		margin-left: auto;
	}
}


#ap-add-action{margin-top: .5rem;}

/* ============================================================
   v2.1 — Play editor simplification + playful readability
   ============================================================ */
.ap-wrap--play-editor {
	max-width: 1600px;
}

.ap-play-editor-layout {
	grid-template-columns: minmax(0, 1fr) 340px;
	gap: 28px;
}

.ap-play-editor-header {
	margin-bottom: 16px;
}

.ap-back-link {
	font-size: 15px;
	font-weight: 600;
}

#ap-play-form {
	font-size: 16px;
}

.ap-step-panel {
	border-radius: 16px;
	border: 1px solid #e7e6ef;
	padding: 28px;
	box-shadow: none;
}

.ap-step-panel:focus-within {
	border-color: #d8d5ea;
	box-shadow: none;
}

.ap-step-header {
	gap: 16px;
	margin-bottom: 22px;
}

.ap-step-num {
	width: 32px;
	height: 32px;
	font-size: 13px;
	font-weight: 700;
}

.ap-step-label {
	font-size: 22px;
	font-weight: 700;
	line-height: 1.2;
}

.ap-step-sub {
	font-size: 15px;
	color: #5a5872;
	margin-top: 4px;
}

.ap-trigger-grid {
	grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
	gap: 12px;
}

.ap-trigger-card {
	border-radius: 14px;
	padding: 16px;
	border-width: 1px;
	background: #fff;
}

.ap-trigger-card:hover {
	background: #fff;
	border-color: #c8c4df;
}

.ap-trigger-card.is-selected {
	background: #f3f2ff;
	border-color: #534AB7;
}

.ap-trigger-label {
	font-size: 16px;
	font-weight: 700;
	margin-bottom: 6px;
}

.ap-trigger-desc {
	font-size: 13px;
	line-height: 1.45;
}

.ap-timing-pills {
	gap: 10px;
}

.ap-timing-pill {
	font-size: 14px;
	padding: 9px 16px;
	border-radius: 999px;
	border-width: 1px;
}

.ap-timing-pill:hover {
	transform: none;
	box-shadow: none;
}

.ap-action-type-grid {
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 12px;
}

.ap-action-type-card {
	border-radius: 14px;
	border-width: 1px;
	padding: 16px 14px;
	gap: 10px;
}

.ap-action-type-card:hover {
	background: #fff;
}

.ap-action-type-card .ti {
	font-size: 30px;
}

.ap-action-type-card span {
	font-size: 14px;
	font-weight: 600;
	line-height: 1.35;
	text-align: center;
}

.ap-action-card {
	border-radius: 14px;
	border-width: 1px;
}

.ap-action-card:focus-within {
	box-shadow: none;
	border-color: #d4d1e8;
}

.ap-action-card__header {
	padding: 14px 16px;
	background: #fff;
}

.ap-action-fields {
	padding: 16px;
	background: #fff;
}

.ap-field-label {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.04em;
}

.ap-input,
.ap-select,
.ap-textarea {
	font-size: 15px;
	padding: 10px 12px;
	border-radius: 10px;
	border-width: 1px;
	max-width: 100%;
}

.ap-btn {
	font-size: 14px;
	padding: 9px 16px;
	border-radius: 10px;
	border-width: 1px;
}

.ap-btn-lg {
	font-size: 16px;
	padding: 12px 22px;
}

.ap-guided-actions {
	padding-top: 18px;
}

.ap-story-hero {
	background: #fff;
	border: 1px solid #e7e6ef;
	border-radius: 16px;
	padding: 16px;
	box-shadow: none;
}

.ap-story-card {
	border-radius: 12px;
	border-width: 1px;
	padding: 14px;
	box-shadow: none;
}

.ap-story-card__icon {
	width: 44px;
	height: 44px;
}

.ap-story-card__icon svg {
	width: 22px;
	height: 22px;
}

.ap-story-card__title {
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.ap-story-card__text {
	font-size: 16px;
	font-weight: 700;
}

.ap-story-connector {
	height: 18px;
}

.ap-store-recovered {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 8px;
	margin: 8px 0 0;
	font-size: 13px;
}
.ap-store-recovered__label { color: #6b7280; }
.ap-store-recovered__amount { color: #1a1830; font-size: 18px; }
.ap-store-recovered__meta { color: #6b7280; font-size: 12px; }

.ap-template-quickwin { margin: 20px 0 28px; }
.ap-template-quickwin__eyebrow {
	margin: 0 0 10px;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #534AB7;
}

.ap-settings-subheading {
	margin: 0 0 8px;
	font-size: 13px;
	font-weight: 600;
	color: #1a1830;
}
.ap-settings-fieldset {
	border: 1px solid #e5e4f0;
	border-radius: 8px;
	padding: 12px 16px 4px;
	margin: 0 0 20px;
}
.ap-settings-legend {
	padding: 0 6px;
	font-size: 13px;
	font-weight: 600;
	color: #1a1830;
}
.ap-settings-advanced {
	border: 1px solid #e5e4f0;
	border-radius: 10px;
	padding: 0 16px 16px;
	background: #faf9ff;
}
.ap-settings-advanced__summary {
	cursor: pointer;
	padding: 14px 0;
	font-size: 14px;
	font-weight: 600;
	color: #1a1830;
	list-style: none;
}
.ap-settings-advanced__summary::-webkit-details-marker { display: none; }
.ap-settings-advanced__body { padding-top: 4px; }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
	}
}