/**
 * MarginBeacon admin styles — modern foundation with CSS custom properties,
 * reusable components, and WCAG AA accessibility.
 *
 * Preserves WordPress core styles; scoped under .aksmb-wrap.
 */

:root {
	--aksmb-spacing-xs: 0.5rem;
	--aksmb-spacing-sm: 0.75rem;
	--aksmb-spacing-md: 1rem;
	--aksmb-spacing-lg: 1.5rem;
	--aksmb-spacing-xl: 2rem;

	--aksmb-radius-sm: 4px;
	--aksmb-radius-md: 8px;
	--aksmb-radius-lg: 12px;
	--aksmb-radius-full: 9999px;

	--aksmb-surface: #fff;
	--aksmb-surface-subtle: #f6f7f7;
	--aksmb-surface-elevated: #ffffff;
	--aksmb-foreground: #1d2327;
	--aksmb-muted: #646970;
	--aksmb-border: #d8dbe0;
	--aksmb-border-strong: #c3c4c7;
	--aksmb-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);

	--aksmb-severity-critical-bg: #fcf0f1;
	--aksmb-severity-critical-border: #d63638;
	--aksmb-severity-critical-fg: #b32d2e;

	--aksmb-severity-high-bg: #fcf0f1;
	--aksmb-severity-high-border: #e65054;
	--aksmb-severity-high-fg: #d63638;

	--aksmb-severity-warning-bg: #fcf9e8;
	--aksmb-severity-warning-border: #dba617;
	--aksmb-severity-warning-fg: #996800;

	--aksmb-severity-safe-bg: #edfaef;
	--aksmb-severity-safe-border: #00a32a;
	--aksmb-severity-safe-fg: #007017;

	--aksmb-severity-unknown-bg: #f0f6fc;
	--aksmb-severity-unknown-border: #72aee6;
	--aksmb-severity-unknown-fg: #135e96;

	--aksmb-focus-ring: #2271b1;
}

/* RTL support: direction-aware */
html[dir="rtl"] .aksmb-wrap {
	direction: rtl;
}

/* Scope: all MarginBeacon admin under .aksmb-wrap only */
.aksmb-wrap {
	max-width: min(1100px, 100%);
	width: 100%;
	box-sizing: border-box;
	min-width: 0;
	overflow-x: clip;
}

/* --- Page Header --- */
.aksmb-header {
	margin-bottom: var( --aksmb-spacing-lg, 16px );
	padding-bottom: var( --aksmb-spacing-md, 12px );
	border-bottom: 1px solid var( --aksmb-border, #c3c4c7 );
}

.aksmb-header title {
	margin: 0 0 var( --aksmb-spacing-xs, 4px );
	font-size: 1.875rem;
	font-weight: 600;
	color: var( --aksmb-foreground, #1d2327 );
}

.aksmb-header__subtitle {
	margin: 0 0 var( --aksmb-spacing-sm, 6px );
	font-size: 0.875rem;
	color: var( --aksmb-muted, #646970 );
}

.aksmb-header__status {
	margin: 0;
	font-size: 0.85rem;
	color: var( --aksmb-muted, #646970 );
}

/* --- Navigation Tabs --- */
.aksmb-nav-tabs {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 0;
	margin: 16px 0 20px;
	max-width: 100%;
	padding-bottom: 2px;
	border-bottom: 1px solid var( --aksmb-border, #d8dbe0 );
}

.aksmb-nav-tabs__list {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0 0 -1px;
}

.aksmb-nav-tab {
	float: none;
	margin: 0;
	padding: 9px 14px;
	font-size: 0.875rem;
	font-weight: 500;
	color: var( --aksmb-muted, #646970 );
	background: transparent;
	border: 1px solid transparent;
	border-bottom: none;
	border-radius: var( --aksmb-radius-md, 8px ) var( --aksmb-radius-md, 8px ) 0 0;
	text-decoration: none;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.aksmb-nav-tab:hover,
.aksmb-nav-tab:focus-visible {
	background: var( --aksmb-surface-subtle, #f6f7f7 );
	color: var( --aksmb-foreground, #1d2327 );
}

.aksmb-nav-tab.is-active {
	background: var( --aksmb-surface, #fff );
	color: var( --aksmb-foreground, #1d2327 );
	border-color: var( --aksmb-border, #d8dbe0 );
	border-bottom-color: var( --aksmb-surface, #fff );
	font-weight: 600;
	box-shadow: 0 -1px 0 var( --aksmb-surface, #fff );
}

.aksmb-nav-tab[aria-current="page"] {
	border-color: var( --aksmb-border, #d8dbe0 );
	border-bottom-color: var( --aksmb-surface, #fff );
}

/* Tab panel region */
.aksmb-tab-panel {
	margin-top: 4px;
	min-width: 0;
	max-width: 100%;
	overflow-x: clip;
}

/* --- Grid / Layout --- */
.aksmb-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 24px;
	margin-top: 24px;
}

/* Dashboard overview — clearer hierarchy */
.aksmb-dashboard,
.aksmb-page {
	max-width: 1120px;
}

.aksmb-dashboard .aksmb-tagline {
	font-size: 0.9375rem;
	line-height: 1.5;
	margin-bottom: 12px;
}

.aksmb-dashboard .aksmb-disclaimer.notice {
	margin: 0 0 20px;
	border-radius: var( --aksmb-radius-md, 8px );
	border-left-width: 3px;
	box-shadow: none;
}

.aksmb-grid--dashboard {
	display: grid;
	grid-template-columns: 1fr;
	gap: 20px;
	margin-top: 20px;
	align-items: stretch;
}

@media (min-width: 1100px) {
	.aksmb-grid--dashboard {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 20px;
	}

	.aksmb-grid--dashboard > .aksmb-pro-cta-card {
		grid-column: 1 / -1;
	}
}

.aksmb-panel--dashboard {
	display: flex;
	flex-direction: column;
	padding: 20px 22px;
	border-color: var( --aksmb-border, #d8dbe0 );
	border-radius: var( --aksmb-radius-lg, 12px );
	box-shadow: var( --aksmb-shadow-sm );
}

.aksmb-panel--dashboard .aksmb-section-header {
	margin-bottom: 10px;
}

.aksmb-panel--dashboard .aksmb-section-header h2 {
	font-size: 1.05rem;
	letter-spacing: -0.01em;
}

.aksmb-panel__lead {
	margin: 0 0 14px;
	color: var( --aksmb-muted, #646970 );
	font-size: 0.875rem;
	line-height: 1.5;
	max-width: 62ch;
}

.aksmb-panel__note {
	margin: 10px 0 0;
	color: var( --aksmb-muted, #646970 );
	font-size: 0.8125rem;
	line-height: 1.45;
}

.aksmb-panel__subheading {
	margin: 0 0 10px;
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var( --aksmb-muted, #646970 );
}

.aksmb-stat-row {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 16px 20px;
	margin-bottom: 8px;
}

.aksmb-stat {
	flex: 0 0 auto;
	min-width: 88px;
}

.aksmb-stat__value {
	margin: 0;
	font-size: 2rem;
	font-weight: 700;
	line-height: 1;
	letter-spacing: -0.03em;
	color: var( --aksmb-foreground, #1d2327 );
	font-variant-numeric: tabular-nums;
}

.aksmb-stat__unit {
	font-size: 1.1rem;
	font-weight: 600;
	margin-left: 1px;
	color: var( --aksmb-muted, #646970 );
}

.aksmb-stat__label {
	margin: 6px 0 0;
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var( --aksmb-muted, #646970 );
}

.aksmb-stat-row__copy {
	flex: 1 1 180px;
	min-width: 0;
}

.aksmb-stat-row__copy .aksmb-coverage__summary {
	margin: 0 0 4px;
}

.aksmb-stat-row__copy .aksmb-coverage__breakdown {
	margin: 0;
}

.aksmb-kv--compact li {
	padding: 8px 0;
}

.aksmb-kv--compact li:last-child {
	border-bottom: 0;
}

.aksmb-kv__emphasis {
	font-size: 1.05rem;
	color: var( --aksmb-focus-ring, #2271b1 );
}

.aksmb-risk-block {
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid #eef0f2;
}

.aksmb-details {
	margin-top: 14px;
}

.aksmb-details summary {
	cursor: pointer;
	font-weight: 600;
	color: var( --aksmb-focus-ring, #2271b1 );
}

.aksmb-details ul {
	margin: 8px 0 0;
	padding-left: 1.2em;
}

/* --- Reusable Components --- */

/* Panel / Card */
.aksmb-panel {
	background: var( --aksmb-surface, #fff );
	border: 1px solid var( --aksmb-border, #c3c4c7 );
	border-radius: var( --aksmb-radius-md, 6px );
	padding: 16px 20px;
	max-width: 100%;
	min-width: 0;
	box-sizing: border-box;
	overflow-x: clip;
}

.aksmb-panel > :first-child {
	margin-top: 0;
}

.aksmb-panel > :last-child {
	margin-bottom: 0;
}

/* Stacked panels (Help, Preflight, etc.) need vertical rhythm between siblings. */
.aksmb-panel + .aksmb-panel {
	margin-top: 24px;
}

/* Inside the dashboard grid, gap already provides the spacing. */
.aksmb-grid > .aksmb-panel + .aksmb-panel {
	margin-top: 0;
}

/* Section header — descendant of panels/regions */
.aksmb-section-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var( --aksmb-spacing-sm, 8px );
	flex-wrap: wrap;
	margin-bottom: var( --aksmb-spacing-md, 12px );
}

.aksmb-section-header h2,
.aksmb-section-header h3 {
	margin: 0;
	font-size: 1.1rem;
	font-weight: 600;
	color: var( --aksmb-foreground, #1d2327 );
}

/* Settings grouped fieldsets — keep native form-table inside */
.aksmb-settings-group {
	border: 1px solid var( --aksmb-border, #d8dbe0 );
	border-radius: var( --aksmb-radius-lg, 12px );
	padding: 20px 22px 22px;
	margin: 0 0 18px;
	min-width: 0;
	background: var( --aksmb-surface, #fff );
	box-shadow: var( --aksmb-shadow-sm );
}
.aksmb-settings-group > legend.screen-reader-text {
	/* Keep accessible name; visual title is the h2 below. */
	clip: rect(1px, 1px, 1px, 1px);
	height: 1px;
	width: 1px;
	overflow: hidden;
	position: absolute !important;
	word-wrap: normal !important;
}
.aksmb-settings-group > .aksmb-section-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin: 0 0 10px;
	padding: 0 0 12px;
	border-bottom: 1px solid #eef0f2;
}
.aksmb-settings-group > .aksmb-section-header h2 {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 700;
	letter-spacing: -0.01em;
	color: var( --aksmb-foreground, #1d2327 );
}
.aksmb-settings-group > .aksmb-panel__lead {
	margin-top: 0;
}
.aksmb-settings-form {
	max-width: 860px;
}
.aksmb-kv--narrow {
	max-width: 480px;
}
.aksmb-threshold-input {
	width: 96px;
}
.aksmb-threshold-input--critical { border-left: 3px solid var( --aksmb-severity-critical-border, #d63638 ); }
.aksmb-threshold-input--high { border-left: 3px solid var( --aksmb-severity-high-border, #dba617 ); }
.aksmb-threshold-input--warning { border-left: 3px solid var( --aksmb-severity-warning-border, #dba617 ); }

/* Nested fieldset inside settings groups (no double border) */
.aksmb-ack-fieldset.aksmb-nested {
	border-style: dashed;
	background: var( --aksmb-surface-subtle, #f6f7f7 );
	margin: 8px 0 0;
}

/* Metric card */
.aksmb-metric {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: var( --aksmb-spacing-md, 12px );
	background: var( --aksmb-surface, #fff );
	border: 1px solid var( --aksmb-border, #c3c4c7 );
	border-radius: var( --aksmb-radius-md, 6px );
	min-width: 0;
}

.aksmb-metric__label {
	font-size: 0.8125rem;
	color: var( --aksmb-muted, #646970 );
}

.aksmb-metric__value {
	font-size: 1.5rem;
	font-weight: 600;
	color: var( --aksmb-foreground, #1d2327 );
	line-height: 1.1;
}

.aksmb-metric__value--critical { color: var( --aksmb-severity-critical-fg, #b32d2e ); }
.aksmb-metric__value--high { color: var( --aksmb-severity-high-fg, #d63638 ); }
.aksmb-metric__value--warning { color: var( --aksmb-severity-warning-fg, #996800 ); }
.aksmb-metric__value--safe { color: var( --aksmb-severity-safe-fg, #007017 ); }
.aksmb-metric__value--unknown { color: var( --aksmb-severity-unknown-fg, #135e96 ); }

/* Empty state */
.aksmb-empty {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var( --aksmb-spacing-sm, 8px );
	padding: 16px 18px;
	border: 1px dashed var( --aksmb-border-strong, #c3c4c7 );
	border-radius: var( --aksmb-radius-md, 8px );
	color: var( --aksmb-muted, #646970 );
	background: var( --aksmb-surface-subtle, #f6f7f7 );
}

.aksmb-empty__title {
	margin: 0;
	font-weight: 600;
	color: var( --aksmb-foreground, #1d2327 );
}

.aksmb-empty p {
	margin: 0;
}

/* Callout */
.aksmb-callout {
	background: var( --aksmb-surface, #fff );
	border-left: 4px solid var( --aksmb-focus-ring, #2271b1 );
	border-radius: 0 var( --aksmb-radius-sm, 4px ) var( --aksmb-radius-sm, 4px ) 0;
	padding: 12px 16px;
	margin: 12px 0;
	color: var( --aksmb-foreground, #1d2327 );
}

.aksmb-callout--warning {
	border-left-color: var( --aksmb-severity-warning-border, #dba617 );
}

.aksmb-callout--critical {
	border-left-color: var( --aksmb-severity-critical-border, #d63638 );
}

.aksmb-callout--info {
	border-left-color: var( --aksmb-focus-ring, #2271b1 );
}

/* Action row */
.aksmb-action-row {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: var( --aksmb-spacing-sm, 8px );
	margin: 16px 0 0;
	padding: 0;
}

.aksmb-action-row .button {
	margin: 0;
	float: none;
}

/* Severity + lifecycle badges */
.aksmb-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	line-height: 1.5;
	padding: 0.2em 0.6em;
	border: 1px solid transparent;
	border-radius: var( --aksmb-radius-sm, 4px );
	background: #f0f0f1;
	color: #50575e;
	font-size: 0.8125rem;
	font-weight: 600;
	white-space: nowrap;
	box-sizing: border-box;
	margin: 0;
}

/* Color is never the only signal: include a text label glyph for SR */
.aksmb-badge::before {
	content: "";
}

.aksmb-badge--critical {
	background: var( --aksmb-severity-critical-bg, #fcf0f1 );
	border-color: var( --aksmb-severity-critical-border, #d63638 );
	color: var( --aksmb-severity-critical-fg, #b32d2e );
}

.aksmb-badge--high {
	background: var( --aksmb-severity-high-bg, #fcf0f1 );
	border-color: var( --aksmb-severity-high-border, #e65054 );
	color: var( --aksmb-severity-high-fg, #d63638 );
}

.aksmb-badge--warning {
	background: var( --aksmb-severity-warning-bg, #fcf9e8 );
	border-color: var( --aksmb-severity-warning-border, #dba617 );
	color: var( --aksmb-severity-warning-fg, #996800 );
}

.aksmb-badge--safe {
	background: var( --aksmb-severity-safe-bg, #edfaef );
	border-color: var( --aksmb-severity-safe-border, #00a32a );
	color: var( --aksmb-severity-safe-fg, #007017 );
}

.aksmb-badge--unknown {
	background: var( --aksmb-severity-unknown-bg, #f0f6fc );
	border-color: var( --aksmb-severity-unknown-border, #72aee6 );
	color: var( --aksmb-severity-unknown-fg, #135e96 );
}

.aksmb-badge--pending {
	background: #fef8ee;
	border-color: #dba617;
	color: #996800;
}

.aksmb-badge--failed {
	background: #fcf0f1;
	border-color: #d63638;
	color: #b32d2e;
}

.aksmb-badge--muted {
	background: #f0f0f1;
	border-color: #c3c4c7;
	color: #646970;
}

/* Long labels (e.g. free-shipping Safe) — wrap inside narrow side metabox */
.aksmb-badge--wrap {
	display: inline-block;
	white-space: normal;
	line-height: 1.35;
	padding: 0.35em 0.7em;
	text-align: left;
	max-width: 100%;
	height: auto;
}

.aksmb-badge--freshness-fresh {
	background: #edfaef;
	border-color: #00a32a;
	color: #007017;
}

.aksmb-badge--freshness-partial_stale,
.aksmb-badge--freshness-stale,
.aksmb-badge--freshness-pending_refresh {
	background: #fcf9e8;
	border-color: #dba617;
	color: #996800;
}

.aksmb-badge--freshness-needs_verification {
	background: #fcf0f1;
	border-color: #d63638;
	color: #b32d2e;
}

.aksmb-badge--pro {
	background: #f0f6fc;
	color: #135e96;
	border: 1px solid #c3d9ed;
}

/* Right-to-left adjustments for badges' gap */
html[dir="rtl"] .aksmb-badge {
	flex-direction: row-reverse;
}

/* Tagline remains as a quiet description line under page header */
.aksmb-tagline {
	font-size: 0.875rem;
	color: var( --aksmb-muted, #646970 );
	margin: 0 0 var( --aksmb-spacing-md, 12px );
}

/* Wide admin tables — scroll inside panel at zoom / narrow widths (WCAG reflow) */
.aksmb-table-scroll {
	display: block;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	overflow-x: auto;
	overflow-y: visible;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior-x: contain;
	contain: inline-size;
	margin-bottom: 4px;
}

.aksmb-table-scroll > table,
.aksmb-table-scroll > .widefat {
	display: table;
	width: max-content;
	min-width: 100%;
	max-width: none;
	margin-bottom: 0;
}

.aksmb-table-scroll:focus {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

.aksmb-table-scroll .widefat th,
.aksmb-table-scroll .widefat td {
	white-space: normal;
	vertical-align: top;
}

.aksmb-table-scroll .aksmb-badge {
	white-space: normal;
	max-width: 12rem;
	height: auto;
	line-height: 1.35;
	padding: 0.35em 0.6em;
}

.aksmb-inventory-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 0 0 14px;
	padding: 12px 14px;
	background: var( --aksmb-surface-subtle, #f6f7f7 );
	border: 1px solid #eef0f2;
	border-radius: var( --aksmb-radius-md, 8px );
}

.aksmb-inventory-filters input[type="search"],
.aksmb-inventory-filters select {
	max-width: 100%;
	margin: 0;
}

.aksmb-inventory-table {
	width: max-content;
	min-width: 100%;
	max-width: none;
}

.aksmb-inventory-table code {
	word-break: break-word;
}

#wpbody-content .wrap.aksmb-wrap {
	max-width: 100%;
	padding-left: 10px;
		padding-right: 10px;
	overflow-x: clip;
}

.aksmb-panel h2 {
	margin-top: 0;
}

.aksmb-kv {
	list-style: none;
	margin: 0;
	padding: 0;
}

.aksmb-kv li {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 12px;
	padding: 6px 0;
	border-bottom: 1px solid #f0f0f1;
}

.aksmb-kv li > span {
	flex: 0 0 auto;
	color: #646970;
	max-width: 42%;
}

.aksmb-kv li > strong {
	flex: 1 1 auto;
	text-align: right;
	min-width: 0;
	overflow-wrap: anywhere;
	word-break: break-word;
}

.aksmb-steps {
	margin: 0 0 16px 1.2em;
	padding: 0;
	list-style: disc;
}

.aksmb-steps li {
	margin-bottom: 8px;
}

.aksmb-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 16px 0 0;
	padding: 0;
}

.aksmb-actions .button {
	margin: 0;
	float: none;
}

/* Promo Risk badges — mirror WooCommerce order-status marks */
.aksmb-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 2.2em;
	padding: 0 0.8em;
	border: 1px solid transparent;
	border-radius: 4px;
	background: #f0f0f1;
	color: #50575e;
	font-size: 0.85em;
	font-weight: 600;
	white-space: nowrap;
	box-sizing: border-box;
	margin: 0;
}

.aksmb-badge--critical {
	background: #fcf0f1;
	border-color: #d63638;
	color: #b32d2e;
}

.aksmb-badge--high {
	background: #fcf0f1;
	border-color: #e65054;
	color: #d63638;
}

.aksmb-badge--warning {
	background: #fcf9e8;
	border-color: #dba617;
	color: #996800;
}

.aksmb-badge--safe {
	background: #edfaef;
	border-color: #00a32a;
	color: #007017;
}

.aksmb-badge--unknown {
	background: #f0f6fc;
	border-color: #72aee6;
	color: #135e96;
}

.aksmb-badge--pending {
	background: #fef8ee;
	border-color: #dba617;
	color: #996800;
}

.aksmb-badge--failed {
	background: #fcf0f1;
	border-color: #d63638;
	color: #b32d2e;
}

.aksmb-badge--muted {
	background: #f0f0f1;
	border-color: #c3c4c7;
	color: #646970;
}

/* Long labels (e.g. free-shipping Safe) — wrap inside narrow side metabox */
.aksmb-badge--wrap {
	display: inline-block;
	white-space: normal;
	line-height: 1.35;
	padding: 0.35em 0.7em;
	text-align: left;
	max-width: 100%;
	height: auto;
}

.aksmb-badge--freshness-fresh {
	background: #edfaef;
	border-color: #00a32a;
	color: #007017;
}

.aksmb-badge--freshness-partial_stale,
.aksmb-badge--freshness-stale,
.aksmb-badge--freshness-pending_refresh {
	background: #fcf9e8;
	border-color: #dba617;
	color: #996800;
}

.aksmb-badge--freshness-needs_verification {
	background: #fcf0f1;
	border-color: #d63638;
	color: #b32d2e;
}

.aksmb-badge--pro {
	background: #f0f6fc;
	color: #135e96;
	border: 1px solid #c3d9ed;
}

.aksmb-pro-upgrade__header {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: 8px 16px;
	margin-bottom: 8px;
}

.aksmb-pro-upgrade__title {
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.aksmb-pro-upgrade__dismiss {
	font-size: 13px;
	line-height: 1.4;
	text-decoration: none;
}

.aksmb-pro-upgrade__price {
	color: #50575e;
	margin: 12px 0;
}

.aksmb-pro-upgrade__steps {
	margin: 12px 0 16px;
	padding: 0 20px;
}

.aksmb-pro-upgrade__actions .button.disabled {
	pointer-events: none;
	opacity: 0.65;
}

.aksmb-pro-upgrade__pending {
	margin-top: 8px;
}

/* State-aware Pro upgrade card (dashboard + contextual Pro panels) */
.aksmb-pro-cta-card {
	border: 1px solid #c3d9ed;
	border-radius: var( --aksmb-radius-md, 6px );
	background: #f6f8fa;
}

.aksmb-pro-cta-card__title {
	margin: 0 0 8px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.aksmb-pro-cta-card__body {
	margin: 0 0 12px;
	max-width: 72ch;
}

.aksmb-pro-cta-card__price {
	margin: 0 0 12px;
	color: #50575e;
	font-weight: 600;
}

.aksmb-pro-cta-card__actions {
	margin: 0;
}

/* Signed money (preflight gross profit, etc.) */
.aksmb-money {
	font-variant-numeric: tabular-nums;
	font-weight: 600;
}

.aksmb-money--negative {
	color: #b32d2e;
}

.aksmb-money--positive {
	color: #007017;
}

.aksmb-money--zero {
	color: #646970;
}

.column-aksmb_promo_risk {
	width: 14%;
}

.aksmb-promo-risk-cell {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
}

.aksmb-dual-context {
	display: block;
	max-width: 220px;
	font-size: 11px;
	line-height: 1.35;
	color: #50575e;
	font-weight: 400;
	white-space: normal;
}

.aksmb-order-panel {
	margin: 0;
	max-width: 100%;
	overflow: visible;
}

.aksmb-order-panel .aksmb-kv {
	margin: 0;
}

.aksmb-order-panel .aksmb-kv li {
	align-items: flex-start;
}

.aksmb-order-panel .aksmb-kv li > span {
	max-width: 38%;
	padding-top: 2px;
}

.aksmb-order-panel .aksmb-kv li > strong {
	font-size: 12px;
	line-height: 1.4;
	min-width: 0;
	max-width: 62%;
	overflow-wrap: anywhere;
	word-break: break-word;
	white-space: normal;
}

.aksmb-order-panel .aksmb-kv__badge {
	flex-wrap: wrap;
}

.aksmb-order-panel .aksmb-kv__badge > strong {
	min-width: 0;
	max-width: 62%;
	overflow-wrap: anywhere;
	word-break: break-word;
	white-space: normal;
}

.aksmb-order-panel .aksmb-kv__badge > span:first-child {
	max-width: 100%;
}

.aksmb-dual-context-detail,
.aksmb-reason-text {
	text-align: right;
	font-weight: 600;
	white-space: normal;
	max-width: none;
}

.aksmb-origin-tag {
	display: inline-block;
	font-size: 10px;
	line-height: 1.4;
	padding: 0 6px;
	border: 1px solid #c3c4c7;
	border-radius: 3px;
	color: #646970;
	background: #f6f7f7;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

.aksmb-refund-tag {
	display: inline-block;
	font-size: 10px;
	line-height: 1.4;
	padding: 0 6px;
	border: 1px solid #dba617;
	border-radius: 3px;
	color: #996800;
	background: #fcf9e8;
	font-weight: 600;
}

.aksmb-refund-label {
	color: #996800;
}

.aksmb-ack-block {
	margin-top: 16px;
	padding-top: 14px;
	border-top: 1px solid #dcdcde;
}

.aksmb-ack-block h4 {
	margin: 0 0 4px;
	font-size: 13px;
}

.aksmb-ack-block > .description {
	margin: 0 0 12px;
	line-height: 1.45;
}

.aksmb-ack-row {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 8px;
	margin: 0 0 12px;
	padding: 10px 12px;
	background: #f6f7f7;
	border: 1px solid #dcdcde;
	border-radius: 4px;
}

.aksmb-ack-row:last-child {
	margin-bottom: 0;
}

.aksmb-ack-row__title {
	margin: 0;
	font-weight: 600;
	font-size: 13px;
	line-height: 1.35;
	color: #1d2327;
}

.aksmb-ack-row__reason {
	margin: 0;
	font-size: 12px;
	line-height: 1.4;
	color: #50575e;
}

.aksmb-ack-row__reason span {
	font-weight: 600;
	color: #646970;
}

.aksmb-ack-form {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 8px;
	margin: 0;
}

.aksmb-ack-form .button {
	margin: 0;
	float: none;
	width: 100%;
	justify-content: center;
	text-align: center;
}

.aksmb-ack-form__reason {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	margin: 0;
}

/* COGS Wizard */
.aksmb-wizard {
	max-width: 920px;
}

.aksmb-wizard-header {
	margin: 0 0 16px;
}

.aksmb-wizard-progress {
	margin: 0 0 8px;
	font-size: 0.875rem;
	color: var( --aksmb-muted, #646970 );
	font-weight: 600;
}

.aksmb-wizard-progress-bar {
	height: 6px;
	width: 100%;
	max-width: 420px;
	background: #e8eaed;
	border-radius: var( --aksmb-radius-full, 9999px );
	overflow: hidden;
}

.aksmb-wizard-progress-bar__fill {
	display: block;
	height: 100%;
	background: var( --aksmb-focus-ring, #2271b1 );
	border-radius: inherit;
}

.aksmb-wizard-steps {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	list-style: none;
	margin: 0 0 20px;
	padding: 0;
}

.aksmb-wizard-steps__item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	border: 1px solid var( --aksmb-border, #d8dbe0 );
	border-radius: var( --aksmb-radius-full, 9999px );
	background: var( --aksmb-surface, #fff );
	color: var( --aksmb-muted, #646970 );
	box-shadow: none;
}

.aksmb-wizard-steps__item.is-current {
	border-color: var( --aksmb-focus-ring, #2271b1 );
	background: #f0f6fc;
	color: var( --aksmb-foreground, #1d2327 );
	font-weight: 600;
	box-shadow: var( --aksmb-shadow-sm );
}

.aksmb-wizard-steps__item.is-done {
	border-color: var( --aksmb-severity-safe-border, #00a32a );
	background: var( --aksmb-severity-safe-bg, #edfaef );
	color: var( --aksmb-severity-safe-fg, #007017 );
}

.aksmb-wizard-steps__item.is-upcoming {
	opacity: 0.85;
}

.aksmb-wizard-steps__num {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 1.6em;
	height: 1.6em;
	aspect-ratio: 1 / 1;
	border-radius: 50%;
	background: #eef2f6;
	border: 1px solid #d8dbe0;
	font-size: 12px;
	font-weight: 700;
}

.aksmb-wizard-steps__item.is-current .aksmb-wizard-steps__num {
	background: var( --aksmb-focus-ring, #2271b1 );
	border-color: var( --aksmb-focus-ring, #2271b1 );
	color: #fff;
}

.aksmb-wizard-steps__item.is-done .aksmb-wizard-steps__num {
	background: var( --aksmb-severity-safe-border, #00a32a );
	border-color: var( --aksmb-severity-safe-border, #00a32a );
	color: #fff;
}

.aksmb-wizard-panel {
	background: var( --aksmb-surface, #fff );
	border: 1px solid var( --aksmb-border, #d8dbe0 );
	border-radius: var( --aksmb-radius-lg, 12px );
	padding: 22px 24px 24px;
	max-width: 100%;
	box-shadow: var( --aksmb-shadow-sm );
}

.aksmb-wizard-panel .aksmb-section-header h2 {
	margin: 0;
	font-size: 1.2rem;
	letter-spacing: -0.015em;
}

.aksmb-wizard-actions {
	margin-top: 22px;
	padding-top: 16px;
	border-top: 1px solid #eef0f2;
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.aksmb-wizard-actions .button {
	margin: 0;
	float: none;
}

.aksmb-wizard-notice {
	margin: 12px 0;
	border-radius: var( --aksmb-radius-md, 8px );
}

.aksmb-form-table th {
	padding-top: 18px;
}

.aksmb-form-table td {
	padding-top: 14px;
}

.aksmb-choice {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 0 0 10px;
	line-height: 1.4;
}

.aksmb-choice input {
	margin-top: 3px;
}

.aksmb-table {
	border-radius: var( --aksmb-radius-md, 8px );
	overflow: hidden;
}

.aksmb-callout {
	background: var( --aksmb-surface-subtle, #f6f7f7 );
	border-left: 4px solid var( --aksmb-focus-ring, #2271b1 );
	border-radius: 0 var( --aksmb-radius-md, 8px ) var( --aksmb-radius-md, 8px ) 0;
	padding: 12px 16px;
	margin: 12px 0;
}

.aksmb-callout ul {
	margin: 0;
	padding-left: 1.2em;
}

.aksmb-callout p {
	margin: 0 0 8px;
}

.aksmb-callout p:last-child {
	margin-bottom: 0;
}

.aksmb-coverage__summary {
	margin-bottom: 4px;
}

.aksmb-coverage__breakdown {
	color: #646970;
	margin-top: 0;
}

.aksmb-coverage__bar {
	display: flex;
	height: 14px;
	width: 100%;
	max-width: 100%;
	background: #e8eaed;
	border-radius: var( --aksmb-radius-full, 9999px );
	overflow: hidden;
	margin: 12px 0 14px;
}

.aksmb-coverage__bar .is-exact {
	background: #00a32a;
}

.aksmb-coverage__bar .is-estimated {
	background: #dba617;
}

.aksmb-coverage__bar .is-missing {
	background: #d63638;
}

.aksmb-coverage__legend {
	display: flex;
	flex-wrap: wrap;
	gap: 12px 16px;
	list-style: none;
	margin: 0 0 12px;
	padding: 0;
	font-size: 12px;
	color: #50575e;
}

.aksmb-coverage__legend li {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
}

.aksmb-coverage__swatch {
	display: inline-block;
	width: 12px;
	height: 12px;
	border-radius: 2px;
	background: #dcdcde;
}

.aksmb-coverage__swatch.is-exact {
	background: #00a32a;
}

.aksmb-coverage__swatch.is-estimated {
	background: #dba617;
}

.aksmb-coverage__swatch.is-missing {
	background: #d63638;
}

/* Keyboard focus — visible beyond browser default where WP resets it */
.aksmb-wrap a:focus,
.aksmb-wrap button:focus,
.aksmb-wrap input:focus,
.aksmb-wrap select:focus,
.aksmb-wrap textarea:focus,
.aksmb-wrap summary:focus,
.aksmb-nav-tabs .nav-tab:focus {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

.aksmb-nav-tabs .nav-tab-active:focus {
	box-shadow: none;
}

/* Priority next-step panel */
.aksmb-next {
	position: relative;
	margin: 0 0 4px;
	padding: 22px 24px;
	border: 1px solid var( --aksmb-border, #d8dbe0 );
	border-left-width: 4px;
	border-left-color: var( --aksmb-focus-ring, #2271b1 );
	border-radius: var( --aksmb-radius-lg, 12px );
	background: linear-gradient(180deg, #f8fbff 0%, var( --aksmb-surface, #fff ) 100%);
	box-shadow: var( --aksmb-shadow-sm );
}

.aksmb-next--warning {
	border-left-color: var( --aksmb-severity-warning-border, #dba617 );
	background: linear-gradient(180deg, #fffdf5 0%, var( --aksmb-surface, #fff ) 100%);
}

.aksmb-next--critical {
	border-left-color: var( --aksmb-severity-critical-border, #d63638 );
	background: linear-gradient(180deg, #fff8f8 0%, var( --aksmb-surface, #fff ) 100%);
}

.aksmb-next--info {
	border-left-color: var( --aksmb-focus-ring, #2271b1 );
}

.aksmb-next__eyebrow {
	margin: 0 0 6px;
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var( --aksmb-muted, #646970 );
}

.aksmb-next__title {
	margin: 0 0 8px;
	font-size: 1.25rem;
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.3;
	color: var( --aksmb-foreground, #1d2327 );
}

.aksmb-next__body {
	margin: 0 0 16px;
	max-width: 68ch;
	color: var( --aksmb-foreground, #1d2327 );
	line-height: 1.5;
}

.aksmb-next__actions {
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.aksmb-next__actions .button {
	margin: 0;
}

/* Severity summary row — lifecycle state is separate from financial severity */
.aksmb-severity-summary {
	list-style: none;
	margin: 0 0 4px;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.aksmb-severity-summary__item {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 10px 6px 6px;
	background: var( --aksmb-surface-subtle, #f6f7f7 );
	border: 1px solid #eef0f2;
	border-radius: var( --aksmb-radius-md, 8px );
}

.aksmb-severity-summary__count {
	min-width: 1.25em;
	font-size: 0.9375rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	color: var( --aksmb-foreground, #1d2327 );
}

/* Free workflow checklist */
.aksmb-checklist {
	list-style: none;
	margin: 0;
	padding: 0;
}

.aksmb-checklist li {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 12px 0;
	border-bottom: 1px solid #eef0f2;
}

.aksmb-checklist li:last-child {
	border-bottom: 0;
}

.aksmb-checklist li.is-complete .aksmb-checklist__text {
	color: var( --aksmb-muted, #646970 );
	text-decoration: line-through;
}

.aksmb-checklist__mark {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 1.75em;
	height: 1.75em;
	aspect-ratio: 1 / 1;
	border-radius: 50%;
	background: #eef2f6;
	border: 1px solid #d8dbe0;
	font-size: 0.75rem;
	font-weight: 700;
	color: var( --aksmb-muted, #646970 );
}

.aksmb-checklist li.is-complete .aksmb-checklist__mark {
	background: var( --aksmb-severity-safe-bg, #edfaef );
	border-color: var( --aksmb-severity-safe-border, #00a32a );
	color: var( --aksmb-severity-safe-fg, #007017 );
}

.aksmb-checklist__text {
	display: block;
	flex: 1 1 auto;
	min-width: 0;
	line-height: 1.45;
}

.aksmb-checklist__action {
	flex: 0 0 auto;
	align-self: center;
	font-size: 0.8125rem;
	font-weight: 600;
	text-decoration: none;
	color: var( --aksmb-focus-ring, #2271b1 );
	white-space: nowrap;
}

.aksmb-checklist__action:hover,
.aksmb-checklist__action:focus-visible {
	color: #135e96;
	text-decoration: underline;
}

/* Coverage legend — swatches are decorative; text remains readable */
.aksmb-coverage__legend li {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.aksmb-coverage__swatch {
	display: inline-block;
	width: 12px;
	height: 12px;
	border-radius: 2px;
	background: #dcdcde;
}

.aksmb-coverage__swatch.is-exact { background: var( --aksmb-severity-safe-border, #00a32a ); }
.aksmb-coverage__swatch.is-estimated { background: var( --aksmb-severity-warning-border, #dba617 ); }
.aksmb-coverage__swatch.is-missing { background: var( --aksmb-severity-critical-border, #d63638 ); }

/* Free getting-started checklist — wider, calmer, with isolated actions */
.aksmb-started-content {
	max-width: none;
}

.aksmb-started-content .aksmb-checklist {
	margin: 0 0 14px;
}

.aksmb-started-actions {
	padding-top: 14px;
	border-top: 1px solid #eef0f2;
	margin-top: auto;
}

.aksmb-started-actions .aksmb-actions {
	margin-top: 0;
}

.aksmb-panel--started {
	min-height: 100%;
}

/* Pro CTA on dashboard — full-width accent strip */
.aksmb-grid--dashboard > .aksmb-pro-cta-card {
	padding: 22px 24px;
	border-radius: var( --aksmb-radius-lg, 12px );
	border-color: #b7d4ef;
	background: linear-gradient(135deg, #f3f8fd 0%, #f8fbff 55%, #ffffff 100%);
	box-shadow: var( --aksmb-shadow-sm );
}

.aksmb-grid--dashboard > .aksmb-pro-cta-card .aksmb-pro-cta-card__title {
	font-size: 1.15rem;
	letter-spacing: -0.01em;
}

/* Retry box — panel-styled but visually distinct */
.aksmb-retry-box {
	border: 1px solid var( --aksmb-border, #c3c4c7 );
	border-radius: var( --aksmb-radius_md, 6px );
	padding: 12px 16px;
	margin: 12px 0;
	background: var( --aksmb-surface-subtle, #f6f7f7 );
}

/* Glossary (dl/dt/dd) — compact, readable */
.aksmb-glossary {
	max-width: 720px;
}
.aksmb-glossary dt {
	font-weight: 600;
	margin-top: 12px;
	color: var( --aksmb-foreground, #1d2327 );
}
.aksmb-glossary dd {
	margin-left: 0;
	margin-bottom: 8px;
	color: var( --aksmb-foreground, #1d2327 );
}

/* Pro Price History filters + order deep-links (shared visual system) */
.aksmb-ph-filters {
	margin: 0 0 18px;
	padding: 14px 16px;
	background: var( --aksmb-surface-subtle, #f6f7f7 );
	border: 1px solid #eef0f2;
	border-radius: var( --aksmb-radius-md, 8px );
	max-width: 100%;
}
.aksmb-ph-filters label {
	font-weight: 600;
}
.aksmb-ph-filters input[type="text"][placeholder="YYYY-MM-DD"] {
	max-width: 10em;
}
.aksmb-ph-filters p {
	margin: 0 0 10px;
}
.aksmb-ph-filters p:last-child {
	margin-bottom: 0;
}
.aksmb-price-history-links {
	margin: 12px 0;
}
.aksmb-price-history-links ul {
	margin: 0;
	padding-left: 1.2em;
}



/* Specific fixes for OverviewPage preview panel */
#aksmb-recent-preview ul.aksmb-kv {
	margin-bottom: 12px;
}
#aksmb-recent-preview form p.aksmb-actions {
	margin-top: 12px;
}

/* Invalid field + inline error near field */
.aksmb-field--invalid {
	border-color: var( --aksmb-severity-critical-border, #d63638 );
}
.aksmb-field-error {
	display: block;
	margin-top: 2px;
	font-size: 0.8125rem;
	color: var( --aksmb-severity-critical-fg, #b32d2e );
}

/* Acknowledgement fieldset */
.aksmb-ack-fieldset {
	border: 1px solid var( --aksmb-border, #d8dbe0 );
	border-radius: var( --aksmb-radius-lg, 12px );
	padding: 14px 16px;
	margin: 8px 0 0;
	background: var( --aksmb-surface-subtle, #f6f7f7 );
}
.aksmb-ack-fieldset p {
	margin: 0 0 10px;
}
.aksmb-ack-fieldset p:last-child {
	margin-bottom: 0;
}
.aksmb-ack-fieldset label {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	line-height: 1.45;
}
.aksmb-ack-fieldset input[type="checkbox"] {
	margin-top: 3px;
}

/* Preflight numbered workflow steps */
.aksmb-preflight-step {
	margin-bottom: 0;
}
.aksmb-preflight-step h2 {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
}
.aksmb-preflight-step__num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.7em;
	height: 1.7em;
	border-radius: 50%;
	background: var( --aksmb-focus-ring, #2271b1 );
	color: #fff;
	font-size: 0.8em;
	font-weight: 700;
	flex-shrink: 0;
	line-height: 1;
}

.aksmb-page > .aksmb-panel + .aksmb-panel,
.aksmb-page > .aksmb-disclaimer + .aksmb-panel,
.aksmb-dashboard > .aksmb-panel + .aksmb-grid {
	margin-top: 0;
}

.aksmb-page > .aksmb-panel + .aksmb-panel {
	margin-top: 18px;
}

.aksmb-page .aksmb-steps {
	margin: 0;
	padding-left: 1.25em;
}

.aksmb-page .aksmb-steps li {
	margin-bottom: 8px;
	line-height: 1.45;
}

.aksmb-page .aksmb-glossary {
	max-width: none;
}

/* Pro line evidence meta box (order edit) */
#aksmb_order_line_evidence .inside {
	overflow-x: auto;
}

.aksmb-line-evidence-table {
	width: max-content;
	min-width: 100%;
	max-width: none;
	table-layout: auto;
}

.aksmb-line-evidence-table th,
.aksmb-line-evidence-table td {
	vertical-align: top;
	padding: 10px 12px;
}

.aksmb-line-evidence__product {
	min-width: 16rem;
	max-width: 24rem;
}

.aksmb-line-evidence__name {
	display: block;
	font-weight: 600;
	line-height: 1.35;
	overflow-wrap: anywhere;
	word-break: normal;
}

.aksmb-line-evidence__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35em;
	margin-top: 6px;
	color: #646970;
	font-size: 12px;
	line-height: 1.4;
	white-space: nowrap;
}

.aksmb-line-evidence__meta code {
	font-size: 11px;
}

.aksmb-line-evidence__sep {
	color: #c3c4c7;
}

.aksmb-line-evidence__num,
.aksmb-line-evidence__threshold,
.aksmb-line-evidence__history {
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.aksmb-line-evidence__source {
	white-space: nowrap;
}

.aksmb-line-evidence__confidence {
	display: block;
	margin-top: 4px;
	white-space: normal;
}
