/* New Post Alerts – admin */
.afpp-admin {
	--ink: #10231c;
	--muted: #5b6b66;
	--line: #e3e9e7;
	--soft: #f4f7f6;
	--brand: #0b4f43;
	--accent: #25d366;
	--ok: #129a4a;
	--warn: #b7791f;
	--bad: #c0392b;
	--radius: 14px;
	max-width: 1180px;
	margin-right: 20px;
	color: var(--ink);
	font-size: 14px;
}
.afpp-admin *, .afpp-metabox * { box-sizing: border-box; }
.afpp-admin [hidden], .afpp-metabox [hidden] { display: none !important; }
.afpp-admin a { color: var(--brand); }

.afpp-hero {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
	margin: 16px 0 0; padding: 22px 26px; border-radius: var(--radius) var(--radius) 0 0; color: #fff;
	background: radial-gradient(90% 140% at 100% 0%, rgba(37, 211, 102, .35), transparent 55%), linear-gradient(135deg, #0b4f43, #062b25);
}
.afpp-hero__brand { display: flex; align-items: center; gap: 14px; }
.afpp-hero__logo { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--accent); }
.afpp-hero__logo svg { width: 28px; height: 28px; color: #fff; }
.afpp-hero__title { margin: 0; font-size: 20px; font-weight: 700; }
.afpp-hero__meta { margin: 2px 0 0; color: rgba(255, 255, 255, .72); font-size: 13px; }
.afpp-tag { display: inline-block; margin-left: 6px; padding: 2px 10px; border-radius: 999px; background: rgba(255, 255, 255, .16); font-size: 12px; vertical-align: 3px; }
.afpp-hero__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.afpp-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .12); color: #fff !important; font-size: 12px; font-weight: 600; text-decoration: none; }
.afpp-chip i { width: 8px; height: 8px; border-radius: 50%; background: #9aa; }
.afpp-chip.is-ok i { background: #3ee07f; }
.afpp-chip.is-warn i { background: #f6c453; }
.afpp-chip.is-bad i { background: #ff7a6b; }

.afpp-nav { display: flex; flex-wrap: wrap; gap: 2px; padding: 0 12px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); background: #fff; }
.afpp-nav__item { display: inline-flex; align-items: center; gap: 6px; padding: 14px 12px; border-bottom: 2px solid transparent; color: var(--muted) !important; font-weight: 600; text-decoration: none; }
.afpp-nav__item:hover { color: var(--ink) !important; }
.afpp-nav__item.is-active { border-bottom-color: var(--accent); color: var(--ink) !important; }
.afpp-nav__item .dashicons { font-size: 17px; width: 17px; height: 17px; }
.afpp-nav__item.is-pro { color: var(--ok) !important; }

.afpp-flash { display: flex; align-items: center; gap: 8px; margin: 16px 0 0; padding: 10px 14px; border-radius: 10px; background: #eafaf0; color: #0b5d2c; font-weight: 600; }
.afpp-content { padding-top: 16px; }

.afpp-card { margin: 0 0 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.afpp-card__head { padding: 18px 22px 0; }
.afpp-card__head h2 { margin: 0; font-size: 16px; }
.afpp-card__head p { margin: 6px 0 0; color: var(--muted); }
.afpp-card__body { padding: 16px 22px 20px; }
.afpp-card--pro { background: linear-gradient(135deg, #f2fbf5, #fff); border-color: #bfe8cf; }
.afpp-card--pro h2 { margin: 0 0 12px; }

.afpp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.afpp-stat { padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.afpp-stat span { display: block; color: var(--muted); font-size: 13px; }
.afpp-stat strong { display: block; margin-top: 4px; font-size: 26px; font-variant-numeric: tabular-nums; }

.afpp-checklist { margin: 0; padding: 0; list-style: none; }
.afpp-checklist li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.afpp-checklist li:first-child { border-top: 0; }
.afpp-checklist .dashicons { color: #b8c4c0; }
.afpp-checklist .is-done .dashicons { color: var(--ok); }
.afpp-checklist .is-done a { color: var(--muted); text-decoration: line-through; }

.afpp-pro-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 0 0 18px; padding: 0; list-style: none; }
.afpp-pro-list li { display: flex; gap: 10px; }
.afpp-pro-list .dashicons { color: var(--ok); margin-top: 2px; }
.afpp-pro-list p { margin: 2px 0 0; color: var(--muted); }

.afpp-field { display: grid; grid-template-columns: 240px 1fr; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.afpp-field:first-child { border-top: 0; }
.afpp-field > label { padding-top: 6px; font-weight: 600; }
.afpp-field .description { margin-top: 6px; }
.afpp-switch { position: relative; display: inline-block; width: 42px; height: 24px; margin-top: 4px; }
.afpp-switch input { position: absolute; opacity: 0; }
.afpp-switch span { position: absolute; inset: 0; border-radius: 999px; background: #c8d2cf; cursor: pointer; transition: background .15s; }
.afpp-switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; }
.afpp-switch input:checked + span { background: var(--ok); }
.afpp-switch input:checked + span::after { transform: translateX(18px); }
.afpp-switch input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.afpp-vars { margin: 6px 0 0 18px; }
.afpp-copy { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.afpp-copy code { padding: 6px 10px; border-radius: 8px; background: var(--soft); word-break: break-all; }
.afpp-note { color: var(--muted); }
.afpp-test { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.afpp-test__result { flex-basis: 100%; margin: 6px 0 0; padding: 10px 12px; border-radius: 10px; background: #eafaf0; color: #0b5d2c; }
.afpp-test__result.is-error { background: #fdeeee; color: #9b1c1c; }

.afpp-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.afpp-filters { display: flex; flex-wrap: wrap; gap: 4px; }
.afpp-filters a { padding: 6px 10px; border-radius: 8px; text-decoration: none; color: var(--muted) !important; }
.afpp-filters a.is-active { background: var(--soft); color: var(--ink) !important; font-weight: 600; }
.afpp-filters span { color: #8a9a95; }
.afpp-search { display: flex; flex-wrap: wrap; gap: 6px; }
.afpp-search .dashicons { font-size: 16px; width: 16px; height: 16px; vertical-align: -3px; }
.afpp-table { border-radius: 10px; }
.afpp-table td, .afpp-table th { vertical-align: middle; }
.afpp-empty { padding: 24px !important; color: var(--muted); text-align: center; }
.afpp-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.afpp-pages { display: inline-flex; gap: 4px; margin-left: auto; }
.afpp-pages a, .afpp-pages span { min-width: 30px; padding: 4px 8px; border-radius: 6px; text-align: center; text-decoration: none; }
.afpp-pages a.is-active { background: var(--brand); color: #fff !important; }
.afpp-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--soft); font-size: 12px; font-weight: 600; }
.afpp-badge.is-active, .afpp-badge.is-done { background: #e3f7ea; color: #0b6d33; }
.afpp-badge.is-pending, .afpp-badge.is-queued, .afpp-badge.is-sending { background: #fff4dc; color: #8a5a00; }
.afpp-badge.is-unsubscribed, .afpp-badge.is-cancelled { background: #eef0f0; color: #59625f; }
.afpp-badge.is-bounced { background: #fdeeee; color: #9b1c1c; }
.afpp-error { margin-top: 4px; color: var(--bad); font-size: 12px; }

.afpp-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.afpp-preview { position: sticky; top: 46px; }
.afpp-preview__label { margin: 0 0 8px; color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: .06em; }
.afpp-preview .afpp-form { margin: 0; }

/* Guide */
.afpp-guide { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.afpp-guide__toc { position: sticky; top: 46px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.afpp-guide__toc > p { margin: 0 0 10px; color: var(--muted); font-size: 12px; }
.afpp-guide__toc ol { margin: 0; padding: 0; list-style: none; }
.afpp-guide__toc li a { display: flex; gap: 8px; padding: 8px 0; font-weight: 600; text-decoration: none; }
.afpp-guide__toc .dashicons { color: #b8c4c0; }
.afpp-guide__toc .is-done .dashicons { color: var(--ok); }
.afpp-guide__need { margin-top: 12px !important; padding-top: 12px; border-top: 1px solid var(--line); line-height: 1.5; }
.afpp-guide .afpp-card { scroll-margin-top: 50px; }
.afpp-steps { margin: 0; padding: 0; list-style: none; }
.afpp-step-item { display: grid; grid-template-columns: 34px 1fr; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); }
.afpp-step-item:first-child { border-top: 0; padding-top: 4px; }
.afpp-step-item__n { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; }
.afpp-step-item h3 { margin: 4px 0 8px; font-size: 15px; }
.afpp-step-item p { margin: 0 0 8px; line-height: 1.55; }
.afpp-substeps, .afpp-list { margin: 0 0 8px 18px; line-height: 1.6; }
.afpp-substeps { list-style: lower-alpha; }
.afpp-list { list-style: disc; }
.afpp-tip, .afpp-warn { padding: 10px 12px; border-radius: 10px; }
.afpp-tip { background: #eaf6fb; color: #134b62; }
.afpp-warn { background: #fff6e5; color: #6d4a00; }
.afpp-kv { width: 100%; margin: 6px 0 10px; border-collapse: collapse; }
.afpp-kv th, .afpp-kv td { padding: 8px 10px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.afpp-kv th { width: 150px; background: var(--soft); font-weight: 600; }
.afpp-codebox { position: relative; margin: 6px 0 10px; }
.afpp-codebox pre { margin: 0; padding: 14px 16px; border-radius: 10px; background: #0f1f1b; color: #e7f5ee; white-space: pre-wrap; font-size: 13px; line-height: 1.55; }
.afpp-codebox .button { position: absolute; top: 8px; right: 8px; }
.afpp-subhead { margin: 18px 0 8px; font-size: 14px; }

/* Post editor box */
.afpp-metabox .button-primary { width: 100%; justify-content: center; text-align: center; }
.afpp-progress { margin-top: 10px; }
.afpp-progress__bar { height: 8px; border-radius: 999px; background: #e3e9e7; overflow: hidden; }
.afpp-progress__bar span { display: block; width: 0; height: 100%; background: #25d366; transition: width .3s; }
.afpp-progress__text { margin: 6px 0 0; font-size: 12px; color: #5b6b66; }
.afpp-metabox__list { margin: 4px 0 0; color: #5b6b66; font-size: 12px; }
.afpp-metabox__history { margin-bottom: 0; }

@media (max-width: 960px) {
	.afpp-grid, .afpp-guide { grid-template-columns: 1fr; }
	.afpp-guide__toc, .afpp-preview { position: static; }
	.afpp-field { grid-template-columns: 1fr; gap: 6px; }
}

/* Second-click confirmation */
.afpp-metabox .button-primary.is-armed, .afpp-admin .button.is-armed { background: #d63638; border-color: #d63638; color: #fff; }
