/**
 * WB Listora Settings — Pattern A Sidebar Layout
 *
 * @package WBListora
 */

/* ── Wrap ── */
.listora-settings-wrap {
	display: flex;
	gap: 0;
	min-height: 600px;
	margin: 20px 0 0;
	background: var(--listora-fg-inverse, var(--listora-bg-elevated));
	border: 1px solid var(--listora-border, var(--listora-wp-admin-border));
	border-radius: 4px;
	overflow: hidden;
}

/* ── Sidebar ── */
.listora-settings-sidebar {
	width: 240px;
	min-width: 240px;
	background: var(--listora-bg-surface, var(--listora-admin-bg-paper));
	border-right: 1px solid var(--listora-border, var(--listora-wp-admin-border));
	display: flex;
	flex-direction: column;
	padding: 0;
}

/* Brand block */
.listora-settings-sidebar__brand {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 20px 16px;
	border-bottom: 1px solid var(--listora-border, var(--listora-wp-admin-border));
}

.listora-settings-sidebar__logo {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	background: var(--listora-primary, var(--listora-primary));
	border-radius: 8px;
	color: var(--listora-fg-inverse, var(--listora-bg-elevated));
	flex-shrink: 0;
}

.listora-settings-sidebar__logo svg {
	width: 20px;
	height: 20px;
}

.listora-settings-sidebar__brand strong {
	display: block;
	font-size: 14px;
	font-weight: 600;
	color: var(--listora-text, var(--listora-wp-admin-text));
	line-height: 1.3;
}

.listora-settings-sidebar__brand span:not(.listora-settings-sidebar__logo) {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.5px;
	color: var(--listora-fg-faint, var(--listora-wp-admin-text-faint));
	text-transform: uppercase;
}

/* Nav groups */
.listora-settings-nav-group {
	padding: 12px 0 4px;
}

.listora-settings-nav-group__label {
	display: block;
	padding: 0 16px 8px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.5px;
	color: var(--listora-fg-faint, var(--listora-wp-admin-text-faint));
	text-transform: uppercase;
}

/* Nav items */
.listora-settings-nav-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 16px;
	margin: 0 8px 2px;
	border-radius: 4px;
	font-size: 13px;
	font-weight: 500;
	color: var(--listora-fg-muted, var(--listora-wp-admin-text-muted));
	text-decoration: none;
	transition: background 0.15s, color 0.15s;
	cursor: pointer;
}

.listora-settings-nav-item:hover {
	background: var(--listora-border, var(--listora-border-default));
	color: var(--listora-text, var(--listora-wp-admin-text));
}

.listora-settings-nav-item:focus-visible {
	outline: 2px solid var(--listora-primary, var(--listora-info));
	outline-offset: 2px;
}

.listora-settings-nav-item.is-active {
	background: var(--listora-primary, var(--listora-primary));
	color: var(--listora-fg-inverse, var(--listora-bg-elevated));
}

.listora-settings-nav-item.is-active:hover {
	background: var(--listora-primary-hover, var(--listora-primary-hover));
	color: var(--listora-fg-inverse, var(--listora-bg-elevated));
}

.listora-settings-nav-item svg {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}

/* Pro badge */
.listora-pro-badge {
	display: inline-block;
	margin-inline-start: auto;
	padding: 1px 6px;
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.3px;
	color: var(--listora-warning-fg);
	background: var(--listora-warning-bg);
	border-radius: 3px;
	text-transform: uppercase;
}

.listora-settings-nav-item.is-active .listora-pro-badge {
	color: var(--listora-fg-inverse, var(--listora-bg-elevated));
	background: rgba(255, 255, 255, 0.25);
}

/* ── Content area ── */
.listora-settings-content {
	flex: 1;
	min-width: 0;
	padding: 24px;
}

/* Sections — hidden by default, shown when active */
.listora-settings-section {
	display: none;
}

.listora-settings-section.is-active {
	display: block;
}

/* ── Card ── */
.listora-card {
	background: var(--listora-fg-inverse, var(--listora-bg-elevated));
	border: 1px solid var(--listora-border, var(--listora-wp-admin-border));
	border-radius: 4px;
	overflow: hidden;
}

.listora-card__head {
	padding: 16px 20px;
	border-bottom: 1px solid var(--listora-border, var(--listora-wp-admin-border));
	background: var(--listora-bg-surface, var(--listora-admin-bg-paper));
}

.listora-card__title {
	margin: 0 0 4px;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.3px;
	color: var(--listora-text, var(--listora-wp-admin-text));
}

.listora-card__desc {
	margin: 0;
	font-size: 13px;
	color: var(--listora-fg-faint, var(--listora-wp-admin-text-faint));
}

/*
 * ════════════════════════════════════════════════════════════════════
 * UNIFIED SETTINGS TAB CONTENT PATTERN
 * ════════════════════════════════════════════════════════════════════
 *
 * ALL settings tab content (Free AND Pro) is wrapped by the core settings
 * page in a single `.listora-settings-body` div that sits inside the
 * .listora-card body. This div provides the 20px uniform padding around
 * every tab's content regardless of what the renderer outputs.
 *
 * Tab renderers should output:
 *   <section class="listora-settings-block">
 *     <div class="listora-settings-block__head">
 *       <h3 class="listora-settings-block__title">Title</h3>
 *       <p class="listora-settings-block__desc">Description</p>
 *     </div>
 *     <table class="form-table" role="presentation"> ... </table>
 *   </section>
 *
 * Multiple sections per tab are separated by a 1px top border.
 * Renderers that emit bare <h3> + <table class="form-table"> still work
 * because the outer .listora-settings-body provides the padding.
 */

/*
 * Legacy `.listora-settings-body` wrapper — kept only for non-form tabs that
 * still emit it (Import/Export, Migration). Form tabs render directly into the
 * tab section without this wrapper now (Jetonomy-parity card pattern in
 * admin.css). DO NOT add inter-block divider rules here — sections separate
 * via .listora-settings-block being its own card.
 */
.listora-settings-body {
	padding: 20px;
}

/* Bare <h3> from legacy renderers that don't use .listora-settings-block */
.listora-settings-body > h3 {
	margin: 0 0 12px;
	font-size: 14px;
	font-weight: 600;
	color: var(--listora-text, var(--listora-wp-admin-text));
}

/* Bare form-table inside body — no extra padding needed, body provides it */
.listora-settings-body > .form-table,
.listora-settings-body > h3 + .form-table {
	margin: 0;
}

.listora-settings-body > .form-table th,
.listora-settings-body > .form-table td {
	padding: 14px 16px 14px 0;
}

.listora-settings-body > .form-table td:last-child {
	padding-inline-end: 0;
}

/* Paragraphs and generic divs from renderers sit inside the padded body */
.listora-settings-body > p,
.listora-settings-body > div:not(.listora-settings-block) {
	margin: 0 0 12px;
}

/*
 * .listora-settings-block (structured pattern used by free tabs).
 * Inside the body, blocks are transparent — no double borders.
 */
.listora-settings-body .listora-settings-block {
	background: transparent;
	border: none;
	border-radius: 0;
	padding: 0;
}

.listora-settings-body .listora-settings-block__head {
	margin: 0 0 12px;
	padding: 0;
	border: none;
}

.listora-settings-body .listora-settings-block__title {
	margin: 0 0 4px;
	font-size: 14px;
	font-weight: 600;
	color: var(--listora-text, var(--listora-wp-admin-text));
}

.listora-settings-body .listora-settings-block__desc {
	margin: 0;
	font-size: 13px;
	color: var(--listora-fg-faint, var(--listora-wp-admin-text-faint));
}

.listora-settings-body .listora-settings-block .form-table {
	margin: 0;
}

.listora-settings-body .listora-settings-block .form-table th,
.listora-settings-body .listora-settings-block .form-table td {
	padding: 14px 0;
}

/* Also apply when .listora-settings-pane is nested (legacy free tabs) */
.listora-settings-body > .listora-settings-pane {
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0;
}

/* ── Section footer / save ── */
.listora-settings-section__footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 16px 0 0;
}

/* Button */
.listora-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.4;
	border: 1px solid transparent;
	border-radius: 4px;
	cursor: pointer;
	text-decoration: none;
	transition: background 0.15s, border-color 0.15s;
}

.listora-btn svg {
	width: 16px;
	height: 16px;
}

.listora-btn--primary {
	background: var(--listora-primary, var(--listora-primary));
	color: var(--listora-fg-inverse, var(--listora-bg-elevated));
	border-color: var(--listora-primary, var(--listora-primary));
}

.listora-btn--primary:hover {
	background: var(--listora-primary-hover, var(--listora-primary-hover));
	border-color: var(--listora-primary-hover, var(--listora-primary-hover));
	color: var(--listora-fg-inverse, var(--listora-bg-elevated));
}

.listora-btn--primary:focus {
	box-shadow: 0 0 0 1px var(--listora-fg-inverse, var(--listora-bg-elevated)), 0 0 0 3px var(--listora-primary, var(--listora-primary));
}

/* ── Danger button (Reset to Defaults) ── */
.listora-btn--danger {
	background: var(--listora-fg-inverse, var(--listora-bg-elevated));
	color: var(--listora-danger);
	border-color: var(--listora-danger);
}

.listora-btn--danger:hover {
	background: var(--listora-danger);
	color: var(--listora-fg-inverse, var(--listora-bg-elevated));
	border-color: var(--listora-danger);
}

.listora-btn--danger:focus {
	box-shadow: 0 0 0 1px var(--listora-fg-inverse, var(--listora-bg-elevated)), 0 0 0 3px var(--listora-danger);
}

/* ── Secondary button (Import/Export) ── */
.listora-btn--secondary {
	background: var(--listora-bg-surface, var(--listora-admin-bg-paper));
	color: var(--listora-primary, var(--listora-primary));
	border-color: var(--listora-primary, var(--listora-primary));
}

.listora-btn--secondary:hover {
	background: var(--listora-primary, var(--listora-primary));
	color: var(--listora-fg-inverse, var(--listora-bg-elevated));
	border-color: var(--listora-primary, var(--listora-primary));
}

.listora-btn--secondary:focus {
	box-shadow: 0 0 0 1px var(--listora-fg-inverse, var(--listora-bg-elevated)), 0 0 0 3px var(--listora-primary, var(--listora-primary));
}

/* ── Help tooltips ── */
.listora-help-tip {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	border: 1px solid var(--listora-fg-faint, var(--listora-wp-admin-text-faint));
	color: var(--listora-fg-faint, var(--listora-wp-admin-text-faint));
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	cursor: help;
	position: relative;
	vertical-align: middle;
	margin-inline-start: 4px;
	text-decoration: none;
}

.listora-help-tip:hover {
	border-color: var(--listora-primary, var(--listora-primary));
	color: var(--listora-primary, var(--listora-primary));
}

/* CSS-only tooltip using data-tip attribute: */
.listora-help-tip::after {
	content: attr(data-tip);
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%);
	background: var(--listora-text, var(--listora-wp-admin-text));
	color: var(--listora-fg-inverse, var(--listora-bg-elevated));
	font-size: 12px;
	font-weight: 400;
	line-height: 1.5;
	padding: 8px 12px;
	border-radius: 4px;
	white-space: normal;
	width: 260px;
	max-width: 300px;
	z-index: 100;
	pointer-events: none;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.15s, visibility 0.15s;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.listora-help-tip::before {
	content: '';
	position: absolute;
	bottom: calc(100% + 2px);
	left: 50%;
	transform: translateX(-50%);
	border: 6px solid transparent;
	border-top-color: var(--listora-text, var(--listora-wp-admin-text));
	z-index: 100;
	pointer-events: none;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.15s, visibility 0.15s;
}

.listora-help-tip:hover::after,
.listora-help-tip:hover::before,
.listora-help-tip:focus::after,
.listora-help-tip:focus::before {
	opacity: 1;
	visibility: visible;
}

/* ── Card head row (title + docs link) ── */
.listora-card__head-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
}

.listora-card__head-row > div:first-child {
	flex: 1 1 auto;
	min-width: 0;
}

/* ── Documentation link — always right-aligned ── */
.listora-docs-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	font-weight: 500;
	color: var(--listora-primary, var(--listora-primary));
	text-decoration: none;
	white-space: nowrap;
	padding: 6px 10px;
	border: 1px solid var(--listora-border, var(--listora-wp-admin-border));
	border-radius: 4px;
	background: var(--listora-fg-inverse, var(--listora-bg-elevated));
	flex-shrink: 0;
	margin-inline-start: auto;
	align-self: flex-start;
}

.listora-docs-link:hover {
	color: var(--listora-primary-hover, var(--listora-primary-hover));
	border-color: var(--listora-primary, var(--listora-primary));
	background: var(--listora-admin-bg-tint);
	text-decoration: none;
}

.listora-docs-link svg {
	width: 14px;
	height: 14px;
}

/* ── Settings saved notice override ── */
.listora-settings-wrap .notice {
	margin: 0 0 16px;
}

/* ── Responsive: sidebar collapses to horizontal ── */
@media screen and (max-width: 782px) {
	.listora-settings-wrap {
		flex-direction: column;
	}

	.listora-settings-sidebar {
		width: 100%;
		min-width: 0;
		flex-direction: column;
		border-right: none;
		border-bottom: 1px solid var(--listora-border, var(--listora-wp-admin-border));
	}

	.listora-settings-sidebar__brand {
		padding: 16px;
	}

	.listora-settings-nav-group {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		gap: 4px;
		padding: 8px 8px 8px 16px;
	}

	.listora-settings-nav-group__label {
		padding: 0 8px 0 0;
		white-space: nowrap;
	}

	.listora-settings-nav-item {
		margin: 0;
		padding: 6px 12px;
	}

	.listora-settings-content {
		padding: 16px;
	}

	.listora-card__head-row {
		flex-direction: column;
		gap: 8px;
	}

	.listora-settings-section__footer {
		flex-direction: column-reverse;
		gap: 8px;
		align-items: stretch;
	}

	.listora-settings-section__footer .listora-btn {
		justify-content: center;
	}

	.listora-help-tip::after {
		left: auto;
		right: 0;
		transform: none;
		width: 200px;
	}

	.listora-help-tip::before {
		left: auto;
		right: 4px;
		transform: none;
	}
}

/* ── Responsive: phones — nav scrolls horizontally instead of wrapping ──
 *
 * At ≤782px the sidebar nav-group wraps (flex-wrap: wrap), which on a narrow
 * phone stacks 10+ tabs into many rows and pushes the actual settings content
 * far down the page. Below 640px, switch to a single horizontal scroll row so
 * the nav stays one line tall and the content sits right under it. A right-edge
 * fade mask cues that the row scrolls; tap targets keep a 40px min-height. */
@media (max-width: 640px) {
	.listora-settings-nav-group {
		flex-wrap: nowrap;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scroll-snap-type: x proximity;
		-webkit-mask-image: linear-gradient(
			to right,
			rgb(0 0 0 / 1) calc(100% - var(--listora-space-6)),
			transparent 100%
		);
		mask-image: linear-gradient(
			to right,
			rgb(0 0 0 / 1) calc(100% - var(--listora-space-6)),
			transparent 100%
		);
	}

	.listora-settings-nav-group__label {
		flex-shrink: 0;
	}

	.listora-settings-nav-item {
		flex-shrink: 0;
		min-height: 40px;
		scroll-snap-align: start;
		white-space: nowrap;
	}
}

/* ────────────────────────────────────────────────────────────────────────
   Import / Export tab — clean 2-column card layout
   Replaces the previous mixed flex-row + form-table mess.
   ──────────────────────────────────────────────────────────────────────── */

.listora-impex {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.listora-impex .listora-impex__group-title {
	margin: 28px 0 4px;
	font-size: 16px;
	font-weight: 600;
	color: var(--listora-text, var(--listora-wp-admin-text));
	border: none;
	padding: 0;
}

.listora-impex .listora-impex__group-title:first-child {
	margin-top: 0;
}

.listora-impex__group-desc {
	margin: 0 0 16px;
	font-size: 13px;
	color: var(--listora-fg-faint, var(--listora-wp-admin-text-faint));
}

.listora-impex__cards {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
	margin-bottom: 12px;
}

@media (max-width: 1024px) {
	.listora-impex__cards {
		grid-template-columns: minmax(0, 1fr);
	}
}

.listora-impex__card {
	background: var(--listora-fg-inverse, var(--listora-bg-elevated));
	border: 1px solid var(--listora-border, var(--listora-wp-admin-border));
	border-radius: 8px;
	padding: 18px 20px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.listora-impex__card:hover {
	border-color: var(--listora-border-strong, var(--listora-border-strong));
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.listora-impex__card-head {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
}

.listora-impex__card-icon {
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	background: var(--listora-admin-bg-tint);
	border-radius: 6px;
	color: var(--listora-primary, var(--listora-primary));
	flex: 0 0 auto;
}

.listora-impex__card-icon svg {
	width: 16px;
	height: 16px;
}

.listora-impex__card-title {
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	color: var(--listora-text, var(--listora-wp-admin-text));
}

.listora-impex__card-desc {
	margin: 0;
	font-size: 13px;
	line-height: 1.5;
	color: var(--listora-fg-muted, var(--listora-wp-admin-text-muted));
}

.listora-impex__field {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.listora-impex__field label {
	font-size: 11px;
	font-weight: 600;
	color: var(--listora-fg-muted, var(--listora-wp-admin-text-muted));
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.listora-impex__field select,
.listora-impex__field input[type="file"],
.listora-impex__card > input[type="file"] {
	width: 100%;
	max-width: 100%;
	padding: 6px 8px;
	font-size: 13px;
	border: 1px solid var(--listora-border-strong, var(--listora-border-strong));
	border-radius: 4px;
	background: var(--listora-fg-inverse, var(--listora-bg-elevated));
}

.listora-impex__field select:focus,
.listora-impex__field input[type="file"]:focus {
	outline: 2px solid var(--listora-primary, var(--listora-primary));
	outline-offset: -1px;
	border-color: transparent;
}

.listora-impex__checkbox {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: var(--listora-fg-muted, var(--listora-wp-admin-text-muted));
	cursor: pointer;
	user-select: none;
}

/* CSV import column-mapping UI */

.listora-impex__mapping {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 4px 0 12px;
	padding: 12px;
	background: var(--listora-bg-surface, var(--listora-admin-bg-paper));
	border: 1px solid var(--listora-border, var(--listora-wp-admin-border));
	border-radius: 8px;
}

.listora-impex__mapping.is-hidden {
	display: none;
}

.listora-impex__mapping-title {
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	color: var(--listora-fg, var(--listora-wp-admin-text));
}

.listora-impex__mapping-hint {
	margin: 0 0 4px;
	font-size: 12px;
	color: var(--listora-fg-faint, var(--listora-wp-admin-text-faint));
}

.listora-impex__mapping-row {
	display: flex;
	align-items: center;
	gap: 12px;
}

.listora-impex__mapping-col {
	flex: 1 1 0;
	min-width: 0;
	font-size: 13px;
	color: var(--listora-fg-muted, var(--listora-wp-admin-text-muted));
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.listora-impex__mapping-select {
	flex: 1 1 0;
	min-width: 0;
}

@media (max-width: 640px) {
	.listora-impex__mapping-row {
		flex-direction: column;
		align-items: stretch;
		gap: 4px;
	}

	.listora-impex__mapping-col {
		white-space: normal;
	}
}

.listora-impex__card-foot {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	margin-top: auto;
	padding-top: 4px;
}

.listora-impex__status {
	font-size: 12px;
	color: var(--listora-fg-faint, var(--listora-wp-admin-text-faint));
	min-height: 16px;
}

.listora-impex__status.is-success {
	color: var(--listora-success-text, var(--listora-success-fg));
}

.listora-impex__status.is-error {
	color: var(--listora-danger-text, var(--listora-danger-fg));
}

/* WP-CLI collapsible footer */

.listora-impex__cli {
	margin: 16px 0 0;
	background: var(--listora-bg-surface, var(--listora-admin-bg-paper));
	border: 1px solid var(--listora-border, var(--listora-wp-admin-border));
	border-radius: 8px;
	font-size: 13px;
}

.listora-impex__cli > summary {
	list-style: none;
	cursor: pointer;
	padding: 12px 16px;
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 600;
	color: var(--listora-text, var(--listora-wp-admin-text));
	user-select: none;
}

.listora-impex__cli > summary::-webkit-details-marker {
	display: none;
}

.listora-impex__cli > summary::after {
	content: "▾";
	margin-inline-start: auto;
	color: var(--listora-fg-faint, var(--listora-wp-admin-text-faint));
	font-size: 12px;
	transition: transform 0.15s;
}

.listora-impex__cli[open] > summary::after {
	transform: rotate(180deg);
}

.listora-impex__cli > summary svg {
	width: 16px;
	height: 16px;
	color: var(--listora-fg-faint, var(--listora-wp-admin-text-faint));
}

.listora-impex__cli ul {
	margin: 0;
	padding: 0 16px 14px 16px;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.listora-impex__cli li {
	font-size: 12px;
	color: var(--listora-fg-muted, var(--listora-wp-admin-text-muted));
}

.listora-impex__cli code {
	background: var(--listora-fg-inverse, var(--listora-bg-elevated));
	border: 1px solid var(--listora-border, var(--listora-wp-admin-border));
	padding: 4px 8px;
	border-radius: 4px;
	font-size: 12px;
	color: var(--listora-text, var(--listora-wp-admin-text));
	font-family: Menlo, Consolas, monospace;
	display: inline-block;
}

/* ════════════════════════════════════════════════════════════════════
 * Extracted from inline <style> blocks in class-settings-page.php
 * (no inline CSS rule). All rules below were previously injected from
 * PHP at line 1701 / 1777 / 2138 / 2553 of the legacy renderer.
 * ════════════════════════════════════════════════════════════════════ */

/* ── Notifications tab — Send Test status pill ────────────────────── */
.listora-notification-test__status {
	margin-inline-start: 8px;
	font-size: 12px;
}

.listora-notification-test__status.is-progress {
	color: var(--listora-primary, var(--listora-primary));
}

.listora-notification-test__status.is-success {
	color: var(--listora-success, var(--listora-success));
}

.listora-notification-test__status.is-error {
	color: var(--listora-danger, var(--listora-danger));
}

/* ── Activity Log tab — log table ─────────────────────────────────── *
 * Visual chrome comes from the shared `.listora-table` primitive
 * (admin.css) — same primitive Claims, Reviews, and Listing Types use.
 * Keeping a sibling rule set here only for status colours + the empty
 * description state. 100% token-based per Part 7.2 / F3. */
.listora-notification-log .is-success {
	color: var(--listora-success-fg);
}

.listora-notification-log .is-error {
	color: var(--listora-danger-fg);
}

.listora-notification-log .description.is-error {
	color: var(--listora-danger-fg);
}

/* ── CSV / JSON export-import status helpers (Tools tab) ──────────── */
.listora-csv-export-status,
.listora-csv-import-status,
.listora-import-status {
	font-size: 12px;
	margin-inline-start: 8px;
}

.listora-csv-export-status.is-progress,
.listora-csv-import-status.is-progress,
.listora-import-status.is-progress {
	color: var(--listora-primary, var(--listora-primary));
}

.listora-csv-export-status.is-success,
.listora-csv-import-status.is-success,
.listora-import-status.is-success {
	color: var(--listora-success, var(--listora-success));
}

.listora-csv-export-status.is-error,
.listora-csv-import-status.is-error,
.listora-import-status.is-error {
	color: var(--listora-danger, var(--listora-danger));
}

/* ── Submission limits — overflow cost row toggle ─────────────────── */
.listora-overflow-cost-row.is-hidden {
	display: none;
}

/* ── Features tab — toggle-list (was inline at line 2138) ─────────── */
.listora-features-form {
	width: 100%;
}

.listora-features-list {
	display: flex;
	flex-direction: column;
	gap: 0;
	border: 1px solid var(--listora-border, var(--listora-border-default));
	border-radius: 8px;
	overflow: hidden;
	background: var(--listora-fg-inverse, var(--listora-bg-elevated));
}

.listora-feature-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1rem 1.25rem;
	border-bottom: 1px solid var(--listora-border, var(--listora-border-default));
}

.listora-feature-row:last-child {
	border-bottom: 0;
}

.listora-feature-row__main {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	flex: 1 1 auto;
	min-width: 0;
}

.listora-feature-row__icon {
	display: inline-flex;
	flex: 0 0 auto;
	width: 32px;
	height: 32px;
	align-items: center;
	justify-content: center;
	background: var(--listora-accent-soft, var(--listora-info-bg));
	color: var(--listora-accent, var(--listora-info));
	border-radius: 6px;
}

.listora-feature-row__icon i[data-lucide] {
	width: 18px;
	height: 18px;
}

.listora-feature-row__text {
	min-width: 0;
}

.listora-feature-row__label {
	display: block;
	font-weight: 600;
	font-size: 14px;
	line-height: 1.4;
	margin: 0 0 2px;
	color: var(--listora-text, var(--listora-wp-admin-text));
	cursor: pointer;
}

.listora-feature-row__desc {
	margin: 0;
	font-size: 13px;
	color: var(--listora-fg-faint, var(--listora-wp-admin-text-muted));
	line-height: 1.45;
}

.listora-feature-row__control {
	flex: 0 0 auto;
}

.listora-toggle {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	cursor: pointer;
	user-select: none;
}

.listora-toggle input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	pointer-events: none;
}

.listora-toggle__track {
	position: relative;
	width: 40px;
	height: 22px;
	background: var(--listora-border-strong);
	border-radius: 999px;
	transition: background-color 0.15s ease;
	flex: 0 0 auto;
}

.listora-toggle__thumb {
	position: absolute;
	top: 2px;
	left: 2px;
	width: 18px;
	height: 18px;
	background: var(--listora-bg-elevated);
	border-radius: 50%;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
	transition: transform 0.15s ease;
}

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

.listora-toggle input:checked + .listora-toggle__track .listora-toggle__thumb {
	transform: translateX(18px);
}

.listora-toggle input:focus-visible + .listora-toggle__track {
	outline: 2px solid var(--listora-accent, var(--listora-info));
	outline-offset: 2px;
}

.listora-toggle__status {
	font-size: 12px;
	font-weight: 600;
	min-width: 60px;
}

.listora-toggle .listora-toggle__on,
.listora-toggle .listora-toggle__off {
	display: none;
}

.listora-toggle input[type="checkbox"]:checked ~ .listora-toggle__status .listora-toggle__on {
	display: inline;
	color: var(--listora-success, var(--listora-success));
}

.listora-toggle input[type="checkbox"]:not(:checked) ~ .listora-toggle__status .listora-toggle__off {
	display: inline;
	color: var(--listora-fg-faint, var(--listora-wp-admin-text-muted));
}

@media (max-width: 640px) {
	.listora-feature-row {
		flex-direction: column;
		align-items: stretch;
	}

	.listora-feature-row__control {
		align-self: flex-end;
	}
}

/* ── Migration progress (Import / Export tab) ─────────────────────── */
@keyframes listora-spin {
	to { transform: rotate(360deg); }
}

.listora-btn--migrating {
	pointer-events: none;
	opacity: 0.7;
}

/* The progress fill width is driven via the --listora-migration-progress
 * CSS custom property that JS sets on the element — no inline style. */
.listora-migration-progress__fill {
	width: var(--listora-migration-progress, 0%);
	transition: width 0.25s ease;
}

/* ════════════════════════════════════════════════════════════════════
 * Email Log — standalone submenu page (was the Activity Log settings tab).
 * Reuses .listora-settings-block + .listora-notification-log table from
 * above, just outside the .listora-settings-content padded shell.
 * ════════════════════════════════════════════════════════════════════ */
.wb-listora-admin > .listora-settings-block {
	max-width: 1400px;
	margin: 0 0 20px;
	background: var(--listora-bg-elevated);
	border: 1px solid var(--listora-border);
	border-radius: 8px;
	box-shadow: var(--listora-shadow-sm);
	overflow: hidden;
}

.wb-listora-admin > .listora-settings-block > .listora-settings-block__head {
	padding: 16px 20px;
	background: var(--listora-bg-muted);
	border-bottom: 1px solid var(--listora-border);
}

.wb-listora-admin > .listora-settings-block > .listora-notification-log {
	padding: 16px 20px;
	min-height: 60px;
}

.wb-listora-admin > .listora-settings-block > .listora-notification-log .description {
	margin: 0;
	color: var(--listora-fg-muted);
	font-size: 13px;
}

/* ════════════════════════════════════════════════════════════════════
 * LAYOUT BREATHING ROOM — Settings page
 * Increases content padding so labels, inputs and the Documentation
 * button don't crowd the right edge of the wrap. Pairs with the
 * widened max-width below for desktop.
 * ════════════════════════════════════════════════════════════════════ */
.listora-settings-wrap {
	max-width: 1400px;
}

.listora-settings-content {
	padding: 28px 32px;
}

/* Tab header (the GENERAL / FEATURES / etc. heading card) — pull in a
 * touch more horizontal padding so the Documentation button on the right
 * sits with proper breathing room. */
.wb-listora-admin .listora-tab-header {
	padding: 1.25rem 1.5rem;
	margin-bottom: 1.5rem;
}

/* Section card heads — compact: title + one-line description should stay
 * around 52-56px. Tighter title→desc gap keeps related text grouped. */
.wb-listora-admin .listora-settings-block__head {
	padding: 0.625rem 1.5rem 0.75rem;
}

.wb-listora-admin .listora-settings-block__head .listora-settings-block__title {
	margin: 0;
	line-height: 1.4;
}

.wb-listora-admin .listora-settings-block__head .listora-settings-block__desc {
	margin: 2px 0 0;
	line-height: 1.4;
}

/* When head is the ONLY child of the block (no form fields or subcontent
 * follow it directly), don't add a bottom margin from the table. */
.wb-listora-admin .listora-settings-block__head + .form-table {
	margin-top: 0.25rem;
}

/* Inset the form-table inside the section card. Padding on <table> has no
 * effect on cell layout, so we apply matching horizontal padding to th/td
 * and use top/bottom margin for vertical breathing room. The 1.5rem (24px)
 * matches .listora-settings-block__head padding so labels align vertically
 * with the section title. */
.wb-listora-admin .listora-settings-pane .listora-settings-block > .form-table,
.wb-listora-admin .listora-settings-pane .listora-settings-block > table.form-table {
	margin: 0.5rem 0 1rem;
}

.wb-listora-admin .listora-settings-pane .listora-settings-block .form-table th {
	padding: 14px 16px 14px 1.5rem;
}

.wb-listora-admin .listora-settings-pane .listora-settings-block .form-table td {
	padding: 14px 1.5rem 14px 0;
}

@media screen and (max-width: 782px) {
	.wb-listora-admin .listora-settings-pane .listora-settings-block .form-table th {
		padding: 10px 1rem 4px 1rem;
	}

	.wb-listora-admin .listora-settings-pane .listora-settings-block .form-table td {
		padding: 4px 1rem 14px;
	}
}

@media screen and (max-width: 1024px) {
	.listora-settings-content {
		padding: 24px;
	}
}

@media screen and (max-width: 782px) {
	.listora-settings-content {
		padding: 20px 16px;
	}
}

/* ─── Page Registry — page-mapping status badges (Pages section in General tab) ─── */

.listora-page-status {
	display: inline-block;
	padding: 2px 8px;
	margin-inline-start: 8px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	vertical-align: middle;
	line-height: 1.6;
}

.listora-page-status--linked {
	background: var(--listora-success-soft, rgba(16, 163, 74, 0.12));
	color: var(--listora-success, var(--listora-success-fg));
}

.listora-page-status--missing,
.listora-page-status--trashed {
	background: var(--listora-warning-soft, rgba(217, 119, 6, 0.12));
	color: var(--listora-warning, var(--listora-warning-fg));
}

.listora-page-status--orphan {
	background: var(--listora-info-soft, rgba(59, 130, 246, 0.12));
	color: var(--listora-info, var(--listora-info-fg));
}

/* Page-review notice (post-activation) */

.listora-pages-review-notice .button {
	margin-inline-start: 0.5rem;
}

/* ─── Health Check (Settings → Advanced + standalone /listora-health page) ─── */
/* Moved from inline <style> blocks per CLAUDE.md "No inline CSS / JS in
   Listora admin" + Rule 6 of admin-ux-rulebook.md. */

.listora-health-block__body {
	padding: 0 1.5rem 1.5rem;
}

.listora-health-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
	gap: 1rem;
	margin-top: 1rem;
}

.listora-health-card {
	background: var(--listora-bg-elevated);
	border: 1px solid var(--listora-border, var(--listora-border-default));
	border-radius: var(--listora-radius-md, 8px);
	padding: 1rem 1.25rem;
	display: flex;
	gap: 0.75rem;
	align-items: flex-start;
}

.listora-health-card__icon {
	flex: 0 0 28px;
	height: 28px;
	width: 28px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 14px;
	line-height: 1;
	color: var(--listora-bg-elevated);
}

.listora-health-card__icon--pass {
	background: var(--listora-success, var(--listora-success));
}

.listora-health-card__icon--fail {
	background: var(--listora-danger, var(--listora-danger));
}

.listora-health-card__icon--warn {
	background: var(--listora-warning, var(--listora-warning));
}

.listora-health-card__body {
	flex: 1;
	min-width: 0;
}

.listora-health-card__title {
	font-weight: var(--listora-weight-semibold, 600);
	margin: 0 0 0.25rem;
	font-size: 14px;
}

.listora-health-card__desc {
	margin: 0;
	color: var(--listora-fg-muted, var(--listora-wp-admin-text-muted));
	font-size: 13px;
	line-height: 1.5;
}

.listora-health-card__fix {
	display: inline-block;
	margin-top: 0.5rem;
	font-size: 12px;
}

.listora-health-summary {
	display: flex;
	gap: 0.75rem;
	flex-wrap: wrap;
	margin-top: 0.75rem;
}

.listora-health-summary span {
	padding: 0.35rem 0.75rem;
	border-radius: 999px;
	font-size: 12px;
	font-weight: var(--listora-weight-semibold, 600);
}

.listora-health-summary .is-pass {
	background: var(--listora-success-soft, var(--listora-success-bg));
	color: var(--listora-success, var(--listora-success-fg));
}

.listora-health-summary .is-fail {
	background: var(--listora-danger-bg, var(--listora-danger-bg));
	color: var(--listora-danger, var(--listora-danger-fg));
}

.listora-health-summary .is-warn {
	background: var(--listora-warning-soft, var(--listora-warning-bg));
	color: var(--listora-warning, var(--listora-warning-fg));
}

/* ─── Card stacking — replace style="margin-top:1.5rem;" repeats ─── */
/* Consecutive .listora-card siblings auto-space. Drops the need for
   inline margin-top on the second-and-later cards in a vertical stack
   (Coupons, Transactions, Analytics, Badges metabox). */

.wb-listora-admin .listora-card + .listora-card,
.wb-listora-admin .listora-card + p,
.wb-listora-admin p + .listora-card {
	margin-top: 1.5rem;
}

/* .listora-card--padded — modifier for cards that need uniform internal
   padding (used by Badges metabox + Pro setup wizard previews). */
.listora-card--padded {
	padding: 1.5rem;
}

/* Followup paragraph after a card (Badges form helper text). */
.listora-card-followup {
	margin-top: 1.5rem;
}

/* ─── Email Log pagination + retention save status ────────────────────── */

.listora-notification-log__pagination {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1rem 1.5rem;
	border-top: 1px solid var(--listora-border, var(--listora-border-default));
	flex-wrap: wrap;
}

.listora-notification-log__pagination-label {
	font-size: var(--listora-text-sm, 0.875rem);
	color: var(--listora-fg-muted, var(--listora-wp-admin-text-muted));
	flex: 1;
	text-align: center;
	min-width: 200px;
}

/* Inline single-row form (used by Email Log retention controls).
 * Variant `--compact` is the routine-config shape: one label + one
 * input + a secondary save button + a hint line, no card chrome.
 * Use this when the form has ≤ 1 input and the action is not the
 * primary purpose of the page.
 */
.listora-inline-form--compact {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--listora-space-3);
	margin: 0 0 var(--listora-space-5);
	padding: var(--listora-space-3) var(--listora-space-4);
	background: var(--listora-bg-elevated);
	border: 1px solid var(--listora-border-subtle);
	border-radius: var(--listora-radius-md);
}

.listora-inline-form--compact .listora-inline-form__field {
	display: inline-flex;
	align-items: center;
	gap: var(--listora-space-2);
	margin: 0;
}

.listora-inline-form--compact .listora-inline-form__label {
	font-size: var(--listora-text-size-sm);
	color: var(--listora-fg-muted);
	font-weight: var(--listora-weight-medium);
}

.listora-inline-form--compact select {
	min-width: 180px;
}

.listora-inline-form__hint {
	flex: 1 1 100%;
	margin: 0;
	font-size: var(--listora-text-size-xs);
	color: var(--listora-fg-faint);
}

/* Inline form save status (used by Email Log retention save). */
.listora-inline-form__status {
	font-size: var(--listora-text-size-sm);
	color: var(--listora-fg-muted);
	min-height: 1.2em;
}

.listora-inline-form__status.is-success {
	color: var(--listora-success, var(--listora-success-fg));
}

.listora-inline-form__status.is-error {
	color: var(--listora-danger, var(--listora-danger-fg));
}

@media (max-width: 640px) {
	.listora-notification-log__pagination {
		gap: 0.5rem;
	}
	.listora-notification-log__pagination-label {
		flex: 1 1 100%;
		text-align: center;
		order: -1;
	}
}

/* ─── Help block (collapsible setup guide) ───
 * Used in Payment Webhook section to expose per-provider integration
 * steps without dumping the docs into the main settings flow.
 */
.listora-help-block {
	margin-top: 1rem;
	border-radius: var(--listora-radius-md, 6px);
	border: 1px solid var(--listora-border-subtle, var(--listora-wp-admin-border));
	background: var(--listora-bg-surface);
	overflow: hidden;
}

.listora-help-block > summary {
	cursor: pointer;
	list-style: none;
	padding: 0.875rem 1rem;
	font-weight: var(--listora-weight-medium, 500);
	font-size: var(--listora-text-sm, 0.9rem);
	color: var(--listora-fg-default, inherit);
	background: var(--listora-bg-elevated, var(--listora-wp-admin-bg-light));
	user-select: none;
	transition: background var(--listora-transition-fast, 150ms ease);
}

.listora-help-block > summary::-webkit-details-marker {
	display: none;
}

.listora-help-block > summary::before {
	content: "▸";
	display: inline-block;
	margin-inline-end: 0.5rem;
	transition: transform var(--listora-transition-fast, 150ms ease);
}

.listora-help-block[open] > summary::before {
	transform: rotate(90deg);
}

.listora-help-block > summary:hover,
.listora-help-block > summary:focus-visible {
	background: var(--listora-bg-elevated);
}

.listora-help-block__body {
	padding: 1rem 1.25rem 1.25rem;
}

.listora-help-block__body h4 {
	margin: 1.25rem 0 0.5rem;
	font-size: var(--listora-text-sm, 0.9rem);
	font-weight: var(--listora-weight-semibold, 600);
}

.listora-help-block__body h4:first-child {
	margin-top: 0;
}

.listora-help-block__body table.widefat {
	margin: 0.5rem 0 1rem;
}

.listora-help-block__body ol {
	margin: 0.5rem 0 1rem 1.25rem;
}

.listora-help-block__body code {
	font-size: 0.85em;
	padding: 1px 4px;
	background: var(--listora-bg-elevated, rgba(0, 0, 0, 0.04));
	border-radius: 3px;
}

.listora-help-block__body pre code {
	display: block;
	padding: 0;
	background: transparent;
}

/* ─── Pane-to-pane spacing ───
 * Within a .listora-settings-pane, sections get 20px gap via flex.
 * Adjacent panes (multiple .listora-settings-pane siblings inside the
 * same tab container) had 0 gap → cards touched. Match the in-pane
 * rhythm so the visual cadence stays consistent.
 */
.listora-settings-pane + .listora-settings-pane {
	margin-top: 20px;
}

/* ─── Help block — polish ───
 * Tighter table chrome (token-based, no WP-admin widefat striping
 * which clashes with the Listora card aesthetic). Callout-style code
 * block. Sub-heading rhythm aligned with .listora-settings-block.
 */
.listora-help-block__body table {
	width: 100%;
	border-collapse: collapse;
	margin: 0.5rem 0 1.25rem;
	border: 1px solid var(--listora-border-subtle);
	border-radius: var(--listora-radius-sm, 4px);
	overflow: hidden;
	background: var(--listora-bg-elevated);
}

.listora-help-block__body table thead th {
	background: var(--listora-bg-elevated);
	font-weight: var(--listora-weight-semibold, 600);
	font-size: 0.85rem;
	color: var(--listora-fg-default);
	text-align: start;
	padding: 0.55rem 0.75rem;
	border-block-end: 1px solid var(--listora-border-subtle);
}

.listora-help-block__body table tbody td {
	padding: 0.55rem 0.75rem;
	font-size: 0.85rem;
	vertical-align: top;
	border-block-end: 1px solid var(--listora-border-subtle);
}

.listora-help-block__body table tbody tr:last-child td {
	border-block-end: 0;
}

.listora-help-block__body table tbody td code {
	white-space: nowrap;
}

.listora-help-block__body ol {
	margin: 0.5rem 0 1.25rem 1.5rem;
	padding: 0;
	font-size: 0.9rem;
	line-height: 1.55;
}

.listora-help-block__body ol li {
	margin-bottom: 0.4rem;
}

.listora-help-block__body ol li:last-child {
	margin-bottom: 0;
}

.listora-help-block__body pre {
	margin: 0.5rem 0 0.75rem;
	padding: 0.875rem 1rem;
	background: var(--listora-bg-elevated);
	border: 1px solid var(--listora-border-subtle);
	border-radius: var(--listora-radius-sm, 4px);
	overflow: auto;
	font-size: 0.8rem;
	line-height: 1.5;
}

.listora-help-block__body pre code {
	font-family: var(--listora-font-mono, ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace);
	color: var(--listora-fg-default);
}

.listora-help-block__body > .description {
	margin: 0 0 0.75rem;
	font-size: 0.85rem;
	color: var(--listora-fg-muted);
}
