/**
 * Aureon admin panel styles. Scoped to the panel — never shipped to the
 * frontend (separate bundle from frontend.scss).
 */

@use "../shared/intro-card" as *;

/**
 * Design tokens as real CSS custom properties (not Sass variables) so the
 * whole panel can flip to a dark palette at runtime via [data-theme="dark"]
 * on <html> — same mechanism the frontend's dark mode toggle already uses
 * (Aureon Nexus's Dark_Mode_Render_Feature).
 * Popovers and modals render in a portal on <body>, outside .aureon-admin,
 * so they get the tokens (and the retint below) too — safe because this
 * stylesheet only loads on our page.
 */
.aureon-admin,
.aureon-hb-dock,
.components-modal__screen-overlay,
.components-popover {

	/* Aureon gold (palette-aureon 500/600 — matches --aureon-color-primary/-hover
	 * defaults). Literal, not var(--aureon-color-primary): Dynamic_CSS only
	 * emits --aureon-color-* on the front end (see Assets::print_dynamic_css),
	 * so wp-admin has no runtime access to those custom properties. */
	--aureon-admin-brand: #d4a017;
	--aureon-admin-brand-rgb: 212, 160, 23;
	--aureon-admin-brand-light: #f6e6b8;
	--aureon-admin-brand-hover: #b8860b;
	--aureon-admin-mint: #ecfdf5;
	--aureon-admin-mint-text: #047857;
	--aureon-admin-ink: #0f172a;
	--aureon-admin-muted: #64748b;
	--aureon-admin-subtle: #94a3b8;
	--aureon-admin-border: #e5e7eb;
	--aureon-admin-surface: #fff;
	--aureon-admin-surface-alt: #f8fafc;
	--aureon-admin-shadow:
		0 1px 2px rgba(0, 0, 0, 0.04),
		0 8px 24px rgba(0, 0, 0, 0.06);
	--aureon-admin-radius: 10px;
	--aureon-admin-danger: #dc2626;
	--aureon-admin-danger-rgb: 220, 38, 38;
	--aureon-admin-danger-hover: #b91c1c;
	--aureon-admin-warning: #f59e0b;
	--aureon-admin-warning-ink: #b45309;

	/* Informational blue — deliberately *not* the brand gold: an info note
	 * explains the control beside it, and tinting it gold made it read as
	 * another piece of the control rather than an aside about it. */
	--aureon-admin-info: #2563eb;
	--aureon-admin-info-rgb: 37, 99, 235;

	/**
	 * Retint the WordPress component accent to the Aureon brand gold. Every
	 * @wordpress/components primitive (ToggleControl switches, primary
	 * Buttons, focus rings, checkboxes, SelectControl focus) reads
	 * --wp-admin-theme-color, which otherwise falls back to the wp-admin
	 * default blue (#3858e9).
	 */
	--wp-admin-theme-color: var(--aureon-admin-brand);
	--wp-admin-theme-color--rgb: var(--aureon-admin-brand-rgb);
	--wp-admin-theme-color-darker-10: var(--aureon-admin-brand-hover);
	--wp-admin-theme-color-darker-20: #926d0c;
}

/**
 * Dark palette — applied whenever <html data-theme="dark"> is set (by the
 * admin-bar toggle; see Aureon Nexus's Admin_Dark_Mode_Feature) and only
 * when the site owner has opted into Dark Mode with a scope that covers
 * wp-admin.
 */
html[data-theme="dark"] .aureon-admin,
html[data-theme="dark"] .aureon-hb-dock,
html[data-theme="dark"] .components-modal__screen-overlay,
html[data-theme="dark"] .components-popover {
	color-scheme: dark;

	/* Aureon gold, lightened two steps (palette-aureon 300/400) for contrast
	 * against the dark surface — same two-step offset the light block's
	 * base/hover pair sits at, mirroring the former teal dark-mode pair. */
	--aureon-admin-brand: #f1d384;
	--aureon-admin-brand-rgb: 241, 211, 132;
	--aureon-admin-brand-light: #fbf3df;
	--aureon-admin-brand-hover: #eabc43;
	--aureon-admin-mint: #062e2b;
	--aureon-admin-mint-text: #5eead4;
	--aureon-admin-ink: #e2e8f0;
	--aureon-admin-muted: #94a3b8;
	--aureon-admin-subtle: #64748b;
	--aureon-admin-border: #334155;
	--aureon-admin-surface: #1e293b;
	--aureon-admin-surface-alt: #0f172a;
	--aureon-admin-shadow:
		0 1px 2px rgba(0, 0, 0, 0.3),
		0 8px 24px rgba(0, 0, 0, 0.5);
	--aureon-admin-danger: #f87171;
	--aureon-admin-danger-rgb: 248, 113, 113;
	--aureon-admin-danger-hover: #ef4444;
	--aureon-admin-warning: #fbbf24;
	--aureon-admin-warning-ink: #fde68a;
	--aureon-admin-info: #93c5fd;
	--aureon-admin-info-rgb: 147, 197, 253;
	--wp-admin-theme-color-darker-20: #d4a017;

	.aureon-pairing-card__glyph {

		&--violet {
			background: #312e81;
		}

		&--amber {
			background: #7c2d12;
		}

		&--teal {
			background: #134e4a;
		}

		&--rose {
			background: #831843;
		}
	}
}

/**
 * Base modal chrome — every WP Modal (confirm dialogs, Add Font, header/
 * footer builder element/row/column editors) portals to <body> inside
 * .components-modal__screen-overlay, which already carries the tokens above;
 * consume them here so no modal is left with a hardcoded white frame while
 * the rest of the panel is dark. Modal-specific files still override size
 * (width/max-width) locally.
 */
.components-modal__frame {
	background: var(--aureon-admin-surface);
	color: var(--aureon-admin-ink);
}

// A Media Library opened from inside a modal (`MediaImageField`) should come
// up in front of it. Hidden, not just lowered, so the modal's focus trap and
// outside-click handling can't reach into the library while it's open.
body.aureon-media-open .components-modal__screen-overlay {
	visibility: hidden;
}

.components-modal__header {
	background: var(--aureon-admin-surface);
	border-bottom-color: var(--aureon-admin-border);

	.components-modal__header-heading {
		color: var(--aureon-admin-ink);
	}

	svg {
		fill: var(--aureon-admin-muted);
	}
}

.components-modal__content {
	color: var(--aureon-admin-ink);
}

/**
 * Base popover chrome — generic WP Popover/DropdownMenu content (e.g. the
 * settings-menu's Export/Import/Reset menu) hardcodes a white background;
 * our own custom dropdowns already cover themselves via
 * %aureon-dropdown-panel, but stock DropdownMenu instances need this too.
 */
.components-popover__content {
	background: var(--aureon-admin-surface);
	color: var(--aureon-admin-ink);
	border-color: var(--aureon-admin-border);

	.components-menu-item__button {
		color: var(--aureon-admin-ink);

		&:hover,
		&:focus:not(:disabled) {
			background: var(--aureon-admin-surface-alt);
			color: var(--aureon-admin-ink);
		}
	}
}

.aureon-admin {
	color: var(--aureon-admin-ink);
	font-size: 14px;

	* {
		box-sizing: border-box;
	}

	/**
	 * Generic @wordpress/components form-field theming. Stock TextControl,
	 * SelectControl, NumberControl, and the RangeControl's paired number box
	 * all hardcode a light background/dark text via core CSS; retint them
	 * here so every section (Layout, Sidebar, Blog, WooCommerce, General,
	 * Custom Code, Import/Export, …) reads correctly once dark mode flips
	 * the tokens above. Native <option> list styling is browser-controlled
	 * and can't be fully retinted from CSS.
	 */
	// !important + a doubled-up ancestor class: @wordpress/components (v25+)
	// styles its primitives via Emotion, injecting <style> tags at runtime
	// whose single hashed class (specificity 0,1,0) ties with a bare
	// ".components-select-control__input" selector — the winner then depends
	// on injection order, which varies per render. Chaining an extra ancestor
	// class makes ours unambiguously more specific (0,2,0). Both hosts are named because they nest differently: the standalone page
	// wraps its screens in `.aureon-admin__body`, while the Customizer mounts
	// each section straight into the `.aureon-admin--customizer` root with no
	// such wrapper. A `__body`-only scope therefore missed the Customizer
	// entirely, leaving every field there on core's own 2px radius and
	// `#8d8d8d` border — most visibly Cart's Empty Cart copy fields.
	&__body,
	&--customizer {

		.components-input-control__input,
		.components-input-control__container,
		.components-text-control__input,
		.components-textarea-control__input,
		.components-select-control__input,
		.components-number-control__input,
		select {
			background: var(--aureon-admin-surface) !important;
			color: var(--aureon-admin-ink) !important;
			// Core's own field border is a hard mid-grey that reads as black
			// against the panel's soft surfaces; the panel's border token is
			// what every card, tile and picker around these fields uses.
			border-color: var(--aureon-admin-border) !important;
			border-radius: 6px !important;
		}

		// Import/Export's native file input: the OS-drawn "Choose File" button
		// respects ::file-selector-button styling; the trailing filename text
		// is plain element color.
		input[type="file"] {
			color: var(--aureon-admin-muted) !important;

			&::file-selector-button {
				margin-right: 10px;
				padding: 6px 12px;
				border: 1px solid var(--aureon-admin-border);
				border-radius: 4px;
				background: var(--aureon-admin-surface-alt);
				color: var(--aureon-admin-ink);
				cursor: pointer;
			}
		}

		.components-input-control__backdrop {
			border-color: var(--aureon-admin-border) !important;
			border-radius: 6px !important;
		}

		// Plain @wordpress/components buttons with no bespoke className (e.g.
		// the Import/Export panel's "Export settings") otherwise fall back to
		// core's 2px radius, reading as squarer than the rest of the panel.
		// More specific button rules further down this file
		// (.aureon-admin__save, per-component overrides, …) share this
		// selector's specificity but are declared later, so source order lets
		// them win where they need a different radius.
		.components-button {
			border-radius: 6px;
		}
	}

	// WooCommerce only: WP renders BaseControl field labels as 11px uppercase,
	// which competes with this section's uppercase group headings (__row h3).
	// Drop them to sentence case here so the group headings are the only
	// uppercase tier. Other sections keep the uppercase field-label look.
	&__section--woocommerce .components-base-control__label {
		text-transform: none;
		letter-spacing: normal;
		font-weight: 500;
	}

	// ToggleGroupControl (segmented controls — Dark Mode's "Applies to", the
	// Sidebar's "Default Layout" / "Sidebar Style" pickers, etc.): pill variant.
	// Instead of WP's sliding white card, the *selected option itself* gets a
	// solid gold rounded fill floating inside a padded track (matching the
	// design mock). We drop the ::before backdrop entirely so the pill sits
	// with even breathing room on all sides, and unpin WP's fixed 36px height
	// so the taller options grow the track.
	&__body .components-toggle-group-control,
	&--customizer .components-toggle-group-control {
		background: var(--aureon-admin-surface-alt) !important;
		border-color: var(--aureon-admin-border) !important;
		height: auto !important;
		min-height: 44px !important;
		padding: 4px !important;
		border-radius: 12px !important;

		&::before {
			display: none !important;
		}
	}

	&__body .components-toggle-group-control-option-base,
	&--customizer .components-toggle-group-control-option-base {
		min-height: 36px !important;
		border-radius: 8px !important;
		color: var(--aureon-admin-muted) !important;
		transition: background-color 0.15s ease, color 0.15s ease;

		// Selected option is a solid gold pill with white content.
		&[aria-checked="true"] {
			background: var(--aureon-admin-brand) !important;
			color: #fff !important;
			font-weight: 600 !important;
		}
	}

	// Notice (Custom Code's "output verbatim" warning, Import/Export's
	// success/error banners) hardcodes its light background per variant.
	&__body .components-notice,
	&--customizer .components-notice {
		background: var(--aureon-admin-surface-alt) !important;
		border-left-color: var(--aureon-admin-border) !important;
		color: var(--aureon-admin-ink) !important;
		// Same gap as the .aureon-card stack below it. Used to come for
		// free from the action button's own row margin when that button
		// rendered as a sibling after the notice; now that it renders
		// inside the notice instead (see ViewedSectionExtras), the notice
		// needs to own that trailing gap itself.
		margin-bottom: 24px;

		&.is-warning {
			background: color-mix(in srgb, var(--aureon-admin-warning) 15%, var(--aureon-admin-surface-alt)) !important;
			border-left-color: var(--aureon-admin-warning) !important;
		}

		&.is-success {
			background: var(--aureon-admin-mint) !important;
			border-left-color: var(--aureon-admin-mint-text) !important;
			color: var(--aureon-admin-mint-text) !important;
		}

		&.is-error {
			background: color-mix(in srgb, var(--aureon-admin-danger) 15%, var(--aureon-admin-surface-alt)) !important;
			border-left-color: var(--aureon-admin-danger) !important;
		}

		// A plugin-contributed action (e.g. Aureon Nexus's "switch to
		// classic cart/checkout" button) rendered as a notice child so it
		// reads as part of the same message, not a separate control below
		// it — see ViewedSectionExtras. Drop the row's own bottom margin;
		// the notice's own padding already closes it off.
		.aureon-admin__row {
			margin: 8px 0 0;
		}
	}

	// ToggleControl (switch): flat pill design — brand-gold track when on, white
	// circle thumb with a centered checkmark. Gold (not a literal black) so the
	// "on" state reads the same in light and dark, matching the slider fill.
	.components-form-toggle {
		width: 44px;
		height: 24px;
	}

	.components-form-toggle__track {
		width: 44px;
		height: 24px;
		border: 0;
		border-radius: 12px;
		background: var(--aureon-admin-border);
		box-shadow: none;
		transition: background-color 0.15s ease;
	}

	// `:not(.is-disabled)`: a disabled-but-checked toggle (see Checkout's
	// "Collapse the summary on mobile" once block checkout is active) should
	// read as visually inert same as any other disabled control, not still
	// gold just because its stored value happens to be on.
	.components-form-toggle.is-checked:not(.is-disabled) .components-form-toggle__track {
		background: var(--aureon-admin-brand);
	}

	.components-form-toggle.is-disabled .components-form-toggle__track {
		background: var(--aureon-admin-border);
	}

	.components-form-toggle__thumb {
		top: 3px;
		left: 3px;
		width: 18px;
		height: 18px;
		background: #fff;
		border: 0;
		box-shadow: none;
		transition: transform 0.15s ease;

		&::after {
			content: "";
			display: none;
		}
	}

	.components-form-toggle.is-checked .components-form-toggle__thumb {
		transform: translateX(20px);

		// Checkmark, centered on the 18px thumb. Positioned from the thumb
		// center (50%/50%) then nudged up so the tick reads optically centered.
		&::after {
			display: block;
			position: absolute;
			left: 50%;
			top: 50%;
			width: 4px;
			height: 8px;
			border: solid #18181b;
			border-width: 0 2px 2px 0;
			transform: translate(-50%, -60%) rotate(45deg);
		}
	}

	// ToggleControl card: every switch across the admin reads as a bordered row
	// — label + optional description on the left, the pill switch centred on the
	// right — matching the Header "Sticky behaviour" options. Scoped to
	// ToggleControl so bespoke FormToggle rows (e.g. the sticky options, which
	// already own this look) are untouched.
	.components-toggle-control {
		position: relative;
		display: block;
		// Extra right padding reserves the lane for the absolutely-positioned
		// switch (44px wide, 14px from the edge) so the text never runs under it.
		padding: 12px 62px 12px 14px;
		// Spacing between stacked cards is handled by the adjacency rules below,
		// not a self-margin, so it stays consistent inside flex field stacks too.
		margin: 0;
		border: 1px solid var(--aureon-admin-border);
		border-radius: var(--aureon-admin-radius);
		background: var(--aureon-admin-surface-alt);
		transition: border-color 0.12s ease, background-color 0.12s ease;

		// Not while the switch inside is disabled: a card that lights up under
		// the pointer says "click me", and a disabled switch can't be — the
		// muted label and grey track are the whole of what it has to say.
		&:hover:not(:has(.components-form-toggle.is-disabled)) {
			border-color: color-mix(in srgb, var(--aureon-admin-brand) 35%, var(--aureon-admin-border));
			background: var(--aureon-admin-surface);
		}

		// Float the switch out of the flex row and centre it vertically against
		// the whole card, so it stays centred whether or not a description wraps
		// beneath the label. WP renders it first in source order inside the HStack;
		// pulling it absolute lets the label column own the full width.
		.components-form-toggle {
			position: absolute;
			top: 50%;
			right: 14px;
			transform: translateY(-50%);
			margin: 0;
		}

		.components-toggle-control__label {
			font-size: 13px;
			font-weight: 600;
			color: var(--aureon-admin-ink);
			cursor: pointer;
		}

		// Supporting line sits flush under the label. Core indents the inner span
		// 40px (to clear the default left-hand toggle); reset it here.
		.components-base-control__help {
			margin: 4px 0 0;
			font-size: 12px;
			line-height: 1.4;
			color: var(--aureon-admin-muted);
		}

		.components-toggle-control__help {
			margin-left: 0;
		}

		// Dim the label and (when checked) the checkmark to match the switch's
		// own built-in disabled styling — see `.components-form-toggle.is-disabled`
		// in @wordpress/components, which already grays the track/thumb.
		.components-toggle-control__label.is-disabled {
			color: var(--aureon-admin-muted);
			cursor: default;
		}
	}

	.components-form-toggle.is-disabled.is-checked .components-form-toggle__thumb::after {
		border-color: var(--aureon-admin-subtle);
	}

	// CheckboxControl: a filled brand-coloured square with a white tick, for
	// the "which of these elements show" lists (Category Display's Display
	// Elements is the first). Left to itself this is wp-admin's own checkbox —
	// a white box with a small dashicon tick drawn in `::before`, which reads
	// as a stock form control dropped into a designed panel. Deliberately not
	// the bordered card the switches above get: a short list of elements is a
	// set of ticks, not a stack of independent settings.
	.components-checkbox-control__input[type="checkbox"] {
		width: 20px;
		height: 20px;
		min-width: 20px;
		margin: 0;
		border: 1px solid var(--aureon-admin-border);
		border-radius: 5px;
		background: var(--aureon-admin-surface);
		transition: background-color 0.12s ease, border-color 0.12s ease;

		&:checked {
			border-color: var(--aureon-admin-brand);
			background: var(--aureon-admin-brand);
		}

		// wp-admin draws its own tick here; the SVG below is the one that
		// lines up with this box.
		&::before {
			content: none;
		}

		&:focus {
			border-color: var(--aureon-admin-brand);
			box-shadow: 0 0 0 1px var(--aureon-admin-brand);
		}
	}

	.components-checkbox-control__checked {
		fill: #fff;
	}

	// WP lays the box and its label out in an HStack with `spacing: 0` and
	// `alignment: top`, so out of the box the label butts straight against
	// the box and hangs off its top edge. The gap rides the container rather
	// than the HStack itself — that one's class name is emotion-generated and
	// nothing to hang a selector on.
	//
	// The width has to track the box above. WP sizes this container for its
	// own 16px checkbox and centres the tick SVG on the *container*, not on
	// the input — so widening the box to 20px without this left the tick 2px
	// off-centre inside it.
	.components-checkbox-control__input-container {
		width: 20px;
		margin-right: 10px;
		align-self: center;
	}

	.components-checkbox-control__label {
		align-self: center;
		font-size: 13px;
		font-weight: 600;
		line-height: 1.35;
		color: var(--aureon-admin-ink);
		cursor: pointer;
	}

	// A run of ticks needs room to read as a list rather than one block of
	// text — same rhythm the switch cards above get from their own adjacency
	// rule, since the two often sit in the same group.
	.components-checkbox-control + .components-checkbox-control {
		margin-top: 10px;
	}

	// Indent the supporting line under the *label*, not under the box: left
	// flush it read as a note about the group rather than about this one tick.
	// 30px = the 20px box plus the 10px gap above.
	.components-checkbox-control .components-base-control__help {
		margin: 4px 0 0 30px;
		font-size: 12px;
		line-height: 1.4;
		color: var(--aureon-admin-muted);
	}

	// Consecutive switch cards hug with one small, consistent gap. In block-flow
	// groups (e.g. Performance rows) this margin is the whole gap.
	.components-toggle-control + .components-toggle-control {
		margin-top: 8px;
	}

	// The flex field stacks add their own gap between fields (meant to separate
	// different control types); pull consecutive switch cards back to the same
	// 8px so a run of switches doesn't drift apart. Net = container gap + margin.
	.aureon-fieldstack .components-toggle-control + .components-toggle-control {
		margin-top: -12px; // 20px gap → 8px
	}

	// Metagroup uses its own 10px flex gap; cancel the fieldstack pull-up above
	// so consecutive switch cards keep the full 10px gap.
	.aureon-metagroup .components-toggle-control + .components-toggle-control {
		margin-top: 0;
	}

	// RangeControl (slider): thick flat rail — brand-gold fill, themed-border
	// remainder, white circle thumb with a gold ring. Same token rationale as
	// the switch above so both controls stay on-brand in either scheme.
	.components-range-control__wrapper {

		> span[aria-hidden="true"]:not(.components-range-control__track) {
			height: 8px;
			border-radius: 4px;
			background: var(--aureon-admin-border);
		}
	}

	.components-range-control__track {
		height: 8px;
		border-radius: 4px;
		background: var(--aureon-admin-brand);
	}

	.components-range-control__thumb-wrapper {
		// Center the 24px thumb on the 8px rail. WP absolutely-positions this
		// wrapper as a sibling of the rail (not nested), so it can't be centered
		// with top:50%/translateY against the rail — this measured offset lands
		// the thumb centre exactly on the rail centre. Verified pixel-perfect
		// against the current @wordpress/components render.
		margin-top: 11px !important;

		> span[aria-hidden="true"] {
			width: 24px;
			height: 24px;
			border-radius: 50%;
			background: #fff;
			border: 2.5px solid var(--aureon-admin-brand);
			box-sizing: border-box;
			box-shadow: none;

			// Focus/active halo: WP draws it via ::before sized + offset for its
			// default 12px thumb (20px at top/left:-4px). Our thumb is 24px, so
			// that fixed offset lands the halo 6px up-and-left of the thumb centre
			// (visible on click/drag). Re-centre it geometrically so it stays a
			// symmetric ring around the thumb at any thumb size.
			&::before {
				width: 34px !important;
				height: 34px !important;
				top: 50% !important;
				left: 50% !important;
				transform: translate(-50%, -50%) !important;
			}
		}
	}

	&__soon {
		color: var(--aureon-admin-muted);
		font-style: italic;
	}
}

/* The admin icons (src/admin/icons.tsx) ship with fill="none" (stroke-only outlines); the
 * @wordpress/components button styles force fill: currentColor on every
 * button svg, which fills in the paths and makes the icons look solid/broken.
 * Restore the intended stroke-only rendering wherever a lucide icon is used
 * inside a WordPress Button/MenuItem. */
.components-button svg.lucide,
.components-menu-item__button svg.lucide {
	fill: none;
}

.aureon-admin__toast--success.components-snackbar {
	background: var(--aureon-admin-mint);
	color: var(--aureon-admin-mint-text);
}

.aureon-admin__toast--error.components-snackbar {
	background: var(--aureon-admin-danger);
	color: #fff;
}

/* Confirm dialog (SweetAlert-style destructive confirmation) */
.aureon-admin__confirm-modal.components-modal__frame {
	width: 420px;
	max-width: 90vw;
}

.aureon-admin__confirm-modal .components-modal__content {
	padding: 32px;
	text-align: center;
}

.aureon-admin__confirm-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	margin: 0 auto 16px;
	border-radius: 50%;
	background: rgba(var(--aureon-admin-danger-rgb), 0.1);
	color: var(--aureon-admin-danger);
}

.aureon-admin__confirm-title {
	margin: 0 0 8px;
	font-size: 17px;
	font-weight: 700;
}

.aureon-admin__confirm-description {
	margin: 0 0 24px;
	color: var(--aureon-admin-muted);
	font-size: 13px;
	line-height: 1.6;
}

.aureon-admin__confirm-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

/* Neutral Cancel. Scoped past the wp-admin color schemes (e.g. "Modern"),
   which hard-code a blue secondary button that the token retint can't reach. */
.aureon-admin__confirm-actions .components-button.is-secondary {
	border-color: transparent;
}

.aureon-admin__confirm-actions .components-button.is-secondary:not(.aureon-admin__confirm-danger-outline) {
	color: var(--aureon-admin-ink);
	box-shadow: inset 0 0 0 1px var(--aureon-admin-border);

	&:hover:not(:disabled) {
		color: var(--aureon-admin-ink);
		background: var(--aureon-admin-surface-alt);
		box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--aureon-admin-muted) 45%, var(--aureon-admin-border));
	}
}

.aureon-admin__confirm-danger.components-button {
	background: var(--aureon-admin-danger);

	&:hover:not(:disabled) {
		background: var(--aureon-admin-danger-hover);
	}
}

.aureon-admin__badge {
	font-size: 10px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	background: var(--aureon-admin-surface-alt);
	color: var(--aureon-admin-subtle);
	padding: 2px 6px;
	border-radius: 10px;
}

.aureon-admin__section h2 {
	margin: 0 0 6px;
	padding-bottom: 14px;
	font-size: 18px;
	font-weight: 700;
	border-bottom: 1px solid var(--aureon-admin-border);
}

/* Icon avatar + heading, used both for a section's own header and for the block
 * headers inside one (Typography's "Font Pairings", "Font Library"). */
.aureon-admin__section-head {
	display: flex;
	gap: 16px;
	align-items: flex-start;
	margin-bottom: 20px;

	h2 {
		margin: 0 0 6px;
		padding-bottom: 0;
		font-size: 20px;
		font-weight: 700;
		border-bottom: 0;
	}
}

/**
 * The section's *own* header — `SectionIntro` — as one intro card (see
 * `src/shared/_intro-card.scss`, which the Customizer's native panel ledes
 * share), so a section opens by saying what it is before the controls start.
 *
 * The icon disc is what distinguishes it. The block headers inside a section
 * (Typography's "Font Pairings" and "Font Library", each of which wraps itself
 * in a nested `__section`) reuse `__section-head` for the same heading layout
 * but carry no disc — and they're each their parent's first child too, so
 * position can't tell them apart. Carding those as well stacked three cards
 * down Typography.
 *
 * The title shows in the Customizer too: the card is the same card on every
 * screen, WooCommerce's panel lede included, rather than a titled one on the
 * admin page and a bare line under core's breadcrumb.
 */
.aureon-admin .aureon-admin__section-head:has(> .aureon-admin__section-icon) {

	@include intro-card(var(--aureon-admin-surface), var(--aureon-admin-brand), 0 1px 2px rgba(15, 23, 42, 0.06));

	h2 {

		@include intro-card-title(var(--aureon-admin-ink));
	}

	.aureon-admin__desc {

		@include intro-card-text(var(--aureon-admin-muted));
		// Narrower than the 60ch a description gets in open content: the card
		// is a lead-in, and a line running the full width of a widened pane
		// stops reading as one.
		max-width: 46ch;
	}
}

.aureon-admin__section-head-text {
	flex: 1 1 auto;
	min-width: 0;
}

.aureon-admin__section-icon {

	@include intro-card-icon(var(--aureon-admin-brand), #fff);
}

// The lighter gold of the dark palette needs dark ink on it, not white.
html[data-theme="dark"] .aureon-admin .aureon-admin__section-icon {
	color: var(--aureon-admin-surface-alt);
}

.aureon-admin__desc {
	color: var(--aureon-admin-muted);
	max-width: 60ch;
	margin: 0;
}

/* Small uppercase group label above a cluster of fields (Blog "Post meta",
 * Dark Mode "Dark palette"). Matches the __row h3 treatment so ad-hoc field
 * groups read the same as the wrapped ones. */
.aureon-admin__field-label {
	margin: 20px 0 10px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--aureon-admin-muted);
}

/* Vertical rhythm between stacked fields. WP controls render with
 * __nextHasNoMarginBottom (margin-bottom:0) and the custom controls carry no
 * margin of their own, so consecutive fields would otherwise touch. Grouping
 * wrappers (grid/row/subhead/section-head/pills) manage their own spacing and
 * are intentionally excluded. The doubled-class selector (0,2,0) outranks the
 * component's own __nextHasNoMarginBottom rule (0,1,0). */
.aureon-admin__section > .components-base-control,
.aureon-admin__section > .aureon-select-field,
.aureon-admin__section > .aureon-unit-field,
.aureon-admin__section > .aureon-color-field,
.aureon-admin__row > .components-base-control,
.aureon-admin__row > .aureon-select-field,
.aureon-admin__row > .aureon-unit-field,
.aureon-admin__row > .aureon-color-field {
	margin-bottom: 16px;
}

/* A standalone help note (e.g. the Sidebar widget-area notice) describes the
 * control directly above it. When one follows a field, tighten the field→note
 * gap so the note reads as belonging to that field, and give the note a clear
 * bottom gap so it doesn't collide with the next field's label. The :has()
 * selector (0,3,0) outranks the rhythm rule above (0,2,0). */
.aureon-admin__section > .components-base-control:has(+ .aureon-admin__desc),
.aureon-admin__section > .aureon-select-field:has(+ .aureon-admin__desc),
.aureon-admin__section > .aureon-unit-field:has(+ .aureon-admin__desc),
.aureon-admin__section > .aureon-color-field:has(+ .aureon-admin__desc) {
	margin-bottom: 6px;
}

.aureon-admin__section > * + .aureon-admin__desc {
	margin-bottom: 20px;
}

.aureon-admin__subhead {
	margin-top: 28px;
	margin-bottom: 20px;
	padding-top: 20px;
	border-top: 1px solid var(--aureon-admin-border);

	h3 {
		margin: 0 0 4px;
		font-size: 15px;
		font-weight: 600;
	}
}

.aureon-admin__row {
	margin-bottom: 24px;

	h3 {
		margin: 0 0 10px;
		font-size: 13px;
		font-weight: 600;
		text-transform: uppercase;
		letter-spacing: 0.04em;
		color: var(--aureon-admin-muted);
	}
}

/**
 * Field group — see `controls/field-group.tsx`. A bordered card version of
 * `.aureon-admin__row` above, for a tab whose groups earn a title *and* a
 * description (Product Catalog's General tab is the first). The two aren't
 * merged into one: most `__row` usages have neither the icon nor the
 * description this carries, and giving every one of them a card surface
 * would be a much bigger visual change than any of those tabs asked for.
 */
.aureon-fieldgroup {
	margin-bottom: 16px;
	padding: 16px 18px;
	border: 1px solid var(--aureon-admin-border);
	border-radius: var(--aureon-admin-radius);
	background: var(--aureon-admin-surface);
}

.aureon-fieldgroup__head {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	margin-bottom: 16px;

	// A group switched off renders no body, so the head is the whole card and
	// its bottom margin would pad the box out below the description.
	&:last-child {
		margin-bottom: 0;
	}
}

// A note that stands in for the group's hidden body — see `FieldGroup`'s
// `notice` prop. Sits flush under the head, where the body would have begun.
// The head already carries the 16px gap the body would have sat below, so the
// note needs no margin of its own; a body rendered under it keeps its own.
.aureon-fieldgroup__notice {
	margin-bottom: 16px;

	&:last-child {
		margin-bottom: 0;
	}
}

// The trailing end of the head row — the master switch, the state pill, or
// both. Pinned to the end and vertically centred against the title line rather
// than the whole two-line block.
.aureon-fieldgroup__head-end {
	display: flex;
	align-items: center;
	gap: 16px;
	flex: 0 0 auto;
	margin-left: auto;
	min-height: 20px;
}

.aureon-fieldgroup__toggle {
	display: flex;
	align-items: center;
	flex: 0 0 auto;
	min-height: 20px;
}

// A read-only state pill at the end of the head row (see `FieldGroup`'s `badge`
// prop) — the alternative to the switch above, for a card whose subject is
// configured rather than toggled. Tinted by whichever `is-tone-*` it carries,
// with the same leading dot the `status` row uses, so "Connected" reads the
// same here as it does there.
.aureon-fieldgroup__badge {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	flex: 0 0 auto;
	min-height: 20px;
	padding: 5px 12px;
	border-radius: 999px;
	background: var(--aureon-admin-surface-alt);
	font-size: 12px;
	font-weight: 600;
	color: var(--aureon-admin-muted);
	white-space: nowrap;

	&::before {
		content: "";
		width: 7px;
		height: 7px;
		border-radius: 50%;
		background: currentcolor;
	}
}

.aureon-fieldgroup__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 8px;
	border: 1px solid var(--aureon-admin-border);
	background: var(--aureon-admin-surface-alt);
	color: var(--aureon-admin-ink);
	flex: 0 0 auto;
}

// A numbered step in place of the icon tile, for a card that is one stage of an
// ordered setup. Same footprint as the tile it replaces, so a mixed run of
// stepped and unstepped cards still lines up.
.aureon-fieldgroup__step {
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	flex: 0 0 auto;
	border-radius: 50%;
	background: var(--aureon-admin-brand);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

// Text beside the head switch, for a switch whose subject the card title
// doesn't already state. Clickable, being a real label for the control.
.aureon-fieldgroup__toggle-label {
	margin-left: 10px;
	font-size: 13px;
	font-weight: 600;
	color: var(--aureon-admin-ink);
	cursor: pointer;
}

// A brand mark supplies its own shape and colour, so the tinted, bordered tile
// a line icon needs would only box it in — see `brand-icons.tsx`.
.aureon-fieldgroup__icon.is-brand {
	width: 38px;
	height: 38px;
	border: 0;
	background: none;
}

.aureon-fieldgroup__head-text {
	min-width: 0;

	h3 {
		margin: 0 0 2px;
		font-size: 14px;
		font-weight: 600;
		color: var(--aureon-admin-ink);
	}
}

.aureon-fieldgroup__desc {
	margin: 0;
	font-size: 12px;
	line-height: 1.4;
	color: var(--aureon-admin-muted);
}

// Fold button at the end of a collapsible group's head — see `FieldGroup`'s
// `collapsible` prop. The chevron points up while open (fold this away) and
// down once folded (open it back up).
.aureon-fieldgroup__fold {
	display: grid;
	place-items: center;
	flex: 0 0 auto;
	width: 28px;
	height: 28px;
	margin-left: auto;
	padding: 0;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: var(--aureon-admin-muted);
	cursor: pointer;
	transition: background-color 0.12s ease, color 0.12s ease;

	svg {
		transform: rotate(180deg);
		transition: transform 0.15s ease;
	}

	&:hover {
		background: var(--aureon-admin-surface-alt);
		color: var(--aureon-admin-ink);
	}

	&:focus-visible {
		outline: 2px solid var(--aureon-admin-brand);
		outline-offset: 1px;
	}

	.is-folded & svg {
		transform: none;
	}
}

// A head-end switch or badge already claims `margin-left: auto`; the fold
// button then just follows it.
.aureon-fieldgroup__head-end + .aureon-fieldgroup__fold,
.aureon-fieldgroup__head-link + .aureon-fieldgroup__fold {
	margin-left: 4px;
}

/**
 * Content Templates cards — `FieldGroup`s with the `aureon-tplcard` class. The
 * head is its own band (tinted icon tile, title, blurb, fold chevron) ruled
 * off from the body, and the body is a query container so the rows inside
 * lay out against the card's width: side by side on the admin page, stacked
 * in the 320px Customizer pane.
 */
.aureon-admin .aureon-tplstack {
	display: flex;
	flex-direction: column;
	gap: 16px;

	> .aureon-fieldgroup {
		margin: 0;
	}
}

.aureon-admin .aureon-tplcard {
	padding: 0;
	border-radius: 14px;

	.aureon-fieldgroup__head {
		align-items: center;
		gap: 14px;
		margin: 0;
		padding: 16px 18px;
		border-bottom: 1px solid var(--aureon-admin-border);
	}

	&.is-folded .aureon-fieldgroup__head {
		border-bottom: 0;
	}

	.aureon-fieldgroup__icon {
		width: 42px;
		height: 42px;
		border: 0;
		border-radius: 10px;
		background: rgba(var(--aureon-admin-brand-rgb), 0.14);
		color: var(--aureon-admin-brand-hover);

		svg {
			width: 20px;
			height: 20px;
		}
	}

	.aureon-fieldgroup__head-text h3 {
		font-size: 15px;
		font-weight: 700;
	}

	.aureon-fieldgroup__body {
		container: aureon-tplcard / inline-size;
		display: flex;
		flex-direction: column;
		gap: 18px;
		padding: 18px;
	}

	// The body's gap is the only spacing between its fields; the controls'
	// own bottom margins (set for block-flow sections) would double it.
	.aureon-segmented,
	.aureon-rangefield {
		margin-bottom: 0;
	}

	// Sidebar's label sits over its pills rather than beside them (five
	// positions need the full width); match the inline labels' weight.
	.aureon-segmented__label {
		margin-bottom: 10px;
	}

	.aureon-metagroup {
		gap: 8px;
	}

	.aureon-togglerow + .aureon-togglerow {
		margin-top: 0;
	}

	// Post Meta's rows are a plain list of switches: the glyph alone says
	// enough, so it drops the tile it gets as a standalone card.
	.aureon-metagroup .aureon-togglerow {
		align-items: center;
		padding-block: 9px;

		.aureon-togglerow__icon {
			width: 24px;
			height: 24px;
			margin: 0;
			border: 0;
			background: none;
		}
	}
}

// Page Title's element list and alignment, under its switch row.
.aureon-admin .aureon-tplcard__sub {
	gap: 16px;
	padding-top: 16px;
	border-top: 1px dashed var(--aureon-admin-border);
}

/* Inline field — label column beside its control. See `inline-field.tsx`. */
.aureon-admin .aureon-inlinefield {
	display: grid;
	grid-template-columns: 130px minmax(0, 1fr);
	align-items: center;
	gap: 16px;

	&__label {
		font-size: 13px;
		font-weight: 600;
		color: var(--aureon-admin-ink);
	}
}

/* Setting row — icon tile, label and help, control. See `setting-row.tsx`. */
.aureon-admin .aureon-settinglist {
	display: flex;
	flex-direction: column;
	gap: 16px;

	// Rules the rows off from the choice bars above them in the same card.
	&.is-divided {
		padding-top: 18px;
		border-top: 1px solid var(--aureon-admin-border);
	}
}

.aureon-admin .aureon-settingrow {
	display: grid;
	grid-template-columns: 40px minmax(0, 1fr) minmax(0, 46%);
	align-items: center;
	column-gap: 14px;

	&.is-compact {
		grid-template-columns: 40px minmax(0, 1fr) auto;
	}

	&__icon {
		display: grid;
		place-items: center;
		width: 40px;
		height: 40px;
		border: 1px solid var(--aureon-admin-border);
		border-radius: 10px;
		background: var(--aureon-admin-surface-alt);
		color: var(--aureon-admin-muted);
	}

	&__text {
		min-width: 0;
	}

	&__label {
		display: block;
		font-size: 13px;
		font-weight: 600;
		line-height: 1.35;
		color: var(--aureon-admin-ink);
	}

	&__help {
		margin: 2px 0 0;
		font-size: 12px;
		line-height: 1.4;
		color: var(--aureon-admin-muted);
	}

	&__control {
		display: flex;
		justify-content: flex-end;
		min-width: 0;

		> * {
			flex: 1 1 auto;
			min-width: 0;
		}

		.components-base-control,
		.components-text-control__input {
			width: 100%;
		}
	}

	&.is-compact &__control > * {
		flex: 0 0 auto;
	}

	// A switch boxed with the word it governs ("Show"), for a switch that owns
	// a block of settings below it rather than one detail.
	&__switchbox {
		display: inline-flex;
		align-items: center;
		gap: 12px;
		padding: 7px 8px 7px 14px;
		border: 1px solid var(--aureon-admin-border);
		border-radius: 10px;
		background: var(--aureon-admin-surface);
		font-size: 13px;
		font-weight: 600;
		color: var(--aureon-admin-ink);
	}
}

// Too narrow for a control beside its text (any Customizer pane): the control
// drops to its own line under the label, keeping the icon's indent. A switch
// is narrow enough to stay put.
@container aureon-tplcard ( max-width: 420px ) {

	.aureon-admin .aureon-inlinefield {
		grid-template-columns: minmax(0, 1fr);
		gap: 10px;
	}

	.aureon-admin .aureon-settinglist {
		gap: 20px;
	}

	.aureon-admin .aureon-settingrow:not(.is-compact) {
		grid-template-columns: 40px minmax(0, 1fr);
		row-gap: 10px;

		.aureon-settingrow__control {
			grid-column: 1 / -1;
		}
	}

	// The boxed "Show" word would take the label's room; the switch alone
	// says the same beside a label that names the thing it shows.
	.aureon-admin .aureon-settingrow__switchbox {
		padding: 0;
		border: 0;
		background: none;

		> span[aria-hidden="true"] {
			display: none;
		}
	}
}

.aureon-admin {

	// `pills` — each choice its own bordered pill, the active one tinted.
	.aureon-segmented--pills {

		.aureon-segmented__track {
			gap: 8px;
			padding: 0;
			border: 0;
			background: none;
		}

		.aureon-segmented__segment {
			height: 40px;
			border: 1px solid var(--aureon-admin-border);
			border-radius: 10px;
			background: var(--aureon-admin-surface);

			&:hover:not(.is-active):not(:disabled) {
				border-color: color-mix(in srgb, var(--aureon-admin-brand) 35%, var(--aureon-admin-border));
			}

			&.is-active {
				border-color: var(--aureon-admin-brand);
				background: rgba(var(--aureon-admin-brand-rgb), 0.14);
				color: var(--aureon-admin-brand-hover);
				box-shadow: none;
			}
		}
	}

	// `solid` — the shared track, the active segment filled in the brand colour.
	.aureon-segmented--solid {

		.aureon-segmented__track {
			gap: 3px;
			padding: 3px;
			background: var(--aureon-admin-surface);
		}

		.aureon-segmented__segment {
			flex: 1 1 0;
			height: 38px;

			&.is-active {
				background: var(--aureon-admin-brand);
				color: var(--aureon-admin-surface);
				box-shadow: none;
			}
		}
	}
}

html[data-theme="dark"] .aureon-admin {

	.aureon-tplcard .aureon-fieldgroup__icon,
	.aureon-segmented--pills .aureon-segmented__segment.is-active {
		color: var(--aureon-admin-brand);
	}
}

// Role checkbox list (Account section → restricted roles).
.aureon-admin__checklist {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 12px;
	padding: 14px 16px;
	border: 1px solid var(--aureon-admin-border);
	border-radius: 10px;
	background: var(--aureon-admin-surface-alt);
}

.aureon-admin__checklist-label {
	font-size: 12px;
	font-weight: 600;
	color: var(--aureon-admin-muted);
}

/*
 * Provenance badge — a module's or surface's origin, beside its name on the
 * Modules card, its nav entry, and its area tab. `is-compact` is the icon-only
 * form used where there's no room for the word.
 */
.aureon-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	flex: none;
	padding: 2px 7px;
	border-radius: 999px;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	line-height: 1.6;

	// Icon-only form, for rows too tight for the word: no fill, so it reads as a
	// mark against the label rather than a second chip competing with it.
	&.is-compact {
		padding: 0;
		background: none;
	}
}

.aureon-badge--pro {
	color: #a16207;
	background: #fdf1d6;
}

.aureon-badge--beta {
	color: #4a4a8a;
	background: #e9e9f7;
}

.aureon-badge--new {
	color: #0a6b3d;
	background: #ddf3e6;
}

/*
 * Plugin-contributed surfaces (see Admin_Panel::panel_sections()). A descriptor's
 * `status` row and any toned copy resolve to these classes; the tones are the
 * closed set the PHP normalizer allows.
 */
.aureon-panel-status__value {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	font-size: 14px;
	font-weight: 600;

	&::before {
		content: "";
		width: 8px;
		height: 8px;
		border-radius: 50%;
		background: currentcolor;
	}
}

.aureon-panel-action {
	margin-top: 4px;
}

// Deactivating a licence, deleting a thing — an action that takes something
// away, so it stops borrowing the brand colour every other button uses.
.aureon-admin .aureon-panel-action.is-destructive {
	border: 1px solid rgba(var(--aureon-admin-danger-rgb), 0.4);
	background: var(--aureon-admin-surface);
	color: var(--aureon-admin-danger);
	box-shadow: none;

	&:hover:not(:disabled) {
		border-color: var(--aureon-admin-danger);
		background: rgba(var(--aureon-admin-danger-rgb), 0.06);
		color: var(--aureon-admin-danger);
	}
}

// A primary button that's disabled still renders in the brand colour by
// default, which reads as the thing to press. A card's own Save is disabled
// until it has something to save, so it has to look it.
.aureon-admin .aureon-panel-action:disabled,
.aureon-admin .aureon-panel-action[aria-disabled="true"] {
	background: var(--aureon-admin-surface-alt) !important;
	border-color: var(--aureon-admin-border) !important;
	color: var(--aureon-admin-muted) !important;
	box-shadow: none !important;
	cursor: not-allowed;
}

.is-tone-success {
	color: var(--aureon-admin-success, #00a32a);
}

.is-tone-warning {
	color: var(--aureon-admin-warning, #dba617);
}

.is-tone-error {
	color: var(--aureon-admin-danger, #d63638);
}

.is-tone-info {
	color: var(--aureon-admin-muted);
}

/* View switcher — underline tab bar for the Content Templates workspace. */
.aureon-viewswitch {
	display: flex;
	flex-wrap: wrap;
	gap: 28px;
	margin: 4px 0 8px;
	border-bottom: 1px solid var(--aureon-admin-border);
}

.aureon-viewswitch__chip {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 9px;
	padding: 4px 2px 14px;
	border: 0;
	background: transparent;
	color: var(--aureon-admin-muted);
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: color 0.12s ease;

	// The gold underline for the active tab, sitting on the container's baseline.
	&::after {
		content: "";
		position: absolute;
		left: 0;
		right: 0;
		bottom: -1px;
		height: 2px;
		border-radius: 2px 2px 0 0;
		background: transparent;
		transition: background-color 0.12s ease;
	}

	svg {
		color: var(--aureon-admin-subtle);
		transition: color 0.12s ease;
	}

	&:hover {
		color: var(--aureon-admin-ink);

		svg {
			color: var(--aureon-admin-muted);
		}
	}

	&.is-active {
		color: var(--aureon-admin-brand);

		svg {
			color: var(--aureon-admin-brand);
		}

		&::after {
			background: var(--aureon-admin-brand);
		}
	}

	&:focus-visible {
		outline: 2px solid var(--aureon-admin-brand);
		outline-offset: 2px;
		border-radius: 4px;
	}
}

.aureon-viewswitch__blurb {
	margin: 0 0 28px;
	font-size: 13px;
}

/* Setting card — grouped controls with a heading, used across Templates. */
.aureon-card {
	margin-bottom: 24px;
	padding: 24px 24px 12px;
	border: 1px solid var(--aureon-admin-border);
	border-radius: 14px;
	background: var(--aureon-admin-surface);
}

.aureon-card__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 20px;

	h3 {
		margin: 0;
		font-size: 15px;
		font-weight: 700;
		letter-spacing: 0.01em;
	}
}

.aureon-card__intro {
	margin: -8px 0 20px;
	font-size: 13px;
}

/* Even vertical rhythm for a stack of mixed controls (blog/feed settings). */
.aureon-fieldstack {
	display: flex;
	flex-direction: column;
	gap: 20px;

	// Specificity, not just source order, needs to beat .aureon-admin
	// .aureon-segmented's own margin-bottom below — nest under .aureon-admin
	// too so this reset can't lose a tie.
	.aureon-admin & > .aureon-segmented {
		margin-bottom: 0;
	}
}

/**
 * Reparented WooCommerce-core checkout fields — Checkout's Form tab (see
 * `NativeFormFields` in `sections/woocommerce/checkout/index.tsx`) moves
 * core's own Company name/Address line 2/Phone/required-fields/Privacy
 * Policy/Terms controls here by direct DOM surgery rather than recreating
 * them, so their markup carries core's own `customize-control-*` classes,
 * not `@wordpress/components`' — restyled by hand here to read as part of
 * this same field stack instead of a different design system pasted on top.
 * `.aureon-fieldstack`'s own gap already spaces the rows; this only resets
 * what core's stylesheet puts on the `<li>` itself and reskins what's inside.
 */
.aureon-admin .aureon-native-fields {

	> li {
		margin: 0;
	}

	.customize-control-title {
		display: block;
		margin-bottom: 8px;
		font-size: 13px;
		font-weight: 600;
		color: var(--aureon-admin-ink);
	}

	.customize-control-description {
		display: block;
		margin: 4px 0 0;
		font-size: 12px;
		line-height: 1.4;
		color: var(--aureon-admin-muted);
	}

	select,
	textarea,
	input[type="text"] {
		box-sizing: border-box;
		width: 100%;
		max-width: 100%;
		padding: 8px 10px;
		border: 1px solid var(--aureon-admin-border);
		border-radius: 6px;
		background: var(--aureon-admin-surface);
		color: var(--aureon-admin-ink);
		font-size: 13px;
		// Without this the panel's own body line-height (around 2.7) applies,
		// and a single-line select comes out 53px tall — half again the height
		// of the SelectControls it sits between.
		line-height: 1.4;

		&:focus {
			border-color: var(--aureon-admin-brand);
			outline: 2px solid color-mix(in srgb, var(--aureon-admin-brand) 30%, transparent);
			outline-offset: 1px;
		}
	}

	textarea {
		min-height: 72px;
		resize: vertical;
	}

	// The one checkbox in this set ("Highlight required fields") sits right
	// beside this theme's own ToggleControl switches further down the same
	// tab — a bare checkbox there would read as a different control system
	// entirely. Recast as the same bordered card + pill switch those use
	// (see the ToggleControl rules above), the real checkbox still there
	// underneath (full-card hit target, just invisible) for focus, keyboard
	// and screen-reader behaviour to keep working exactly as core wired it.
	.customize-control-checkbox {
		position: relative;
		padding: 12px 62px 12px 14px;
		border: 1px solid var(--aureon-admin-border);
		border-radius: var(--aureon-admin-radius);
		background: var(--aureon-admin-surface-alt);
		transition: border-color 0.12s ease, background-color 0.12s ease;

		// Not while the checkbox inside is disabled — same reasoning as the
		// ToggleControl card's hover.
		&:hover:not(:has(input:disabled)) {
			border-color: color-mix(in srgb, var(--aureon-admin-brand) 35%, var(--aureon-admin-border));
			background: var(--aureon-admin-surface);
		}

		.customize-inside-control-row {
			display: block;
			// Core indents this row by 24px to clear the checkbox that
			// normally sits to the left of the label. The checkbox is the
			// whole card here, so the indent is just a notch bitten out of
			// the card's leading edge.
			margin: 0;
		}

		label {
			display: block;
			margin: 0;
			font-size: 13px;
			font-weight: 600;
			color: var(--aureon-admin-ink);
			cursor: pointer;
		}

		input[type="checkbox"] {
			position: absolute;
			inset: 0;
			width: 100%;
			height: 100%;
			margin: 0;
			opacity: 0;
			cursor: pointer;
		}

		// Drawn on the card itself, not the checkbox: a checkbox is a
		// replaced element, unreliable ground for generated content, and
		// there's no later sibling here the way `.components-form-toggle`
		// gives the real ToggleControl to key a `+`/`~` selector off —
		// `:has()` reaching back into the card from the checkbox inside it
		// is what's left.
		&::before,
		&::after {
			content: "";
			position: absolute;
			top: 50%;
			transform: translateY(-50%);
			transition: right 0.15s ease, background-color 0.15s ease;
		}

		&::before {
			right: 14px;
			width: 44px;
			height: 24px;
			border-radius: 12px;
			background: var(--aureon-admin-border);
		}

		&::after {
			right: 37px;
			width: 18px;
			height: 18px;
			border-radius: 50%;
			background: #fff;
		}

		&:has(input:checked) {

			&::before {
				background: var(--aureon-admin-brand);
			}

			&::after {
				right: 17px;
			}
		}
	}
}

.aureon-metagroup {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

/**
 * Segmented control — one pill bar split into segments.
 *
 * Nested under .aureon-admin (the wrapper every Customizer/admin mount of
 * this app renders inside) so its specificity beats aureon-blocks' own
 * .aureon-segmented — an unrelated block-editor component that happens to
 * share this exact class name. Loaded together on the Customizer screen,
 * the plugin's plain-class rule (display:flex row, its own --aureon-border
 * var) was winning ties by source order, turning the label/track/help into
 * three squashed row columns instead of our stacked control — invisible at
 * a glance until the track grew past one row and the help text started
 * rendering on top of it.
 */
.aureon-admin {

	.aureon-segmented {
		// A property this rule never declared (display, gap, padding, border,
		// background) doesn't get a specificity contest at all — the plugin's
		// rule is simply the only vote, and wins by default. Reset every
		// property its .aureon-segmented sets, even the ones this control
		// was never meant to have, so nothing bleeds through regardless of
		// which stylesheet happens to load second.
		display: block;
		gap: 0;
		padding: 0;
		border: 0;
		border-radius: 0;
		background: none;
		margin-bottom: 24px;
		// A flex column ancestor (.aureon-fieldstack and friends) doesn't clamp
		// a child's cross-axis size to its own width the way block layout would —
		// the child's min-content width wins instead, so a 3-segment bar with
		// icons+labels was growing past its card and getting hard-clipped by an
		// ancestor's overflow, rather than the segments' own ellipsis ever
		// kicking in. Force it to respect the space it's actually given.
		min-width: 0;

		/* Inert, not hidden — the choice still exists, it just has nothing to act on
		 * under the current layout. The help line below the track says why. */
		&.is-disabled {

			.aureon-segmented__track {
				opacity: 0.5;
			}

			.aureon-segmented__segment {
				cursor: default;
			}
		}

		/* Stacked: one segment per row, each the full width of the track.
		 *
		 * Set by the control itself once it has measured that the labels do not
		 * fit across (see `useStacked()` in segmented-control.tsx) — the words
		 * decide, not a breakpoint, so the same bar is a row of pills in the
		 * admin page and a list in the 240px Customizer pane. It stays one
		 * bordered track either way: this is the same control in a narrower
		 * space, not a different one. */
		&.is-stacked {

			.aureon-segmented__segment {
				flex-basis: 100%;
				height: 36px;
			}
		}
	}
}

/* Token multiselect (the add-to-cart label's product kinds). WordPress's own
 * FormTokenField ships square corners and square tokens; round both so the
 * control sits with the panel's inputs and chips rather than beside them. */
.components-form-token-field__input-container {
	border-radius: var(--aureon-admin-radius);

	.components-form-token-field__token-text,
	.components-form-token-field__remove-token {
		border-radius: 0;
	}

	.components-form-token-field__token-text {
		border-start-start-radius: 999px;
		border-end-start-radius: 999px;
		padding-left: 10px;
	}

	.components-form-token-field__remove-token {
		border-start-end-radius: 999px;
		border-end-end-radius: 999px;
	}
}

.aureon-admin {

	.aureon-segmented__label {
		display: block;
		margin-bottom: 10px;
		font-size: 13px;
		font-weight: 600;
		color: var(--aureon-admin-ink);
	}

	.aureon-segmented__track {
		display: flex;
		flex-wrap: wrap;
		width: 100%;
		min-width: 0;
		gap: 5px;
		padding: 5px;
		border: 1px solid var(--aureon-admin-border);
		border-radius: 11px;
		background: var(--aureon-admin-surface-alt);
	}

	.aureon-segmented__segment {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		gap: 7px;
		// `min-width: 0` let 3–4 icon+label segments get squeezed down to
		// unreadable slivers ("C...", icon-only) once the track itself stopped
		// overflowing its card. `max-content` keeps every segment fully legible
		// and lets `flex-wrap` on the track carry extras onto a second row
		// instead — self-adjusting to however many segments actually fit,
		// rather than guessing a breakpoint for every consumer of this control.
		flex: 1 1 auto;
		min-width: max-content;
		height: 40px;
		padding: 0 12px;
		border: 0;
		border-radius: 7px;
		background: transparent;
		color: var(--aureon-admin-muted);
		font-size: 12.5px;
		font-weight: 600;
		cursor: pointer;
		transition:
			background-color 0.12s ease,
			color 0.12s ease,
			box-shadow 0.12s ease;

		span {
			white-space: nowrap;
		}

		// `:not(:disabled)`: a bar that is off cannot be chosen from, and a
		// segment that answers the pointer says otherwise — the dimmed track
		// is the whole of what a disabled bar has to say.
		&:hover:not(.is-active):not(:disabled) {
			color: var(--aureon-admin-ink);
		}

		&.is-active {
			background: var(--aureon-admin-surface);
			color: var(--aureon-admin-brand);
			box-shadow: var(--aureon-admin-shadow);
		}

		&:focus-visible {
			outline: 2px solid var(--aureon-admin-brand);
			outline-offset: 1px;
		}
	}

	.aureon-segmented__help {
		margin-top: 8px;
	}

	/**
	 * `cards` variant — each choice its own bordered card, icon over label.
	 * The track loses its own surface and padding so the cards sit directly on
	 * the panel; each segment gains the border and the tinted active state the
	 * shared track used to carry for the whole group.
	 */
	.aureon-segmented--cards {

		.aureon-segmented__track {
			gap: 8px;
			padding: 0;
			border: 0;
			background: none;
		}

		.aureon-segmented__segment {
			// Icon over label, so the choice is read as a picture first — which
			// is the point of drawing these as cards rather than pills.
			flex-direction: column;
			gap: 5px;
			// A real basis rather than the bar variant's `max-content`: three
			// cards fit a 320px pane, so a fourth wraps to the next line (five
			// sidebar positions read 3 + 2) and the last line's cards then grow
			// to fill the width. `flex: 1 1 0` would instead squeeze all five
			// onto one line at a sliver each.
			flex: 1 1 70px;
			min-width: 70px;
			height: auto;
			padding: 10px 6px 9px;
			border: 1px solid var(--aureon-admin-border);
			border-radius: 10px;
			background: var(--aureon-admin-surface);
			font-size: 12px;

			// Same reasoning as the bar variant's hover above: a disabled card
			// takes no border on hover, because it cannot be picked.
			&:hover:not(.is-active):not(:disabled) {
				border-color: var(--aureon-admin-subtle);
			}

			&.is-active {
				border-color: var(--aureon-admin-brand);
				background: rgba(var(--aureon-admin-brand-rgb), 0.06);
				color: var(--aureon-admin-brand);
				box-shadow: none;
			}
		}
	}
}

/**
 * Option cards — a radio group of bordered cards (icon + label, optionally
 * a description), used where a segmented bar's single row of pills doesn't
 * leave room to explain each choice (e.g. container width).
 */
.aureon-admin {

	.aureon-optioncards {
		margin-bottom: 24px;
	}

	.aureon-optioncards__label {
		display: block;
		margin-bottom: 10px;
		font-size: 13px;
		font-weight: 600;
		color: var(--aureon-admin-ink);
	}

	.aureon-optioncards__grid {
		display: grid;
		// auto-fit rather than a fixed 2-column grid: this control mounts both
		// in the wide standalone admin page (two columns fit) and inside a
		// native Customizer panel a few hundred pixels wide (one column is all
		// that fits) — a media query can't tell those apart since the
		// Customizer's own viewport is full width, only its sidebar is narrow.
		grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
		gap: 10px;
	}

	.aureon-optioncards__card {
		position: relative;
		display: flex;
		align-items: flex-start;
		gap: 10px;
		padding: 14px;
		border: 1px solid var(--aureon-admin-border);
		border-radius: var(--aureon-admin-radius);
		background: var(--aureon-admin-surface);
		text-align: left;
		cursor: pointer;
		transition:
			border-color 0.12s ease,
			background-color 0.12s ease;

		&:hover:not(.is-active) {
			border-color: #c3c4c7;
		}

		&.is-active {
			border-color: var(--aureon-admin-brand);
			background: color-mix(in srgb, var(--aureon-admin-brand) 6%, var(--aureon-admin-surface));

			// Nesting these under `&.is-active` (rather than writing
			// `.aureon-optioncards__card.is-active &` inside the dot/icon's
			// own block below) matters here: this whole ruleset already sits
			// nested inside `.aureon-admin`, so `&` there would expand to
			// `.aureon-admin .aureon-optioncards__dot` — and prefixing THAT
			// with `.aureon-optioncards__card.is-active` puts `.aureon-admin`
			// after the active card in the selector chain, descendant of it,
			// when it's actually the card's own ancestor. That selector can
			// never match; the active dot/icon colour silently never applied.
			.aureon-optioncards__dot {
				border-color: var(--aureon-admin-brand);

				&::after {
					background: var(--aureon-admin-brand);
				}
			}

			.aureon-optioncards__icon {
				color: var(--aureon-admin-brand);
			}
		}

		&:focus-visible {
			outline: 2px solid var(--aureon-admin-brand);
			outline-offset: 1px;
		}
	}

	.aureon-optioncards__dot {
		position: absolute;
		top: 12px;
		right: 12px;
		display: flex;
		align-items: center;
		justify-content: center;
		width: 16px;
		height: 16px;
		border-radius: 50%;
		border: 1.5px solid var(--aureon-admin-border);
		background: var(--aureon-admin-surface);
		transition: border-color 0.12s ease;

		// The filled center — transparent until the card is active, so the
		// unselected dot reads as an empty ring rather than a filled one.
		&::after {
			content: "";
			width: 8px;
			height: 8px;
			border-radius: 50%;
			background: transparent;
			transition: background-color 0.12s ease;
		}
	}

	.aureon-optioncards__icon {
		display: inline-flex;
		flex: 0 0 auto;
		color: var(--aureon-admin-muted);
		transition: color 0.12s ease;
	}

	.aureon-optioncards__body {
		display: flex;
		flex-direction: column;
		gap: 3px;
		min-width: 0;
		// Leaves room for the dot in the top-right corner so a long label
		// never runs under it.
		padding-right: 20px;
	}

	.aureon-optioncards__title {
		font-size: 13px;
		font-weight: 700;
		color: var(--aureon-admin-ink);
	}

	.aureon-optioncards__desc {
		font-size: 12px;
		line-height: 1.4;
		color: var(--aureon-admin-muted);
	}

	.aureon-optioncards__help {
		margin-top: 8px;
	}

	/* Compact variant — icon + label only, centered, for a denser row of
	 * choices that don't need a description (hover effect, pagination). */
	.aureon-optioncards--compact {

		.aureon-optioncards__grid {
			grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
			gap: 8px;
		}

		.aureon-optioncards__card {
			flex-direction: column;
			align-items: center;
			gap: 6px;
			padding: 12px 8px;
			text-align: center;
		}

		.aureon-optioncards__body {
			padding-right: 0;
		}

		.aureon-optioncards__title {
			font-size: 12px;
			font-weight: 600;
		}
	}
}

/* Grid card's device row — a label paired with a small device switcher that
 * picks which breakpoint the segmented control below edits (desktop / tablet
 * / mobile), instead of stacking a full segmented picker per breakpoint. */
.aureon-grid-devicerow {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.aureon-grid-devicerow__label {
	font-size: 13px;
	font-weight: 600;
	color: var(--aureon-admin-ink);
}

.aureon-devicepicker {
	display: flex;
	gap: 4px;
	padding: 4px;
	border: 1px solid var(--aureon-admin-border);
	border-radius: 9px;
	background: var(--aureon-admin-surface-alt);
}

.aureon-devicepicker__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	padding: 0;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: var(--aureon-admin-muted);
	cursor: pointer;
	transition: background-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;

	&:hover:not(.is-active) {
		color: var(--aureon-admin-ink);
	}

	&.is-active {
		background: var(--aureon-admin-surface);
		color: var(--aureon-admin-brand);
		box-shadow: var(--aureon-admin-shadow);
	}

	&:focus-visible {
		outline: 2px solid var(--aureon-admin-brand);
		outline-offset: 1px;
	}
}

/* Category pills — segmented control: one bordered strip, small-radius chips */
.aureon-admin__pills {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 4px;
	padding: 4px;
	margin-bottom: 20px;
	border: 1px solid var(--aureon-admin-border);
	border-radius: 10px;
	background: var(--aureon-admin-surface-alt);
}

.aureon-admin__pill {
	height: 32px;
	padding: 0 14px;
	border-radius: 6px;
	border: 0;
	background: transparent;
	color: var(--aureon-admin-muted);
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition:
		background-color 0.12s ease,
		color 0.12s ease;

	&:hover:not(.is-active) {
		background: rgba(255, 255, 255, 0.6);
		color: var(--aureon-admin-ink);
	}

	&.is-active {
		background: var(--aureon-admin-brand);
		color: #fff;
	}
}

.aureon-admin__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 16px;
	margin-bottom: 24px;
}

/**
 * Toggle row — a ToggleControl card (see the base .components-toggle-control
 * rule above) with a leading icon tile. Used by the Sidebar section's
 * Sticky/Show on Mobile/Show on Tablet switches.
 */
.aureon-admin {

	.aureon-togglerow {
		position: relative;
		display: flex;
		align-items: flex-start;
		gap: 12px;
		padding: 12px 62px 12px 14px;
		border: 1px solid var(--aureon-admin-border);
		border-radius: var(--aureon-admin-radius);
		background: var(--aureon-admin-surface-alt);
		transition: border-color 0.12s ease, background-color 0.12s ease;

		// Not while its switch is disabled — see the ToggleControl card above.
		&:hover:not(:has(.components-form-toggle.is-disabled)) {
			border-color: color-mix(in srgb, var(--aureon-admin-brand) 35%, var(--aureon-admin-border));
			background: var(--aureon-admin-surface);
		}

		&__icon {
			display: flex;
			flex: 0 0 auto;
			align-items: center;
			justify-content: center;
			width: 34px;
			height: 34px;
			margin-top: 1px;
			border: 1px solid var(--aureon-admin-border);
			border-radius: 8px;
			background: var(--aureon-admin-surface);
			color: var(--aureon-admin-muted);
		}

		// The nested ToggleControl already renders its own bordered-row card
		// (see the base rule above) — undo that back to zero so this wrapper
		// is the only box, and let its switch float against the wrapper (not
		// its own now-borderless box) so the one reserved lane (the padding
		// above) fits both.
		.components-toggle-control {
			position: static;
			flex: 1 1 auto;
			min-width: 0;
			padding: 0;
			margin: 0;
			border: none;
			background: transparent;

			&:hover {
				border: none;
				background: transparent;
			}

			.components-form-toggle {
				position: absolute;
				top: 50%;
				right: 14px;
				transform: translateY(-50%);
			}
		}
	}

	.aureon-togglerow + .aureon-togglerow {
		margin-top: 8px;
	}

	/**
	 * Sidebar layout cards — like .aureon-optioncards, but each card shows a
	 * mini column-diagram thumbnail (browser mockup) instead of an icon.
	 * Purpose-built for the Sidebar section's "Default Layout" position picker.
	 */
	.aureon-sidebarlayout {
		margin-bottom: 20px;

		&__label {
			display: block;
			margin-bottom: 10px;
			font-size: 13px;
			font-weight: 600;
			color: var(--aureon-admin-ink);
		}

		&__grid {
			display: grid;
			grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
			gap: 10px;
		}

		&__card {
			display: flex;
			flex-direction: column;
			align-items: center;
			gap: 8px;
			padding: 10px;
			border: 1px solid var(--aureon-admin-border);
			border-radius: var(--aureon-admin-radius);
			background: var(--aureon-admin-surface);
			cursor: pointer;
			transition: border-color 0.12s ease, background-color 0.12s ease;

			&:hover:not(.is-active) {
				border-color: #c3c4c7;
			}

			&.is-active {
				border-color: var(--aureon-admin-brand);
				background: color-mix(in srgb, var(--aureon-admin-brand) 6%, var(--aureon-admin-surface));

				.aureon-sidebarlayout__col--sidebar {
					background: var(--aureon-admin-brand);
				}

				.aureon-sidebarlayout__title {
					color: var(--aureon-admin-brand);
				}
			}

			&:focus-visible {
				outline: 2px solid var(--aureon-admin-brand);
				outline-offset: 1px;
			}
		}

		&__thumb {
			display: flex;
			flex-direction: column;
			gap: 4px;
			width: 100%;
			padding: 6px;
			border: 1px solid var(--aureon-admin-border);
			border-radius: 6px;
			background: var(--aureon-admin-surface-alt);
		}

		&__bar {
			display: flex;
			gap: 3px;

			i {
				width: 4px;
				height: 4px;
				border-radius: 50%;
				background: var(--aureon-admin-subtle);
			}
		}

		&__body {
			display: flex;
			gap: 3px;
			height: 28px;
		}

		&__col {
			border-radius: 2px;
			background: var(--aureon-admin-border);

			&--main {
				flex: 1 1 auto;
			}

			&--sidebar {
				flex: 0 0 18%;
				transition: background-color 0.12s ease;
			}
		}

		&__title {
			font-size: 12px;
			font-weight: 600;
			color: var(--aureon-admin-ink);
			transition: color 0.12s ease;
		}
	}
}

/**
 * Cart item-style cards — see `controls/cart-style-cards.tsx`. Same skeleton
 * as .aureon-sidebarlayout above (thumbnail + label, ring on the active card),
 * but the thumbnail is a stack of cart lines rather than a column diagram, and
 * the active card adds a corner tick: a picker whose thumbnails are themselves
 * made of boxes needs more than an outline to say which one is chosen.
 */
.aureon-cartstyle {
	margin-bottom: 20px;

	&.is-disabled {
		opacity: 0.55;
		pointer-events: none;
	}

	&__label {
		display: block;
		margin-bottom: 10px;
		font-size: 13px;
		font-weight: 600;
		color: var(--aureon-admin-ink);
	}

	// Three styles across even in the Customizer's 320px pane — wrapping the
	// third onto a line of its own would read as a group of two plus a stray.
	&__grid {
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(68px, 1fr));
		gap: 8px;
	}

	&__card {
		position: relative;
		overflow: hidden;
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: 8px;
		padding: 10px;
		border: 1px solid var(--aureon-admin-border);
		border-radius: var(--aureon-admin-radius);
		background: var(--aureon-admin-surface);
		cursor: pointer;
		transition: border-color 0.12s ease, background-color 0.12s ease;

		&:hover:not(.is-active) {
			border-color: #c3c4c7;
		}

		&.is-active {
			border-color: var(--aureon-admin-brand);
			background: color-mix(in srgb, var(--aureon-admin-brand) 6%, var(--aureon-admin-surface));

			.aureon-cartstyle__title {
				color: var(--aureon-admin-brand);
			}
		}

		&:focus-visible {
			outline: 2px solid var(--aureon-admin-brand);
			outline-offset: 1px;
		}
	}

	&__thumb {
		display: flex;
		flex-direction: column;
		justify-content: center;
		gap: 4px;
		width: 100%;
		height: 56px;
		padding: 6px;
		border: 1px solid var(--aureon-admin-border);
		border-radius: 6px;
		background: var(--aureon-admin-surface-alt);
		overflow: hidden;

		// Compact packs more, shorter lines into the same box; table drops the
		// thumbnail block for a full-width row, i.e. a column grid.
		&--compact {
			gap: 3px;
		}
	}

	&__row {
		display: flex;
		flex: 1 1 auto;
		align-items: stretch;
		gap: 4px;
		min-height: 0;
	}

	&__block {
		flex: 0 0 22%;
		border-radius: 2px;
		background: var(--aureon-admin-border);
	}

	// Two stubs standing in for the line's name and price, so a row reads as
	// text beside a thumbnail rather than as a second solid block.
	&__lines {
		display: flex;
		flex: 1 1 auto;
		flex-direction: column;
		justify-content: center;
		gap: 3px;
		min-width: 0;

		i {
			height: 3px;
			border-radius: 2px;
			background: color-mix(in srgb, var(--aureon-admin-border) 65%, transparent);

			&:last-child {
				width: 55%;
			}
		}
	}

	// Table: no per-line thumbnail, so each row is one full-width band — the
	// column grid WooCommerce ships, read at thumbnail size.
	&__thumb--table &__block {
		display: none;
	}

	// Compact: twice the rows in the same box, so each carries a single line
	// rather than a name-and-price pair that wouldn't fit legibly.
	&__thumb--compact &__lines i:last-child {
		display: none;
	}

	&__title {
		font-size: 12px;
		font-weight: 600;
		color: var(--aureon-admin-ink);
		transition: color 0.12s ease;
	}

	// Inside the card, not straddling its corner: the grid is tight enough at
	// 320px that an overhanging badge would be clipped by the card's own
	// rounding or overlap the card beside it.
	&__tick {
		position: absolute;
		top: 4px;
		right: 4px;
		display: flex;
		align-items: center;
		justify-content: center;
		width: 18px;
		height: 18px;
		border-radius: 50%;
		background: var(--aureon-admin-brand);
		color: #fff;
	}

	&__help {
		margin: 8px 0 0;
	}
}

/**
 * Checkout preview cards — same card chrome as `.aureon-cartstyle` above (and
 * deliberately so: they sit two tabs apart in the same workspace and should
 * read as one control family), with two thumbnail vocabularies of its own —
 * the page-layout columns and the step strip.
 */
.aureon-checkoutpreview {
	margin-bottom: 20px;

	&.is-disabled {
		opacity: 0.55;
		pointer-events: none;
	}

	&__label {
		display: block;
		margin-bottom: 10px;
		font-size: 13px;
		font-weight: 600;
		color: var(--aureon-admin-ink);
	}

	&__label + &__desc {
		margin: -6px 0 10px;
	}

	&__desc {
		margin: 0 0 10px;
		font-size: 12px;
		color: var(--aureon-admin-muted);
	}

	// Both callers have two or three options, and each thumbnail needs more
	// width than a cart line does to read as a *page*, so this sets a wider
	// floor than `.aureon-cartstyle__grid` and lets the third wrap at 320px.
	&__grid {
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
		gap: 8px;
	}

	&__card {
		position: relative;
		overflow: hidden;
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: 8px;
		padding: 10px;
		border: 1px solid var(--aureon-admin-border);
		border-radius: var(--aureon-admin-radius);
		background: var(--aureon-admin-surface);
		cursor: pointer;
		transition: border-color 0.12s ease, background-color 0.12s ease;

		&:hover:not(.is-active) {
			border-color: #c3c4c7;
		}

		&.is-active {
			border-color: var(--aureon-admin-brand);
			background: color-mix(in srgb, var(--aureon-admin-brand) 6%, var(--aureon-admin-surface));

			.aureon-checkoutpreview__title {
				color: var(--aureon-admin-brand);
			}
		}

		&:focus-visible {
			outline: 2px solid var(--aureon-admin-brand);
			outline-offset: 1px;
		}
	}

	&__thumb {
		display: flex;
		gap: 5px;
		width: 100%;
		height: 56px;
		padding: 7px;
		border: 1px solid var(--aureon-admin-border);
		border-radius: 6px;
		background: var(--aureon-admin-surface-alt);
		overflow: hidden;

		// The step strip is a single row of markers, centered in the box,
		// rather than a page shape filling it.
		&--steps {
			align-items: center;
			justify-content: center;
		}
	}

	// The form column: stubs standing in for labelled fields.
	&__stack {
		display: flex;
		flex: 1 1 auto;
		flex-direction: column;
		justify-content: center;
		gap: 4px;
		min-width: 0;

		i {
			height: 4px;
			border-radius: 2px;
			background: color-mix(in srgb, var(--aureon-admin-border) 70%, transparent);

			&:last-child {
				width: 60%;
			}
		}
	}

	// The order summary beside it — one solid block, since what's being chosen
	// is that the column exists, not what's in it.
	&__summary {
		flex: 0 0 34%;
		border-radius: 3px;
		background: var(--aureon-admin-border);
	}

	&__steps {
		display: flex;
		align-items: center;
		gap: 7px;
	}

	&__step {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 9px;
		height: 9px;
		border-radius: 50%;
		background: var(--aureon-admin-border);

		&.is-current {
			background: var(--aureon-admin-brand);
		}
	}

	// Numbered: the same markers grown enough to carry a digit legibly.
	&__steps.is-numbered &__step {
		width: 16px;
		height: 16px;
		font-size: 9px;
		font-weight: 600;
		line-height: 1;
		color: var(--aureon-admin-muted);

		&.is-current {
			color: #fff;
		}
	}

	// Width / density / input thumbnails are centered drawings, not a page
	// shape filling the box.
	&__thumb--width,
	&__thumb--density,
	&__thumb--input {
		align-items: center;
		justify-content: center;
	}

	&__thumb--width {
		padding: 6px 8px 0;
		align-items: flex-end;
	}

	// Form width: a browser window whose inner sheet is the measure.
	&__window {
		display: flex;
		flex-direction: column;
		align-items: center;
		width: 100%;
		height: 100%;
		border: 1px solid var(--aureon-admin-border);
		border-bottom: 0;
		border-radius: 4px 4px 0 0;
		background: var(--aureon-admin-surface);
		overflow: hidden;
	}

	&__chrome {
		display: flex;
		align-self: stretch;
		gap: 2px;
		padding: 3px 4px;
		border-bottom: 1px solid var(--aureon-admin-border);
		background: var(--aureon-admin-surface-alt);

		i {
			width: 3px;
			height: 3px;
			border-radius: 50%;
			background: var(--aureon-admin-subtle);
		}
	}

	&__sheet {
		display: flex;
		flex-direction: column;
		gap: 3px;
		width: 60%;
		margin-top: 5px;
		padding: 5px;
		border: 1px solid var(--aureon-admin-border);
		border-bottom: 0;
		border-radius: 3px 3px 0 0;
		transition: width 0.15s ease;

		&.is-narrow {
			width: 42%;
		}

		&.is-wide {
			width: 86%;
		}

		i {
			height: 3px;
			border-radius: 2px;
			background: color-mix(in srgb, var(--aureon-admin-border) 80%, transparent);

			&:nth-child(even) {
				width: 70%;
			}
		}
	}

	// Field spacing: three field bars, the gap between them is the density.
	&__fields {
		display: flex;
		flex-direction: column;
		gap: 5px;
		width: 72%;

		&.is-compact {
			gap: 1px;
		}

		&.is-spacious {
			gap: 9px;
		}

		i {
			height: 9px;
			border: 1px solid var(--aureon-admin-border);
			border-radius: 3px;
			background: var(--aureon-admin-surface);
		}
	}

	&__fields.is-spacious i {
		height: 8px;
	}

	&__fields.is-compact i {
		height: 11px;
	}

	// Input style: one sample field in the chosen treatment.
	&__input {
		display: flex;
		align-items: center;
		width: 100%;
		height: 26px;
		padding: 0 7px;
		overflow: hidden;
		font-size: 10px;
		line-height: 1;
		white-space: nowrap;
		text-overflow: ellipsis;
		color: var(--aureon-admin-muted);
		border: 1px solid transparent;
		border-radius: 4px;

		&.is-outline {
			border-color: var(--aureon-admin-subtle);
			background: var(--aureon-admin-surface);
		}

		&.is-filled {
			background: color-mix(in srgb, var(--aureon-admin-border) 55%, var(--aureon-admin-surface));
		}

		&.is-underline {
			padding-inline: 2px;
			border-radius: 0;
			border-bottom-color: var(--aureon-admin-subtle);
		}
	}

	&__thumb--input {
		background: var(--aureon-admin-surface);
	}

	&__title {
		font-size: 12px;
		font-weight: 600;
		color: var(--aureon-admin-ink);
		transition: color 0.12s ease;
	}

	// Inside the card for the same reason as `.aureon-cartstyle__tick` — see
	// the note there.
	&__tick {
		position: absolute;
		top: 4px;
		right: 4px;
		display: flex;
		align-items: center;
		justify-content: center;
		width: 18px;
		height: 18px;
		border-radius: 50%;
		background: var(--aureon-admin-brand);
		color: #fff;
	}

	&__help {
		margin: 8px 0 0;
	}
}

/**
 * Sidebar-width field — the icon + heading/description row above the Sidebar
 * section's width slider, boxed the same as a toggle row so it reads as one
 * setting card rather than loose page content.
 */
.aureon-sidebar-field {
	margin-bottom: 20px;
	padding: 14px;
	border: 1px solid var(--aureon-admin-border);
	border-radius: var(--aureon-admin-radius);
	background: var(--aureon-admin-surface-alt);

	&__head {
		display: flex;
		align-items: flex-start;
		gap: 12px;
		margin-bottom: 10px;

		strong {
			display: block;
			margin-bottom: 2px;
			font-size: 13px;
			color: var(--aureon-admin-ink);
		}
	}
}

/**
 * Field card — a plain bordered/surfaced box around a single control that
 * already renders its own label and help text (RangeControl, OptionCards),
 * so a group of otherwise-flush controls reads as separate settings instead
 * of one undifferentiated stack. Used by the Layout section's Content tab.
 */
.aureon-fieldcard {
	margin-bottom: 16px;
	padding: 18px;
	border: 1px solid var(--aureon-admin-border);
	border-radius: var(--aureon-admin-radius);
	background: var(--aureon-admin-surface);

	&:last-child {
		margin-bottom: 0;
	}

	// OptionCards carries its own bottom margin for when it's used flush in
	// a stack of other controls; inside a card of its own, that margin would
	// just pad the box out unevenly under its help text.
	> .aureon-optioncards {
		margin-bottom: 0;
	}
}

/* Color card */
.aureon-color-card {
	border: 1px solid var(--aureon-admin-border);
	border-radius: var(--aureon-admin-radius);
	padding: 16px;
	background: var(--aureon-admin-surface);
	transition: border-color 0.15s ease;

	&:hover {
		border-color: #c3c4c7;
	}

	&__head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin-bottom: 10px;
	}

	&__label {
		font-weight: 700;
		font-size: 14px;
	}

	&__reset.components-button {
		width: 24px;
		height: 24px;
		min-width: 24px;
		padding: 0;
		color: var(--aureon-admin-muted);

		svg {
			width: 15px;
			height: 15px;
		}

		&:hover {
			color: var(--aureon-admin-brand);
		}
	}

	&__toggle.components-button {
		display: flex;
		align-items: center;
		gap: 8px;
		height: auto;
		width: 100%;
		padding: 6px 10px;
		border: 1px solid var(--aureon-admin-border);
		border-radius: 6px;
		justify-content: flex-start;
		transition: border-color 0.12s ease;

		&:hover {
			border-color: var(--aureon-admin-brand);
		}

		code {
			font-size: 13px;
		}
	}

	&__swatch {
		width: 28px;
		height: 28px;
		border-radius: 50%;
		border: 1px solid rgba(0, 0, 0, 0.15);
		flex: 0 0 auto;
	}

	&__picker {
		padding: 8px;
	}

	&__desc {
		margin: 8px 0 0;
		font-size: 12px;
		color: var(--aureon-admin-muted);
	}
}

/**
 * Tick slider — a native `<input type="range">` restyled as a labelled-step
 * slider (see TickSlider's own docblock for why this isn't RangeControl's
 * `marks`). The filled portion of the track is drawn with a gradient split
 * at `--aureon-tickslider-fill` (a percentage custom property set inline
 * per render) rather than a real "progress" sub-element, since
 * `<input type="range">` has none in Chromium — Firefox gets the same look
 * via its own `::-moz-range-progress`, which *is* a real element there.
 */
.aureon-tickslider {
	margin-bottom: 16px;

	&__label {
		display: block;
		margin-bottom: 10px;
		font-size: 13px;
		font-weight: 600;
		color: var(--aureon-admin-ink);
	}

	&__input {
		display: block;
		width: 100%;
		height: 20px;
		margin: 0;
		padding: 0;
		background: transparent;
		cursor: pointer;
		appearance: none;

		&::-webkit-slider-runnable-track {
			height: 4px;
			border-radius: 2px;
			background: linear-gradient(to right, var(--aureon-admin-brand) 0%, var(--aureon-admin-brand) var(--aureon-tickslider-fill, 0%), var(--aureon-admin-border) var(--aureon-tickslider-fill, 0%), var(--aureon-admin-border) 100%);
		}

		&::-webkit-slider-thumb {
			appearance: none;
			width: 18px;
			height: 18px;
			margin-top: -7px;
			border-radius: 50%;
			border: 3px solid var(--aureon-admin-brand);
			background: var(--aureon-admin-surface);
			box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
			cursor: pointer;
		}

		&::-moz-range-track {
			height: 4px;
			border-radius: 2px;
			background: var(--aureon-admin-border);
		}

		&::-moz-range-progress {
			height: 4px;
			border-radius: 2px;
			background: var(--aureon-admin-brand);
		}

		&::-moz-range-thumb {
			width: 18px;
			height: 18px;
			border-radius: 50%;
			border: 3px solid var(--aureon-admin-brand);
			background: var(--aureon-admin-surface);
			box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
			cursor: pointer;
		}

		&:focus-visible {

			&::-webkit-slider-thumb {
				outline: 2px solid var(--aureon-admin-brand);
				outline-offset: 2px;
			}

			&::-moz-range-thumb {
				outline: 2px solid var(--aureon-admin-brand);
				outline-offset: 2px;
			}
		}
	}

	&__ticks {
		display: flex;
		justify-content: space-between;
		margin-top: 8px;
	}

	&__tick {
		flex: 1 1 0;
		font-size: 12px;
		color: var(--aureon-admin-subtle);
		text-align: center;
		white-space: nowrap;

		&:first-child {
			text-align: left;
		}

		&:last-child {
			text-align: right;
		}

		&.is-active {
			color: var(--aureon-admin-brand);
			font-weight: 700;
		}
	}

	&__help {
		margin-top: 8px;
	}
}

/**
 * Range field — TickSlider's own track/thumb look, but for a continuous
 * value: a number+unit box sits beside the track instead of a row of step
 * labels underneath, and the min/max bounds are labelled underneath instead.
 * Used by the Sidebar section's Width/border/spacing sliders.
 */
.aureon-rangefield {
	margin-bottom: 16px;

	&__label {
		display: block;
		margin-bottom: 10px;
		font-size: 13px;
		font-weight: 600;
		color: var(--aureon-admin-ink);
	}

	&__row {
		display: flex;
		align-items: center;
		gap: 14px;
	}

	// The track/fill are drawn as real elements (rail underneath, gold fill
	// bar sized to the current percent) rather than a linear-gradient split
	// at a custom property read inside ::-webkit-slider-runnable-track —
	// that pseudo-element doesn't reliably see a custom property set via a
	// React inline style in every engine, so the split silently stayed at
	// its 0% fallback. This way the fill is a plain, always-correct `width`.
	&__track {
		position: relative;
		display: flex;
		align-items: center;
		flex: 1 1 auto;
		height: 20px;

		&::before {
			content: "";
			position: absolute;
			top: 50%;
			left: 0;
			right: 0;
			height: 8px;
			border-radius: 4px;
			background: var(--aureon-admin-border);
			transform: translateY(-50%);
		}
	}

	&__fill {
		position: absolute;
		top: 50%;
		left: 0;
		height: 8px;
		border-radius: 4px;
		background: var(--aureon-admin-brand);
		transform: translateY(-50%);
		pointer-events: none;
	}

	&__input {
		position: relative;
		display: block;
		width: 100%;
		height: 20px;
		margin: 0;
		padding: 0;
		background: transparent;
		cursor: pointer;
		appearance: none;

		// Both engines' native tracks stay fully transparent — the rail and
		// fill above are the only visible track, this element only supplies
		// the thumb and the drag hit area.
		&::-webkit-slider-runnable-track {
			height: 8px;
			background: transparent;
		}

		&::-webkit-slider-thumb {
			appearance: none;
			width: 24px;
			height: 24px;
			margin-top: -8px;
			border-radius: 50%;
			border: 2.5px solid var(--aureon-admin-brand);
			background: var(--aureon-admin-surface);
			box-sizing: border-box;
			cursor: pointer;
		}

		&::-moz-range-track {
			height: 8px;
			background: transparent;
		}

		&::-moz-range-thumb {
			width: 24px;
			height: 24px;
			border-radius: 50%;
			border: 2.5px solid var(--aureon-admin-brand);
			background: var(--aureon-admin-surface);
			box-sizing: border-box;
			cursor: pointer;
		}

		&:focus-visible {

			&::-webkit-slider-thumb {
				outline: 2px solid var(--aureon-admin-brand);
				outline-offset: 2px;
			}

			&::-moz-range-thumb {
				outline: 2px solid var(--aureon-admin-brand);
				outline-offset: 2px;
			}
		}
	}

	&__value {
		display: flex;
		flex: 0 0 auto;
		align-items: stretch;
		height: 40px;
		overflow: hidden;
		border: 1px solid var(--aureon-admin-border);
		border-radius: 10px;
		background: var(--aureon-admin-surface);
		box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
	}

	// `input[type="number"]` alone (core's own selector in forms.css) outranks
	// a single class, so `&__quantity` here loses its border/padding/height
	// reset to wp-admin's default text-input chrome (1px #949494 border, 12px
	// padding, 40px min-height) unless matched by an equally-specific
	// selector — hence the redundant `[type="number"]` below.
	&__quantity[type="number"] {
		width: 48px;
		min-height: 0;
		padding: 0 10px;
		border: none;
		background: transparent;
		color: var(--aureon-admin-ink);
		font-size: 14px;
		text-align: center;

		&:focus,
		&:focus-visible {
			outline: none;
			box-shadow: none;
		}

		// Hide the native spinner so the box reads as a plain number field.
		&::-webkit-outer-spin-button,
		&::-webkit-inner-spin-button {
			appearance: none;
			margin: 0;
		}
	}

	&__unit {
		display: flex;
		align-items: center;
		padding: 0 12px;
		border-left: 1px solid var(--aureon-admin-border);
		background: var(--aureon-admin-surface-alt);
		color: var(--aureon-admin-muted);
		font-size: 13px;
	}

	&__scale {
		display: flex;
		justify-content: space-between;
		margin-top: 8px;
		font-size: 12px;
		color: var(--aureon-admin-subtle);
	}
}

/* Scale field (Spacing / Radius) — mirrors .aureon-color-card's shell */
.aureon-scale-field {
	border: 1px solid var(--aureon-admin-border);
	border-radius: var(--aureon-admin-radius);
	padding: 16px;
	background: var(--aureon-admin-surface);
	transition: border-color 0.15s ease;

	&:hover {
		border-color: #c3c4c7;
	}

	&__head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin-bottom: 10px;
	}

	&__label {
		font-weight: 700;
		font-size: 14px;
	}

	&__reset.components-button {
		width: 24px;
		height: 24px;
		min-width: 24px;
		padding: 0;
		color: var(--aureon-admin-muted);

		svg {
			width: 15px;
			height: 15px;
		}

		&:hover {
			color: var(--aureon-admin-brand);
		}
	}

	&__preview {
		display: flex;
		align-items: center;
		height: 32px;
		margin-bottom: 10px;

		&--bar {
			padding: 0 2px;
		}

		&--radius {
			justify-content: flex-start;
		}
	}

	&__swatch {
		display: block;
		background: rgba(var(--aureon-admin-brand-rgb), 0.35);
	}

	&__preview--bar &__swatch {
		height: 8px;
		border-radius: 2px;
	}

	&__preview--radius &__swatch {
		width: 32px;
		height: 32px;
		border: 1.5px solid var(--aureon-admin-brand);
		background: rgba(var(--aureon-admin-brand-rgb), 0.12);
	}

	&__desc {
		margin: 8px 0 0;
		font-size: 12px;
		color: var(--aureon-admin-muted);
	}

	&__slider {
		width: 100%;
		height: 4px;
		margin: 4px 0 12px;
		appearance: none;
		border-radius: 2px;
		background: var(--aureon-admin-border);
		cursor: pointer;

		&::-webkit-slider-thumb {
			appearance: none;
			width: 16px;
			height: 16px;
			border-radius: 50%;
			background: var(--aureon-admin-brand);
			border: 2px solid var(--aureon-admin-surface);
			box-shadow: 0 0 0 1px var(--aureon-admin-brand);
		}

		&::-moz-range-thumb {
			width: 16px;
			height: 16px;
			border: 2px solid var(--aureon-admin-surface);
			border-radius: 50%;
			background: var(--aureon-admin-brand);
			box-shadow: 0 0 0 1px var(--aureon-admin-brand);
		}

		&::-moz-range-track {
			height: 4px;
			border-radius: 2px;
			background: var(--aureon-admin-border);
		}
	}
}

/* "How it works" callout */
.aureon-admin__callout {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 12px;
	margin-top: 16px;
	padding: 16px;
	background: var(--aureon-admin-mint);
	border-radius: var(--aureon-admin-radius);

	// The icon and the text it introduces; the action sits on its own line below.
	&-head {
		display: flex;
		align-items: flex-start;
		gap: 12px;
	}

	&-icon {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 36px;
		height: 36px;
		border-radius: 8px;
		background: rgba(var(--aureon-admin-brand-rgb), 0.12);
		color: var(--aureon-admin-brand);
		flex: 0 0 auto;
	}

	&-body {
		flex: 1 1 auto;
		min-width: 0;
	}

	&-title {
		margin: 0 0 2px;
		font-size: 14px;
		font-weight: 600;
	}

	&-text {
		margin: 0;
		font-size: 13px;
		color: var(--aureon-admin-mint-text);
	}
}

.aureon-admin__callout-action.components-button {
	flex: 0 0 auto;
	align-self: flex-end;
	background: var(--aureon-admin-surface);
	border: 1px solid var(--aureon-admin-brand);
	border-radius: 6px;
	color: var(--aureon-admin-brand);
	box-shadow: none;

	&:hover:not(:disabled) {
		background: rgba(var(--aureon-admin-brand-rgb), 0.08);
		color: var(--aureon-admin-brand-hover);
		box-shadow: none;
	}

	&:focus:not(:disabled) {
		box-shadow:
			0 0 0 var(--wp-admin-border-width-focus, 2px)
			rgba(var(--aureon-admin-brand-rgb), 0.3);
	}
}

.aureon-admin__tokens-table {
	width: 100%;
	border-collapse: collapse;

	th,
	td {
		text-align: left;
		padding: 6px 10px;
		border-bottom: 1px solid var(--aureon-admin-border);
		font-size: 13px;
	}
}

/* Typography card — one per role (Body/Headings/Links/Buttons/Misc) */
.aureon-typography-card {
	border: 1px solid var(--aureon-admin-border);
	border-radius: var(--aureon-admin-radius);
	padding: 20px;
	background: var(--aureon-admin-surface);
	margin-bottom: 16px;
	transition: border-color 0.15s ease;

	&:hover {
		border-color: #c3c4c7;
	}

	&__head {
		display: flex;
		align-items: flex-start;
		justify-content: space-between;
		gap: 12px;
		margin-bottom: 16px;

		h3 {
			margin: 0 0 4px;
			font-size: 15px;
			font-weight: 700;
		}
	}

	&__desc {
		margin: 0;
		font-size: 12px;
		color: var(--aureon-admin-muted);
	}

	&__reset.components-button {
		width: 24px;
		height: 24px;
		min-width: 24px;
		padding: 0;
		color: var(--aureon-admin-muted);
		flex: 0 0 auto;

		svg {
			width: 15px;
			height: 15px;
		}

		&:hover {
			color: var(--aureon-admin-brand);
		}
	}

	&__grid {
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
		gap: 16px;
	}
}

.aureon-color-field__label {
	display: block;
	margin-bottom: 8px;
	font-size: 11px;
	font-weight: 500;
	line-height: 1.4;
}

/* Global-or-custom switch — a globe segment (inherit) paired with the
   override editor. While a setting follows the global token the right
   segment is just a pencil, so an unset override reads as
   "click to customize" rather than as blank. */
.aureon-gc {

	&__label {
		display: block;
		margin-bottom: 8px;
		font-size: 11px;
		font-weight: 500;
		line-height: 1.4;
	}

	// Hug the segments instead of filling the field row — the switch is a
	// compact pair, and the custom segment grows only when it holds a value.
	&__segments {
		display: flex;
		align-items: stretch;
		width: fit-content;
		border: 1px solid var(--aureon-admin-border);
		border-radius: 8px;
		overflow: hidden;
		background: var(--aureon-admin-surface);
	}

	&__seg {
		display: flex;
		align-items: center;
		justify-content: center;
		min-height: 36px;
		padding: 0 10px;
		color: var(--aureon-admin-muted);
		background: transparent;
	}

	// Both segments render as WP Buttons in their inactive state; drop the pill
	// radius so they read as one control.
	&__seg.components-button {
		height: auto;
		border-radius: 0;

		&:hover {
			color: var(--aureon-admin-brand);
		}
	}

	// The active segment. `aria-pressed` is in the selector on purpose: WP's
	// component styles paint pressed buttons near-black, which would swallow the
	// brand tint.
	&__seg.is-active,
	&__seg.components-button[aria-pressed="true"] {
		background: rgba(var(--aureon-admin-brand-rgb), 0.1);
		color: var(--aureon-admin-brand);
	}

	&__seg--custom {
		flex: 0 1 auto;
		min-width: 48px;
		border-left: 1px solid var(--aureon-admin-border);
		padding: 3px 6px;
	}

	// The embedded editor already sits inside the segment's border — strip its
	// own shell so we don't draw a box in a box.
	.aureon-color-card__toggle.components-button {
		width: auto;
		padding: 2px 4px;
		border: 0;

		// WP paints <code> on a grey block, which reads as a second surface
		// inside the tinted segment.
		code {
			background: none;
			padding: 0;
		}
	}

	.aureon-color-card__swatch {
		width: 20px;
		height: 20px;
	}

	.components-base-control {
		margin: 0;
	}
}

/* Media image picker (logo / favicon) — thumbnail preview + choose/remove. */
.aureon-media-field {
	display: flex;
	align-items: center;
	gap: 12px;
}

.aureon-media-field__preview {
	width: 48px;
	height: 48px;
	object-fit: contain;
	border: 1px solid var(--aureon-admin-border);
	border-radius: 4px;
	background: var(--aureon-admin-surface);
	padding: 4px;
}

.aureon-media-field__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;

	// Give the Select image / Replace button real breathing room and a softer
	// radius — the default small secondary button reads too thin and boxy.
	.components-button.is-secondary {
		height: auto;
		min-height: 40px;
		padding: 8px 16px;
		border-radius: 8px;
		font-weight: 500;
	}

	.components-button.is-tertiary {
		height: auto;
		min-height: 40px;
		padding: 8px 12px;
		border-radius: 8px;
	}
}

/* ==========================================================================
 * Tab bar (`Tabs`, underline + segmented variants).
 *
 * Tabs switch the pane, so they're drawn as navigation — never as the rounded
 * pill group an option uses to pick a value (`.aureon-segmented`), which is
 * what they used to look like and what made them read as a setting. A
 * full-width strip of equal tabs on a hairline baseline: icon over label, the
 * active tab lifted to ink with a gold bar under it and a faint gold wash.
 * ========================================================================== */
%aureon-tab {
	position: relative;
	display: inline-flex;
	// Sized by label, so a long one ("Size & Spacing") takes the room it needs
	// rather than truncating inside an equal third.
	flex: 1 1 auto;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 5px;
	min-width: 0;
	min-height: 40px;
	margin: 0;
	padding: 9px 6px 10px;
	border: 0;
	border-radius: 6px 6px 0 0;
	background: transparent;
	box-shadow: none;
	color: var(--aureon-admin-muted);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0.01em;
	text-align: center;
	cursor: pointer;
	transition:
		color 0.12s ease,
		background-color 0.12s ease;

	> span {
		max-width: 100%;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	svg {
		flex: 0 0 auto;
		color: var(--aureon-admin-subtle);
		transition: color 0.12s ease;
	}

	// The active marker, riding the strip's baseline.
	&::after {
		content: "";
		position: absolute;
		left: 10px;
		right: 10px;
		bottom: -1px;
		height: 2px;
		border-radius: 2px 2px 0 0;
		background: var(--aureon-admin-brand);
		transform: scaleX(0);
		transition: transform 0.16s ease;
	}

	&:hover:not(.is-active) {
		background: var(--aureon-admin-surface-alt);
		color: var(--aureon-admin-ink);

		svg {
			color: var(--aureon-admin-muted);
		}
	}

	&.is-active {
		background: linear-gradient(to top, rgba(var(--aureon-admin-brand-rgb), 0.1), rgba(var(--aureon-admin-brand-rgb), 0));
		color: var(--aureon-admin-ink);

		svg {
			color: var(--aureon-admin-brand);
		}

		&::after {
			left: 0;
			right: 0;
			transform: scaleX(1);
		}
	}

	&:focus {
		box-shadow: none;
		outline: none;
	}

	&:focus-visible {
		outline: 2px solid var(--aureon-admin-brand);
		outline-offset: -2px;
	}
}

.aureon-tabs {
	display: flex;
	align-items: flex-end;
	gap: 12px;
	margin-bottom: 20px;
	border-bottom: 1px solid var(--aureon-admin-border);

	&__list {
		display: flex;
		flex: 1 1 auto;
		gap: 2px;
		min-width: 0;
	}

	&__trailing {
		flex: 0 0 auto;
		display: flex;
		align-items: center;
		gap: 6px;
		padding-bottom: 6px;
	}

	&__tab {

		@extend %aureon-tab;
	}
}

/* Typography overview tab — active pairing summary */
.aureon-typography-overview {
	margin-bottom: 24px;

	&__pairing {
		display: flex;
		align-items: center;
		gap: 16px;
		padding: 20px;
		border: 1px solid var(--aureon-admin-border);
		border-radius: var(--aureon-admin-radius);
		background: var(--aureon-admin-surface);
	}

	&__pairing-action.components-button {
		flex: 0 0 auto;
		background: var(--aureon-admin-surface);
		border: 1px solid var(--aureon-admin-brand);
		border-radius: 6px;
		color: var(--aureon-admin-brand);
		box-shadow: none;

		&:hover:not(:disabled) {
			background: rgba(var(--aureon-admin-brand-rgb), 0.08);
			color: var(--aureon-admin-brand-hover);
			box-shadow: none;
		}

		&:focus:not(:disabled) {
			box-shadow:
				0 0 0 var(--wp-admin-border-width-focus, 2px)
				rgba(var(--aureon-admin-brand-rgb), 0.3);
		}
	}

	&__glyph {
		display: flex;
		align-items: center;
		justify-content: center;
		flex: 0 0 auto;
		width: 48px;
		height: 48px;
		border-radius: 50%;
		background: rgba(var(--aureon-admin-brand-rgb), 0.12);
		font-size: 18px;
		font-weight: 700;
		line-height: 1;
		color: var(--aureon-admin-brand);
	}

	&__section-head {
		display: flex;
		flex-wrap: wrap;
		align-items: flex-start;
		justify-content: space-between;
		gap: 12px;
		margin: 24px 0 12px;
	}

	&__section-title {
		margin: 0 0 2px;
		font-size: 16px;
		font-weight: 600;
		color: var(--aureon-admin-ink);
	}

	&__section-desc {
		margin: 0;
		font-size: 13px;
		color: var(--aureon-admin-muted);
	}

	&__label {
		margin: 0 0 4px;
		font-size: 12px;
		font-weight: 600;
		color: var(--aureon-admin-muted);
		text-transform: uppercase;
		letter-spacing: 0.04em;
	}

	&__value {
		margin: 0;
		font-size: 14px;
		color: var(--aureon-admin-ink);

		strong {
			font-weight: 700;
		}
	}

	&__preview-wrap {
		display: grid;
		grid-template-columns: minmax(0, 1fr) 160px;
		gap: 24px;
		align-items: stretch;
		padding: 24px 20px;
		margin-top: 0;
		border: 1px solid var(--aureon-admin-border);
		border-radius: var(--aureon-admin-radius);
		background: var(--aureon-admin-surface-alt);

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

	&__preview {
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		justify-content: center;
		gap: 10px;
		min-width: 0;
	}

	&__preview-visual {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 10px;
		padding: 16px;
		border-radius: var(--aureon-admin-radius);
		background: var(--aureon-admin-surface);
		border: 1px solid var(--aureon-admin-border);

		@media (max-width: 700px) {
			display: none;
		}
	}

	&__preview-visual-glyph {
		font-size: 40px;
		font-weight: 700;
		line-height: 1;
		color: var(--aureon-admin-brand);
	}

	&__preview-visual-line {
		display: block;
		width: 100%;
		height: 6px;
		border-radius: 3px;
		background: var(--aureon-admin-border);

		&--short {
			width: 60%;
		}
	}

	&__preview-heading {
		margin: 0;
	}

	&__preview-body {
		margin: 4px 0 0;
		max-width: 60ch;

		a {
			color: var(--aureon-admin-brand);
		}
	}

	&__preview-button {
		display: inline-block;
		margin-top: 4px;
		padding: 8px 18px;
		border-radius: var(--aureon-admin-radius);
		background: var(--aureon-admin-brand);
		color: #fff;
	}

	&__cards {
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
		gap: 12px;
		margin-top: 16px;
	}

	&__card {
		position: relative;
		display: flex;
		align-items: flex-start;
		gap: 12px;
		padding: 14px 16px;
		border: 1px solid var(--aureon-admin-border);
		border-radius: var(--aureon-admin-radius);
		background: var(--aureon-admin-surface);
		text-align: left;
		cursor: pointer;

		&:hover,
		&:focus-visible {
			border-color: var(--aureon-admin-brand);
		}
	}

	&__card-icon {
		display: flex;
		align-items: center;
		justify-content: center;
		flex: 0 0 auto;
		width: 40px;
		height: 40px;
		border-radius: 50%;
		background: rgba(var(--aureon-admin-brand-rgb), 0.12);
		color: var(--aureon-admin-brand);
	}

	&__card-body {
		display: flex;
		flex-direction: column;
		gap: 2px;
		min-width: 0;
		flex: 1 1 auto;
	}

	&__card-label {
		font-size: 12px;
		font-weight: 600;
		color: var(--aureon-admin-muted);
		text-transform: uppercase;
		letter-spacing: 0.04em;
	}

	&__card-family {
		font-size: 14px;
		font-weight: 700;
		color: var(--aureon-admin-ink);
	}

	&__card-meta {
		font-size: 12px;
		color: var(--aureon-admin-muted);
	}

	&__card-chevron {
		flex: 0 0 auto;
		margin-top: 12px;
		color: var(--aureon-admin-muted);
	}
}

.aureon-typography-card__pairing-note {
	grid-column: 1 / -1;
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;

	p {
		margin: 0;
		font-size: 13px;
		color: var(--aureon-admin-muted);

		strong {
			color: var(--aureon-admin-ink);
		}
	}
}

.aureon-typography-card__custom-sizes {
	grid-column: 1 / -1;

	&-grid {
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
		gap: 16px;
		margin-top: 12px;
	}
}

/* Font pairing cards */
.aureon-font-pairings {
	// @wordpress/components' Button reads --wp-components-color-accent for
	// its secondary/primary skins, which WP core sets to its own blue and
	// doesn't tie to --wp-admin-theme-color — left alone, "Set as Default",
	// "Create Pairing" and the icon actions render in wp-admin blue instead
	// of the Aureon brand gold used everywhere else in this section (the
	// mint badges, the active border). Scoped to the whole section, not just
	// the pairing cards, so "Add New Pairing" picks it up too.
	--wp-components-color-accent: var(--aureon-admin-brand);
	--wp-components-color-accent-inverted: #fff;

	&__list {
		display: flex;
		flex-direction: column;
		gap: 12px;
		margin-bottom: 12px;
	}

	&__hint {
		margin: 0 0 24px;
		font-size: 12px;
		color: var(--aureon-admin-subtle);
	}

	&__add {
		padding: 20px;
		border: 1px solid var(--aureon-admin-border);
		border-radius: var(--aureon-admin-radius);
		background: var(--aureon-admin-surface-alt);
		margin-bottom: 24px;

		h3 {
			margin: 0 0 4px;
			font-size: 15px;
			font-weight: 700;
		}
	}

	&__add-row {
		display: flex;
		align-items: flex-end;
		gap: 12px;
		margin-top: 16px;

		> * {
			flex: 1 1 200px;
		}
	}

	&__swap.components-button {
		flex: 0 0 auto;
		margin-bottom: 0;
		color: var(--aureon-admin-muted);

		&:hover {
			color: var(--aureon-admin-brand);
		}
	}

	&__limit {
		margin: 12px 0 0;
		font-size: 12px;
		color: var(--aureon-admin-subtle);
		font-style: italic;
	}
}

.aureon-pairing-card {
	position: relative;
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 16px;
	border: 1px solid var(--aureon-admin-border);
	border-radius: var(--aureon-admin-radius);
	background: var(--aureon-admin-surface);
	transition: border-color 0.15s ease;

	&:hover {
		border-color: #c3c4c7;
	}

	&.is-active {
		border-color: var(--aureon-admin-brand);
	}

	&__check-badge {
		position: absolute;
		top: -8px;
		right: -8px;
		display: flex;
		align-items: center;
		justify-content: center;
		width: 22px;
		height: 22px;
		border-radius: 50%;
		background: var(--aureon-admin-brand);
		color: #fff;
		box-shadow: 0 0 0 2px var(--aureon-admin-surface);
	}

	&__preview {
		display: flex;
		align-items: center;
		gap: 16px;
		flex: 1 1 auto;
		min-width: 0;
	}

	&__glyph {
		flex: 0 0 auto;
		width: 56px;
		font-size: 32px;
		font-weight: 700;
		line-height: 1;
		text-align: center;
		color: var(--aureon-admin-ink);
		padding: 12px 0;
		border-radius: 8px;

		// Decorative tints, cycled per pairing so cards stay visually distinct
		// at a glance — no semantic meaning attached to the colors.
		&--neutral {
			background: var(--aureon-admin-surface);
			border: 1px solid var(--aureon-admin-border);
			padding: 11px 0;
		}

		&--violet {
			background: #e0e7ff;
		}

		&--amber {
			background: #fde7d3;
		}

		&--teal {
			background: #ccfbf1;
		}

		&--rose {
			background: #ffe4e6;
		}
	}

	&__fonts,
	&__edit {
		flex: 1 1 auto;
		display: flex;
		flex-wrap: wrap;
		gap: 10px;
		min-width: 0;
	}

	&__edit {
		gap: 16px;

		> * {
			flex: 1 1 200px;
		}
	}

	&__font-row {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		row-gap: 4px;
		column-gap: 6px;
		min-width: 120px;
	}

	&__font-label {
		flex: 0 0 auto;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		min-width: 18px;
		font-size: 11px;
		font-weight: 700;
		line-height: 1.6;
		color: var(--aureon-admin-muted);
		background: var(--aureon-admin-surface-alt);
		border: 1px solid var(--aureon-admin-border);
		padding: 0 5px;
		border-radius: 4px;
		text-transform: uppercase;
		letter-spacing: 0.04em;
	}

	&__font-value {
		flex: 0 1 auto;
		font-size: 13px;
		font-weight: 600;
		color: var(--aureon-admin-ink);
	}

	// Holds just the Google Fonts glyph now (the label moved to a Tooltip), so
	// it's a small square swatch rather than a text pill.
	&__badge {
		flex: 0 0 auto;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 20px;
		height: 20px;
		padding: 4px;
		border-radius: 5px;
		background: var(--aureon-admin-mint);

		svg {
			width: 100%;
			height: 100%;
		}
	}

	&__status {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 8px;
		flex: 0 0 auto;
	}

	&__active-pill {
		display: inline-flex;
		align-items: center;
		gap: 6px;
		padding: 6px 12px;
		border-radius: 999px;
		background: var(--aureon-admin-mint);
		color: var(--aureon-admin-mint-text);
		font-size: 12px;
		font-weight: 700;
	}

	&__set-default.components-button {
		border-radius: var(--aureon-admin-radius);
	}

	// Edit + Delete, grouped as one visual unit at the row's end rather than
	// reading as two unrelated icon buttons.
	&__icon-actions {
		display: flex;
		flex: 0 0 auto;
		align-items: center;
		gap: 10px;
	}

	&__icon-btn.components-button {
		width: 40px;
		height: 40px;
		min-width: 40px;
		padding: 10px;
		border: 1px solid var(--aureon-admin-border);
		border-radius: 10px;
		background: var(--aureon-admin-surface-alt);
		color: var(--aureon-admin-muted);

		&:hover {
			border-color: var(--aureon-admin-brand);
			background: rgba(var(--aureon-admin-brand-rgb), 0.1);
			color: var(--aureon-admin-brand);
		}
	}

	&__icon-btn--danger.components-button:hover {
		border-color: var(--aureon-admin-danger);
		background: rgba(var(--aureon-admin-danger-rgb), 0.1);
		color: var(--aureon-admin-danger);
	}
}

/**
 * Lightweight CSS-only tooltip — a dark bubble with a downward-pointing tail,
 * shown via `data-tooltip` + `:hover`/`:focus-visible`. Used instead of
 * @wordpress/components' Tooltip (built on Ariakit) because that one has a
 * baked-in ~700ms show delay; this one has none.
 */
.aureon-tooltip {
	position: relative;

	&::before,
	&::after {
		position: absolute;
		bottom: 100%;
		left: 50%;
		transform: translateX(-50%);
		opacity: 0;
		pointer-events: none;
		transition: opacity 0.08s ease;
		z-index: 20;
	}

	&::after {
		content: attr(data-tooltip);
		margin-bottom: 8px;
		padding: 6px 10px;
		border-radius: 6px;
		background: #1e1e1e;
		color: #fff;
		font-size: 11px;
		font-weight: 600;
		line-height: 1.4;
		white-space: nowrap;
		box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
	}

	// A bottom border (even transparent) adds its own height to the box,
	// which then sits *inside* the bubble's margin instead of below it —
	// the colored top border ends up hidden behind the bubble and only the
	// invisible bottom sliver peeks out. Skip border-bottom entirely so the
	// box's whole height is the visible triangle, flush under the bubble.
	&::before {
		content: "";
		margin-bottom: 2px;
		border-left: 6px solid transparent;
		border-right: 6px solid transparent;
		border-top: 6px solid #1e1e1e;
	}

	&:hover::after,
	&:hover::before,
	&:focus-visible::after,
	&:focus-visible::before {
		opacity: 1;
	}
}

// Established on the whole section (not just __list) so the "Add New
// Pairing" row below the list responds to the same narrow-host breakpoint.
.aureon-font-pairings {
	container-type: inline-size;
	container-name: aureon-pairing-list;
}

// The one-row layout above needs the glyph, two 120px-minimum font columns
// and the status actions side by side — around 560px — and never wraps to
// ask for less, so on a narrower host (any Customizer pane, pinned at 320px)
// `&__fonts`' `min-width: 0` just lets it get crushed down to a sliver
// instead. Stacking gives every part of the card its own line and the full
// width, rather than fighting for a share of one that was never wide enough
// to begin with.
@container aureon-pairing-list ( max-width: 580px ) {

	.aureon-pairing-card {
		flex-wrap: wrap;

		&__fonts {
			flex-basis: 100%;
			flex-direction: column;
		}

		&__status {
			flex-basis: 100%;
			flex-wrap: wrap;
		}
	}

	// Same problem, same fix: four flex-basis:200px children (two selects,
	// swap button, submit button) never fit a Customizer-width host, so they
	// were overflowing the card and forcing a horizontal scrollbar. Stack
	// them full-width instead.
	.aureon-font-pairings__add-row {
		flex-direction: column;
		align-items: stretch;

		> * {
			flex-basis: auto;
		}
	}

	.aureon-font-pairings__swap.components-button {
		align-self: center;
		transform: rotate(90deg);
	}
}

/* Font Library (Typography Pairings tab, second block) */
.aureon-font-library {
	margin-top: 32px;
	margin-bottom: 32px;

	&__head {
		justify-content: space-between;
		align-items: center;
	}

	&__empty {
		display: flex;
		flex-direction: column;
		align-items: center;
		text-align: center;
		gap: 4px;
		padding: 48px 24px;
		border: 1px dashed var(--aureon-admin-border);
		border-radius: var(--aureon-admin-radius);
		background: var(--aureon-admin-surface-alt);
	}

	&__empty-icon {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 56px;
		height: 56px;
		margin-bottom: 12px;
		border-radius: var(--aureon-admin-radius);
		border: 1px solid var(--aureon-admin-border);
		background: var(--aureon-admin-surface);
		color: var(--aureon-admin-muted);
	}

	&__empty-title {
		margin: 0;
		font-size: 15px;
		font-weight: 700;
	}

	&__empty-desc {
		margin: 0 0 16px;
		max-width: 42ch;
		color: var(--aureon-admin-muted);
		font-size: 13px;
	}

	&__table {
		width: 100%;
		border-collapse: collapse;
		border: 1px solid var(--aureon-admin-border);
		border-radius: var(--aureon-admin-radius);
		overflow: hidden;

		th,
		td {
			padding: 12px 16px;
			text-align: left;
			font-size: 13px;
			border-bottom: 1px solid var(--aureon-admin-border);
		}

		thead th {
			font-size: 11px;
			font-weight: 600;
			text-transform: uppercase;
			letter-spacing: 0.04em;
			color: var(--aureon-admin-muted);
			background: var(--aureon-admin-surface-alt);
		}

		tbody tr:last-child td {
			border-bottom: 0;
		}
	}

	&__cell-family {
		font-weight: 600;
		color: var(--aureon-admin-ink);
	}

	&__status {
		display: inline-flex;
		align-items: center;
		gap: 6px;
		padding: 0;
		border: 0;
		background: transparent;
		color: var(--aureon-admin-muted);
		font-size: 13px;
		cursor: pointer;

		&--active {
			color: var(--aureon-admin-mint-text);
		}
	}

	&__status-dot {
		width: 7px;
		height: 7px;
		border-radius: 50%;
		background: var(--aureon-admin-subtle);
		flex: 0 0 auto;
	}

	&__status--active &__status-dot {
		background: var(--aureon-admin-brand);
	}

	&__actions {
		display: flex;
		align-items: center;
		gap: 4px;
		white-space: nowrap;
	}

	&__actions-head {
		width: 1%;
	}
}

/* Add Font modal */
.aureon-admin__add-font-modal.components-modal__frame {
	width: 760px;
	max-width: 92vw;
}

.aureon-add-font-modal__tabs {
	margin-bottom: 16px;
}

.aureon-add-font-modal__toolbar {
	display: flex;
	align-items: flex-end;
	gap: 12px;
	margin-bottom: 12px;

	.components-search-control {
		flex: 1;
	}
}

.aureon-add-font-modal__picker {
	display: grid;
	grid-template-columns: 1fr 220px;
	gap: 16px;
}

.aureon-add-font-modal__picker-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
	max-height: 360px;
	overflow-y: auto;
	border: 1px solid var(--aureon-admin-border);
	border-radius: var(--aureon-admin-radius);
	padding: 4px;
}

.aureon-add-font-modal__picker-items {
	margin: 0;
	padding: 0;
	list-style: none;
}

.aureon-add-font-modal__picker-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 4px 10px;

	& + & {
		border-top: 1px solid var(--aureon-admin-border);
	}
}

.aureon-add-font-modal__picker-item {
	margin: 0;
}

.aureon-add-font-modal__picker-item-meta {
	font-size: 12px;
	color: var(--aureon-admin-muted);
	white-space: nowrap;
}

.aureon-add-font-modal__show-more {
	align-self: center;
	margin: 8px 0 4px;
}

.aureon-add-font-modal__empty {
	padding: 20px 14px;
	color: var(--aureon-admin-muted);
	font-size: 13px;
	text-align: center;
}

.aureon-add-font-modal__selected {
	display: flex;
	flex-direction: column;
	max-height: 360px;
	border: 1px solid var(--aureon-admin-border);
	border-radius: var(--aureon-admin-radius);
	background: var(--aureon-admin-surface-alt);
	overflow: hidden;
}

.aureon-add-font-modal__selected-title {
	margin: 0;
	padding: 10px 12px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--aureon-admin-muted);
	border-bottom: 1px solid var(--aureon-admin-border);
}

.aureon-add-font-modal__selected-list {
	margin: 0;
	padding: 0;
	list-style: none;
	overflow-y: auto;
}

.aureon-add-font-modal__selected-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 8px 12px;
	font-size: 13px;
	color: var(--aureon-admin-ink);

	& + & {
		border-top: 1px solid var(--aureon-admin-border);
	}
}

.aureon-add-font-modal__selected-remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--aureon-admin-muted);
	cursor: pointer;

	&:hover {
		color: var(--aureon-admin-ink);
	}
}

.aureon-add-font-modal__selected-empty {
	padding: 12px;
	font-size: 12px;
	color: var(--aureon-admin-muted);
	text-align: center;
}

.aureon-add-font-modal__error {
	margin: 12px 0 0;
	font-size: 12px;
	color: var(--aureon-admin-danger);
}

.aureon-add-font-modal__footer {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 16px;
}

.aureon-add-font-modal__upload {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 12px;
}

.aureon-add-font-modal__filename {
	margin: 0;
	font-size: 12px;
	color: var(--aureon-admin-muted);
}

/* Headings scale preview row */
.aureon-admin__heading-preview {
	display: flex;
	flex-wrap: wrap;
	gap: 24px;
	padding: 20px;
	margin: -4px 0 24px;
	border: 1px solid var(--aureon-admin-border);
	border-radius: var(--aureon-admin-radius);
	background: var(--aureon-admin-surface-alt);

	&-item {
		display: flex;
		flex-direction: column;
		gap: 6px;
		min-width: 0;
	}

	&-sample {
		font-weight: 700;
		line-height: 1;
		white-space: nowrap;
	}

	&-meta {
		font-size: 12px;
		color: var(--aureon-admin-muted);
	}
}

/* Live preview panel */
.aureon-admin__preview {
	position: sticky;
	top: 32px;
	background: var(--aureon-admin-surface);
	border: 1px solid var(--aureon-admin-border);
	border-radius: var(--aureon-admin-radius);
	box-shadow: var(--aureon-admin-shadow);
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.aureon-admin__preview-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
}

.aureon-admin__preview-title {
	margin: 0;
	font-size: 14px;
	font-weight: 700;
}

.aureon-admin__preview-status {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 4px 0 0;
	font-size: 12px;
	color: var(--aureon-admin-muted);
}

.aureon-admin__preview-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--aureon-admin-brand);
	flex: 0 0 auto;
}

.aureon-admin__preview-toolbar {
	display: flex;
	align-items: center;
	gap: 4px;
	flex: 0 0 auto;
}

.aureon-admin__preview-tool {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 6px;
	border: 1px solid var(--aureon-admin-border);
	background: var(--aureon-admin-surface);
	color: var(--aureon-admin-muted);
	cursor: pointer;
	text-decoration: none;

	svg {
		width: 16px;
		height: 16px;
	}

	&:hover {
		border-color: var(--aureon-admin-brand);
		color: var(--aureon-admin-brand);
	}

	&.is-active {
		border-color: var(--aureon-admin-brand);
		color: var(--aureon-admin-brand);
		background: rgba(var(--aureon-admin-brand-rgb), 0.08);
	}
}

.aureon-admin__preview-frame {
	position: relative;
	overflow: hidden;
	border: 1px solid var(--aureon-admin-border);
	border-radius: 8px;
	background: var(--aureon-admin-surface-alt);
	height: 70vh;

	// Occupies the scaled footprint of the iframe and centers it. The iframe
	// itself renders at a real device width and is transform-scaled to fit.
	iframe {
		display: block;
		border: 0;
		background: var(--aureon-admin-surface);
	}

	&--expanded {
		flex: 1;
		height: auto;
		min-height: 0;
	}
}

.aureon-admin__preview-scale {
	position: relative;
	overflow: hidden;
	margin: 0 auto;
}

.aureon-admin__preview-loading {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.6);
	backdrop-filter: blur(1px);
	pointer-events: none;

	.components-spinner {
		width: 32px;
		height: 32px;
		color: var(--aureon-admin-brand);
	}
}

.aureon-admin__preview-modal {

	&.components-modal__frame {
		width: 90vw;
		height: 85vh;
		max-height: 85vh;
		max-width: 1600px;
	}

	.components-modal__content {
		display: flex;
		flex-direction: column;
		min-height: 0;
	}

	.components-modal__children-container {
		display: flex;
		flex-direction: column;
		flex: 1;
		min-height: 0;
	}
}

.aureon-admin__preview-modal-header {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 12px;
	margin-bottom: 12px;
}

.aureon-admin__preview-modal-title {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
}

.aureon-admin__preview-toolbar--modal {
	justify-content: center;
	flex: 0 0 auto;
}

.aureon-admin__preview-modal-minimize {
	display: flex;
	align-items: center;
	justify-content: center;
	justify-self: end;
	width: 32px;
	height: 32px;
	border-radius: 6px;
	border: 1px solid var(--aureon-admin-border);
	background: var(--aureon-admin-surface);
	color: var(--aureon-admin-muted);
	cursor: pointer;

	svg {
		width: 16px;
		height: 16px;
	}

	&:hover {
		border-color: var(--aureon-admin-brand);
		color: var(--aureon-admin-brand);
	}
}

.aureon-admin__toggles {
	display: flex;
	flex-wrap: wrap;
	gap: 20px 32px;
	margin: 4px 0 24px;
	padding-bottom: 20px;
	border-bottom: 1px solid var(--aureon-admin-border);
}

.aureon-admin__zones {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 16px;
	margin-bottom: 20px;
}

.aureon-admin__zone {
	border: 1px solid var(--aureon-admin-border);
	border-radius: 6px;
	padding: 14px 16px;
	background: var(--aureon-admin-surface-alt);
	transition: border-color 0.15s ease;

	&:hover {
		border-color: #c3c4c7;
	}

	h3,
	h4 {
		margin: 0 0 10px;
		font-size: 12px;
		font-weight: 600;
		text-transform: uppercase;
		letter-spacing: 0.04em;
		color: var(--aureon-admin-muted);
	}
}

.aureon-text-field {
	max-width: 320px;
	margin-bottom: 12px;
}

.aureon-unit-field {
	display: flex;
	align-items: stretch;
	border: 1px solid var(--aureon-admin-border);
	border-radius: 6px;
	overflow: hidden;
	background: var(--aureon-admin-surface);

	.aureon-unit-field__quantity {
		flex: 1 1 auto;
		min-width: 0;

		.components-text-control__input {
			border: none;
			border-radius: 0;
			background: transparent;
			box-shadow: none;

			&:focus,
			&:focus-visible {
				box-shadow: none !important;
				outline: none !important;
			}
		}
	}

	.aureon-unit-field__unit {
		display: flex;
		flex: 0 0 auto;
	}
}

.aureon-unit-field__toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	height: 100%;
	padding: 0 10px;
	border: none;
	border-left: 1px solid var(--aureon-admin-border);
	background: var(--aureon-admin-surface-alt);
	font-size: 13px;
	font-weight: 500;
	color: var(--aureon-admin-ink);
	white-space: nowrap;
	cursor: pointer;

	&:focus,
	&:focus-visible {
		box-shadow: none;
		outline: none;
	}
}

.aureon-unit-field__chevron {
	flex: 0 0 auto;
	color: var(--aureon-admin-muted);
	transition: transform 0.15s ease;

	.aureon-unit-field__toggle.is-open & {
		transform: rotate(180deg);
	}
}

.aureon-unit-field__panel.components-dropdown__content
.components-popover__content {

	@extend %aureon-dropdown-panel;
	width: 64px;
}

/* Box field (padding / margin): four side inputs + a link toggle + a shared
   unit dropdown, all reading as one control. */
.aureon-box-field__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 6px;
}

.aureon-box-field__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border: 1px solid var(--aureon-admin-border);
	border-radius: 6px;
	background: var(--aureon-admin-surface);
	color: var(--aureon-admin-muted);
	cursor: pointer;
	transition:
		color 0.12s ease,
		border-color 0.12s ease,
		background-color 0.12s ease;

	&:hover {
		color: var(--aureon-admin-ink);
	}

	&.is-linked {
		color: var(--aureon-admin-brand);
		border-color: var(--aureon-admin-brand);
		background: rgba(var(--aureon-admin-brand-rgb), 0.08);
	}

	&:focus-visible {
		outline: 2px solid var(--aureon-admin-brand);
		outline-offset: 1px;
	}
}

.aureon-box-field__row {
	display: flex;
	align-items: stretch;
	gap: 8px;
}

.aureon-box-field__sides {
	display: flex;
	flex: 1 1 auto;
	min-width: 0;
	border: 1px solid var(--aureon-admin-border);
	border-radius: 6px;
	overflow: hidden;
	background: var(--aureon-admin-surface);
}

.aureon-box-field__side {
	display: flex;
	align-items: center;
	flex: 1 1 0;
	min-width: 0;
	padding-left: 8px;

	& + & {
		border-left: 1px solid var(--aureon-admin-border);
	}
}

.aureon-box-field__abbr {
	flex: 0 0 auto;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.04em;
	color: var(--aureon-admin-muted);
}

.aureon-box-field__input {
	flex: 1 1 auto;
	min-width: 0;

	.components-text-control__input {
		border: none;
		border-radius: 0;
		background: transparent;
		box-shadow: none;
		padding-left: 4px;
		padding-right: 4px;
		// Each side is ~30px wide at most — a native number spinner eats half
		// that, clipping a 2-digit value down to its first digit. Hidden here
		// rather than globally: other number inputs in this admin have room
		// for the spinner and lose nothing by keeping it.
		appearance: textfield;

		&::-webkit-inner-spin-button,
		&::-webkit-outer-spin-button {
			appearance: none;
			margin: 0;
		}

		&:focus,
		&:focus-visible {
			box-shadow: none !important;
			outline: none !important;
		}
	}
}

.aureon-box-field__unit {
	display: flex;
	flex: 0 0 auto;
	border: 1px solid var(--aureon-admin-border);
	border-radius: 6px;
	overflow: hidden;
	background: var(--aureon-admin-surface);

	.aureon-unit-field__toggle {
		border-left: none;
	}
}

/* Border field: a pixel width input + a color swatch on one row. */
.aureon-border-field__row {
	display: flex;
	align-items: center;
	gap: 8px;

	.aureon-text-field {
		flex: 1 1 auto;
		margin-bottom: 0;
	}
}

.aureon-border-field__width {
	flex: 0 0 108px;
	align-items: center;
}

/* Which edges the border is drawn on — only shown for columns, and only once a
   width exists to place. Wraps rather than shrinking the labels. */
.aureon-border-field__sides {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-top: 8px;
}

.aureon-border-field__unit {
	display: flex;
	align-items: center;
	flex: 0 0 auto;
	padding: 0 12px;
	border-left: 1px solid var(--aureon-admin-border);
	background: var(--aureon-admin-surface-alt);
	font-size: 13px;
	color: var(--aureon-admin-muted);
}

/* Floating options panel shared by SelectField and UnitField dropdowns */
%aureon-dropdown-panel {
	box-sizing: border-box;
	// Core's resize/size middleware sets `overflow: auto` as an inline style
	// to clamp height against the viewport; !important is required to still
	// clip horizontal overflow since inline styles otherwise win the cascade.
	overflow-x: hidden !important;
	border: 1px solid var(--aureon-admin-border);
	border-radius: 8px;
	background: var(--aureon-admin-surface);
	box-shadow: var(--aureon-admin-shadow);

	.components-menu-item__button {
		border-radius: 4px;
		font-size: 13px;
		color: var(--aureon-admin-ink);
		box-shadow: none;

		// Core reserves 48px for a checkmark icon we don't render; left
		// unchecked it makes long labels overflow the panel width.
		.components-menu-item__item {
			padding-right: 0;
			box-sizing: border-box;
		}

		+ .components-menu-item__button {
			margin-top: 3px;
		}

		&:hover,
		&:focus:not(:disabled) {
			background: var(--aureon-admin-surface-alt);
			color: var(--aureon-admin-ink);
			box-shadow: none;
		}

		&:focus-visible {
			box-shadow: inset 0 0 0 1.5px var(--aureon-admin-brand);
			outline: none;
		}

		&[aria-checked="true"] {
			background: var(--aureon-admin-mint);
			color: var(--aureon-admin-mint-text);
			font-weight: 500;
		}
	}
}

/* Select field — custom dropdown trigger + floating options panel */
.aureon-select-field {
	max-width: 320px;

	// The `help` line stays at full contrast — it's the part that explains
	// why the control is out of reach.
	&.is-disabled &__toggle {
		opacity: 0.55;
		cursor: default;
	}

	&__dropdown {
		display: block;
	}

	&__toggle {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 8px;
		width: 100%;
		height: 40px;
		padding: 0 12px;
		border: 1px solid var(--aureon-admin-border);
		border-radius: 6px;
		background: var(--aureon-admin-surface);
		font-size: 13px;
		color: var(--aureon-admin-ink);
		text-align: left;
		cursor: pointer;
		transition:
			border-color 0.15s ease,
			box-shadow 0.15s ease;

		// `:not(:disabled)`: the dimmed field is the whole of what a disabled
		// select has to say, and a border that answers the pointer contradicts
		// it — the same reasoning as the segmented control's hover states.
		&:hover:not(:disabled) {
			border-color: #c3c4c7;
		}

		&:focus-visible,
		&.is-open {
			outline: none;
			border-color: var(--aureon-admin-brand);
			box-shadow: 0 0 0 1px var(--aureon-admin-brand);
		}
	}

	&__value {
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
	}

	&__chevron {
		flex: 0 0 auto;
		color: var(--aureon-admin-muted);
		transition: transform 0.15s ease;

		.aureon-select-field__toggle.is-open & {
			transform: rotate(180deg);
		}
	}

	&__panel.components-dropdown__content .components-popover__content {

		@extend %aureon-dropdown-panel;
		width: 100%;
	}

	&__help {
		margin-top: 6px;
		font-size: 12px;
	}
}

/* Two controls sharing a row (e.g. a pair of colour fields). Wraps on narrow
 * panels rather than overflowing. */
.aureon-fieldrow {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;

	> * {
		flex: 1 1 140px;
		min-width: 0;
	}

	/* Two controls that must stay side by side even in the Customizer's 320px
	 * pane, where the wrapping default breaks them onto separate lines — for a
	 * pair of short one-of-N selects (Cart's Summary position + Thumbnail
	 * size), two half-width dropdowns read better than two full-width ones. */
	&--pair {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
	}
}

.aureon-elist {

	&__empty {
		margin: 0 0 10px;
		padding: 12px 14px;
		border: 1px dashed var(--aureon-admin-border);
		border-radius: 10px;
		color: var(--aureon-admin-subtle);
		font-size: 13px;
	}

	&__items {
		margin: 0 0 12px;
		padding: 0;
		list-style: none;
		display: flex;
		flex-direction: column;
		gap: 8px;
	}

	&__item {
		margin-bottom: 0;
		background: var(--aureon-admin-surface);
		border: 1px solid var(--aureon-admin-border);
		border-radius: 10px;
		overflow: hidden;
		// The whole row is the drag handle, so signal grabbability across it.
		cursor: grab;
		transition:
			border-color 0.12s ease,
			box-shadow 0.12s ease,
			opacity 0.12s ease;

		&:hover {
			border-color: var(--aureon-admin-subtle);
		}

		&:active {
			cursor: grabbing;
		}

		&.is-drop-target {
			border-color: var(--aureon-admin-brand);
			box-shadow: 0 0 0 1px var(--aureon-admin-brand);
		}

		// The row being dragged dims so the drop target reads as the live one.
		&.is-dragging {
			opacity: 0.5;
		}

		// Hidden, but kept in its place so it comes back where it was: greyed
		// label and a muted crossed-out eye, the row itself still draggable.
		&.is-hidden {
			background: var(--aureon-admin-surface-alt);

			.aureon-elist__label {
				color: var(--aureon-admin-subtle);
				font-weight: 500;
			}

			.aureon-elist__eye {
				color: var(--aureon-admin-subtle);

				&:hover {
					color: var(--aureon-admin-muted);
				}
			}
		}
	}

	&__row {
		display: flex;
		align-items: center;
		gap: 10px;
		padding: 0 8px 0 4px;
		height: 44px;
	}

	&__grip {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 28px;
		height: 100%;
		padding: 0;
		border: 0;
		background: transparent;
		color: var(--aureon-admin-subtle);
		cursor: grab;

		&:active {
			cursor: grabbing;
		}

		&:hover {
			color: var(--aureon-admin-muted);
		}

		&:focus-visible {
			outline: 2px solid var(--aureon-admin-brand);
			outline-offset: -2px;
			border-radius: 8px;
		}
	}

	&__label {
		flex: 1;
		font-size: 13.5px;
		font-weight: 600;
		color: var(--aureon-admin-ink);
	}

	&__eye,
	&__expand {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		flex: 0 0 auto;
		width: 28px;
		height: 28px;
		padding: 0;
		border: 0;
		border-radius: 7px;
		background: transparent;
		color: var(--aureon-admin-brand);
		cursor: pointer;
		transition:
			background-color 0.12s ease,
			color 0.12s ease;

		&:hover {
			background: rgba(var(--aureon-admin-brand-rgb), 0.1);
		}

		&:focus-visible {
			outline: 2px solid var(--aureon-admin-brand);
			outline-offset: 1px;
		}
	}

	// Only a hidden-eligible row's eye is lit; the button itself has no
	// separate "off" state today (see element-list.tsx's docblock) — clicking
	// it always hides, so it always reads as "currently shown".
	&__expand {
		color: var(--aureon-admin-subtle);

		svg {
			transition: transform 0.12s ease;
		}
	}

	&__item.is-expanded &__expand {
		color: var(--aureon-admin-brand);

		svg {
			transform: rotate(180deg);
		}
	}

	&__settings {
		padding: 12px;
		border-top: 1px solid var(--aureon-admin-border);
		background: var(--aureon-admin-surface-alt);
		// The row above is a drag source; the settings panel below it isn't —
		// without this, dragging from inside a field (e.g. a text selection)
		// would be interpreted as an attempt to reorder the card.
		cursor: default;
	}

	// The label sits above its chips rather than beside them: at 320px, an
	// inline label ate a third of the row and pushed every chip onto its own
	// line.
	&__add {
		display: flex;
		flex-direction: column;
		gap: 8px;
	}

	&__add-label {
		font-size: 12px;
		font-weight: 600;
		color: var(--aureon-admin-muted);
	}

	&__add-chips {
		display: flex;
		flex-wrap: wrap;
		gap: 6px;
	}

	// Sized so the two shortest chips share a row in a 320px pane rather than
	// each taking one — a column of full-width chips read as a second element
	// list rather than as the leftovers you can add back.
	&__add-chip {
		display: inline-flex;
		align-items: center;
		gap: 3px;
		padding: 5px 9px 5px 6px;
		background: transparent;
		border: 1px dashed var(--aureon-admin-border);
		border-radius: 8px;
		color: var(--aureon-admin-muted);
		font-size: 12px;
		font-weight: 600;
		cursor: pointer;
		transition:
			border-color 0.12s ease,
			background-color 0.12s ease,
			color 0.12s ease;

		svg {
			color: var(--aureon-admin-subtle);
			transition: color 0.12s ease;
		}

		&:hover {
			border-color: var(--aureon-admin-brand);
			border-style: solid;
			background: color-mix(in srgb, var(--aureon-admin-brand) 8%, transparent);
			color: var(--aureon-admin-ink);

			svg {
				color: var(--aureon-admin-brand);
			}
		}

		&:focus-visible {
			outline: 2px solid var(--aureon-admin-brand);
			outline-offset: 1px;
		}
	}
}

/* Header builder — visual drag-and-drop canvas */
.aureon-hb {
	display: flex;
	flex-direction: column;
	gap: 12px;

	&__hint {
		margin: 0 0 12px;
		font-size: 12px;
		color: var(--aureon-admin-muted);
	}

	&__single-label {
		font-size: 11px;
		font-weight: 600;
		text-transform: uppercase;
		letter-spacing: 0.04em;
		color: var(--aureon-admin-muted);
	}

	/* Toggle-button icon picker (Off-Canvas tab) */
	&__icon-picker {
		margin-bottom: 16px;
	}

	&__icon-picker-label {
		display: block;
		margin-bottom: 8px;
		font-size: 11px;
		font-weight: 600;
		text-transform: uppercase;
		letter-spacing: 0.04em;
		color: var(--aureon-admin-muted);
	}

	&__icon-grid {
		display: flex;
		flex-wrap: wrap;
		gap: 8px;
	}

	&__icon-swatch.components-button,
	&__icon-swatch {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 40px;
		height: 40px;
		padding: 0;
		border: 1px solid var(--aureon-admin-border);
		border-radius: var(--aureon-admin-radius);
		background: var(--aureon-admin-surface);
		color: var(--aureon-admin-ink);
		cursor: pointer;
		transition: border-color 0.12s ease, background-color 0.12s ease;

		&:hover:not(:disabled) {
			border-color: var(--aureon-admin-brand);
			background: color-mix(in srgb, var(--aureon-admin-brand) 6%, var(--aureon-admin-surface));
		}

		&.is-selected {
			border-color: var(--aureon-admin-brand);
			box-shadow: inset 0 0 0 1px var(--aureon-admin-brand);
			color: var(--aureon-admin-brand);
		}
	}

	&__col-tools {
		position: relative;
		display: flex;
	}

	&__col-gear.components-button {
		width: 24px;
		height: 24px;
		min-width: 24px;
		padding: 0;
		color: var(--aureon-admin-subtle);

		&:hover:not(:disabled) {
			color: var(--aureon-admin-brand);
		}
	}

	&__field-label {
		font-size: 11px;
		font-weight: 600;
		text-transform: uppercase;
		letter-spacing: 0.04em;
		color: var(--aureon-admin-muted);
	}

	&__align-group {
		display: flex;
		gap: 4px;
		padding: 4px;
		border: 1px solid var(--aureon-admin-border);
		border-radius: 8px;
		background: var(--aureon-admin-surface-alt);
	}

	&__align-btn.components-button {
		flex: 1 1 0;
		justify-content: center;
		height: 32px;
		border-radius: 6px;
		color: var(--aureon-admin-muted);

		&:hover:not(:disabled) {
			color: var(--aureon-admin-ink);
		}

		&.is-active {
			background: var(--aureon-admin-brand);
			color: #fff;
		}
	}

}

/* Row settings popover (gear) */
.aureon-hb__lead-popover.components-popover .components-popover__content {

	@extend %aureon-dropdown-panel;
	width: 260px;
	padding: 16px;
}

/* Column settings modal (gear) */
.aureon-hb__col-modal.components-modal__frame {
	width: 460px;
	max-width: 92vw;
}

/* Row settings modal (gear) */
.aureon-hb__row-modal.components-modal__frame {
	width: 460px;
	max-width: 92vw;
}

.aureon-hb__settings {
	display: flex;
	flex-direction: column;
	gap: 18px;
	padding-top: 16px;

	// When a form splits its controls across Content / Style sub-tabs (the menu
	// elements), each tab panel becomes the single flex child — so the 18px
	// field rhythm has to be re-established inside the panel, not just between
	// the tab bar and the panel.
	[role="tabpanel"] {
		display: flex;
		flex-direction: column;
		gap: 18px;
	}

	// The settings container already spaces its children by 18px; drop the tab
	// bar's own 24px bottom margin so it doesn't stack into an oversized gap.
	.aureon-tabs {
		margin-bottom: 0;
	}
}

// Sub-group heading inside an element settings form (e.g. the Account
// element's logged-out / logged-in view groups).
.aureon-hb__group-title {
	margin: 4px 0 -6px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--aureon-admin-text-subtle, #6b7280);
}

.aureon-hb__field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.aureon-hb__settings-actions {
	display: flex;
	gap: 8px;
	padding-top: 16px;
	border-top: 1px solid var(--aureon-admin-border);

	// Footer action bar for the element settings modal — Apply/Cancel pinned
	// to the trailing edge, matching a conventional dialog layout.
	&--end {
		justify-content: flex-end;
		margin-top: 16px;
	}

	.components-button {
		border-radius: 6px;
	}
}

// Repeatable "Add link" button (social / link-list forms): it renders as a
// small WP button (~24px tall), too cramped for a full-width add affordance.
// Give it real internal vertical padding so the "+ Add link" row has height,
// and round it to match the modal's fields/buttons.
.aureon-hb__add-link.components-button {
	height: auto;
	min-height: 0;
	padding: 12px;
	border-radius: 6px;
}

// Element settings modals are narrow (420px) — the shared
// .aureon-admin__grid's 220px-minmax columns collapse to a single column
// there, stacking color fields full-width with wasted horizontal space.
// Force a tight 2-up grid instead.
.aureon-hb__color-grid {
	grid-template-columns: repeat(2, 1fr);
	gap: 12px;
	margin-bottom: 0;
}

/* Element settings modal */
.aureon-hb__element-modal.components-modal__frame {
	width: 420px;
	max-width: 92vw;
}

// The builder modals render through a portal at <body>, outside
// .aureon-admin__body — so the generic field theming there (surface
// background, ink text, 6px radius) never reaches their inputs, leaving the
// stock @wordpress/components look that reads as "off" against the panel and
// breaks in dark mode. Re-apply the same theming inside these modal frames.
.aureon-hb__element-modal,
.aureon-hb__col-modal,
.aureon-hb__row-modal,
.aureon-bm {

	.components-input-control__input,
	.components-text-control__input,
	.components-textarea-control__input,
	.components-select-control__input,
	.components-number-control__input,
	select {
		background: var(--aureon-admin-surface) !important;
		color: var(--aureon-admin-ink) !important;
		border-radius: 6px !important;
	}

	.components-input-control__backdrop {
		border-color: var(--aureon-admin-border) !important;
		border-radius: 6px !important;
	}
}

.aureon-hb__editor-body {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding-top: 4px;
}

.aureon-hb__social {
	display: flex;
	flex-direction: column;
	gap: 10px;

	&-empty {
		margin: 0;
		font-size: 12px;
		color: var(--aureon-admin-subtle);
	}

	&-row {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto;
		align-items: center;
		gap: 6px;
	}
}

.aureon-hb-switcher {
	// Compact template switcher docked to the end of the Header tab row: a pill
	// showing the active template, an "add" button, and a popover holding the
	// full manager list.
	display: flex;
	align-items: center;
	gap: 6px;

	&__pill {
		display: inline-flex;
		align-items: center;
		gap: 8px;
		max-width: 240px;
		padding: 6px 10px;
		border: 1px solid var(--aureon-admin-border);
		border-radius: 8px;
		background: var(--aureon-admin-surface);
		color: var(--aureon-admin-ink);
		font-size: 13px;
		font-weight: 600;
		line-height: 1.2;
		cursor: pointer;
		transition:
			border-color 0.12s ease,
			background-color 0.12s ease;

		&:hover {
			border-color: var(--aureon-admin-subtle);
		}
	}

	&__dot {
		flex: 0 0 auto;
		width: 7px;
		height: 7px;
		border-radius: 999px;
		background: var(--aureon-admin-brand);
	}

	&__pill-name {
		max-width: 180px;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	&__caret {
		flex: 0 0 auto;
		color: currentcolor;
		opacity: 0.7;
	}
}

.aureon-hb-templates {
	// Header layout presets modal — an Astra-style gallery of starter layouts.
	// Each card frames a schematic preview inside a mock "browser" surface, with
	// the name/description below and a full-width Apply action revealed on hover.

	// Cap the frame so three cards stay compact instead of stretching edge to
	// edge; it still shrinks to the viewport on small screens.
	width: min(880px, calc(100vw - 48px));

	&__intro {
		margin: 0 0 18px;
		font-size: 13px;
		color: var(--aureon-admin-muted);
	}

	&__grid {
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 18px;
		margin: 0;
		padding: 0;
		list-style: none;

		@media (max-width: 960px) {
			grid-template-columns: repeat(2, minmax(0, 1fr));
		}

		@media (max-width: 600px) {
			grid-template-columns: 1fr;
		}
	}

	&__card {
		display: flex;
		flex-direction: column;
		overflow: hidden;
		border: 1px solid var(--aureon-admin-border);
		border-radius: 12px;
		background: var(--aureon-admin-surface);
		transition:
			border-color 0.15s ease,
			box-shadow 0.15s ease,
			transform 0.15s ease;

		&:hover,
		&:focus-within {
			border-color: color-mix(in srgb, var(--aureon-admin-brand) 55%, var(--aureon-admin-border));
			box-shadow: var(--aureon-admin-shadow);
			transform: translateY(-2px);
		}
	}

	// The framed preview area — a mock browser viewport the schematic sits in.
	&__preview {
		display: flex;
		flex-direction: column;
		gap: 5px;
		justify-content: center;
		min-height: 104px;
		padding: 16px;
		border-bottom: 1px solid var(--aureon-admin-border);
		background: linear-gradient(180deg, var(--aureon-admin-surface-alt) 0%, color-mix(in srgb, var(--aureon-admin-brand) 4%, var(--aureon-admin-surface-alt)) 100%);
	}

	// Each row is three zones (left / center / right) spread edge to edge, so a
	// cluster of bars in one zone (e.g. nav + account on the right) reads
	// distinctly from the same bars split across zones.
	&__preview-row {
		display: flex;
		align-items: center;
		justify-content: space-between;
		min-height: 14px;
	}

	&__preview-group {
		display: flex;
		align-items: center;
		gap: 6px;
		min-width: 0;
	}

	&__preview-col {
		height: 9px;
		flex: 0 1 44px;
		min-width: 26px;
		border-radius: 3px;
		background: var(--aureon-admin-brand);
		opacity: 0.5;
	}

	&__body {
		display: flex;
		flex-direction: column;
		flex: 1 1 auto;
		padding: 14px 16px 16px;
	}

	&__name {
		margin: 0 0 4px;
		font-size: 14px;
		font-weight: 600;
		color: var(--aureon-admin-ink);
	}

	&__desc {
		margin: 0 0 14px;
		font-size: 12px;
		line-height: 1.5;
		color: var(--aureon-admin-muted);
	}

	&__apply.components-button {
		justify-content: center;
		width: 100%;
		height: auto;
		min-height: 34px;
		margin-top: auto;
		border-radius: 8px;
		font-weight: 600;
	}

	// Inline confirmation panel — swaps in for the grid when a preset is chosen,
	// avoiding a second stacked Modal (which dismissed the parent before apply).
	&__confirm {
		display: flex;
		flex-direction: column;
		align-items: center;
		text-align: center;
		max-width: 420px;
		margin: 0 auto;
		padding: 12px 8px 8px;
	}

	&__confirm-icon {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 52px;
		height: 52px;
		margin-bottom: 14px;
		border-radius: 999px;
		color: var(--aureon-admin-warning-ink);
		background: color-mix(in srgb, var(--aureon-admin-warning) 15%, var(--aureon-admin-surface));
	}

	&__confirm-title {
		margin: 0 0 6px;
		font-size: 16px;
		font-weight: 600;
		color: var(--aureon-admin-ink);
	}

	&__confirm-desc {
		margin: 0 0 20px;
		font-size: 13px;
		line-height: 1.5;
		color: var(--aureon-admin-muted);
	}

	&__confirm-actions {
		display: flex;
		justify-content: center;
		gap: 10px;
	}
}

.aureon-hb-cond {
	// Header display conditions.

	&__title {
		margin: 0 0 4px;
		font-size: 14px;
		font-weight: 600;
		color: var(--aureon-admin-ink);
	}

	&__rule {
		display: flex;
		flex-direction: column;
		margin-bottom: 10px;
		border-radius: var(--aureon-admin-radius);
		box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
	}

	// The mode + condition selects and the remove button share one centred row so
	// the × lines up vertically with the fields instead of floating above them.
	&__row {
		display: flex;
		align-items: center;
		gap: 10px;
	}

	&__mode {
		flex: 0 0 130px;
		max-width: none;
	}

	&__type {
		flex: 1 1 auto;
		min-width: 0;
		max-width: none;
	}

	&__value {
		width: 100%;
		max-width: none;
	}

	// Round the WordPress select controls to match the card language.
	.components-input-base,
	.components-input-control__backdrop,
	.components-select-control__input {
		border-radius: 8px;
	}

	&__remove.components-button {
		flex: 0 0 auto;
		width: 32px;
		height: 32px;
		min-width: 32px;
		padding: 0;
		border-radius: 8px;
		color: var(--aureon-admin-subtle);
		transition: color 0.12s ease, background-color 0.12s ease;

		&:hover {
			color: var(--aureon-admin-danger);
			background: color-mix(in srgb, var(--aureon-admin-danger) 8%, var(--aureon-admin-surface));
		}
	}

	// Minimal outline "Add condition" — no fill, matching the popover language.
	&__add.components-button {
		margin-top: 4px;
		height: auto;
		min-height: 36px;
		padding: 6px 14px;
		border: 1px dashed color-mix(in srgb, var(--aureon-admin-brand) 45%, var(--aureon-admin-border));
		border-radius: 10px;
		background: transparent;
		color: var(--aureon-admin-mint-text);
		font-weight: 600;
		box-shadow: none;
		transition: border-color 0.12s ease, background-color 0.12s ease, color 0.12s ease;

		&:hover:not(:disabled) {
			border-color: var(--aureon-admin-brand);
			background: color-mix(in srgb, var(--aureon-admin-brand) 8%, var(--aureon-admin-surface));
			color: var(--aureon-admin-brand-hover);
		}
	}
}

.aureon-hb-sticky {
	// Global sticky-scroll behaviour — each option is its own bordered row with a
	// label, a supporting line, and a trailing toggle, rather than a bare switch
	// list.
	margin: 24px 0 0;
	padding-top: 20px;
	border-top: 1px solid var(--aureon-admin-border);

	&__title {
		margin: 0 0 4px;
		font-size: 14px;
		font-weight: 600;
		color: var(--aureon-admin-ink);
	}

	&__options {
		display: flex;
		flex-direction: column;
		gap: 10px;
		margin-top: 14px;
	}

	&__option {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 16px;
		padding: 12px 14px;
		border: 1px solid var(--aureon-admin-border);
		border-radius: var(--aureon-admin-radius);
		background: var(--aureon-admin-surface-alt);
		cursor: pointer;
		transition: border-color 0.12s ease, background-color 0.12s ease;

		// Not while its switch is disabled — see the ToggleControl card above.
		&:hover:not(:has(.components-form-toggle.is-disabled)) {
			border-color: color-mix(in srgb, var(--aureon-admin-brand) 35%, var(--aureon-admin-border));
			background: var(--aureon-admin-surface);
		}

		// Keep the WP switch vertically centred and clear of default margins.
		.components-base-control,
		.components-toggle-control {
			margin: 0;
		}
	}

	&__option-text {
		display: flex;
		flex-direction: column;
		gap: 2px;
		min-width: 0;
	}

	&__option-label {
		font-size: 13px;
		font-weight: 600;
		color: var(--aureon-admin-ink);
	}

	&__option-desc {
		font-size: 12px;
		line-height: 1.4;
		color: var(--aureon-admin-muted);
	}
}

/* Style Presets ----------------------------------------------------------- */

.aureon-admin__preset-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 16px;
	margin-top: 16px;
}

.aureon-admin__preset-card {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 16px;
	border: 1px solid var(--aureon-admin-border);
	border-radius: 10px;
	background: var(--aureon-admin-surface);
}

.aureon-admin__preset-swatches {
	display: flex;
	height: 44px;
	border-radius: 8px;
	overflow: hidden;
	border: 1px solid var(--aureon-admin-border);
}

.aureon-admin__preset-swatch {
	flex: 1 1 0;
}

.aureon-admin__preset-meta {
	display: flex;
	flex-direction: column;
	gap: 2px;

	.aureon-admin__desc {
		font-size: 12px;
		color: var(--aureon-admin-muted);
	}
}

/* Colors / Dark Mode — palette gallery (Style-Presets-style cards + Custom) */

/**
 * A section's tabs as a sub-navigation (see `SubNav`): a list of rows to drill
 * into, and a back row above the screen you land on.
 *
 * Drawn to match the panel's own section rows in `customize-controls/style.scss`
 * — same 30px icon tile, same chevron, same seam between rows — because it is the
 * same move one level further in, and reading it as anything else would be a
 * lie about where you are.
 */
.aureon-subnav {
	display: flex;
	flex-direction: column;
	margin-bottom: 20px;
	border-radius: 12px;
	background: var(--aureon-admin-surface);
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
	overflow: hidden;

	&__item {
		display: flex;
		align-items: center;
		gap: 11px;
		padding: 10px 12px;
		border: 0;
		background: transparent;
		color: var(--aureon-admin-ink);
		font-size: 13px;
		font-weight: 600;
		text-align: left;
		cursor: pointer;

		& + & {
			border-top: 1px solid var(--aureon-admin-border);
		}

		&:hover,
		&:focus-visible {
			background: rgba(var(--aureon-admin-brand-rgb), 0.05);
		}

		// Rows carrying a description (e.g. WooCommerce's view list) get a
		// roomier, top-aligned layout so the second line has space to wrap;
		// plain rows (no description) stay the tight single-line row above.
		&--roomy {
			align-items: flex-start;
			padding: 12px 14px;
		}
	}

	&__icon {
		display: flex;
		align-items: center;
		justify-content: center;
		flex: 0 0 auto;
		width: 30px;
		height: 30px;
		border-radius: 7px;
		background: rgba(var(--aureon-admin-brand-rgb), 0.12);
		color: var(--aureon-admin-brand);

		.aureon-subnav__item--roomy & {
			width: 38px;
			height: 38px;
			border-radius: 9px;
		}
	}

	&__label {
		flex: 1 1 auto;
		min-width: 0;
	}

	&__label-title {
		display: block;
	}

	&__desc {
		display: block;
		margin-top: 2px;
		font-size: 12px;
		font-weight: 400;
		line-height: 1.4;
		color: var(--aureon-admin-muted);
		white-space: normal;
	}

	&__chevron {
		flex: 0 0 auto;
		align-self: center;
		color: var(--aureon-admin-subtle);
	}
}

// `subnavStyle="cards"` — one bordered card per destination rather than one
// grouped list, for a hub with only a few (Content Templates' four views).
// Hover or focus lifts a card: brand border, a faint tint, a filled chevron.
.aureon-subnav--cards {
	gap: 12px;
	border-radius: 0;
	background: none;
	box-shadow: none;
	overflow: visible;

	.aureon-subnav__item {
		gap: 14px;
		padding: 16px;
		border: 1px solid var(--aureon-admin-border);
		border-radius: 14px;
		background: var(--aureon-admin-surface);
		box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
		transition:
			border-color 0.12s ease,
			background-color 0.12s ease;

		+ .aureon-subnav__item {
			border-top: 1px solid var(--aureon-admin-border);
		}

		&:hover,
		&:focus-visible {
			border-color: var(--aureon-admin-brand);
			background: color-mix(in srgb, var(--aureon-admin-brand) 5%, var(--aureon-admin-surface));
			outline: none;

			.aureon-subnav__chevron {
				background: var(--aureon-admin-brand);
				color: var(--aureon-admin-surface);
			}
		}

		&:focus-visible {
			box-shadow: 0 0 0 1px var(--aureon-admin-brand);
		}
	}

	.aureon-subnav__item--roomy {
		align-items: center;
	}

	// Same tile whether or not the row has a description — every card here does.
	.aureon-subnav__icon,
	.aureon-subnav__item--roomy .aureon-subnav__icon {
		width: 44px;
		height: 44px;
		border-radius: 10px;
		background: rgba(var(--aureon-admin-brand-rgb), 0.12);
		color: var(--aureon-admin-brand-hover);
	}

	.aureon-subnav__label-title {
		font-size: 14.5px;
		font-weight: 700;
	}

	.aureon-subnav__desc {
		margin-top: 3px;
		font-size: 12.5px;
	}

	.aureon-subnav__chevron {
		display: grid;
		place-items: center;
		width: 28px;
		height: 28px;
		border-radius: 50%;
		color: var(--aureon-admin-muted);
		transition:
			background-color 0.12s ease,
			color 0.12s ease;
	}
}

html[data-theme="dark"] .aureon-admin {

	.aureon-subnav--cards .aureon-subnav__icon {
		color: var(--aureon-admin-brand);
	}
}

// A row of always-visible, evenly-split cards standing in for the plain
// underline tab row — for a handful of genuinely different destinations
// (Fields/Settings/Style) a reader picks between, not a scan-and-pick list.
.aureon-cardtabs {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 20px;

	&__item {
		display: flex;
		align-items: center;
		flex: 1 1 220px;
		gap: 12px;
		padding: 14px 16px;
		border: 1px solid var(--aureon-admin-border);
		border-radius: 12px;
		background: var(--aureon-admin-surface);
		color: var(--aureon-admin-ink);
		text-align: left;
		cursor: pointer;
		transition: border-color 0.15s ease, background-color 0.15s ease;

		&:hover:not(.is-active) {
			border-color: var(--aureon-admin-brand);
		}

		&.is-active {
			border-color: var(--aureon-admin-brand);
			background: var(--aureon-admin-brand);
			color: var(--aureon-admin-brand-ink, #fff);

			.aureon-cardtabs__icon {
				background: rgba(255, 255, 255, 0.2);
				color: inherit;
			}

			.aureon-cardtabs__desc {
				color: inherit;
				opacity: 0.85;
			}
		}
	}

	&__icon {
		display: flex;
		align-items: center;
		justify-content: center;
		flex: 0 0 auto;
		width: 34px;
		height: 34px;
		border-radius: 8px;
		background: rgba(var(--aureon-admin-brand-rgb), 0.12);
		color: var(--aureon-admin-brand);
	}

	&__label {
		flex: 1 1 auto;
		min-width: 0;
	}

	&__label-title {
		display: block;
		font-size: 14px;
		font-weight: 600;
	}

	&__desc {
		display: block;
		margin-top: 2px;
		font-size: 12px;
		font-weight: 400;
		color: var(--aureon-admin-muted);
		white-space: normal;
	}
}

/* The open screen's own header: a back row, then the screen's title. */
.aureon-subnav__head {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
	margin-bottom: 16px;
}

.aureon-subnav__back {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin-left: -6px;
	padding: 4px 6px;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: var(--aureon-admin-muted);
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;

	&:hover,
	&:focus-visible {
		background: rgba(var(--aureon-admin-brand-rgb), 0.08);
		color: var(--aureon-admin-brand);
	}
}

.aureon-subnav__title {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	border: 0;
	color: var(--aureon-admin-ink);
	font-size: 16px;
	font-weight: 700;

	svg {
		color: var(--aureon-admin-brand);
	}
}

// `.aureon-tabs--segmented` is kept as a class for the `variant` prop, but no
// longer drawn as a pill group: pills are how an option picks a value
// (`.aureon-segmented`), and a tab bar that looks like one reads as a setting.

/**
 * The palette list — one row per palette (see `PaletteGallery`).
 *
 * The colours lead: a solid block of the palette's five roles, wide enough to
 * judge, with the name, description and action beside it. The applied row
 * takes a brand border, and its action is replaced by an "Applied" chip in the
 * same slot — so the row doesn't shift, and there's nothing left to press.
 */
.aureon-palette-list {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-bottom: 20px;
	container: aureon-palette-list / inline-size;
}

.aureon-palette-row {
	position: relative;
	display: flex;
	align-items: center;
	gap: 16px;
	width: 100%;
	padding: 12px;
	border: 1px solid var(--aureon-admin-border);
	border-radius: 12px;
	background: var(--aureon-admin-surface);
	text-align: left;
	transition:
		border-color 0.12s ease,
		box-shadow 0.12s ease;

	&.is-applied {
		border-color: var(--aureon-admin-brand);
		box-shadow: 0 0 0 1px var(--aureon-admin-brand);
	}

	&__swatches,
	&__placeholder {
		display: flex;
		flex: 0 0 auto;
		width: 40%;
		max-width: 200px;
		height: 62px;
		border-radius: 8px;
		overflow: hidden;
	}

	// The ring is what keeps a palette's white and near-white roles from
	// disappearing into the card behind them — without it the block reads as a
	// gap rather than as a colour.
	&__swatches {
		box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.09);
	}

	&__swatch {
		flex: 1 1 0;
	}

	&__placeholder {
		align-items: center;
		justify-content: center;
		border: 1px dashed var(--aureon-admin-subtle);
		background: var(--aureon-admin-surface-alt);
		color: var(--aureon-admin-muted);
	}

	&__meta {
		display: flex;
		flex-direction: column;
		align-items: stretch;
		gap: 5px;
		flex: 1 1 auto;
		min-width: 0;

		strong {
			color: var(--aureon-admin-ink);
			font-size: 14px;
			font-weight: 700;
		}

		.aureon-admin__desc {
			font-size: 12px;
		}
	}

	// Apply / Customize and the Applied chip share one footprint — same
	// height, radius and type — so a row reads the same whichever it holds.
	// Nested under the row for specificity over core's `.is-secondary` rules.
	.aureon-palette-row &__apply.components-button {
		flex: 0 0 auto;
		justify-content: center;
		gap: 5px;
		height: 30px;
		min-width: 76px;
		padding: 0 14px;
		border: 0;
		border-radius: 999px;
		background: var(--aureon-admin-surface);
		box-shadow: inset 0 0 0 1px rgba(var(--aureon-admin-brand-rgb), 0.55);
		color: var(--aureon-admin-brand);
		font-size: 12px;
		font-weight: 600;
		line-height: 1;
		transition:
			background-color 0.12s ease,
			box-shadow 0.12s ease,
			color 0.12s ease;

		&:hover:not(:disabled) {
			background: var(--aureon-admin-brand);
			box-shadow: inset 0 0 0 1px var(--aureon-admin-brand);
			color: #fff;
		}

		&:focus-visible {
			outline: 2px solid var(--aureon-admin-brand);
			outline-offset: 2px;
			box-shadow: inset 0 0 0 1px var(--aureon-admin-brand);
		}
	}

	// The Custom row opens an editor rather than applying anything, so its
	// button is the neutral outline and only takes the brand on hover.
	.aureon-palette-row &__apply--custom.components-button {
		box-shadow: inset 0 0 0 1px var(--aureon-admin-border);
		color: var(--aureon-admin-ink);

		&:hover:not(:disabled) {
			background: rgba(var(--aureon-admin-brand-rgb), 0.08);
			box-shadow: inset 0 0 0 1px var(--aureon-admin-brand);
			color: var(--aureon-admin-brand);
		}
	}

	// The applied row's marker: a label, not a control, so it isn't a button.
	&__chip {
		flex: 0 0 auto;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		gap: 5px;
		height: 30px;
		padding: 0 12px 0 10px;
		border-radius: 999px;
		background: var(--aureon-admin-brand);
		color: #fff;
		font-size: 12px;
		font-weight: 600;
		line-height: 1;
	}

	&--custom:not(.is-applied) {
		border-style: dashed;
	}

}

/**
 * A narrow pane (the default Customizer width) has no room for swatches, text
 * and a button across one line. Squeezing the swatches into a column beside
 * the text turns them into tall pinstripes, so the row stacks instead: the
 * colours run as a full-width strip across the top, with the name and the
 * action on the line beneath.
 */
@container aureon-palette-list ( max-width: 400px ) {

	.aureon-palette-row {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
		align-items: center;
		gap: 10px 12px;
		padding: 10px;

		&__swatches,
		&__placeholder {
			grid-column: 1 / -1;
			width: 100%;
			max-width: none;
			height: 40px;
		}

		&__meta {
			grid-column: 1;
			gap: 2px;
		}

		.aureon-palette-row &__apply.components-button,
		&__chip {
			grid-column: 2;
			height: 28px;
			min-width: 0;
		}

		.aureon-palette-row &__apply.components-button {
			padding: 0 14px;
		}
	}
}

.aureon-palette-gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 16px;
	margin-bottom: 20px;
}

.aureon-palette-card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 16px;
	border: 1px solid var(--aureon-admin-border);
	border-radius: 10px;
	background: var(--aureon-admin-surface);
	text-align: left;
	transition:
		border-color 0.12s ease,
		box-shadow 0.12s ease;

	&.is-applied {
		border-color: var(--aureon-admin-brand);
		box-shadow: 0 0 0 1px var(--aureon-admin-brand);
	}

	// The full-width Apply / Applied / Customize action pinned to the card foot.
	&__apply.components-button {
		margin-top: auto;
		justify-content: center;
		width: 100%;
	}

	&__swatches {
		display: flex;
		height: 44px;
		border-radius: 8px;
		overflow: hidden;
		border: 1px solid var(--aureon-admin-border);
	}

	&__swatch {
		flex: 1 1 0;
	}

	// Custom card is one clickable tile; a hover overlay reveals "+ Customize".
	&--custom {
		cursor: pointer;

		&:hover {
			border-color: var(--aureon-admin-subtle);
		}
	}

	&__overlay {
		position: absolute;
		inset: 0;
		z-index: 1;
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 6px;
		border-radius: 10px;
		background: var(--aureon-admin-surface);
		color: var(--aureon-admin-brand);
		font-size: 13px;
		font-weight: 600;
		opacity: 0;
		transition: opacity 0.12s ease;
	}

	&--custom:hover &__overlay {
		opacity: 1;
	}

	// Empty swatch-strip placeholder shown until a custom palette is set.
	&__placeholder {
		height: 44px;
		border-radius: 8px;
		border: 1px dashed var(--aureon-admin-subtle);
		background: var(--aureon-admin-surface-alt);
	}

	// Static, button-shaped status label for the Custom card foot.
	&__status {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 4px;
		margin-top: auto;
		height: 36px;
		border-radius: 6px;
		border: 1px solid var(--aureon-admin-border);
		color: var(--aureon-admin-muted);
		font-size: 13px;
		font-weight: 600;

		&.is-applied {
			border-color: var(--aureon-admin-brand);
			color: var(--aureon-admin-brand);
		}
	}

	&__meta {
		display: flex;
		flex-direction: column;
		gap: 2px;

		strong {
			font-size: 13px;
			font-weight: 600;
			color: var(--aureon-admin-ink);
		}

		.aureon-admin__desc {
			font-size: 12px;
			color: var(--aureon-admin-muted);
		}
	}
}

/* WooCommerce — product-card design gallery.
 *
 * Mirrors the palette gallery's card shell, but each thumbnail is a miniature
 * wireframe of the layout drawn from divs (see design-gallery.tsx) rather than
 * a colour strip, so no bitmap assets ship with the theme. */
.aureon-design-field {
	display: flex;
	flex-direction: column;
	gap: 8px;

	&__label {
		font-size: 11px;
		font-weight: 500;
		text-transform: uppercase;
		letter-spacing: 0.02em;
		color: var(--aureon-admin-ink);
	}
}

/* Two designs to a row inside the 320px Customizer pane — the min track is
 * what decides that, so it's sized to the narrowest column the wireframes still
 * read at rather than to a comfortable card width (which fitted only one). */
.aureon-design-gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
	gap: 10px;
}

/* Three to a row, for the category-tile layouts: each of those wireframes is a
 * single cell rather than a 2x2 grid of them, so it still reads at two thirds
 * the width — and the whole set then fits the pane without wrapping. */
.aureon-design-gallery--dense {
	grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
}

.aureon-design-card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 10px;
	border: 1px solid var(--aureon-admin-border);
	border-radius: 10px;
	background: var(--aureon-admin-surface);
	text-align: center;
	cursor: pointer;
	transition:
		border-color 0.12s ease,
		background-color 0.12s ease,
		box-shadow 0.12s ease;

	&:hover {
		border-color: var(--aureon-admin-subtle);
	}

	&:focus-visible {
		outline: 2px solid var(--aureon-admin-brand);
		outline-offset: 1px;
	}

	&.is-selected {
		border-color: var(--aureon-admin-brand);
		background: rgba(var(--aureon-admin-brand-rgb), 0.06);
		box-shadow: 0 0 0 1px var(--aureon-admin-brand);
	}

	&__label {
		font-size: 12px;
		font-weight: 600;
		line-height: 1.3;
		color: var(--aureon-admin-ink);
	}

	/* The current pick, marked inside the card's own top corner — overlapping
	 * the wireframe rather than hanging off the card, which would collide with
	 * the neighbouring card across the grid gap. */
	&__tick {
		position: absolute;
		top: 5px;
		right: 5px;
		display: grid;
		place-items: center;
		width: 20px;
		height: 20px;
		border-radius: 50%;
		background: var(--aureon-admin-brand);
		color: #fff;
	}
}

/* The wireframe thumbnail. A 2x2 cell grid by default; individual designs
 * override the track shape, gaps, and cell internals below. */
.aureon-design-wire {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 5px;
	padding: 7px;
	// Two designs to a row leaves each thumbnail about 90px wide, so the
	// height comes down with it to keep the miniature roughly card-shaped
	// rather than a tall box with a squeezed layout inside it.
	height: 68px;
	border-radius: 8px;
	border: 1px solid var(--aureon-admin-border);
	background: var(--aureon-admin-surface-alt);
	overflow: hidden;

	&--empty {
		display: block;
		border-style: dashed;
	}

	&__cell {
		display: flex;
		flex-direction: column;
		gap: 3px;
		min-width: 0;
	}

	&__img {
		flex: 1 1 auto;
		min-height: 0;
		border-radius: 3px;
		background: var(--aureon-admin-subtle);
	}

	&__bars {
		display: flex;
		flex-direction: column;
		gap: 2px;
	}

	&__bar {
		height: 3px;
		border-radius: 2px;
		background: var(--aureon-admin-subtle);

		&.is-short {
			width: 55%;
		}
	}

	/* List: two full-width rows, image beside the bars. */
	&.is-list {
		grid-template-columns: 1fr;

		.aureon-design-wire__cell {
			flex-direction: row;
			align-items: center;
			gap: 6px;
		}

		.aureon-design-wire__img {
			flex: 0 0 34%;
			align-self: stretch;
		}

		.aureon-design-wire__bars {
			flex: 1 1 auto;
		}
	}

	/* Inline price: the second bar sits beside the first, right-aligned. */
	&.is-inline .aureon-design-wire__bars {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		gap: 4px;

		.aureon-design-wire__bar {
			width: 45%;
		}

		.aureon-design-wire__bar.is-short {
			width: 25%;
		}
	}

	/* Tall: taller image, so the bars are squeezed to the foot. */
	&.is-tall .aureon-design-wire__bars {
		flex: 0 0 auto;
	}

	&.is-tall .aureon-design-wire__img {
		flex: 1 1 100%;
	}

	/* Overlay: a button bar floats at the image's foot. */
	&.is-overlay .aureon-design-wire__img {
		position: relative;

		&::after {
			content: "";
			position: absolute;
			inset: auto 4px 4px;
			height: 5px;
			border-radius: 2px;
			background: var(--aureon-admin-brand);
			opacity: 0.65;
		}
	}

	/* Bordered: no gaps, hairlines between cells instead. */
	&.is-bordered {
		gap: 0;
		padding: 0;

		.aureon-design-wire__cell {
			padding: 6px;
			border-right: 1px solid var(--aureon-admin-border);
			border-bottom: 1px solid var(--aureon-admin-border);
		}
	}

	/* Showcase: a price chip sits at the image's foot, and the CTA is a solid
	 * bar under the two text lines. */
	&.is-showcase .aureon-design-wire__img {
		position: relative;

		&::after {
			content: "";
			position: absolute;
			right: 3px;
			bottom: 3px;
			width: 40%;
			height: 4px;
			border-radius: 2px;
			background: var(--aureon-admin-surface);
			opacity: 0.9;
		}
	}

	&.is-showcase .aureon-design-wire__bar.is-short {
		width: 100%;
		height: 5px;
		background: var(--aureon-admin-subtle);
	}

	/* Detail: each cell is its own bordered card with a solid CTA bar. */
	&.is-detail .aureon-design-wire__cell {
		padding: 3px;
		border: 1px solid var(--aureon-admin-border);
		border-radius: 4px;
		background: var(--aureon-admin-surface);
	}

	&.is-detail .aureon-design-wire__bar.is-short {
		width: 100%;
		height: 5px;
		background: var(--aureon-admin-brand);
		opacity: 0.65;
	}

	/* Category tiles: one cell, not a grid of them — each draws a single tile
	 * rather than a miniature of a whole loop. */
	&.is-catstack,
	&.is-catinline,
	&.is-catoverlay,
	&.is-cattext {
		grid-template-columns: 1fr;
	}

	/* Image left, title and count beside it. */
	&.is-catinline .aureon-design-wire__cell {
		flex-direction: row;
		align-items: center;
		gap: 6px;
	}

	&.is-catinline .aureon-design-wire__img {
		flex: 0 0 40%;
		align-self: stretch;
	}

	&.is-catinline .aureon-design-wire__bars {
		flex: 1 1 auto;
	}

	/* Title over the image: the bars sit on the picture's lower edge. */
	&.is-catoverlay .aureon-design-wire__cell {
		position: relative;
	}

	&.is-catoverlay .aureon-design-wire__bars {
		position: absolute;
		inset-inline: 5px;
		bottom: 5px;
	}

	&.is-catoverlay .aureon-design-wire__bar {
		background: var(--aureon-admin-surface);
	}

	/* Title only: no picture at all, so the bars carry the whole tile and are
	 * centred in it rather than pinned under an image that isn't there. */
	&.is-cattext .aureon-design-wire__cell {
		justify-content: center;
		align-items: center;
		gap: 4px;
	}

	&.is-cattext .aureon-design-wire__bars {
		align-items: center;
		width: 70%;
	}

	&.is-cattext .aureon-design-wire__bar {
		width: 100%;
		height: 4px;

		&.is-short {
			width: 55%;
		}
	}
}

/* Palette editor modal — wide, colours gridded at least three per row */
.aureon-palette-modal.components-modal__frame {
	width: 760px;
	max-width: calc(100vw - 32px);
}

.aureon-palette-modal {

	&__intro {
		margin: 0 0 16px;
	}

	&__grid {
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 14px;
		margin-bottom: 20px;

		@media (max-width: 660px) {
			grid-template-columns: repeat(2, minmax(0, 1fr));
		}

		@media (max-width: 440px) {
			grid-template-columns: 1fr;
		}
	}

	&__foot {
		display: flex;
		justify-content: flex-end;
		gap: 8px;
	}
}

/* Buttons section ---------------------------------------------------------- */

/* FieldGroup — a bordered white card per field cluster in the Buttons section
 * ("Button Style", "Padding", "Border", "Hover Style"…), each with its own
 * icon square + eyebrow label heading. Matches the reference mockup's card
 * treatment: every group is its own visually distinct box, not a flat list
 * separated by headings alone. */
.aureon-field-group {
	margin-top: 16px;
	padding: 16px;
	border: 1px solid var(--aureon-admin-border);
	border-radius: 10px;
	background: var(--aureon-admin-surface);

	&:first-child {
		margin-top: 0;
	}
}

.aureon-field-group__head {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin-bottom: 12px;
}

.aureon-field-group__heading {
	flex: 1 1 auto;
	min-width: 0;
}

.aureon-field-group__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 28px;
	height: 28px;
	border-radius: 7px;
	background: rgba(var(--aureon-admin-brand-rgb), 0.12);
	color: var(--aureon-admin-brand);
}

.aureon-field-group__reset.components-button {
	flex: 0 0 auto;
	width: 24px;
	height: 24px;
	min-width: 24px;
	padding: 0;
	color: var(--aureon-admin-muted);

	svg {
		width: 15px;
		height: 15px;
	}

	&:hover {
		color: var(--aureon-admin-brand);
	}
}

.aureon-field-group__eyebrow {
	margin: 0 0 2px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.06em;
	color: var(--aureon-admin-ink);
}

/* Button Style — a compact row of 4 equal-width toggle boxes (icon over
 * label, no per-card copy — the shared description lives once on the
 * FieldGroup itself, "The default style is used across the site."), matching
 * the reference mockup's Default/Outline/Text/Link row. */
.aureon-button-style-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 8px;
	width: 100%;
}

.aureon-button-style-grid__card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 10px 4px;
	border: 1px solid var(--aureon-admin-border);
	border-radius: 8px;
	background: var(--aureon-admin-surface);
	text-align: center;
	cursor: pointer;
	transition: border-color 0.12s ease, background-color 0.12s ease;

	&:hover {
		border-color: var(--aureon-admin-subtle);
	}

	&.is-selected {
		border-color: var(--aureon-admin-brand);
		background: rgba(var(--aureon-admin-brand-rgb), 0.06);
	}

	strong {
		font-size: 11px;
		font-weight: 600;
		color: var(--aureon-admin-ink);
	}
}

.aureon-button-style-grid__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--aureon-admin-muted);
}

.aureon-button-style-grid__card.is-selected .aureon-button-style-grid__icon {
	color: var(--aureon-admin-brand);
}

/* Button Preview — a row of live sample buttons styled from the working
 * --aureon-btn-* values, so every group above visibly updates it as it's
 * edited. No border/background of its own — it already sits inside a
 * .aureon-field-group card, so a second nested box would double up. */
.aureon-button-preview {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
}

.aureon-button--preview {
	pointer-events: none;
}

/* This admin bundle never loads the theme's own frontend stylesheet — the
 * customizer control panel is a wp-admin screen, not the preview iframe — so
 * `.aureon-button`/`--secondary`/`--outline`/`--text`/`--link` need their own
 * scoped copy here (mirroring src/frontend/style.scss) rather than relying on
 * rules that only exist on the front end. Scoped under `.aureon-button-preview`
 * so nothing here leaks onto (or gets shadowed by) any other plugin's same-named
 * class elsewhere in wp-admin. */
.aureon-button-preview .aureon-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: var(--aureon-btn-padding-y, 0.65em) var(--aureon-btn-padding-x, 1.4em);
	border: var(--aureon-btn-border-width, 2px) var(--aureon-btn-border-style, solid) var(--aureon-btn-border-color, transparent);
	border-radius: var(--aureon-radius-md, 8px);
	background: var(--aureon-btn-bg, var(--aureon-color-primary, #d4a017));
	color: var(--aureon-btn-text, var(--aureon-color-button-text, #fff));
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
}

.aureon-button-preview .aureon-button--secondary {
	background: var(--aureon-color-secondary, #0f172a);
	border-color: transparent;
	color: var(--aureon-color-button-text, #fff);
}

.aureon-button-preview .aureon-button--outline {
	background: transparent;
	border-color: var(--aureon-btn-border-color, var(--aureon-color-primary, #d4a017));
	color: var(--aureon-color-primary, #d4a017);
}

.aureon-button-preview .aureon-button--text,
.aureon-button-preview .aureon-button--link {
	background: transparent;
	border-color: transparent;
	color: var(--aureon-color-primary, #d4a017);
	padding-inline: 0.4em;
}

.aureon-button-preview .aureon-button--link {
	text-decoration: underline;
}

/**
 * Static Front Page ("Homepage Settings") — see
 * StaticFrontPageSection in src/admin/sections/static-front-page.tsx. Two
 * selectable cards ("Your latest posts" / "A static page") standing in for
 * core's own radio buttons, and a full-width "Add Page" link under each page
 * dropdown that opens the native editor in a new tab.
 */

.aureon-homepage__choices {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 20px;
}

.aureon-homepage__choice {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	width: 100%;
	padding: 14px;
	border: 1px solid var(--aureon-admin-border);
	border-radius: var(--aureon-admin-radius);
	background: var(--aureon-admin-surface);
	text-align: left;
	cursor: pointer;
	font: inherit;
	color: inherit;
	transition: border-color 0.12s ease, background-color 0.12s ease;

	&:hover {
		border-color: var(--aureon-admin-subtle);
	}

	&.is-selected {
		border-color: var(--aureon-admin-brand);
		background: rgba(var(--aureon-admin-brand-rgb), 0.06);
	}
}

.aureon-homepage__choice-radio {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	margin-top: 1px;
	border: 2px solid var(--aureon-admin-border);
	border-radius: 50%;
	background: var(--aureon-admin-surface);
	transition: border-color 0.12s ease;
}

.aureon-homepage__choice.is-selected .aureon-homepage__choice-radio {
	border-width: 5px;
	border-color: var(--aureon-admin-brand);
}

.aureon-homepage__choice-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 36px;
	height: 36px;
	border-radius: 8px;
	background: var(--aureon-admin-surface-alt);
	color: var(--aureon-admin-muted);
}

.aureon-homepage__choice.is-selected .aureon-homepage__choice-icon {
	color: var(--aureon-admin-brand);
}

.aureon-homepage__choice-text {
	display: flex;
	flex-direction: column;
	gap: 2px;

	strong {
		font-size: 13px;
		font-weight: 600;
		color: var(--aureon-admin-ink);
	}

	span {
		font-size: 12px;
		color: var(--aureon-admin-muted);
	}
}

// Shared by an `<a>` (opens a new tab elsewhere) and a `<button>` (removes
// the current logo here) — reset enough of each's UA defaults that both look
// identical.
.aureon-homepage__add-page {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: 100%;
	margin: 8px 0 20px;
	padding: 10px;
	border: 1px dashed var(--aureon-admin-border);
	border-radius: var(--aureon-admin-radius);
	background: rgba(var(--aureon-admin-brand-rgb), 0.06);
	color: var(--aureon-admin-ink);
	font: inherit;
	font-size: 12px;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;

	&:hover {
		border-color: var(--aureon-admin-brand);
		color: var(--aureon-admin-brand);
	}
}

/**
 * Site Identity — see SiteIdentitySection in
 * src/admin/sections/site-identity.tsx. Logo/Site Title/Tagline/Site Icon
 * each get their own bordered card (`__group`), so the section reads as four
 * distinct fields rather than one continuous flow. The Logo/Site Icon
 * dropzones share a tile+badge empty-state graphic and, once filled, the
 * Site Icon field adds a mocked browser tab so picking an icon shows roughly
 * what it'll look like where it actually matters.
 */
.aureon-site-identity__group {
	padding: 16px;
	border: 1px solid var(--aureon-admin-border);
	border-radius: var(--aureon-admin-radius);
	background: var(--aureon-admin-surface);
	margin-bottom: 16px;

	&:last-child {
		margin-bottom: 0;
	}
}

.aureon-site-identity__group-title {
	margin: 0 0 4px;
	font-size: 14px;
	font-weight: 700;
	color: var(--aureon-admin-ink);
}

.aureon-site-identity__group .aureon-admin__desc {
	margin-bottom: 12px;
}

// Site Title / Tagline use stock @wordpress/components TextControl, which
// the generic `&__body .components-input-control__*` retint further up this
// file never reaches: that selector targets `.aureon-admin__body`, the page
// host's own wrapper (see app.tsx) — Mount_Control prints no such wrapper
// around content mounted in the Customizer (see its own class docblock), the
// same gap the header builder's own modals hit (see the near-identical block
// by `.aureon-hb__element-modal` above). Re-themed here to this card's own
// language — var(--aureon-admin-radius) instead of the page host's plain 6px —
// rather than widening that selector, since nothing else in the Customizer
// uses a raw TextControl for this to affect.
.aureon-site-identity {

	.components-input-control__input,
	.components-text-control__input {
		min-height: 44px !important;
		padding: 0 14px !important;
		background: var(--aureon-admin-surface) !important;
		color: var(--aureon-admin-ink) !important;
		font-size: 14px !important;
	}

	.components-input-control__backdrop {
		border-color: var(--aureon-admin-border) !important;
		border-radius: var(--aureon-admin-radius) !important;
	}
}

.aureon-site-identity__dropzone {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	width: 100%;
	min-height: 140px;
	margin-bottom: 12px;
	padding: 20px;
	border: 1px dashed var(--aureon-admin-border);
	border-radius: var(--aureon-admin-radius);
	background: var(--aureon-admin-surface-alt);
	cursor: pointer;
	transition: border-color 0.12s ease, background-color 0.12s ease;

	&:hover,
	&.is-drag-over {
		border-color: var(--aureon-admin-brand);
	}

	&.is-drag-over {
		background: rgba(var(--aureon-admin-brand-rgb), 0.06);
	}
}

// The gray tile + brand "+" badge shown in an empty Logo/Site Icon dropzone.
.aureon-site-identity__dropzone-tile {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	margin-bottom: 4px;
	border-radius: 12px;
	background: var(--aureon-admin-surface);
	color: var(--aureon-admin-subtle);
}

.aureon-site-identity__dropzone-badge {
	position: absolute;
	right: -6px;
	bottom: -6px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--aureon-admin-brand);
	color: #fff;
}

.aureon-site-identity__dropzone-label {
	font-size: 14px;
	font-weight: 700;
	color: var(--aureon-admin-brand);
}

// Shown in place of the empty-state graphic while a dropped file uploads —
// see Dropzone's `progress` state in site-identity.tsx.
.aureon-site-identity__dropzone-progress {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	width: 100%;
	max-width: 220px;
}

.aureon-site-identity__dropzone-progress-track {
	display: block;
	width: 100%;
	height: 6px;
	border-radius: 999px;
	background: var(--aureon-admin-border);
	overflow: hidden;
}

.aureon-site-identity__dropzone-progress-fill {
	display: block;
	height: 100%;
	border-radius: inherit;
	background: var(--aureon-admin-brand);
	transition: width 0.15s ease;
}

.aureon-site-identity__dropzone-hint {
	font-size: 11px;
	color: var(--aureon-admin-muted);

	strong {
		color: var(--aureon-admin-ink);
	}
}

.aureon-site-identity__dropzone-logo {
	max-width: 100%;
	max-height: 96px;
	object-fit: contain;
}

// The gray box behind the icon preview + tab mock, once a Site Icon is set.
.aureon-site-identity__icon-preview-box {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px;
	border-radius: var(--aureon-admin-radius);
	background: var(--aureon-admin-surface-alt);
	margin-bottom: 12px;
}

.aureon-site-identity__icon-preview {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 56px;
	height: 56px;
	border: 1px solid var(--aureon-admin-border);
	border-radius: 12px;
	background: var(--aureon-admin-surface);
	cursor: pointer;
	overflow: hidden;

	&:hover {
		border-color: var(--aureon-admin-brand);
	}

	img {
		width: 100%;
		height: 100%;
		object-fit: cover;
	}
}

.aureon-site-identity__tab-mock {
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1 1 auto;
	padding: 10px 12px;
	border: 1px solid var(--aureon-admin-border);
	border-radius: var(--aureon-admin-radius);
	background: var(--aureon-admin-surface);
}

.aureon-site-identity__tab-dots {
	display: flex;
	gap: 5px;

	i {
		width: 8px;
		height: 8px;
		border-radius: 50%;
		background: var(--aureon-admin-border);
	}
}

.aureon-site-identity__tab-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	width: fit-content;
	max-width: 100%;
	padding: 5px 10px;
	border-radius: 999px;
	background: var(--aureon-admin-surface-alt);
	color: var(--aureon-admin-muted);
	font-size: 11px;

	img {
		width: 14px;
		height: 14px;
		border-radius: 3px;
		object-fit: cover;
		flex: 0 0 auto;
	}

	span {
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
		color: var(--aureon-admin-ink);
	}
}

.aureon-site-identity__icon-actions {
	display: flex;
	gap: 8px;
}

// Remove/Change image — plain buttons (not @wordpress/components' Button)
// so the pill shape, border color and icon-plus-label layout can match the
// reference mockup exactly rather than WP admin's own button skin.
.aureon-site-identity__btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	border: 1px solid var(--aureon-admin-border);
	border-radius: 8px;
	background: var(--aureon-admin-surface);
	color: var(--aureon-admin-ink);
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;

	&:hover {
		border-color: var(--aureon-admin-subtle);
	}
}

.aureon-site-identity__btn--danger {
	border-color: #fecaca;
	color: #dc2626;

	&:hover {
		border-color: #dc2626;
	}
}

/* Info note — see controls/info-note.tsx. Tinted the informational blue rather
 * than the brand gold, so it reads as an aside about the control above it
 * rather than as another part of that control. */
.aureon-infonote {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	padding: 11px 13px;
	border-radius: var(--aureon-admin-radius);
	background: rgba(var(--aureon-admin-info-rgb), 0.08);
}

// Warning tone — for a note that reports something already wrong rather than
// something worth knowing. Same shape; only the two colours change, so the
// note still reads as one family with the info variant beside it.
.aureon-infonote--warning {
	background: rgba(var(--aureon-admin-brand-rgb), 0.1);

	.aureon-infonote__icon {
		background: var(--aureon-admin-brand);
	}
}

.aureon-infonote__icon {
	display: grid;
	place-items: center;
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--aureon-admin-info);
	// Against the light-mode blue this is white; against the dark-mode blue
	// (a light tint) the same white would vanish, so the badge takes the
	// panel's own ground as its glyph colour instead.
	color: var(--aureon-admin-surface);
}

.aureon-infonote__body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
}

.aureon-infonote__text {
	margin: 0;
	font-size: 12px;
	line-height: 1.45;
	color: var(--aureon-admin-muted);
}

// The note's optional "go to the section that owns this" link (see
// info-note.tsx) — a button, not an anchor: every host navigates in JS.
.aureon-infonote__action {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--aureon-admin-brand);
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;

	&:hover {
		text-decoration: underline;
	}

	&:focus-visible {
		outline: 2px solid var(--aureon-admin-brand);
		outline-offset: 2px;
		border-radius: 4px;
	}
}

/**
 * Cart's and Checkout's block-cart/block-checkout warning — an `InfoNote`
 * carrying the companion plugin's "Use the classic cart/checkout design"
 * action button in its footer slot. The button arrives as a generic
 * `.aureon-panel-action` inside `ExtrasFields`' own `.aureon-admin__row`,
 * which carries a 24px bottom margin meant for a stack of settings rows;
 * inside a note it just pads the tint out below the button.
 */
.aureon-woo-blocknote {
	margin-bottom: 16px;

	.aureon-admin__row {
		margin-bottom: 0;
	}

	.aureon-panel-action {
		height: auto;
		min-height: 32px;
		padding: 6px 12px;
		border-radius: 6px;
		font-size: 12px;
	}
}

// The tinted "Recommended size" callout under an empty Site Icon dropzone —
// same icon-avatar + title + description shape as .aureon-admin__section-head
// (see style.scss above), but deliberately its own class: that one gets its
// `h2` hidden inside the Customizer (it duplicates core's own breadcrumb
// title), where this card's title never does.
.aureon-notice-card {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	margin-bottom: 20px;
	padding: 14px 16px;
	border-radius: var(--aureon-admin-radius);
	background: rgba(var(--aureon-admin-brand-rgb), 0.08);
}

.aureon-notice-card__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: rgba(var(--aureon-admin-brand-rgb), 0.18);
	color: var(--aureon-admin-brand);
}

.aureon-notice-card__title {
	display: block;
	margin-bottom: 2px;
	font-size: 13px;
	font-weight: 700;
	color: var(--aureon-admin-ink);
}

.aureon-notice-card .aureon-admin__desc {
	font-size: 12px;

	strong {
		color: var(--aureon-admin-ink);
	}
}

/**
 * Sale Badge section — see `sections/woocommerce/shop/sale-badge.tsx`.
 *
 * Its own block rather than `.aureon-optioncards`/`.aureon-sidebarlayout`,
 * because both pickers here show the badge itself: Position draws it on a
 * product-image thumbnail, Shape draws it at the size and radius the shop
 * will render, and both are tinted live from the colour fields below them —
 * neither is an icon-and-label card.
 */
.aureon-salebadge {
	display: flex;
	flex-direction: column;
	gap: 14px;

	&__field {
		padding: 16px;
		border: 1px solid var(--aureon-admin-border);
		border-radius: var(--aureon-admin-radius);
		background: var(--aureon-admin-surface);
	}

	&__field-label {
		display: block;
		// Spacing to the control below. A description, when there is one,
		// takes that job over — see the `:has` rule under it.
		margin-bottom: 12px;
		font-size: 13px;
		font-weight: 600;
		color: var(--aureon-admin-ink);

		&:has(+ .aureon-salebadge__field-desc) {
			margin-bottom: 2px;
		}
	}

	&__field-desc {
		margin: 0 0 12px;
		font-size: 12px;
		line-height: 1.45;
		color: var(--aureon-admin-muted);
	}

	&__field-help {
		margin: 8px 0 0;
		font-size: 12px;
		line-height: 1.45;
		color: var(--aureon-admin-muted);
	}

	/* Custom text: the input and the "insert the discount token" button share
	 * one row, the button sized to match the input's own height. */
	&__text {
		display: flex;
		align-items: stretch;
		gap: 8px;

		.components-base-control {
			flex: 1 1 auto;
			min-width: 0;
		}
	}

	&__token.components-button {
		flex: 0 0 auto;
		width: 40px;
		height: auto;
		align-self: stretch;
		justify-content: center;
		border: 1px solid var(--aureon-admin-border);
		border-radius: var(--aureon-admin-radius);
		background: var(--aureon-admin-surface-alt);
		color: var(--aureon-admin-muted);

		&:hover:not(:disabled) {
			border-color: var(--aureon-admin-brand);
			background: var(--aureon-admin-surface);
			color: var(--aureon-admin-brand);
		}
	}

	/* Thumbnail radio grid, shared by Position and Shape. */
	&__grid {
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
		gap: 10px;
	}

	/* The Product page card holds two pickers, so each names itself — quieter
	 * than the card's own label, which names the pair. */
	&__sublabel {
		display: block;
		margin-bottom: 8px;
		font-size: 12px;
		font-weight: 600;
		color: var(--aureon-admin-muted);

		~ .aureon-salebadge__sublabel {
			margin-top: 14px;
		}
	}

	/* The "Same as shop" card previews whatever the shop is set to; dimming it
	 * keeps that from reading as a corner/shape chosen here. */
	&__thumb.is-inherited,
	&__chip-wrap.is-inherited {
		opacity: 0.45;
	}

	&__card {
		position: relative;
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: 8px;
		padding: 10px;
		border: 1px solid var(--aureon-admin-border);
		border-radius: var(--aureon-admin-radius);
		background: var(--aureon-admin-surface);
		cursor: pointer;
		transition: border-color 0.12s ease, background-color 0.12s ease;

		&:hover:not(.is-active) {
			border-color: color-mix(in srgb, var(--aureon-admin-brand) 35%, var(--aureon-admin-border));
		}

		&.is-active {
			border-color: var(--aureon-admin-brand);
			background: rgba(var(--aureon-admin-brand-rgb), 0.06);

			.aureon-salebadge__card-label {
				color: var(--aureon-admin-brand);
			}
		}

		&:focus-visible {
			outline: 2px solid var(--aureon-admin-brand);
			outline-offset: 1px;
		}
	}

	// The tick sits half over the card's corner, the same "this one" marker
	// the design galleries use on a selected preset.
	&__check {
		position: absolute;
		top: -6px;
		inset-inline-end: -6px;
		display: grid;
		place-items: center;
		width: 18px;
		height: 18px;
		border-radius: 50%;
		background: var(--aureon-admin-brand);
		color: var(--aureon-admin-surface);
	}

	&__card-label {
		font-size: 12px;
		font-weight: 600;
		color: var(--aureon-admin-ink);
		transition: color 0.12s ease;
	}

	/* Position: a stand-in product image with the badge dot in one corner. */
	&__thumb {
		position: relative;
		display: block;
		width: 100%;
		height: 44px;
		border-radius: 6px;
		background: var(--aureon-admin-surface-alt);
		border: 1px solid var(--aureon-admin-border);
	}

	&__dot {
		position: absolute;
		width: 10px;
		height: 10px;
		border-radius: 50%;
	}

	&__thumb--top-left &__dot,
	&__thumb--top-right &__dot,
	&__thumb--bottom-left &__dot,
	&__thumb--bottom-right &__dot {
		// Placement comes from the modifiers below; this only shares the inset.
		margin: 6px;
	}

	&__thumb--top-left &__dot {
		top: 0;
		inset-inline-start: 0;
	}

	&__thumb--top-right &__dot {
		top: 0;
		inset-inline-end: 0;
	}

	&__thumb--bottom-left &__dot {
		bottom: 0;
		inset-inline-start: 0;
	}

	&__thumb--bottom-right &__dot {
		bottom: 0;
		inset-inline-end: 0;
	}

	/* Shape: the badge itself, at the radius the front end gives it. */
	&__chip-wrap {
		display: grid;
		place-items: center;
		width: 100%;
		height: 44px;
	}

	&__chip {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		max-width: 100%;
		padding: 4px 10px;
		font-size: 11px;
		font-weight: 700;
		line-height: 1.3;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;

		&--pill {
			border-radius: 999px;
		}

		&--rounded {
			border-radius: 6px;
		}

		&--square {
			border-radius: 0;
		}

		// Matches the front end's fixed-size disc (`body.aureon-badge-circle`),
		// where a long label is clipped rather than stretching the badge.
		&--circle {
			width: 38px;
			height: 38px;
			padding: 0;
			border-radius: 50%;
		}
	}

	/* Colour + its reset, side by side; the reset only renders once the colour
	 * has been set, so the field takes the full width until then. */
	&__color {
		display: flex;
		align-items: flex-end;
		gap: 6px;

		> .components-base-control {
			flex: 1 1 auto;
			min-width: 0;
		}
	}

	&__reset.components-button {
		flex: 0 0 auto;
		width: 32px;
		height: 32px;
		justify-content: center;
		border: 1px solid var(--aureon-admin-border);
		border-radius: var(--aureon-admin-radius);
		color: var(--aureon-admin-muted);

		&:hover:not(:disabled) {
			border-color: var(--aureon-admin-brand);
			color: var(--aureon-admin-brand);
		}
	}

	/* Section-wide undo, last in the stack and deliberately quiet — it throws
	 * away every choice above it, so it shouldn't compete with them. */
	&__resetall {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 8px;
		width: 100%;
		padding: 11px;
		border: 1px solid var(--aureon-admin-border);
		border-radius: var(--aureon-admin-radius);
		background: none;
		color: var(--aureon-admin-muted);
		font: inherit;
		font-size: 13px;
		font-weight: 600;
		cursor: pointer;
		transition: border-color 0.12s ease, color 0.12s ease;

		&:hover {
			border-color: var(--aureon-admin-brand);
			color: var(--aureon-admin-brand);
		}

		&:focus-visible {
			outline: 2px solid var(--aureon-admin-brand);
			outline-offset: 1px;
		}
	}
}

/* -------------------------------------------------------------------------
 * Sale Price (WooCommerce ▸ Sale Price)
 *
 * Cousin of `.aureon-salebadge` above, and for the same reason: the
 * presentation picker draws real prices — tinted, struck through and wrapped
 * in the prefix/suffix wording set below it — rather than naming three
 * layouts in a dropdown. The cards themselves are `.aureon-fieldgroup`s, so
 * only the picker, the colour rows and the two notices are styled here.
 * ---------------------------------------------------------------------- */
.aureon-saleprice {
	display: flex;
	flex-direction: column;
	gap: 14px;
	// This section renders in two places of very different widths: the full
	// settings screen, and the 320px Customizer pane. Nothing inside may size
	// itself off its own content, or the pane gets an overflow it can only
	// answer by widening — so every track below bottoms out at 0, not at its
	// items' intrinsic width.
	min-width: 0;

	&__grid {
		display: grid;
		// `auto-fit` + a 0 minimum drops to fewer columns as the pane narrows
		// instead of holding three and spilling out of it.
		grid-template-columns: repeat(auto-fit, minmax(min(96px, 100%), 1fr));
		gap: 10px;
	}

	/* Two controls side by side where there's room for them, stacked where
	 * there isn't — a text input carries a default intrinsic width well over
	 * half the Customizer pane, so a plain flex row would never fit. */
	&__row {
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
		gap: 12px;

		> * {
			min-width: 0;
		}

		// WordPress's own inputs are `width: 100%` but keep the intrinsic
		// `size` width as their minimum, which is what pushes the grid wider
		// than its column.
		input[type="text"],
		input[type="number"] {
			min-width: 0;
		}
	}

	&__card {
		position: relative;
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: 8px;
		min-width: 0;
		padding: 12px 10px 10px;
		border: 1px solid var(--aureon-admin-border);
		border-radius: var(--aureon-admin-radius);
		background: var(--aureon-admin-surface);
		cursor: pointer;
		transition: border-color 0.12s ease, background-color 0.12s ease;

		&:hover:not(.is-active) {
			border-color: color-mix(in srgb, var(--aureon-admin-brand) 35%, var(--aureon-admin-border));
		}

		&.is-active {
			border-color: var(--aureon-admin-brand);
			background: rgba(var(--aureon-admin-brand-rgb), 0.06);

			.aureon-saleprice__card-label {
				color: var(--aureon-admin-brand);
			}
		}

		&:focus-visible {
			outline: 2px solid var(--aureon-admin-brand);
			outline-offset: 1px;
		}
	}

	// Same corner tick the badge cards and the design galleries use.
	&__check {
		position: absolute;
		top: -6px;
		inset-inline-end: -6px;
		display: grid;
		place-items: center;
		width: 18px;
		height: 18px;
		border-radius: 50%;
		background: var(--aureon-admin-brand);
		color: var(--aureon-admin-surface);
	}

	&__card-label {
		font-size: 12px;
		font-weight: 600;
		color: var(--aureon-admin-ink);
		transition: color 0.12s ease;
	}

	/* The price itself. A fixed height keeps the three cards level whether the
	 * layout runs on one line or stacks onto two. */
	&__thumb {
		display: flex;
		flex-wrap: wrap;
		align-items: baseline;
		justify-content: center;
		gap: 6px;
		width: 100%;
		min-height: 40px;
		font-size: 15px;
		font-weight: 700;
		line-height: 1.3;

		&--stacked {
			flex-direction: column;
			align-items: center;
			gap: 2px;
		}
	}

	&__ins {
		display: inline-flex;
		align-items: baseline;
		gap: 4px;
	}

	/* The original price. Its colour is the *front end's* muted price colour,
	 * not the panel's subtle ink, so the three decorations read here the way
	 * they will on the shop: struck through, faded, or plain like the text
	 * around it — "plain" has to say so by taking the full-strength ink, or it
	 * is the same thumbnail as "muted". */
	&__del {
		display: inline-flex;
		align-items: baseline;
		gap: 4px;
		font-size: 0.85em;
		font-weight: 600;
		color: var(--aureon-admin-ink);

		&--strikethrough {
			text-decoration: line-through;
			opacity: 0.5;
		}

		&--dim {
			opacity: 0.5;
		}
	}

	// "Was" / "Now", and the prefix/suffix wording — both are labels around a
	// number, so both stand down from it.
	&__tag,
	&__affix {
		font-size: 0.7em;
		font-weight: 600;
		text-transform: uppercase;
		letter-spacing: 0.03em;
		opacity: 0.75;
	}

	/* Colour + its reset, side by side; the reset only renders once the colour
	 * has been set, so the field takes the full width until then. */
	&__color {
		display: flex;
		align-items: flex-end;
		gap: 6px;
		min-width: 0;

		> .components-base-control {
			flex: 1 1 auto;
			min-width: 0;
		}
	}

	&__reset.components-button {
		flex: 0 0 auto;
		width: 32px;
		height: 32px;
		justify-content: center;
		border: 1px solid var(--aureon-admin-border);
		border-radius: var(--aureon-admin-radius);
		color: var(--aureon-admin-muted);

		&:hover:not(:disabled) {
			border-color: var(--aureon-admin-brand);
			color: var(--aureon-admin-brand);
		}
	}

	// Shown in place of the sale colour picker while the accent switch owns it.
	&__note {
		margin: 0;
		font-size: 12px;
		line-height: 1.5;
		color: var(--aureon-admin-muted);
	}

	&__hint {
		display: flex;
		align-items: center;
		gap: 8px;
		margin: 12px 0 0;
		padding: 10px 12px;
		border-radius: var(--aureon-admin-radius);
		background: var(--aureon-admin-surface-alt);
		font-size: 12px;
		line-height: 1.45;
		color: var(--aureon-admin-muted);

		> svg {
			flex: 0 0 auto;
			color: var(--aureon-admin-brand);
		}
	}

	/* Section-wide undo, last in the stack and deliberately quiet — it throws
	 * away every choice above it, so it shouldn't compete with them. */
	&__resetall {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 8px;
		width: 100%;
		padding: 11px;
		border: 1px solid var(--aureon-admin-border);
		border-radius: var(--aureon-admin-radius);
		background: none;
		color: var(--aureon-admin-muted);
		font: inherit;
		font-size: 13px;
		font-weight: 600;
		cursor: pointer;
		transition: border-color 0.12s ease, color 0.12s ease;

		&:hover {
			border-color: var(--aureon-admin-brand);
			color: var(--aureon-admin-brand);
		}

		&:focus-visible {
			outline: 2px solid var(--aureon-admin-brand);
			outline-offset: 1px;
		}
	}
}

/* ==========================================================================
 * Header builder — Elements grid (controls pane) + docked rows canvas.
 * See sections/header/element-grid.tsx and builder-dock.tsx.
 * ========================================================================== */

.aureon-hbx {
	display: flex;
	flex-direction: column;
	gap: 16px;

	> .aureon-tabs {
		margin-bottom: 0;
	}
}

.aureon-hbx-elements {
	display: flex;
	flex-direction: column;
	gap: 18px;
	margin: -4px;
	padding: 4px;
	border-radius: var(--aureon-admin-radius);
	transition: background-color 0.12s ease;

	&.is-over {
		background: rgba(var(--aureon-admin-danger-rgb), 0.05);
		outline: 1px dashed rgba(var(--aureon-admin-danger-rgb), 0.45);
	}

	&__empty {
		margin: 0;
		font-size: 13px;
		color: var(--aureon-admin-muted);
	}
}

.aureon-hbx-search {
	display: flex;
	align-items: center;
	gap: 10px;
	height: 40px;
	padding: 0 12px;
	border: 1px solid var(--aureon-admin-border);
	border-radius: 8px;
	background: var(--aureon-admin-surface);
	color: var(--aureon-admin-muted);

	&:focus-within {
		border-color: var(--aureon-admin-brand);
		box-shadow: 0 0 0 1px var(--aureon-admin-brand);
	}

	input[type="search"] {
		flex: 1;
		min-width: 0;
		min-height: 0;
		height: 100%;
		padding: 0;
		border: 0;
		background: transparent;
		box-shadow: none;
		font-size: 13px;
		color: var(--aureon-admin-ink);

		&:focus {
			outline: none;
			box-shadow: none;
		}
	}
}

.aureon-hbx-group {
	display: flex;
	flex-direction: column;
	gap: 12px;

	&__head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		width: 100%;
		padding: 0;
		border: 0;
		background: none;
		font-size: 15px;
		font-weight: 600;
		color: var(--aureon-admin-ink);
		cursor: pointer;

		svg {
			color: var(--aureon-admin-muted);
			transition: transform 0.15s ease;
		}

		&[aria-expanded="false"] svg {
			transform: rotate(-90deg);
		}
	}
}

.aureon-hbx-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 8px;
}

.aureon-hbx-card {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 84px;
	padding: 12px 6px 10px;
	border: 1px solid var(--aureon-admin-border);
	border-radius: 8px;
	background: var(--aureon-admin-surface);
	color: var(--aureon-admin-ink);
	cursor: grab;
	touch-action: none;
	transition:
		border-color 0.12s ease,
		box-shadow 0.12s ease;

	&:hover {
		border-color: var(--aureon-admin-brand);
		box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
	}

	&:focus-visible {
		outline: 2px solid var(--aureon-admin-brand);
		outline-offset: 1px;
	}

	&__label {
		font-size: 12px;
		line-height: 1.3;
		text-align: center;
	}

	&.is-placed {
		background: var(--aureon-admin-surface-alt);
		color: var(--aureon-admin-muted);
		cursor: pointer;
	}

	&__badge {
		position: absolute;
		top: 6px;
		right: 6px;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 16px;
		height: 16px;
		border-radius: 50%;
		background: var(--aureon-admin-brand);
		color: #fff;
	}
}

// The info note under the Elements grid.
.aureon-hbx-elements + .aureon-infonote {
	margin-top: 20px;
}

/* --- Dock placement in the Customizer overlay --------------------------- */

// The preview frame itself is drawn for every section and device in
// customize-controls/style.scss; the dock only lifts its bottom edge.
// Tripled up to outrank that file's `.wp-full-overlay.wp-full-overlay`, which
// loads after this one.
.wp-full-overlay.wp-full-overlay.has-aureon-hb-dock {
	--aureon-preview-bottom: var(--aureon-hb-dock-h, 14px);
}

.aureon-hb-dock-host {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 1;
	padding: var(--aureon-preview-gap, 14px);
}

/* --- Dock panel ----------------------------------------------------------- */

.aureon-hb-dock {
	// Core ties Button's secondary skin to its own blue, not the theme color
	// (see .aureon-font-pairings).
	--wp-components-color-accent: var(--aureon-admin-brand);
	--wp-components-color-accent-inverted: #fff;
	display: flex;
	flex-direction: column;
	max-height: 50vh;
	// Keeps the active device tab's underline inside the rounded corner,
	// most visibly when minimized and the tab row is the card's bottom edge.
	overflow: hidden;
	border: 1px solid var(--aureon-admin-border);
	border-radius: 10px;
	background: var(--aureon-admin-surface);
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
	color: var(--aureon-admin-ink);
	font-size: 13px;

	&__bar {
		display: flex;
		align-items: stretch;
		justify-content: space-between;
		gap: 12px;
		min-height: 52px;
		padding: 0 12px 0 0;
		border-bottom: 1px solid var(--aureon-admin-border);
	}

	&.is-collapsed &__bar {
		border-bottom: 0;
	}

	&__devices {
		display: flex;
		align-items: stretch;
	}

	&__device {
		display: inline-flex;
		align-items: center;
		gap: 10px;
		padding: 0 22px;
		border: 0;
		border-bottom: 2px solid transparent;
		margin-bottom: -1px;
		background: none;
		font-size: 14px;
		color: var(--aureon-admin-muted);
		cursor: pointer;

		&:first-child {
			border-top-left-radius: 10px;
		}

		&:hover {
			color: var(--aureon-admin-ink);
		}

		&.is-active {
			border-bottom-color: var(--aureon-admin-brand);
			font-weight: 600;
			color: var(--aureon-admin-ink);
		}

		&:focus-visible {
			outline: 2px solid var(--aureon-admin-brand);
			outline-offset: -2px;
		}
	}

	&__actions {
		display: flex;
		align-items: center;
		gap: 10px;
		flex-wrap: wrap;
		justify-content: flex-end;
	}

	&__custom {
		display: inline-flex;
		align-items: center;
		gap: 8px;
		color: var(--aureon-admin-muted);
		cursor: pointer;
	}

	&__presets.components-button {
		height: 38px;
		gap: 8px;
		padding: 0 14px;
		border: 1px solid var(--aureon-admin-border);
		border-radius: 8px;
		color: var(--aureon-admin-ink);
		font-weight: 500;

		&:hover:not(:disabled) {
			border-color: var(--aureon-admin-brand);
			color: var(--aureon-admin-ink);
		}
	}

	&__collapse.components-button {
		color: var(--aureon-admin-muted);

		svg {
			transition: transform 0.15s ease;
		}

		&.is-collapsed svg {
			transform: rotate(180deg);
		}
	}

	&__rows {
		display: flex;
		flex-direction: column;
		padding: 4px 0;
	}

	&__add-row {
		display: inline-flex;
		align-items: center;
		align-self: flex-start;
		gap: 6px;
		margin: 4px 0 6px 20px;
		padding: 4px 8px;
		border: 0;
		border-radius: 6px;
		background: none;
		font-size: 12px;
		color: var(--aureon-admin-muted);
		cursor: pointer;

		&:hover {
			background: var(--aureon-admin-surface-alt);
			color: var(--aureon-admin-ink);
		}
	}

	&__inherit {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 16px;
		padding: 18px 20px;

		p {
			margin: 0;
			color: var(--aureon-admin-muted);
		}
	}
}

.aureon-hbx-row {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 60px;
	// Top room for the column tabs that sit on each column's top edge.
	padding: 16px 12px 10px 8px;
	background: var(--aureon-admin-surface);

	& + & {
		border-top: 1px solid var(--aureon-admin-border);
	}

	&.is-dragging {
		z-index: 2;
		box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
	}

	&__lead {
		display: flex;
		align-items: center;
		gap: 2px;
		flex: 0 0 176px;
	}

	&__grip {
		display: inline-flex;
		padding: 6px;
		border: 0;
		border-radius: 6px;
		background: none;
		color: var(--aureon-admin-subtle);
		cursor: grab;
		touch-action: none;

		&:hover {
			background: var(--aureon-admin-surface-alt);
			color: var(--aureon-admin-ink);
		}
	}

	&__name {
		display: inline-flex;
		align-items: center;
		gap: 6px;
		padding: 6px;
		border: 0;
		border-radius: 6px;
		background: none;
		font-size: 14px;
		color: var(--aureon-admin-ink);
		text-align: left;
		cursor: pointer;

		&:hover {
			background: var(--aureon-admin-surface-alt);
		}
	}

	&.is-disabled &__name {
		color: var(--aureon-admin-subtle);
	}

	&.is-disabled &__zones {
		opacity: 0.55;
	}

	&__body {
		position: relative;
		flex: 1;
		min-width: 0;
		align-self: stretch;
		display: flex;
	}

	&__zones {
		display: flex;
		flex: 1;
		gap: 8px;
		min-width: 0;
	}

	// A fully empty row shows one "Add element" strip over its columns
	// (still drop targets underneath) — see DockRow.
	&.is-empty:not(.is-receiving) &__zones {
		visibility: hidden;
		height: 48px;
		overflow: hidden;
	}

	&__placeholder {
		position: absolute;
		inset: 0;
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 8px;
		width: 100%;
		border: 1px dashed #cfd5dd;
		border-radius: 8px;
		background: var(--aureon-admin-surface-alt);
		font-size: 14px;
		color: var(--aureon-admin-ink);
		cursor: pointer;

		&:hover,
		&[aria-expanded="true"] {
			border-color: var(--aureon-admin-brand);
			background: rgba(var(--aureon-admin-brand-rgb), 0.06);
		}
	}

	&__settings.components-button {
		flex: 0 0 auto;
		width: 30px;
		min-width: 30px;
		height: 30px;
		margin-left: auto;
		padding: 0;
		justify-content: center;
		border: 1px solid var(--aureon-admin-border);
		border-radius: 7px;
		color: var(--aureon-admin-muted);

		svg {
			width: 16px;
			height: 16px;
		}

		&:hover {
			border-color: var(--aureon-admin-brand);
			color: var(--aureon-admin-ink);
		}
	}

	.aureon-hbx-add {
		align-self: stretch;
		display: flex;
	}

	.aureon-hbx-add:has(.aureon-hbx-row__placeholder) {
		position: absolute;
		inset: 0;
	}

	&__add.components-button {
		width: 44px;
		height: auto;
		min-height: 44px;
		justify-content: center;
		border: 1px solid var(--aureon-admin-border);
		border-radius: 8px;
		color: var(--aureon-admin-ink);

		&:hover {
			border-color: var(--aureon-admin-brand);
		}
	}
}

.aureon-hbx-zone {
	position: relative;
	display: flex;
	flex-direction: column;
	flex: 1 1 0;
	min-width: 0;
	border: 1px dashed #d6dbe1;
	border-radius: 8px;
	background: var(--aureon-admin-surface);
	transition:
		border-color 0.12s ease,
		background-color 0.12s ease;

	// A tab sitting on the column's top edge, like a fieldset legend.
	&__head {
		position: absolute;
		top: -10px;
		left: 10px;
		z-index: 1;
		display: flex;
	}

	&__tab {
		display: inline-flex;
		align-items: center;
		gap: 5px;
		height: 20px;
		padding: 0 9px 0 7px;
		border: 1px solid var(--aureon-admin-border);
		border-radius: 999px;
		background: var(--aureon-admin-surface);
		font-size: 11px;
		font-weight: 500;
		line-height: 1;
		white-space: nowrap;
		color: var(--aureon-admin-muted);
		cursor: pointer;
		transition:
			border-color 0.12s ease,
			color 0.12s ease;

		svg {
			flex: 0 0 auto;
		}

		&:hover {
			border-color: var(--aureon-admin-brand);
			color: var(--aureon-admin-ink);
		}
	}

	&__list {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		align-content: center;
		gap: 6px;
		flex: 1;
		min-height: 52px;
		padding: 12px 8px 8px;
	}

	&.is-center &__list {
		justify-content: center;
	}

	&.is-right &__list {
		justify-content: flex-end;
	}

	// The add button sits in the column, so it follows the column's alignment.
	&__list > .aureon-hbx-add {
		display: flex;
		flex: 1;
	}

	&__add {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		gap: 6px;
		width: 100%;
		height: 36px;
		border: 0;
		border-radius: 6px;
		background: none;
		font-size: 12px;
		color: var(--aureon-admin-subtle);
		cursor: pointer;

		&:hover,
		&[aria-expanded="true"] {
			background: var(--aureon-admin-surface-alt);
			color: var(--aureon-admin-ink);
		}
	}

	&:hover {
		border-color: #c3cad3;
	}

	.aureon-hbx-row.is-receiving & {
		background: var(--aureon-admin-surface-alt);
	}

	&.is-over,
	.aureon-hbx-row.is-receiving &.is-over {
		border-color: var(--aureon-admin-brand);
		border-style: solid;
		background: rgba(var(--aureon-admin-brand-rgb), 0.08);
	}
}

.aureon-hbx-chip {
	display: inline-flex;
	align-items: center;
	height: 40px;
	border: 1px solid var(--aureon-admin-border);
	border-radius: 7px;
	background: var(--aureon-admin-surface);
	color: var(--aureon-admin-ink);
	cursor: grab;
	touch-action: none;
	transition:
		border-color 0.12s ease,
		box-shadow 0.12s ease;

	&:hover {
		border-color: #cfd5dd;
	}

	&:focus-visible {
		outline: 2px solid var(--aureon-admin-brand);
		outline-offset: 1px;
	}

	&.is-overlay {
		border-color: var(--aureon-admin-brand);
		box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
		cursor: grabbing;
		font-size: 13px;
	}

	&__main {
		display: inline-flex;
		align-items: center;
		gap: 8px;
		height: 100%;
		padding: 0 6px 0 12px;
		border: 0;
		background: none;
		font-size: 13px;
		color: inherit;
		cursor: inherit;
		white-space: nowrap;

		&:disabled {
			color: inherit;
		}
	}

	&__label {
		max-width: 140px;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	&__remove {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 30px;
		height: 100%;
		margin-left: 10px;
		padding: 0;
		border: 0;
		border-radius: 0 7px 7px 0;
		background: none;
		color: var(--aureon-admin-muted);
		cursor: pointer;

		&:hover {
			color: var(--aureon-admin-danger);
		}
	}
}

/* --- Off-canvas drawer card (sections/header/drawer-card.tsx) ------------- */

.aureon-hb-dock__body {
	display: flex;
	flex: 1;
	min-height: 0;

	// The drawer sits on the edge the panel slides in from.
	&.is-drawer-left {
		flex-direction: row-reverse;
	}
}

.aureon-hb-dock__main {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-width: 0;
	overflow-y: auto;
}

.aureon-hb-drawer {
	display: flex;
	flex-direction: column;
	flex: 0 0 236px;
	gap: 8px;
	min-height: 0;
	padding: 10px 12px 12px;
	border-left: 1px solid var(--aureon-admin-border);
	background: var(--aureon-admin-surface-alt);
	overflow-y: auto;

	.is-drawer-left > & {
		border-left: 0;
		border-right: 1px solid var(--aureon-admin-border);
	}

	&__head {
		display: flex;
		align-items: center;
		gap: 6px;
		min-height: 28px;
	}

	&__title {
		display: inline-flex;
		align-items: center;
		gap: 7px;
		font-size: 11px;
		font-weight: 600;
		letter-spacing: 0.06em;
		text-transform: uppercase;
		color: var(--aureon-admin-ink);

		svg {
			color: var(--aureon-admin-brand);
		}
	}

	&__meta {
		margin-left: auto;
		font-size: 11px;
		color: var(--aureon-admin-subtle);
	}

	&__gear.components-button {
		min-width: 26px;
		width: 26px;
		height: 26px;
		padding: 0;
		justify-content: center;
		color: var(--aureon-admin-subtle);

		&:hover {
			color: var(--aureon-admin-ink);
		}
	}

	// The panel itself: a white sheet with the close × in its corner, like the
	// open drawer on a phone.
	&__panel {
		position: relative;
		display: flex;
		flex-direction: column;
		gap: 6px;
		flex: 1;
		min-height: 120px;
		padding: 30px 8px 8px;
		border: 1px solid var(--aureon-admin-border);
		border-radius: 10px;
		background: var(--aureon-admin-surface);
		box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
		transition:
			border-color 0.12s ease,
			box-shadow 0.12s ease;
	}

	&__close {
		position: absolute;
		top: 8px;
		right: 10px;
		display: inline-flex;
		color: var(--aureon-admin-subtle);
	}

	&__list {
		display: flex;
		flex-direction: column;
		align-items: stretch;
		gap: 6px;

		.aureon-hbx-chip {
			justify-content: space-between;
			height: 36px;
		}

		&.is-center .aureon-hbx-chip__main {
			justify-content: center;
			flex: 1;
		}

		&.is-right .aureon-hbx-chip__main {
			justify-content: flex-end;
			flex: 1;
		}
	}

	&__empty {
		margin: 2px 4px;
		font-size: 12px;
		color: var(--aureon-admin-subtle);
	}

	&__panel > .aureon-hbx-add {
		display: flex;
		margin-top: auto;
	}

	&__add {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		gap: 6px;
		width: 100%;
		height: 34px;
		border: 1px dashed #d6dbe1;
		border-radius: 7px;
		background: none;
		font-size: 12px;
		color: var(--aureon-admin-muted);
		cursor: pointer;

		&:hover,
		&[aria-expanded="true"] {
			border-color: var(--aureon-admin-brand);
			color: var(--aureon-admin-ink);
		}
	}

	&.is-hot &__panel {
		border-color: var(--aureon-admin-brand);
		box-shadow: 0 0 0 3px rgba(var(--aureon-admin-brand-rgb), 0.18);
	}

	&.is-over &__panel {
		border-color: var(--aureon-admin-brand);
		background: rgba(var(--aureon-admin-brand-rgb), 0.05);
	}
}

// Desktop: a slim tab on the edge instead of the full card.
.aureon-hb-drawer-tab {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	flex: 0 0 40px;
	padding: 14px 0;
	border: 0;
	border-left: 1px solid var(--aureon-admin-border);
	background: var(--aureon-admin-surface-alt);
	color: var(--aureon-admin-muted);
	cursor: pointer;

	span {
		font-size: 11px;
		font-weight: 600;
		letter-spacing: 0.04em;
		white-space: nowrap;
		writing-mode: vertical-rl;
	}

	&:hover {
		color: var(--aureon-admin-ink);
		background: rgba(var(--aureon-admin-brand-rgb), 0.08);
	}

	.is-drawer-left > & {
		border-left: 0;
		border-right: 1px solid var(--aureon-admin-border);
	}
}

// The Toggle chip wears the drawer's colour: it's what opens it.
.aureon-hbx-chip.is-linked {
	border-color: rgba(var(--aureon-admin-brand-rgb), 0.55);

	.aureon-hbx-chip__link {
		margin-left: 2px;
		color: var(--aureon-admin-brand);
	}

	&.is-hot {
		border-color: var(--aureon-admin-brand);
		box-shadow: 0 0 0 3px rgba(var(--aureon-admin-brand-rgb), 0.18);
	}
}

.aureon-hbx-card__drawer {
	position: absolute;
	top: 6px;
	left: 6px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	border-radius: 4px;
	background: var(--aureon-admin-ink);
	color: #fff;
}

/* --- Builder dropdown menus (sections/header/dock-menu.tsx) --------------- */

.aureon-hbx-popover .components-popover__content {
	min-width: 220px;
	max-height: 360px;
	overflow-y: auto;
	padding: 6px;
	border: 1px solid var(--aureon-admin-border);
	border-radius: 10px;
	background: var(--aureon-admin-surface);
	box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
	outline: none;
}

.aureon-hbx-menu {
	display: flex;
	flex-direction: column;

	&__group + &__group {
		margin-top: 6px;
		padding-top: 6px;
		border-top: 1px solid var(--aureon-admin-border);
	}

	&__label {
		padding: 6px 10px 4px;
		font-size: 10px;
		font-weight: 600;
		letter-spacing: 0.06em;
		text-transform: uppercase;
		color: var(--aureon-admin-subtle);
	}

	&__empty {
		margin: 4px 10px 6px;
		font-size: 12px;
		color: var(--aureon-admin-muted);
	}

	&__item {
		display: flex;
		align-items: center;
		gap: 10px;
		width: 100%;
		height: 34px;
		padding: 0 10px;
		border: 0;
		border-radius: 6px;
		background: none;
		font-size: 13px;
		color: var(--aureon-admin-ink);
		text-align: left;
		cursor: pointer;

		svg {
			flex: 0 0 auto;
			color: var(--aureon-admin-muted);
		}

		&:hover,
		&:focus-visible {
			outline: none;
			background: rgba(var(--aureon-admin-brand-rgb), 0.1);

			svg {
				color: var(--aureon-admin-brand-hover);
			}
		}

		&.is-danger {
			color: var(--aureon-admin-danger);

			svg {
				color: currentcolor;
			}

			&:hover,
			&:focus-visible {
				background: rgba(var(--aureon-admin-danger-rgb), 0.08);
			}
		}
	}
}

.aureon-hb-dock__reset.components-button {
	width: 38px;
	min-width: 38px;
	height: 38px;
	padding: 0;
	justify-content: center;
	border: 1px solid var(--aureon-admin-border);
	border-radius: 8px;
	color: var(--aureon-admin-muted);

	svg {
		width: 17px;
		height: 17px;
	}

	&:hover {
		border-color: var(--aureon-admin-brand);
		color: var(--aureon-admin-ink);
	}
}

/* --- Template manager (sections/header/template-switcher.tsx) ------------- */

.aureon-tpl-popover .components-popover__content {
	width: 360px;
	max-width: 90vw;
	max-height: none;
	padding: 14px;
}

.aureon-tpl {
	display: flex;
	flex-direction: column;
	gap: 10px;
	font-size: 13px;

	&__title {
		margin: 0 0 2px;
		font-size: 14px;
		font-weight: 600;
		color: var(--aureon-admin-ink);
	}

	&__hint {
		margin: 0;
		font-size: 12px;
		line-height: 1.45;
		color: var(--aureon-admin-muted);
	}

	&__list {
		display: flex;
		flex-direction: column;
		gap: 6px;
		margin: 0;
		padding: 0;
		list-style: none;
	}

	&__item {
		position: relative;
		display: flex;
		align-items: center;
		gap: 6px;
		min-height: 52px;
		margin: 0;
		padding: 6px 10px 6px 4px;
		border: 1px solid var(--aureon-admin-border);
		border-radius: 8px;
		background: var(--aureon-admin-surface);

		&.is-selected {
			border-color: rgba(var(--aureon-admin-brand-rgb), 0.6);
			background: rgba(var(--aureon-admin-brand-rgb), 0.06);
			box-shadow: inset 3px 0 0 var(--aureon-admin-brand);
		}

		&.is-dragging {
			z-index: 2;
			box-shadow: 0 8px 20px rgba(15, 23, 42, 0.14);
		}

		&.is-disabled &__name {
			color: var(--aureon-admin-subtle);
		}
	}

	&__grip {
		display: inline-flex;
		align-self: stretch;
		align-items: center;
		padding: 0 4px;
		border: 0;
		border-radius: 5px;
		background: none;
		color: var(--aureon-admin-subtle);
		cursor: grab;
		touch-action: none;

		&:hover:not(:disabled) {
			color: var(--aureon-admin-ink);
		}

		&:disabled {
			cursor: default;
			opacity: 0.4;
		}
	}

	&__main {
		display: flex;
		flex: 1;
		flex-direction: column;
		gap: 2px;
		min-width: 0;
		padding: 2px 0;
		border: 0;
		background: none;
		text-align: left;
		cursor: pointer;
	}

	&__name {
		display: flex;
		align-items: center;
		gap: 7px;
		overflow: hidden;
		font-size: 13px;
		font-weight: 600;
		color: var(--aureon-admin-ink);
		white-space: nowrap;
		text-overflow: ellipsis;
	}

	&__rank {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		flex: 0 0 auto;
		width: 18px;
		height: 18px;
		border-radius: 50%;
		background: var(--aureon-admin-surface-alt);
		font-size: 10px;
		font-weight: 700;
		color: var(--aureon-admin-muted);
	}

	&__item.is-selected &__rank {
		background: var(--aureon-admin-brand);
		color: #fff;
	}

	&__cond {
		padding-left: 25px;
		overflow: hidden;
		font-size: 11px;
		color: var(--aureon-admin-muted);
		white-space: nowrap;
		text-overflow: ellipsis;
	}

	&__actions {
		display: flex;
		gap: 2px;
		opacity: 0;
		transition: opacity 0.12s ease;
	}

	&__item:hover &__actions,
	&__item:focus-within &__actions,
	&__item.is-selected &__actions {
		opacity: 1;
	}

	&__icon {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 26px;
		height: 26px;
		padding: 0;
		border: 0;
		border-radius: 6px;
		background: none;
		color: var(--aureon-admin-muted);
		cursor: pointer;

		&:hover:not(:disabled) {
			background: var(--aureon-admin-surface-alt);
			color: var(--aureon-admin-ink);
		}

		&.is-danger:hover:not(:disabled) {
			background: rgba(var(--aureon-admin-danger-rgb), 0.08);
			color: var(--aureon-admin-danger);
		}

		&.is-save {
			background: var(--aureon-admin-brand);
			color: #fff;

			&:hover:not(:disabled) {
				background: var(--aureon-admin-brand-hover);
				color: #fff;
			}
		}

		&:disabled {
			cursor: default;
			opacity: 0.35;
		}
	}

	&__toggle {
		flex: 0 0 auto;
		margin-left: 4px;
	}

	&__rename {
		display: flex;
		flex: 1;
		align-items: center;
		gap: 4px;
		min-width: 0;
	}

	&__input[type="text"] {
		flex: 1;
		min-width: 0;
		height: 32px;
		padding: 0 10px;
		border: 1px solid var(--aureon-admin-brand);
		border-radius: 6px;
		box-shadow: 0 0 0 2px rgba(var(--aureon-admin-brand-rgb), 0.18);
		font-size: 13px;
		color: var(--aureon-admin-ink);

		&:focus {
			outline: none;
		}
	}

	&__add {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		gap: 6px;
		width: 100%;
		height: 38px;
		border: 1px dashed var(--aureon-admin-border);
		border-radius: 8px;
		background: none;
		font-size: 13px;
		font-weight: 500;
		color: var(--aureon-admin-ink);
		cursor: pointer;

		&:hover:not(:disabled) {
			border-color: var(--aureon-admin-brand);
			background: rgba(var(--aureon-admin-brand-rgb), 0.06);
		}

		&:disabled {
			cursor: default;
			opacity: 0.5;
		}
	}

	&__cap {
		margin: 0;
		font-size: 12px;
		color: var(--aureon-admin-muted);
		text-align: center;
	}
}

// Core's Customizer draws focus in wp-admin blue with a literal colour (not
// the theme-colour variable), so the dock and its menus restate it in gold.
.aureon-hb-dock.aureon-hb-dock :focus,
.aureon-hbx-popover.aureon-hbx-popover :focus {
	outline-color: var(--aureon-admin-brand);
}

/* --- Builder settings window (sections/header/builder-modal.tsx) ---------- *
 * Column, row, element and off-canvas settings share this shell: icon tile +
 * title, segmented tabs, a scrolling body and a footer bar — the dock's own
 * vocabulary, instead of core's bare modal. */

.aureon-bm.components-modal__frame {
	width: 460px;
	max-width: calc(100vw - 32px);
	border-radius: 14px;
	box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
	overflow: hidden;

	.components-modal__content {
		display: flex;
		flex-direction: column;
		margin-top: 0;
		padding: 0;
		overflow: hidden;
	}
}

.aureon-bm {
	// Core's Button (primary/tertiary skins, focus rings) reads this, not the
	// theme-colour variable — see .aureon-font-pairings.
	--wp-components-color-accent: var(--aureon-admin-brand);
	--wp-components-color-accent-darker-10: var(--aureon-admin-brand-hover);
	--wp-components-color-accent-darker-20: #926d0c;
	--wp-components-color-accent-inverted: #fff;

	:focus-visible {
		outline-color: var(--aureon-admin-brand);
	}

	.components-select-control,
	.components-input-control {
		width: 100%;
	}

	// Fields fill the window rather than the panel's 320px cap.
	.aureon-select-field {
		max-width: none;
	}

	&__head {
		display: flex;
		align-items: center;
		gap: 12px;
		padding: 18px 16px 14px 20px;
	}

	&__icon {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		flex: 0 0 auto;
		width: 38px;
		height: 38px;
		border-radius: 10px;
		background: rgba(var(--aureon-admin-brand-rgb), 0.14);
		color: var(--aureon-admin-brand-hover);
	}

	&__heading {
		flex: 1;
		min-width: 0;
	}

	&__title {
		margin: 0;
		overflow: hidden;
		font-size: 16px;
		font-weight: 600;
		line-height: 1.3;
		color: var(--aureon-admin-ink);
		white-space: nowrap;
		text-overflow: ellipsis;
	}

	&__subtitle {
		margin: 1px 0 0;
		font-size: 12px;
		color: var(--aureon-admin-muted);
	}

	&__close {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		align-self: flex-start;
		width: 32px;
		height: 32px;
		padding: 0;
		border: 0;
		border-radius: 8px;
		background: none;
		color: var(--aureon-admin-muted);
		cursor: pointer;

		&:hover {
			background: var(--aureon-admin-surface-alt);
			color: var(--aureon-admin-ink);
		}
	}

	// The window's own tabs, drawn like every other tab bar: a full-width strip
	// on a hairline baseline, the active tab marked by a gold bar under it.
	&__tabs {
		display: flex;
		margin: 0 20px;
		border-bottom: 1px solid var(--aureon-admin-border);
	}

	&__tab {

		@extend %aureon-tab;
	}

	// Inner tab bars some element forms carry (menu Content / Style).
	.aureon-tabs {
		margin: 0;
	}

	&__body {
		display: flex;
		flex-direction: column;
		gap: 18px;
		max-height: min(64vh, 620px);
		padding: 18px 20px 22px;
		overflow-y: auto;

		.aureon-hb__settings {
			padding-top: 0;
		}
	}

	&__foot {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		padding: 12px 16px 12px 12px;
		border-top: 1px solid var(--aureon-admin-border);
		background: var(--aureon-admin-surface-alt);
	}

	&__foot-start,
	&__foot-end {
		display: flex;
		align-items: center;
		gap: 4px;
	}

	&__foot-end {
		gap: 8px;
		margin-left: auto;
	}

	&__foot .components-button.is-primary,
	&__foot .components-button.is-tertiary {
		height: 34px;
		padding: 0 16px;
		border-radius: 8px;
	}

	&__action.components-button {
		height: 32px;
		gap: 6px;
		padding: 0 10px;
		border-radius: 7px;
		font-size: 13px;
		color: var(--aureon-admin-muted);

		svg {
			width: 15px;
			height: 15px;
			margin: 0;
		}

		&:hover:not(:disabled) {
			background: var(--aureon-admin-surface);
			color: var(--aureon-admin-ink);
		}

		&.is-danger {
			color: var(--aureon-admin-danger);

			&:hover:not(:disabled) {
				background: rgba(var(--aureon-admin-danger-rgb), 0.08);
				color: var(--aureon-admin-danger);
			}
		}
	}

	// On/off options as one bordered list.
	&__toggles {
		border: 1px solid var(--aureon-admin-border);
		border-radius: 10px;
		overflow: hidden;
	}

	&__toggle {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 16px;
		padding: 12px 14px;
		cursor: pointer;

		& + & {
			border-top: 1px solid var(--aureon-admin-border);
		}
	}

	&__toggle-text {
		display: flex;
		flex-direction: column;
		gap: 2px;
		min-width: 0;
	}

	&__toggle-label {
		font-size: 13px;
		font-weight: 600;
		color: var(--aureon-admin-ink);
	}

	&__toggle-help {
		font-size: 12px;
		line-height: 1.4;
		color: var(--aureon-admin-muted);
	}

	&__note {
		margin: -8px 0 0;
		font-size: 12px;
		color: var(--aureon-admin-muted);
	}

	// Field labels: sentence case, like the rest of the builder.
	.aureon-hb__field-label,
	.aureon-hb__icon-picker-label,
	.aureon-rangefield__label,
	.components-base-control__label {
		font-size: 12px;
		font-weight: 600;
		letter-spacing: 0;
		text-transform: none;
		color: var(--aureon-admin-ink);
	}

	// Segmented choices: a sunk track with a raised white selection, gold icon.
	.aureon-hb__align-group {
		gap: 2px;
		padding: 3px;
		border-radius: 9px;
	}

	.aureon-hb__align-btn.components-button {
		gap: 6px;
		height: 34px;
		border-radius: 7px;
		font-size: 13px;
		font-weight: 500;
		color: var(--aureon-admin-muted);

		svg {
			width: 15px;
			height: 15px;
			margin: 0;
		}

		&.is-active {
			background: var(--aureon-admin-surface);
			box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1);
			color: var(--aureon-admin-ink);

			svg {
				color: var(--aureon-admin-brand);
			}
		}
	}
}

/**
 * Dark Mode section — see `sections/dark-mode.tsx`. The cards are ordinary
 * `.aureon-fieldgroup`s; this only adds what the section's mockup asks of
 * them: a larger card title, a filled scope bar, muted "i" hints under a
 * control, and the intro's "Learn more" link.
 */
.aureon-admin .aureon-darkmode {

	.aureon-fieldgroup {
		padding: 18px;
		border-radius: 12px;
	}

	.aureon-fieldgroup__head {
		margin-bottom: 14px;
	}

	.aureon-fieldgroup__head-text h3 {
		margin-bottom: 4px;
		font-size: 16px;
	}

	.aureon-fieldgroup__desc {
		font-size: 13px;
	}

	// Controls stacked inside a card; the hint hugs the control above it.
	.aureon-fieldgroup__body {
		container: aureon-darkmode-card / inline-size;
		display: flex;
		flex-direction: column;
		gap: 16px;

		> .aureon-segmented {
			margin-bottom: 0;
		}

		> .aureon-darkmode__hint {
			margin-top: -8px;
		}

		> .aureon-select-field {
			max-width: none;
		}
	}

	// A card with only its enable switch has an empty body; drop it and the
	// gap the head leaves for it.
	.aureon-fieldgroup__body:empty {
		display: none;
	}

	.aureon-fieldgroup__head:has(+ .aureon-fieldgroup__body:empty) {
		margin-bottom: 0;
	}

	// The scope bar: always one row, however narrow the pane — a stacked list
	// read as three separate settings rather than one choice. Icon beside
	// label, which fits the default Customizer pane; only a card narrower
	// than that moves each icon above its label (see the container query
	// below) so the labels still fit unclipped. The chosen
	// scope is the section's headline decision, so the active segment is
	// filled with the brand rather than lifted on a white chip.
	.aureon-segmented:not(.aureon-segmented--cards) {

		.aureon-segmented__track {
			flex-wrap: nowrap;
			gap: 3px;
			padding: 3px;
			border-radius: 10px;
			background: var(--aureon-admin-surface);
		}

		.aureon-segmented__segment {
			flex: 1 1 auto;
			min-width: 0;
			height: 38px;
			gap: 5px;
			padding: 0 6px;
			color: var(--aureon-admin-ink);
			font-size: 12px;

			span {
				overflow: hidden;
				text-overflow: ellipsis;
			}

			svg {
				flex: 0 0 auto;
				width: 15px;
				height: 15px;
			}

			&.is-active {
				background: var(--aureon-admin-brand);
				color: #fff;
				box-shadow: none;
			}
		}

		&.is-stacked .aureon-segmented__segment {
			flex-basis: auto;
			height: 38px;
		}

		@container aureon-darkmode-card ( max-width: 239px ) {

			.aureon-segmented__segment,
			&.is-stacked .aureon-segmented__segment {
				flex-direction: column;
				gap: 4px;
				height: 54px;
				padding: 0 4px;
			}
		}
	}

	// Toggle position: four cards, two by two.
	.aureon-darkmode__positions {

		.aureon-segmented {
			margin-bottom: 0;
		}

		.aureon-segmented__segment {
			flex: 1 1 calc(50% - 4px);
			flex-direction: row;
			gap: 7px;
			height: 40px;
			padding: 0 10px;
		}
	}

	.aureon-admin__callout {
		margin-top: 0;
	}

	.aureon-admin__callout-action.components-button {
		align-self: center;
	}
}

.aureon-darkmode__hint {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 0;
	font-size: 12.5px;
	line-height: 1.5;
	color: var(--aureon-admin-muted);

	svg {
		flex: 0 0 auto;
		margin-top: 2px;
	}
}

.aureon-darkmode__learn {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin-top: 6px;
	font-size: 13px;
	font-weight: 600;
	color: var(--aureon-admin-brand);
	text-decoration: none;

	&:hover,
	&:focus {
		color: var(--aureon-admin-brand-hover);
	}
}

/* -----------------------------------------------------------------------------
 * Plugin surfaces — status card (a run of `status` fields) and the inline
 * input + action row (a `text` field followed by `action`s). See
 * PanelFieldsList in sections/panel-section.tsx.
 * -------------------------------------------------------------------------- */
.aureon-panel-statuscard {
	--aureon-status: var(--aureon-admin-muted);
	--aureon-status-rgb: 100, 116, 139;

	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 20px 32px;
	margin: 4px 0 24px;
	padding: 20px 24px;
	border: 1px solid rgba(var(--aureon-status-rgb), 0.28);
	border-radius: 14px;
	background: rgba(var(--aureon-status-rgb), 0.06);

	&.is-success {
		--aureon-status: #047857;
		--aureon-status-rgb: 16, 185, 129;
	}

	&.is-warning {
		--aureon-status: var(--aureon-admin-warning-ink);
		--aureon-status-rgb: 245, 158, 11;
	}

	&.is-error {
		--aureon-status: var(--aureon-admin-danger);
		--aureon-status-rgb: var(--aureon-admin-danger-rgb);
	}
}

html[data-theme="dark"] .aureon-panel-statuscard.is-success {
	--aureon-status: #6ee7b7;
}

.aureon-panel-statuscard__main {
	display: flex;
	align-items: center;
	gap: 16px;
	min-width: 0;

	.aureon-admin__desc {
		margin: 4px 0 0;
	}
}

.aureon-panel-statuscard__icon {
	display: grid;
	place-items: center;
	width: 52px;
	height: 52px;
	flex: 0 0 auto;
	border-radius: 14px;
	background: rgba(var(--aureon-status-rgb), 0.14);
	color: var(--aureon-status);
}

.aureon-panel-statuscard__label {
	margin: 0 0 2px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--aureon-admin-subtle);
}

.aureon-panel-statuscard__value {
	margin: 0;
	font-size: 20px;
	font-weight: 700;
	letter-spacing: -0.01em;
	color: var(--aureon-status);
}

.aureon-panel-statuscard__details {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin: 0;
}

.aureon-panel-statuscard__detail {
	min-width: 120px;
	padding: 10px 14px;
	border: 1px solid var(--aureon-admin-border);
	border-radius: 10px;
	background: var(--aureon-admin-surface);

	dt {
		margin: 0 0 2px;
		font-size: 11px;
		font-weight: 600;
		letter-spacing: 0.06em;
		text-transform: uppercase;
		color: var(--aureon-admin-subtle);
	}

	dd {
		margin: 0;
		font-size: 14px;
		font-weight: 600;
		color: var(--aureon-admin-ink);
	}
}

.aureon-panel-inline {
	margin-bottom: 16px;

	.aureon-admin__desc {
		margin-top: 8px;
	}
}

.aureon-panel-inline__row {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 8px;

	.aureon-panel-action {
		margin: 0;
		height: 40px;
	}
}

.aureon-panel-inline__input {
	flex: 1 1 280px;
	min-width: 0;

	.components-text-control__input {
		height: 40px;
		font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
		letter-spacing: 0.02em;
	}
}

/* -----------------------------------------------------------------------------
 * The screen-leading state card, the detail record and the entitlement
 * checklist — see StateCard / DetailRow in sections/panel-section.tsx.
 * -------------------------------------------------------------------------- */

// Tinted by its tone, and sized to be the first thing read on the screen. The
// neutral default is deliberately quiet: a site that simply hasn't been set up
// yet isn't in an error state, and shouldn't be coloured like one.
.aureon-panel-statecard {
	--aureon-state: var(--aureon-admin-muted);
	--aureon-state-rgb: 100, 116, 139;

	position: relative;
	display: flex;
	align-items: center;
	gap: 22px;
	margin: 0 0 20px;
	padding: 26px 28px;
	border: 1px solid rgba(var(--aureon-state-rgb), 0.22);
	border-radius: 14px;
	background: rgba(var(--aureon-state-rgb), 0.05);
	overflow: hidden;

	&.is-success {
		--aureon-state: #059669;
		--aureon-state-rgb: 16, 185, 129;
	}

	&.is-warning {
		--aureon-state: var(--aureon-admin-warning-ink);
		--aureon-state-rgb: 245, 158, 11;
	}

	&.is-error {
		--aureon-state: var(--aureon-admin-danger);
		--aureon-state-rgb: var(--aureon-admin-danger-rgb);
	}

	&.is-info {
		--aureon-state: var(--aureon-admin-brand);
		--aureon-state-rgb: var(--aureon-admin-brand-rgb);
	}
}

html[data-theme="dark"] .aureon-panel-statecard.is-success {
	--aureon-state: #6ee7b7;
}

.aureon-panel-statecard__icon {
	display: grid;
	place-items: center;
	width: 72px;
	height: 72px;
	flex: 0 0 auto;
	border-radius: 50%;
	background: rgba(var(--aureon-state-rgb), 0.14);
	color: var(--aureon-state);
}

.aureon-panel-statecard__text {
	min-width: 0;
	flex: 1 1 auto;
}

.aureon-panel-statecard__eyebrow {
	margin: 0 0 4px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--aureon-admin-subtle);
}

.aureon-panel-statecard__value {
	margin: 0;
	font-size: 28px;
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.02em;
	color: var(--aureon-state);
}

.aureon-panel-statecard__help {
	margin: 8px 0 0;
	max-width: 62ch;
	font-size: 13px;
	line-height: 1.5;
	color: var(--aureon-admin-muted);
}

.aureon-panel-statecard__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	flex: 0 0 auto;
	// Above the watermark, which spans the card's end.
	position: relative;
	z-index: 1;

	.aureon-panel-action {
		margin: 0;
	}
}

// Stands in for the illustration this card is shaped around: the same glyph,
// oversized and faded into the card's trailing corner. Decorative only, and it
// never takes space — the content above sits on top of it.
.aureon-panel-statecard__mark {
	position: absolute;
	right: -34px;
	bottom: -54px;
	color: var(--aureon-state);
	opacity: 0.07;
	pointer-events: none;
}

// A text input with a leading tile, same shape as a `copy` field's row.
.aureon-panel-textfield {
	display: flex;
	align-items: flex-start;
	gap: 10px;

	> .components-base-control {
		flex: 1 1 auto;
		min-width: 0;
		margin-bottom: 0;
	}

	.components-text-control__input {
		height: 40px;
		font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	}
}

.aureon-panel-textfield__icon {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	flex: 0 0 auto;
	border: 1px solid var(--aureon-admin-border);
	border-radius: 8px;
	background: var(--aureon-admin-surface-alt);
	color: var(--aureon-admin-muted);
}

// A read-only record: label and value per row, aligned into a column pair.
.aureon-panel-details {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin: 0;
}

.aureon-panel-details__row {
	display: grid;
	grid-template-columns: minmax(0, 132px) minmax(0, 1fr);
	gap: 16px;
	align-items: center;

	dt {
		margin: 0;
		font-size: 13px;
		color: var(--aureon-admin-muted);
	}

	dd {
		display: flex;
		align-items: center;
		gap: 8px;
		min-width: 0;
		margin: 0;
	}
}

.aureon-panel-details__value {
	min-width: 0;
	font-size: 13px;
	font-weight: 600;
	overflow-wrap: anywhere;

	// Only the untoned rows take the ink colour. A toned one is coloured by the
	// shared `is-tone-*` classes, which carry the same specificity as this rule
	// and would otherwise lose to it on source order.
	&:not([class*="is-tone-"]) {
		color: var(--aureon-admin-ink);
	}

	// A plan name reads as a label rather than as data.
	&.is-badge {
		padding: 4px 10px;
		border-radius: 999px;
		background: rgba(var(--aureon-admin-brand-rgb), 0.14);
		color: var(--aureon-admin-brand-ink, var(--aureon-admin-brand));
		font-size: 12px;
	}

	// A state, prefixed with its own tone dot — same vocabulary as the pill on
	// a group's head.
	&.is-dot {
		display: inline-flex;
		align-items: center;
		gap: 7px;

		&::before {
			content: "";
			width: 7px;
			height: 7px;
			border-radius: 50%;
			background: currentcolor;
		}
	}
}

.aureon-panel-details__copy {
	flex: 0 0 auto;
	color: var(--aureon-admin-muted);
}

// What a plan includes. Ticks are glyphs, not checkboxes: nothing here is
// togglable, and a real checkbox would invite the reader to try.
.aureon-panel-checklist {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin: 0;
	list-style: none;

	li {
		display: flex;
		align-items: flex-start;
		gap: 10px;
		margin: 0;
		font-size: 13px;
		line-height: 1.45;
		color: var(--aureon-admin-ink);
	}

	svg {
		flex: 0 0 auto;
		margin-top: 1px;
		color: #059669;
	}
}

html[data-theme="dark"] .aureon-panel-checklist svg {
	color: #6ee7b7;
}

// A link weighted as one of a card's actions.
.aureon-panel-link.is-button {
	justify-content: center;
	height: 40px;
	padding: 0 16px;
	border: 1px solid var(--aureon-admin-border);
	border-radius: 6px;
	background: var(--aureon-admin-surface);
	color: var(--aureon-admin-ink);

	&:hover,
	&:focus {
		border-color: rgba(var(--aureon-admin-brand-rgb), 0.5);
		color: var(--aureon-admin-ink);
	}

	&.is-primary {
		border-color: rgba(37, 99, 235, 0.35);
		background: rgba(37, 99, 235, 0.06);
		color: #2563eb;
	}

	// The nudging arrow belongs to an inline link; inside a button it only
	// makes the label look unstable.
	svg:last-of-type {
		display: none;
	}
}

// "Where do I find this?", at the end of a card's head row.
.aureon-fieldgroup__head-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	flex: 0 0 auto;
	margin-left: auto;
	font-size: 12px;
	color: var(--aureon-admin-muted);
	text-decoration: none;
	white-space: nowrap;

	&:hover,
	&:focus {
		color: var(--aureon-admin-ink);
	}
}

/* -----------------------------------------------------------------------------
 * Plugin surfaces — the `copy` card, `secret` input, `link`, `helpcard` and the
 * surface-level `docs` card. See sections/panel-section.tsx.
 * -------------------------------------------------------------------------- */

// The documentation card at the end of a surface's heading row. Pushed to the
// trailing edge and capped in width so a long section description doesn't end
// up wrapping against it.
.aureon-panel-docs {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 0 0 auto;
	max-width: 300px;
	margin-left: auto;
	padding: 12px 14px;
	border: 1px solid var(--aureon-admin-border);
	border-radius: 12px;
	background: var(--aureon-admin-surface);
	color: var(--aureon-admin-ink);
	text-decoration: none;

	&:hover,
	&:focus {
		border-color: rgba(var(--aureon-admin-brand-rgb), 0.5);
		color: var(--aureon-admin-ink);
		box-shadow: none;
	}

	// The whole card is the link; underlining its two lines of text would read
	// as two separate links inside it.
	&,
	&:hover,
	&:focus {
		text-decoration: none;
	}

	> svg:last-of-type {
		flex: 0 0 auto;
		color: var(--aureon-admin-muted);
	}
}

// With no supporting line there's nothing to stack, so the card collapses to a
// button — which is all a bare "View documentation" ever needed to be.
.aureon-panel-docs.is-compact {
	gap: 8px;
	padding: 9px 14px;

	.aureon-panel-docs__icon {
		width: auto;
		height: auto;
		border-radius: 0;
		background: none;
		color: currentcolor;
	}

	.aureon-panel-docs__label {
		white-space: nowrap;
	}
}

.aureon-panel-docs__icon {
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	flex: 0 0 auto;
	border-radius: 9px;
	background: rgba(var(--aureon-admin-brand-rgb), 0.1);
	color: var(--aureon-admin-brand);
}

.aureon-panel-docs__text {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.aureon-panel-docs__label {
	font-size: 13px;
	font-weight: 600;
}

.aureon-panel-docs__help {
	font-size: 11px;
	line-height: 1.35;
	color: var(--aureon-admin-muted);
}

// A select with a decorative leading tile. The tile aligns to the control
// itself, not to the label above it or any help below, so a row of these lines
// up whether or not each one carries both.
.aureon-panel-select {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	column-gap: 12px;
	row-gap: 6px;
	align-items: center;

	// `contents` lifts the control's own label, dropdown and help out of their
	// wrapper and into this grid, so the label can span the full width while the
	// dropdown sits beside the tile. Without it the label would be indented to
	// the dropdown's column, reading as though it belonged to the tile.
	.aureon-select-field {
		display: contents;
	}

	.aureon-color-field__label {
		grid-area: 1 / 1 / 2 / -1;
	}

	.aureon-select-field__dropdown {
		grid-area: 2 / 2 / 3 / -1;
		min-width: 0;
	}

	.aureon-select-field__help {
		grid-area: 3 / 1 / 4 / -1;
		margin: 0;
	}
}

.aureon-panel-select__icon {
	grid-area: 2 / 1 / 3 / 2;
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	flex: 0 0 auto;
	border: 1px solid var(--aureon-admin-border);
	border-radius: 9px;
	background: var(--aureon-admin-surface-alt);
	color: var(--aureon-admin-muted);
}

// One outbound destination on its own line, with its glyphs sized to the text
// rather than to a button.
.aureon-panel-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	font-weight: 600;

	&,
	&:hover,
	&:focus {
		text-decoration: none;
	}

	svg {
		flex: 0 0 auto;
	}

	// The trailing arrow nudges on hover, which is the whole hover affordance
	// now that the underline is gone.
	svg:last-of-type {
		transition: transform 0.15s ease;
	}

	&:hover svg:last-of-type {
		transform: translateX(2px);
	}
}

// The row that closes a card: link at one end, buttons at the other. Wraps to
// two rows rather than crushing either when the card is narrow.
.aureon-panel-footer {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 4px;
}

.aureon-panel-footer__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-left: auto;

	.aureon-panel-action {
		margin: 0;
	}
}

// A `chips` checkbox set: the label and description head a tinted panel, and
// each box below is its own bordered tile flowing across the card. Reads as a
// set of things to pick rather than as a column of unrelated switches, which is
// what a long plain list of roles turns into.
.aureon-panel-checkboxes.is-chips {
	padding: 16px 18px;
	border-radius: var(--aureon-admin-radius);
	background: var(--aureon-admin-surface-alt);

	.aureon-admin__field-label {
		margin-bottom: 2px;
		font-size: 13px;
	}

	// The base list is a flex *column*, which would stretch every tile to full
	// width however narrow its label is.
	.aureon-admin__checklist {
		display: flex;
		flex-direction: row;
		flex-wrap: wrap;
		gap: 10px;
		margin-top: 12px;
		padding: 0;
		border: 0;
		background: none;
	}

	// Each box is a tile of its own. The whole tile is the control's label, so
	// the click target is the tile rather than the 16px box inside it.
	// `.components-base-control` is full-width by default, which would give one
	// tile per row — the plain list this layout exists to replace.
	.components-checkbox-control {
		flex: 0 0 auto;
		width: auto;
		margin: 0;
		padding: 9px 14px 9px 12px;
		border: 1px solid var(--aureon-admin-border);
		border-radius: 10px;
		background: var(--aureon-admin-surface);
	}

	.components-checkbox-control__label {
		font-size: 13px;
		font-weight: 500;
	}
}

// An editable list of rows a site owner builds themselves — Aureon Nexus's
// sign-up form builder, for one. Each row is its own bordered tile with a
// head (drag grip, title, reorder/remove) and a body of small controls.
.aureon-panel-repeater {

	&__head {
		display: flex;
		flex-wrap: wrap;
		align-items: flex-start;
		justify-content: space-between;
		gap: 12px;
		margin-bottom: 12px;
	}

	&__add {
		flex: none;
	}

	&__empty {
		margin: 0 0 12px;
		padding: 16px;
		border: 1px dashed var(--aureon-admin-border);
		border-radius: var(--aureon-admin-radius);
		color: var(--aureon-admin-muted);
		font-size: 13px;
		text-align: center;
	}

	&__list {
		border: 1px solid var(--aureon-admin-border);
		border-radius: var(--aureon-admin-radius);
		overflow: hidden;
	}

	&__item {
		background: var(--aureon-admin-surface);
		// A left accent rather than nothing, so an open row still reads as one
		// unit with its own edit panel below it, not two things that happen to
		// be adjacent — the accent runs the full height of both.
		border-left: 2px solid transparent;

		+ .aureon-panel-repeater__item {
			border-top: 1px solid var(--aureon-admin-border);
		}

		&.is-open {
			background: var(--aureon-admin-surface-alt);
			border-left-color: var(--aureon-admin-brand);
		}

		&.is-dragging {
			opacity: 0.4;
		}

		&.is-drop-target {
			box-shadow: inset 0 2px 0 var(--aureon-admin-brand);
		}

		// Username/Email/Password — read-only, so nothing here ever gets a
		// hover state or an open/edit affordance to hint at.
		&.is-pinned {
			background: var(--aureon-admin-surface-alt);
		}
	}

	// Grip, type glyph, then name — the only part that actually flexes — then
	// one tight cluster (badge, required pill, enabled switch, actions) held
	// together on the right. A grid with its own fixed-width column per
	// piece was tried first and rejected: it spaced badge/required/actions
	// out across the row's full width instead of keeping them as one group,
	// leaving a stretch of empty track between them on anything wider than
	// the content actually needed.
	&__row {
		display: flex;
		align-items: center;
		gap: 12px;
		padding: 12px 16px;

		@media (max-width: 782px) {
			flex-wrap: wrap;
			gap: 8px;
		}
	}

	// A fixed-width grid, not a shrink-to-fit flex row: every `__row` is its
	// own independent layout box, so a flex cluster sized to its own content
	// lands its badge at a different x-position on a pinned row (2 children:
	// badge, required) than on an editable one (4: badge, required, toggle,
	// actions). Explicit column tracks give the cluster the same total width
	// — and the badge/required/toggle/actions columns the same start x — on
	// every row regardless of how many of them a given row actually fills,
	// so the list reads as a table with real columns instead of four items
	// drifting left or right depending on their neighbours.
	&__meta {
		display: grid;
		grid-template-columns: 92px 84px 40px 96px;
		align-items: center;
		// A fixed gap, not `space-between` — that filled *all* the leftover
		// row width (see `&__name`'s cap), which on an actual wide panel
		// stretched the space between badge/required/toggle/actions into
		// three ballooning gaps instead of a comfortable, constant one.
		// Flush right via `margin-left: auto` keeps the cluster's own width
		// (and so its start x) the same across rows regardless of viewport.
		gap: 28px;
		margin-left: auto;

		@media (max-width: 782px) {
			grid-template-columns: 1fr 1fr auto auto;
			justify-items: end;
			gap: 8px;
			margin-left: 32px; // clears the grip + type glyph above it
		}
	}

	&__grip {
		display: inline-flex;
		flex: none;
		color: var(--aureon-admin-muted);
		cursor: grab;

		&:active {
			cursor: grabbing;
		}

		&.is-locked {
			color: var(--aureon-admin-subtle, var(--aureon-admin-muted));
			cursor: default;
		}
	}

	&__type-icon {
		display: inline-flex;
		flex: none;
		color: var(--aureon-admin-muted);
	}

	// Capped rather than left to grow — a short label ("First name") used to
	// get handed every pixel of leftover row width, which shoved the whole
	// badge/required/toggle/actions cluster into a cramped strip jammed
	// against the right edge. Letting the *cluster* claim the leftover
	// space instead (see `&__meta`'s `flex: 1 1 auto` below) is what gives
	// the row its actual table-like spread.
	&__name {
		flex: 0 1 260px;
		min-width: 60px;
		overflow: hidden;
		color: var(--aureon-admin-ink);
		font-size: 13px;
		font-weight: 600;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	&__badge {
		display: inline-flex;
		flex: none;
		align-items: center;
		justify-content: center;
		gap: 4px;
		padding: 3px 10px;
		border-radius: 999px;
		background: rgba(var(--aureon-admin-info-rgb), 0.12);
		color: var(--aureon-admin-info);
		font-size: 11px;
		font-weight: 600;
		white-space: nowrap;
	}

	// A read-only pill stating whether the row is required — informational
	// only; `required` itself is edited inside the open row's form, not by
	// clicking this.
	&__required {
		flex: none;
		padding: 3px 10px;
		border-radius: 999px;
		background: var(--aureon-admin-surface-alt);
		color: var(--aureon-admin-muted);
		font-size: 11px;
		font-weight: 600;
		text-align: center;
		white-space: nowrap;

		&.is-required {
			background: var(--aureon-admin-brand-light);
			color: var(--aureon-admin-brand-hover);
		}
	}

	// The "shown on the form" switch — a plain pill track with a sliding
	// thumb, hand-rolled rather than `ToggleControl` (see the comment beside
	// its markup) so it can actually be sized and colored to match the rest
	// of this row instead of fighting generated CSS-in-JS for every pixel.
	&__enabled {
		position: relative;
		flex: none;
		width: 40px;
		height: 22px;
		padding: 0;
		border: 1px solid var(--aureon-admin-border);
		border-radius: 999px;
		background: var(--aureon-admin-surface-alt);
		cursor: pointer;
		transition: background-color 0.15s ease, border-color 0.15s ease;

		&.is-checked {
			border-color: var(--aureon-admin-brand);
			background: var(--aureon-admin-brand);
		}

		&:focus-visible {
			outline: 2px solid var(--aureon-admin-brand);
			outline-offset: 2px;
		}
	}

	&__enabled-thumb {
		position: absolute;
		top: 2px;
		left: 2px;
		width: 16px;
		height: 16px;
		border-radius: 50%;
		background: #fff;
		box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
		transition: left 0.15s ease;
	}

	&__enabled.is-checked &__enabled-thumb {
		left: 20px;
	}

	&__row-actions {
		display: flex;
		justify-content: flex-end;
		gap: 10px;
	}

	// Bordered square icon buttons rather than bare ghost icons — Edit,
	// Duplicate, Close and Delete read as equally-weighted actions on a row
	// that's otherwise plain text, not as an afterthought tucked in the
	// corner. Sized up from the WP default "small" button box so each one
	// reads as its own tappable tile, with room between them rather than
	// two icons crowded edge to edge.
	//
	// !important throughout: the core Button component's own "small" size
	// styles (height, border-radius) are CSS-in-JS injected after this
	// stylesheet and win any tie on plain specificity — without it the box
	// silently comes out 38×24 (width honoured, height ignored), which is
	// why the icon read as oversized and butted against the edge instead
	// of sitting in a padded square.
	&__icon-btn {
		width: 38px !important;
		height: 38px !important;
		min-width: 38px !important;
		padding: 0 !important;
		border: 1px solid var(--aureon-admin-border);
		border-radius: 12px !important;
		color: var(--aureon-admin-ink);

		// The icon itself: `iconSize` on the Button keeps it a fixed 14px
		// regardless of the box around it, so growing the box (above) reads
		// as more padding around the glyph rather than a bigger glyph.
		svg {
			width: 14px !important;
			height: 14px !important;
		}

		&:hover:not(:disabled) {
			color: var(--aureon-admin-ink);
			border-color: var(--aureon-admin-brand);
			background: var(--aureon-admin-surface-alt);
		}

		// Same neutral border as Edit at rest — only the glyph is red. A red
		// *border* on an idle Delete button read as an alarm going off on
		// every single row; the color should say "this one's destructive"
		// through the icon, not put the whole row on visual alert.
		&.is-danger {
			color: var(--aureon-admin-danger);

			&:hover:not(:disabled) {
				color: var(--aureon-admin-danger);
				background: rgba(var(--aureon-admin-danger-rgb, 220, 38, 38), 0.08);
				border-color: var(--aureon-admin-danger);
			}
		}

		// The core Button component's `isPressed`/focus fill defaults to a
		// near-black background — wrong beside every gold-tinted control on
		// this screen, so these stay outlined instead of filling solid.
		&.is-pressed {
			background: var(--aureon-admin-brand-light);
			color: var(--aureon-admin-brand-hover);
			border-color: var(--aureon-admin-brand);
		}
	}

	// The open row's own edit form — a nested card rather than a plain grid
	// butted against the summary row above it, so "you're now editing this
	// field" has a visible boundary instead of blending into the list.
	&__edit {
		margin: 0 12px 12px;
		padding: 14px;
		background: var(--aureon-admin-surface);
		border: 1px solid var(--aureon-admin-brand);
		border-radius: var(--aureon-admin-radius);
	}

	&__edit-grid {
		display: grid;
		grid-template-columns: repeat(3, 1fr);
		gap: 12px;

		@media (max-width: 900px) {
			grid-template-columns: 1fr 1fr;
		}

		@media (max-width: 600px) {
			grid-template-columns: 1fr;
		}
	}

	&__span {
		grid-column: 1 / -1;
	}

	// A checkbox plus its own explanatory line, boxed to sit level with the
	// text inputs beside it in the grid rather than floating unaligned.
	&__required-field {
		padding: 8px 10px;
		background: var(--aureon-admin-surface-alt);
		border: 1px solid var(--aureon-admin-border);
		border-radius: calc(var(--aureon-admin-radius) - 2px);

		.aureon-admin__desc {
			margin: 4px 0 0 24px;
		}
	}

	&__edit-actions {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		justify-content: space-between;
		gap: 10px;
		margin-top: 14px;
		padding-top: 14px;
		border-top: 1px solid var(--aureon-admin-border);
	}

	&__delete {
		color: var(--aureon-admin-danger);
		border-color: rgba(var(--aureon-admin-danger-rgb, 220, 38, 38), 0.35) !important;

		&:hover:not(:disabled) {
			color: var(--aureon-admin-danger);
			background: rgba(var(--aureon-admin-danger-rgb, 220, 38, 38), 0.08);
		}
	}

	&__edit-actions-end {
		display: flex;
		gap: 8px;
		margin-left: auto;
	}

	&__note {
		display: flex;
		align-items: flex-start;
		gap: 6px;
		margin: 12px 0 0;
		color: var(--aureon-admin-muted);
		font-size: 12px;

		svg {
			flex: none;
			margin-top: 1px;
		}
	}
}

// A row of fields side by side — a screen's closing row, with a reset button at
// one end and a help card at the other. The card takes the slack; everything
// else keeps its own width.
.aureon-panel-row {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	gap: 16px;
	margin-top: 4px;

	> * {
		flex: 0 0 auto;
		margin: 0;
	}

	> .aureon-panel-helpcard {
		flex: 1 1 320px;
	}

	// Cards in a row split it evenly rather than each shrinking to its own
	// copy, so a pair reads as two halves of one shelf.
	> .aureon-fieldgroup {
		flex: 1 1 0;
		min-width: 260px;
	}
}

// The "need a hand?" callout that closes a setup screen.
.aureon-panel-helpcard {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-top: 4px;
	padding: 16px 18px;
	border: 1px solid var(--aureon-admin-border);
	border-radius: var(--aureon-admin-radius);
	background: var(--aureon-admin-surface-alt);

	p {
		margin: 0;
		font-size: 13px;
		font-weight: 600;
		color: var(--aureon-admin-ink);
	}

	.aureon-admin__desc {
		margin-top: 2px;
		font-weight: 400;
	}
}

.aureon-panel-helpcard__icon {
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	flex: 0 0 auto;
	border-radius: 10px;
	background: rgba(var(--aureon-admin-brand-rgb), 0.12);
	color: var(--aureon-admin-brand);
}

.aureon-panel-helpcard__text {
	min-width: 0;
	flex: 1 1 auto;
}

.aureon-panel-helpcard__button {
	flex: 0 0 auto;
}

// An action card's button that takes something away (Reset to defaults) —
// same treatment as a bare `.aureon-panel-action.is-destructive` button.
.aureon-panel-helpcard__button.is-destructive {
	border: 1px solid rgba(var(--aureon-admin-danger-rgb), 0.4);
	background: var(--aureon-admin-surface);
	color: var(--aureon-admin-danger);
	box-shadow: none;

	&:hover:not(:disabled) {
		border-color: var(--aureon-admin-danger);
		background: rgba(var(--aureon-admin-danger-rgb), 0.06);
		color: var(--aureon-admin-danger);
	}
}

// Without a button the whole card is the link, so it takes the hover and the
// chevron stands in for the button's affordance.
.aureon-panel-helpcard.is-link {
	text-decoration: none;
	transition: border-color 0.15s ease;

	&:hover,
	&:focus {
		border-color: rgba(var(--aureon-admin-brand-rgb), 0.5);
		box-shadow: none;
	}

	&:hover .aureon-panel-helpcard__chevron {
		transform: translateX(2px);
	}
}

.aureon-panel-helpcard__chevron {
	flex: 0 0 auto;
	color: var(--aureon-admin-muted);
	transition: transform 0.15s ease;
}

// The in-column variant: no card surface, and the label/value/help stack of an
// ordinary labelled control, so it sits in a two-column group beside real
// fields without reading as a box dropped into the middle of them.
.aureon-panel-copy.is-field {
	display: block;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;

	.aureon-panel-copy__row {
		gap: 8px;
	}

	.aureon-panel-copy__icon {
		width: 40px;
		height: 40px;
		border-radius: 8px;
		background: var(--aureon-admin-surface);
		color: var(--aureon-admin-muted);
	}

	// A quiet bordered square, not the brand-tinted secondary button: the value
	// beside it is the subject here, and two gold elements in one row would
	// compete with the card's own step badge.
	.aureon-panel-copy__button {
		width: 40px;
		height: 40px;
		padding: 0;
		border: 1px solid var(--aureon-admin-border);
		background: var(--aureon-admin-surface);
		color: var(--aureon-admin-muted);
		box-shadow: none;

		&:hover:not(:disabled) {
			border-color: var(--aureon-admin-border);
			background: var(--aureon-admin-surface-alt);
			color: var(--aureon-admin-ink);
		}
	}

	.aureon-admin__desc {
		margin-top: 8px;
	}
}

// A string the reader has to paste elsewhere. Tinted rather than plain-bordered
// so it reads as an instruction rather than as one more control in the column,
// which is what it sits above.
.aureon-panel-copy {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	margin: 0 0 20px;
	padding: 16px 18px;
	border: 1px solid var(--aureon-admin-border);
	border-radius: var(--aureon-admin-radius);
	background: var(--aureon-admin-surface-alt);
}

.aureon-panel-copy__icon {
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	flex: 0 0 auto;
	border-radius: 8px;
	border: 1px solid var(--aureon-admin-border);
	background: var(--aureon-admin-surface);
	color: var(--aureon-admin-ink);
}

.aureon-panel-copy__text {
	min-width: 0;
	flex: 1 1 auto;

	.aureon-admin__desc {
		margin: 8px 0 0;
	}
}

.aureon-panel-copy__label {
	margin: 0 0 4px;
	font-size: 13px;
	font-weight: 600;
	color: var(--aureon-admin-ink);
}

// The value and its button share a row, so the button reads as belonging to
// this one string rather than to the card as a whole.
.aureon-panel-copy__row {
	display: flex;
	align-items: center;
	gap: 10px;
}

// `.aureon-admin` on the front of the selector to outweigh core's own
// `input[readonly]` rule, which greys the field out as though it were disabled.
// It isn't: the value is live, and the reader is meant to take it away.
.aureon-admin .aureon-panel-copy__value {
	flex: 1 1 auto;
	min-width: 0;
	height: 40px;
	padding: 0 12px;
	border: 1px solid var(--aureon-admin-border);
	border-radius: 8px;
	background: var(--aureon-admin-surface);
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 12px;
	color: var(--aureon-admin-ink);
	box-shadow: none;

	// Read-only, not disabled: it still has to be selectable by hand, which is
	// the fallback when the clipboard API isn't there.
	&:read-only {
		cursor: text;
	}

	&:focus {
		border-color: rgba(var(--aureon-admin-brand-rgb), 0.5);
		box-shadow: none;
		outline: none;
	}
}

.aureon-panel-copy__button {
	flex: 0 0 auto;
}

// A masked credential with its reveal button overlaid on the input's trailing
// edge. Absolute rather than a flex sibling so the control keeps the same width
// and baseline as the plain `text` fields it sits beside in a card. `__control`
// wraps the label and input alone — a `secret`'s help text renders outside it,
// so the box the button is positioned against is never taller than the input
// it has to sit on.
.aureon-panel-secret .aureon-admin__desc {
	margin-top: 8px;
}

.aureon-panel-secret__control {
	position: relative;

	.components-text-control__input {
		padding-right: 40px;
	}

	// Monospace suits a credential but not the sentence prompting for one, so
	// it only applies once there's a value to read.
	.components-text-control__input:not(:placeholder-shown) {
		font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	}
}

// Centred on the input, not pinned to its foot: the control box is the label
// plus the input, so anchoring to the bottom edge and nudging up by a few pixels
// only lands centred while the input happens to be 40px tall. A full-height band
// at the input's end centres the glyph whatever that height turns out to be.
// `.aureon-admin` on the front to outweigh `.components-button.is-small`, which
// pins the button to a 24px box — the height is what does the centring here, so
// losing it puts the glyph 8px low.
.aureon-admin .aureon-panel-secret__reveal {
	position: absolute;
	right: 2px;
	bottom: 0;
	display: grid;
	place-items: center;
	width: 36px;
	height: 40px;
	min-width: 0;
	padding: 0;
	color: var(--aureon-admin-muted);

	&:hover:not(:disabled) {
		background: none;
		color: var(--aureon-admin-ink);
	}
}

/**
 * Declarative field group — a `group` field in a plugin-contributed surface,
 * rendered through the same `FieldGroup` the hand-written sections use (see
 * `sections/panel-section.tsx`).
 *
 * It needs body spacing of its own because those sections style their cards'
 * innards themselves, while a declarative group's children are whatever the
 * descriptor listed — the `.aureon-admin__section > …` rules above don't reach
 * them, being direct-child selectors, so without this the controls stack on
 * their component defaults and read as a cramped run.
 */
.aureon-panel-group .aureon-fieldgroup__body {
	display: flex;
	flex-direction: column;
	gap: 18px;

	// These carry their own bottom margin for the flat-list case; inside a
	// card the gap above is doing that job.
	> .aureon-select-field,
	> .components-base-control,
	> .aureon-panel-copy,
	> .aureon-admin__row {
		margin-bottom: 0;
	}

	// A `secret` wraps its control in a positioning div, so the reset above
	// (a direct-child selector) doesn't reach the control inside it.
	> .aureon-panel-secret .components-base-control {
		margin-bottom: 0;
	}

	// A checkbox list is already a bordered, tinted box; nested in a card it
	// reads as a box inside a box, so it drops back to a plain indented list.
	> .aureon-admin__row .aureon-admin__checklist {
		margin-top: 8px;
		padding: 0;
		border: 0;
		background: none;
	}
}

// A two-column group body (`columns => 2` on the descriptor). The rows that
// span both columns are the ones that aren't single controls — a card's closing
// footer row, or a nested group — since splitting those would read as a column
// of unrelated fragments.
.aureon-panel-group.is-two-column .aureon-fieldgroup__body {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 18px 24px;

	> .aureon-panel-footer,
	> .aureon-panel-helpcard,
	> .aureon-panel-row,
	> .aureon-panel-copy:not(.is-field),
	> .aureon-panel-checkboxes,
	> .aureon-panel-repeater,
	> .aureon-fieldgroup {
		grid-column: 1 / -1;
	}

	// A notice and the action that answers it belong together and to the whole
	// card — an empty state spanning the columns rather than sitting in one.
	> .aureon-admin__desc,
	> .aureon-panel-action {
		grid-column: 1 / -1;
		justify-self: start;
	}
}

// A group whose whole body is hidden behind its head switch leaves an empty
// body element; drop it and the gap the head reserves for it.
.aureon-panel-group .aureon-fieldgroup__body:empty {
	display: none;
}

.aureon-panel-group .aureon-fieldgroup__head:has(+ .aureon-fieldgroup__body:empty) {
	margin-bottom: 0;
}

/* Header Image / Background Image — see sections/header-image.tsx and
 * sections/background-image.tsx. Cards on the same surface language as the
 * Site Identity groups above; the dropzone, Change/Remove buttons and toggle
 * rows are the shared pieces, so only the image-specific parts live here. */
.aureon-imgsec {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.aureon-imgsec__group {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 16px;
	border: 1px solid var(--aureon-admin-border);
	border-radius: var(--aureon-admin-radius);
	background: var(--aureon-admin-surface);
}

.aureon-imgsec__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.aureon-imgsec__label {
	margin: 0;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--aureon-admin-muted);
}

// The background card labels read as ordinary field titles, not eyebrows.
.aureon-imgsec__label--plain {
	font-size: 14px;
	letter-spacing: 0;
	text-transform: none;
	color: var(--aureon-admin-ink);
}

.aureon-imgsec__note {
	margin: 0;
	padding: 14px;
	border-radius: 8px;
	background: var(--aureon-admin-surface-alt);
	color: var(--aureon-admin-muted);
	font-size: 13px;
}

.aureon-imgsec__preview {
	position: relative;
	overflow: hidden;
	border-radius: var(--aureon-admin-radius);
	background: var(--aureon-admin-surface-alt);

	img {
		display: block;
		width: 100%;
		max-height: 220px;
		object-fit: cover;
	}
}

// Round white buttons floated over a preview.
.aureon-imgsec__fab {
	position: absolute;
	right: 10px;
	bottom: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #fff;
	color: var(--aureon-admin-ink);
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
	cursor: pointer;
}

.aureon-imgsec__fab--danger {
	color: var(--aureon-admin-danger);
}

.aureon-imgsec__actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;

	.aureon-site-identity__btn {
		justify-content: center;
	}
}

.aureon-imgsec__link {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--aureon-admin-brand);
	font: inherit;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;

	&:hover {
		text-decoration: underline;
	}
}

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

.aureon-imgsec__item {
	position: relative;
	display: flex;
	align-items: center;
	gap: 8px;
}

.aureon-imgsec__thumb {
	flex: 1 1 auto;
	min-width: 0;
	padding: 3px;
	border: 2px solid transparent;
	border-radius: 10px;
	background: var(--aureon-admin-surface-alt);
	cursor: pointer;

	img {
		display: block;
		width: 100%;
		height: 56px;
		border-radius: 7px;
		object-fit: cover;
	}

	&:hover {
		border-color: var(--aureon-admin-border);
	}

	.is-selected & {
		border-color: var(--aureon-admin-brand);
	}
}

.aureon-imgsec__check {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--aureon-admin-brand);
	color: #fff;
}

.aureon-imgsec__menu .components-button {
	width: 34px;
	height: 34px;
	min-width: 0;
	padding: 0;
	border: 1px solid var(--aureon-admin-border);
	border-radius: 8px;
	background: var(--aureon-admin-surface);
	color: var(--aureon-admin-ink);
}

.aureon-imgsec__drop {
	margin-bottom: 0;
}

.aureon-imgsec__drop-title {
	font-size: 15px;
	font-weight: 700;
	color: var(--aureon-admin-ink);
}

.aureon-imgsec__cta {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 8px;
	padding: 9px 18px;
	border-radius: 8px;
	background: var(--aureon-admin-brand);
	color: #fff;
	font-size: 13px;
	font-weight: 600;
}

.aureon-imgsec__random {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 11px 14px;
	border: 1px solid var(--aureon-admin-border);
	border-radius: var(--aureon-admin-radius);
	background: var(--aureon-admin-surface);
	color: var(--aureon-admin-ink);
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;

	&:hover {
		border-color: var(--aureon-admin-subtle);
	}

	&.is-on {
		border-color: var(--aureon-admin-brand);
		background: rgba(var(--aureon-admin-brand-rgb), 0.08);
	}
}

// Position picker: a 3 x 3 grid beside a one-line hint.
.aureon-imgsec__position {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 12px;
	align-items: stretch;
}

.aureon-imgsec__grid {
	display: grid;
	grid-template-columns: repeat(3, 40px);
	grid-auto-rows: 40px;
	overflow: hidden;
	border: 1px solid var(--aureon-admin-border);
	border-radius: 8px;
	background: var(--aureon-admin-border);
	gap: 1px;
}

.aureon-imgsec__cell {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	background: var(--aureon-admin-surface);
	color: var(--aureon-admin-ink);
	cursor: pointer;

	&:hover {
		background: var(--aureon-admin-surface-alt);
	}

	&.is-active {
		background: rgba(var(--aureon-admin-brand-rgb), 0.14);
		color: var(--aureon-admin-brand);
	}
}

.aureon-imgsec__tip {
	display: flex;
	gap: 8px;
	align-items: flex-start;
	padding: 12px;
	border-radius: 8px;
	background: var(--aureon-admin-surface-alt);
	color: var(--aureon-admin-muted);
	font-size: 12px;
	line-height: 1.5;

	svg {
		flex: none;
		margin-top: 2px;
		color: var(--aureon-admin-brand);
	}
}

.aureon-imgsec__toggles {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 8px 16px;
	border: 1px solid var(--aureon-admin-border);
	border-radius: var(--aureon-admin-radius);
	background: var(--aureon-admin-surface);
}
