/*
 * Hatch admin, React app stylesheet.
 *
 * Scoped to .hatch-react. Token block is the canonical source for the React
 * admin. Mirrors the marketing site's tokens 1:1 so design.md saved from this
 * dashboard renders identically on the Astro frontend.
 *
 * Structure (in order):
 *   1. palette         : surface / border / text / brand / state / gray scale (light)
 *   2. space           : --hx-space-1..7
 *   3. grid            : .hx-grid-cols-*
 *   4. component styles: pill nav, save bar, buttons, checkboxes, etc.
 *
 * Design lineage: clean-room, learned from product admin dashboards
 * via Mobbin reference reads. Zero code copied.
 * Values were derived from a monotonic oklch gray ramp so light/dark stay
 * visually balanced without hand-tuning.
 */

/* ─────────────────────────────────────────────────────────────────────────
   1. palette, light (default)
   Every color used in the admin resolves to one of these tokens. If you
   reach for a hex literal in a tab, you owe a token instead.
   ───────────────────────────────────────────────────────────────────────── */
.hatch-react {
	/* Gray scale, 12 steps, monotonic in perceived lightness.
	   1..3 = surfaces, 4..6 = borders, 7..9 = interactive/muted text,
	   10..12 = body/heading text. Same rung count in dark; only values flip. */
	--hx-gray-1:  #ffffff;
	--hx-gray-2:  #fafafa;
	--hx-gray-3:  #f4f4f5;
	--hx-gray-4:  #ebebeb;
	--hx-gray-5:  #e5e5e5;
	--hx-gray-6:  #d4d4d4;
	--hx-gray-7:  #a3a3a3;
	--hx-gray-8:  #666666;
	--hx-gray-9:  #525252;
	--hx-gray-10: #404040;
	--hx-gray-11: #262626;
	--hx-gray-12: #0a0a0a;

	/* Surfaces */
	--hx-surface:    var(--hx-gray-1);   /* card body, elevated panels */
	--hx-surface-2:  var(--hx-gray-3);   /* nav pill background, subtle wells */
	--hx-surface-3:  var(--hx-gray-4);   /* deeper wells, code blocks */
	--hx-bg:         var(--hx-gray-2);   /* app page background */

	/* Borders */
	--hx-border:        var(--hx-gray-5);
	--hx-border-strong: var(--hx-gray-6);

	/* Text */
	--hx-text:        var(--hx-gray-12);
	--hx-text-muted:  var(--hx-gray-9);
	--hx-text-subtle: var(--hx-gray-8);

	/* Accent. Brand lime, used sparingly (DESIGN-SYSTEM.md section 1). It is
	   an accent, never a state colour: toggles stay black. Lime text on white
	   fails contrast, so links and focus rings use the foreground colour. */
	--hx-primary:         #7ebc11;
	--hx-primary-hover:   #69a10d;
	--hx-primary-3:       #f1f8e3;
	--hx-primary-subtle:  var(--hx-primary-3);
	--hx-link:            var(--hx-text);
	--hx-focus:           var(--hx-text);
	/* Text on the lime button is ink (#071222): above 7:1. */
	--hx-on-primary:      #071222;

	/* State, foreground + subtle-fill pair for each. -soft and -edge tint a
	   whole card or notice (fill and border) without shouting. */
	--hx-success:         #16a34a;
	--hx-success-subtle:  #dcfce7;
	--hx-success-soft:    #f0fdf4;
	--hx-success-edge:    #bbf7d0;
	--hx-warning:         #8a6d00;
	--hx-warning-subtle:  #fef3c7;
	--hx-warning-soft:    #fff7ed;
	--hx-warning-edge:    #fed7aa;
	--hx-danger:          #b91c1c;
	--hx-on-danger:       #fafafa;
	--hx-danger-subtle:   #fee2e2;
	--hx-danger-soft:     #fef2f2;
	--hx-danger-edge:     #fecaca;
	--hx-info:            #2563eb;
	--hx-info-subtle:     #dbeafe;
	--hx-info-soft:       #eff6ff;
	--hx-info-edge:       #bfdbfe;

	/* Save bar: warm dark zinc, never --hx-text, in both themes. */
	--hx-bar:             #18181b;
	--hx-bar-fg:          #fafafa;
	--hx-bar-fg-dim:      #a3a3a3;
	--hx-bar-line:        #3f3f46;
	/* Toggle thumb: near-white in both themes. */
	--hx-thumb:           #fafafa;
	--hx-thumb-on:        #fafafa;

	/* Elevation */
	--hx-shadow-1:        0 1px 4px rgba(10, 10, 10, 0.12);
	--hx-shadow-hover:    0 4px 20px rgba(10, 10, 10, 0.07);
	--hx-shadow-bar:      0 8px 32px rgba(10, 10, 10, 0.28);

	/* Motion */
	--hx-ease: cubic-bezier(0.16, 1, 0.3, 1);

	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
	color: var(--hx-text);
	-webkit-font-smoothing: antialiased;
}

/* ─────────────────────────────────────────────────────────────────────────
   3. space, the only spacing scale used in the admin.
   ───────────────────────────────────────────────────────────────────────── */
.hatch-react {
	--hx-space-1: 4px;
	--hx-space-2: 8px;
	--hx-space-3: 12px;
	--hx-space-4: 16px;
	--hx-space-5: 24px;
	--hx-space-6: 32px;
	--hx-space-7: 48px;
}

/* ─────────────────────────────────────────────────────────────────────────
   4. grid, layout utilities.
   Use these in tabs instead of style={{display:'grid', gridTemplateColumns:...}}.
   .hx-grid-cols-{2,3}    , fixed n equal columns
   ───────────────────────────────────────────────────────────────────────── */
.hatch-react .hx-grid-cols-2     { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--hx-space-3); }
.hatch-react .hx-grid-cols-3     { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--hx-space-3); }

@media (max-width: 640px) {
	.hatch-react .hx-grid-cols-2,
	.hatch-react .hx-grid-cols-3 { grid-template-columns: 1fr; }
}

/* Settings row: label on the start side, control on the end side. The control
   never shrinks on a wide screen. On a narrow screen the row may wrap so a wide
   control (count chips, a text field) drops under its label instead of pushing
   the page sideways. */
.hatch-react .hx-row-ctl { flex-shrink: 0; }
@media (max-width: 640px) {
	.hatch-react .hx-row { flex-wrap: wrap; }
	.hatch-react .hx-row-ctl { flex-shrink: 1; min-width: 0; max-width: 100%; }
	.hatch-react .hx-row-ctl > [role="group"] { justify-content: flex-start !important; }
	/* Action rows (Connection tab): the control always sits under its description, start aligned,
	   so a row never has its button on the right while its neighbour has it below. */
	.hatch-react .hx-row-stack { flex-direction: column; align-items: flex-start !important; gap: 10px !important; }
	.hatch-react .hx-row-stack > div:first-child { flex: 0 0 auto !important; width: 100%; }
}

/* Tab pill strip: scrolls sideways on a narrow screen. The native scrollbar is
   hidden (it was a chunky grey bar under the labels) and the right edge fades
   to show there is more. Arrow keys and touch still scroll it. */
.hatch-react .hx-tabstrip { scrollbar-width: none; -ms-overflow-style: none; }
.hatch-react .hx-tabstrip::-webkit-scrollbar { display: none; }
@media (max-width: 640px) {
	.hatch-react .hx-tabstrip {
		-webkit-mask-image: linear-gradient(to right, CanvasText calc(100% - 28px), transparent);
		mask-image: linear-gradient(to right, CanvasText calc(100% - 28px), transparent);
	}
}

/* ─────────────────────────────────────────────────────────────────────────
   5. component styles, everything below inherits tokens above.
   Do NOT hardcode colors here; if a value is missing, add a token.
   ───────────────────────────────────────────────────────────────────────── */

.hatch-react *,
.hatch-react *::before,
.hatch-react *::after {
	box-sizing: border-box;
}

.hatch-react input,
.hatch-react select,
.hatch-react textarea,
.hatch-react button {
	font-family: inherit;
	color: inherit;
}

.hatch-react select {
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23737373' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 10px center;
	background-size: 12px;
	padding-inline-end: 30px !important;
	cursor: pointer;
}
.hatch-react select:hover { border-color: var(--hx-border-strong); }
.hatch-react { --hx-dir: 1; }
[dir="rtl"] .hatch-react { --hx-dir: -1; }
[dir="rtl"] .hatch-react select { background-position: left 10px center; }

/* The app draws its own full-bleed layout: cancel wp-admin's content padding
   on the two Hatch screens only. */
body.toplevel_page_hatch #wpcontent,
body.admin_page_hatch-setup #wpcontent { padding-inline-start: 0 !important; }
.hatch-react { margin: 0 !important; padding-inline-start: 0 !important; }

/* Mount wrapper: no default .wrap margin. The hr.wp-header-end marker makes
   WordPress place admin notices between it and the app, so they get the same
   side gutter as the app content. */
.hatch-wrap { margin: 0; max-width: none; }
.hatch-wrap > .notice { margin: 12px max(16px, calc((100% - 728px) / 2)) 0; }
body.toplevel_page_hatch #screen-meta,
body.toplevel_page_hatch #screen-meta-links,
body.admin_page_hatch-setup #screen-meta,
body.admin_page_hatch-setup #screen-meta-links { display: none !important; }
body.toplevel_page_hatch #wpbody-content,
body.admin_page_hatch-setup #wpbody-content { padding-bottom: 0 !important; }

/* Login address shown in the security bookmark notice. */
.hatch-login-url { word-break: break-all; }

/* The WP-admin surround sits outside .hatch-react, so it carries its own copy
   of the page colour. Same value as --hx-bg. */
body.toplevel_page_hatch,
body.admin_page_hatch-setup { --hx-page-bg: #fafafa; }
/* A heading focused by script (step changes) needs no ring. */
.hatch-react [tabindex="-1"]:focus { outline: none; }
/* Focus rings, WCAG 2.4.7 */
.hatch-react button:focus-visible,
.hatch-react input:focus-visible,
.hatch-react select:focus-visible,
.hatch-react a:focus-visible,
.hatch-react summary:focus-visible {
	outline: 2px solid var(--hx-focus);
	outline-offset: 2px;
	border-radius: 4px;
}

/* Text links. Lime text fails contrast on white, so links use the
   foreground colour and are told apart by the underline. */
.hatch-react a.hx-link {
	color: var(--hx-link);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	overflow-wrap: anywhere;
}
.hatch-react a.hx-link:hover { text-decoration-thickness: 2px; }

/* Tab attention dot (section 4): amber, pulses once to catch the eye. */
.hatch-react .hx-tab-dot {
	position: absolute;
	top: 4px;
	inset-inline-end: 3px;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--hx-warning);
	box-shadow: 0 0 0 2px var(--hx-surface-2);
}
.hatch-react .hx-tab-dot::after {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: var(--hx-warning);
	animation: hxPulse 1.8s var(--hx-ease) infinite;
}
@keyframes hxPulse {
	0%   { opacity: 0.6; transform: scale(1); }
	100% { opacity: 0;   transform: scale(2.6); }
}
@media (prefers-reduced-motion: reduce) { .hatch-react .hx-tab-dot::after { animation: none; display: none; } }

/* Footer links */
.hatch-react .hatch-foot-link {
	font-size: 12px;
	color: var(--hx-text-subtle);
	text-decoration: none;
	transition: color .15s var(--hx-ease);
}
.hatch-react .hatch-foot-link:hover { color: var(--hx-text-muted); }

.hatch-react .hatch-tab:hover:not(.is-active) { color: var(--hx-text-muted) !important; }

@keyframes hxFadeUp {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: translateY(0); }
}
.hatch-react .hatch-tab-enter { animation: hxFadeUp 0.2s var(--hx-ease) both; }

@keyframes hxFadeIn {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@keyframes hxPopIn {
	from { opacity: 0; transform: translateX(-50%) translateY(8px) scale(0.97); }
	to   { opacity: 1; transform: translateX(-50%) translateY(0)   scale(1); }
}
.hatch-react .hatch-save-bar { animation: hxPopIn 0.2s var(--hx-ease) both; }

@media (min-width: 783px) {
	body.toplevel_page_hatch:not(.folded) .hatch-react .hatch-save-bar { margin-inline-start: 80px; }
	body.toplevel_page_hatch.folded          .hatch-react .hatch-save-bar { margin-inline-start: 18px; }
}

.hatch-react .hx-card-hover { transition: box-shadow 0.2s var(--hx-ease); }
.hatch-react .hx-card-hover:hover { box-shadow: var(--hx-shadow-hover); }

@keyframes hxSpin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
	.hatch-react .hatch-tab-enter,
	.hatch-react .hatch-save-bar { animation: none; }
}

/* Save bar. The bar is a pill on --hx-bar in both themes; its buttons are
   pills too, matching HxBtn (sm). */
.hatch-react .hatch-save-bar { color: var(--hx-bar-fg); }
.hatch-react .hatch-sb-kbd {
	padding: 2px 7px;
	border-radius: 6px;
	border: 1px solid var(--hx-bar-line);
	font-size: 11px;
	font-weight: 600;
	line-height: 1.4;
	color: var(--hx-bar-fg-dim);
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media (max-width: 640px) { .hatch-react .hatch-sb-kbd { display: none; } }
.hatch-react .hatch-sb-discard {
	padding: 7px 14px;
	border-radius: 999px;
	cursor: pointer;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	background: transparent;
	color: var(--hx-bar-fg-dim);
	border: 1px solid var(--hx-bar-line);
	transition: border-color .2s var(--hx-ease), color .2s var(--hx-ease);
}
.hatch-react .hatch-sb-discard:hover { border-color: var(--hx-bar-fg-dim); color: var(--hx-bar-fg); }
.hatch-react .hatch-sb-save {
	padding: 7px 14px;
	border-radius: 999px;
	cursor: pointer;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	background: var(--hx-primary);
	color: var(--hx-on-primary);
	border: 1px solid transparent;
	transition: opacity .2s var(--hx-ease), transform .2s var(--hx-ease);
}
.hatch-react .hatch-sb-save:hover { opacity: 0.84; transform: translateY(-1px); }
.hatch-react .hatch-sb-retry {
	margin-inline-start: 4px;
	padding: 5px 12px;
	border-radius: 999px;
	cursor: pointer;
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	background: var(--hx-danger);
	color: var(--hx-on-danger);
	border: 1px solid transparent;
}
/* The bar keeps focus rings visible on its dark surface. */
.hatch-react .hatch-save-bar button:focus-visible { outline-color: var(--hx-bar-fg) !important; }

/* Inputs */
.hatch-react input[type="text"],
.hatch-react input[type="email"],
.hatch-react input[type="number"],
.hatch-react input[type="url"] {
	transition: border-color .15s var(--hx-ease), box-shadow .15s var(--hx-ease);
}
.hatch-react input[type="text"]:focus,
.hatch-react input[type="email"]:focus,
.hatch-react input[type="number"]:focus,
.hatch-react input[type="url"]:focus {
	border-color: var(--hx-text);
	box-shadow: 0 0 0 3px var(--hx-surface-2);
}

/* Scrollbar */
.hatch-react ::-webkit-scrollbar { width: 6px; }
.hatch-react ::-webkit-scrollbar-track { background: transparent; }
.hatch-react ::-webkit-scrollbar-thumb { background: var(--hx-border-strong); border-radius: 3px; }

/* Branded checkbox */
.hatch-react .hx-checkbox { user-select: none; -webkit-user-select: none; }
.hatch-react .hx-checkbox input[type="checkbox"] {
	appearance: none;
	-webkit-appearance: none;
	width: 18px;
	height: 18px;
	min-width: 18px;
	min-height: 18px;
	border: 1.5px solid var(--hx-border-strong);
	border-radius: 4px;
	background: var(--hx-surface);
	cursor: pointer;
	margin: 0;
	padding: 0;
	flex-shrink: 0;
	display: inline-block;
	position: relative;
	box-shadow: none;
	outline: none;
	transition: background .12s var(--hx-ease), border-color .12s var(--hx-ease);
}
.hatch-react .hx-checkbox input[type="checkbox"]::before,
.hatch-react .hx-checkbox input[type="checkbox"]:checked::before {
	display: none !important;
	content: none !important;
}
.hatch-react .hx-checkbox input[type="checkbox"]:hover { border-color: var(--hx-text); }
.hatch-react .hx-checkbox input[type="checkbox"]:checked {
	background: var(--hx-text);
	border-color: var(--hx-text);
}
.hatch-react .hx-checkbox input[type="checkbox"]:checked::after {
	content: '';
	position: absolute;
	inset-inline-start: 5px;
	top: 1.5px;
	width: 5px;
	height: 10px;
	border: solid var(--hx-surface);
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

/* hatch-flash */
@keyframes hatchFlash {
	0%   { background: var(--hx-warning-subtle); box-shadow: 0 0 0 2px var(--hx-warning); }
	100% { background: transparent;              box-shadow: 0 0 0 0 transparent; }
}
.hatch-react .hatch-flash { animation: hatchFlash 1.6s var(--hx-ease) forwards; }

/* Typography roles */
.hatch-react .hx-title  { font-size: 15px; font-weight: 600; line-height: 1.3; }
.hatch-react .hx-byline { font-size: 13px; font-weight: 400; line-height: 1.55; }
.hatch-react .hx-label  { font-size: 14px; font-weight: 500; line-height: 1.4; }
.hatch-react .hx-desc   { font-size: 13px; font-weight: 400; line-height: 1.5; }
.hatch-react .hx-help   { font-size: 11px; font-weight: 400; }

/* Feel */
.hatch-react {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	font-variant-numeric: tabular-nums;
}
.hatch-react h1, .hatch-react h2, .hatch-react h3, .hatch-react .hx-title { text-wrap: balance; }
.hatch-react p, .hatch-react .hx-desc, .hatch-react .hx-byline { text-wrap: pretty; }
.hatch-react [class*="tabular"], .hatch-react code, .hatch-react time { font-variant-numeric: tabular-nums; }

.hatch-react * {
	transition-property: background-color, border-color, color, fill, stroke, opacity, transform, box-shadow;
	transition-duration: 160ms;
	transition-timing-function: var(--hx-ease);
}
.hatch-react button:not(:disabled):active,
.hatch-react [role="button"]:not(:disabled):active { transform: scale(0.96); }

.hatch-react a:focus-visible,
.hatch-react button:focus-visible,
.hatch-react input:focus-visible,
.hatch-react select:focus-visible,
.hatch-react textarea:focus-visible,
.hatch-react [role="tab"]:focus-visible,
.hatch-react [role="button"]:focus-visible {
	outline: 2px solid var(--hx-focus);
	outline-offset: 2px;
	border-radius: 4px;
}

/* Deployment history: a plain table that turns into stacked rows on a narrow
   screen so nothing scrolls sideways. */
.hatch-react .hx-hist { width: 100%; border-collapse: collapse; font-size: 13px; }
.hatch-react .hx-hist th,
.hatch-react .hx-hist td { padding: 10px 12px 10px 0; text-align: start; vertical-align: top; border-bottom: 1px solid var(--hx-border); }
.hatch-react .hx-hist th { color: var(--hx-text-subtle); font-weight: 600; font-size: 12px; }
.hatch-react .hx-hist tbody tr:last-child td { border-bottom: 0; }
.hatch-react .hx-hist td { overflow-wrap: anywhere; }
@media (max-width: 640px) {
	.hatch-react .hx-hist thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
	.hatch-react .hx-hist,
	.hatch-react .hx-hist tbody,
	.hatch-react .hx-hist tr,
	.hatch-react .hx-hist td { display: block; width: 100%; box-sizing: border-box; }
	.hatch-react .hx-hist tr { padding: 10px 0; border-bottom: 1px solid var(--hx-border); }
	.hatch-react .hx-hist tbody tr:last-child { border-bottom: 0; }
	.hatch-react .hx-hist td { border: 0; padding: 3px 0; }
	.hatch-react .hx-hist td::before { content: attr(data-label); display: inline-block; min-width: 72px; color: var(--hx-text-subtle); font-size: 12px; font-weight: 600; margin-inline-end: 8px; }
}

/* Setup screen. Step tracker, "before you start" card, token steps,
   permission rows and the "what next" list. All spacing steps come from the
   --hx-space scale; logical properties keep it right in RTL. */
.hatch-react .hx-wiz { max-width: 792px; margin: 0 auto; padding: 32px 16px 0; }
.hatch-react .hx-wiz-head h1 { font-size: 24px; font-weight: 600; line-height: 1.2; margin: 0; padding: 0; color: var(--hx-text); }
.hatch-react .hx-wiz-head p { font-size: 14px; color: var(--hx-text-muted); margin: 6px 0 0; }
.hatch-react .hx-wiz-stack { display: flex; flex-direction: column; gap: 14px; margin-top: 24px; }
.hatch-react .hx-wiz-foot { margin-top: 24px; display: flex; gap: 16px; flex-wrap: wrap; }

.hatch-react .hx-stepper { list-style: none; margin: 20px 0 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.hatch-react .hx-stepper li { display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px 5px 5px; border: 1px solid var(--hx-border); border-radius: 999px; background: var(--hx-surface); color: var(--hx-text-muted); font-size: 13px; line-height: 1.3; }
.hatch-react .hx-stepper li[aria-current="step"] { border-color: var(--hx-primary); color: var(--hx-text); font-weight: 600; }
.hatch-react .hx-stepper .hx-step-dot { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; background: var(--hx-surface-2); color: var(--hx-text); flex-shrink: 0; }
.hatch-react .hx-stepper li[aria-current="step"] .hx-step-dot { background: var(--hx-primary); color: var(--hx-on-primary); }
.hatch-react .hx-stepper li.is-done .hx-step-dot { background: var(--hx-success); color: var(--hx-on-primary); }
.hatch-react .hx-stepper li.is-done { color: var(--hx-text); }

.hatch-react .hx-intro-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px 28px; margin-top: 16px; }
.hatch-react .hx-intro-grid h3 { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--hx-text); }
.hatch-react .hx-ticks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.hatch-react .hx-ticks li { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.5; color: var(--hx-text); }
.hatch-react .hx-ticks li > svg { flex-shrink: 0; margin-top: 2px; color: var(--hx-success); }
.hatch-react .hx-ticks li > span { min-width: 0; }

.hatch-react .hx-how { margin: 0 0 16px; padding: 0; list-style: none; counter-reset: hxhow; display: flex; flex-direction: column; gap: 8px; }
.hatch-react .hx-how li { counter-increment: hxhow; display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.5; color: var(--hx-text); }
.hatch-react .hx-how li::before { content: counter(hxhow); flex-shrink: 0; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; background: var(--hx-surface-2); border: 1px solid var(--hx-border); font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }

.hatch-react .hx-perm-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 4px; }
.hatch-react .hx-perms { list-style: none; margin: 0 0 12px; padding: 0; }
.hatch-react .hx-perms li { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 10px; align-items: start; padding: 8px 0; border-bottom: 1px solid var(--hx-border); }
.hatch-react .hx-perms li:last-child { border-bottom: 0; }
@media (max-width: 480px) {
	.hatch-react .hx-perms li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}

.hatch-react .hx-live-url { display: block; font-size: 18px; font-weight: 600; color: var(--hx-link); overflow-wrap: anywhere; margin: 4px 0 0; }
.hatch-react .hx-next { list-style: none; margin: 12px 0 0; padding: 0; }
.hatch-react .hx-next li { border-top: 1px solid var(--hx-border); }
.hatch-react .hx-next a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; text-decoration: none; color: var(--hx-text); }
.hatch-react .hx-next a:hover .hx-next-title { color: var(--hx-link); text-decoration: underline; }
.hatch-react .hx-next-title { font-size: 14px; font-weight: 600; }
.hatch-react .hx-next-desc { font-size: 13px; color: var(--hx-text-muted); margin-top: 2px; }
[dir="rtl"] .hatch-react .hx-next a svg { transform: scaleX(-1); }

/* The WP-admin surround on the two Hatch screens takes the app's own page
   colour, so a notice above the app does not sit on a grey band. */
body.toplevel_page_hatch,
body.admin_page_hatch-setup,
body.toplevel_page_hatch #wpwrap,
body.admin_page_hatch-setup #wpwrap,
body.toplevel_page_hatch #wpbody,
body.admin_page_hatch-setup #wpbody,
body.toplevel_page_hatch #wpbody-content,
body.admin_page_hatch-setup #wpbody-content,
body.toplevel_page_hatch #wpcontent,
body.admin_page_hatch-setup #wpcontent { background: var(--hx-page-bg); }

/* Windows high contrast and other forced-colors modes: keep borders, focus
   rings and badges visible when the browser replaces our colours. */
@media (forced-colors: active) {
	.hatch-react button,
	.hatch-react a[role="button"] { border: 1px solid ButtonText; }
	.hatch-react button:disabled { border-color: GrayText; color: GrayText; }
	.hatch-react [role="group"] { border-color: CanvasText; }
}

@media (max-width: 600px) {
	.hatch-react .hx-chev { display: none; }
}

/* Some controls carry an inline outline reset. This keeps the keyboard focus ring visible on every one of them. */
.hatch-react a:focus-visible,
.hatch-react button:focus-visible,
.hatch-react input:focus-visible,
.hatch-react select:focus-visible,
.hatch-react textarea:focus-visible,
.hatch-react [role="radio"]:focus-visible {
	outline: 2px solid var(--hx-focus) !important;
	outline-offset: 2px !important;
}

/* Setup wizard: one step on screen at a time (SetupApp.jsx). */
.hx-wiz-progress { margin-top: 18px; }
.hx-wiz-count { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--hx-text-muted); }
.hx-wiz-nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	margin-top: 24px;
	padding-top: 20px;
	border-top: 1px solid var(--hx-border);
}
.hx-key-perms summary { list-style: none; }
.hx-key-perms summary::-webkit-details-marker { display: none; }
@media (max-width: 480px) {
	.hx-stepper li:not([aria-current]) > span:last-child { display: none; }
}
