/* WPX Plugin Directory — documentation / tutorial style.
   Colours come from the theme (theme.json presets) with fallbacks. Loaded only where used. */

:root {
	--wpx-bg: var(--wp--preset--color--base, #fff);
	--wpx-ink: var(--wp--preset--color--contrast, #0f172a);
	--wpx-ink-2: var(--wp--preset--color--accent-3, #334155);
	--wpx-muted: var(--wp--preset--color--accent-4, #64748b);
	--wpx-soft: var(--wp--preset--color--accent-5, #f8fafc);
	--wpx-line: var(--wp--preset--color--accent-6, #e2e8f0);
	--wpx-accent: var(--wp--preset--color--accent-1, #4f46e5);
	--wpx-accent-soft: var(--wp--preset--color--accent-2, #eef2ff);
	--wpx-code-bg: #0b1220;
	--wpx-radius: 12px;
	--wpx-radius-sm: 8px;
	--wpx-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .06);
	--wpx-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

.wpx { color: var(--wpx-ink); font-size: 1rem; line-height: 1.6; }
.wpx *, .wpx *::before, .wpx *::after { box-sizing: border-box; }
.wpx a { color: var(--wpx-accent); text-decoration: none; }
.wpx a:hover { text-decoration: underline; text-underline-offset: 3px; }
.wpx h1, .wpx h2, .wpx h3 { color: var(--wpx-ink); letter-spacing: -0.02em; line-height: 1.2; font-weight: 750; }
.wpx h2 { font-size: clamp(1.35rem, 2.2vw, 1.65rem); margin: 0 0 .75rem; }
.wpx h3 { font-size: 1.1rem; margin: 0 0 .4rem; }
.wpx p { margin: 0 0 1rem; }
.wpx code { font-family: var(--wpx-mono); font-size: .875em; }
.wpx-wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.wpx-muted { color: var(--wpx-muted); }
.wpx-small { font-size: .875rem; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }

/* Breadcrumbs */
.wpx-crumbs ol { list-style: none; margin: 0 0 1.25rem; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: .85rem; color: var(--wpx-muted); }
.wpx-crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--wpx-line); }
.wpx-crumbs a { color: var(--wpx-muted); }

/* Buttons */
.wpx-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border: 1px solid var(--wpx-line); border-radius: var(--wpx-radius-sm); background: var(--wpx-bg); color: var(--wpx-ink) !important; font: inherit; font-weight: 600; font-size: .95rem; line-height: 1.2; text-decoration: none !important; cursor: pointer; transition: background .15s, border-color .15s; }
.wpx-btn:hover { background: var(--wpx-soft); border-color: #cbd5e1; }
.wpx-btn--primary { background: var(--wpx-accent); border-color: var(--wpx-accent); color: #fff !important; }
.wpx-btn--primary:hover { background: var(--wpx-accent); filter: brightness(1.08); border-color: var(--wpx-accent); }
.wpx-btn--block { display: flex; width: 100%; }
.wpx-btn:focus-visible, .wpx a:focus-visible, .wpx button:focus-visible, .wpx input:focus-visible, .wpx select:focus-visible, .wpx textarea:focus-visible { outline: 2px solid var(--wpx-accent); outline-offset: 2px; }

/* Small labels */
.wpx-eyebrow { display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--wpx-accent) !important; }
.wpx-badge { display: inline-block; font-size: .72rem; font-weight: 650; padding: 2px 8px; border-radius: 999px; background: var(--wpx-soft); color: var(--wpx-ink-2); border: 1px solid var(--wpx-line); }
.wpx-badge--review { background: #ecfdf3; color: #067647; border-color: #abefc6; }
.wpx-fresh { display: inline-block; font-size: .7rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: #ecfdf3; color: #067647; vertical-align: 1px; }
.wpx-count { display: inline-block; min-width: 1.6em; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--wpx-soft); font-size: .75rem; text-align: center; color: var(--wpx-muted); }
.wpx-type { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .72rem; font-weight: 700; font-family: var(--wpx-mono); }
.wpx-type--action { background: #e0f2fe; color: #075985; }
.wpx-type--filter { background: #f3e8ff; color: #6b21a8; }

/* Stars */
.wpx-stars { position: relative; display: inline-block; width: 76px; height: 14px; vertical-align: -1px; background: #e2e8f0; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 15'%3E%3Cg%3E%3Cpath id='s' d='M7.5 0l2.2 4.8 5.3.6-3.9 3.6 1.1 5.2-4.7-2.7-4.7 2.7 1.1-5.2L0 5.4l5.3-.6z'/%3E%3Cuse href='%23s' x='16'/%3E%3Cuse href='%23s' x='32'/%3E%3Cuse href='%23s' x='48'/%3E%3Cuse href='%23s' x='64'/%3E%3C/g%3E%3C/svg%3E") 0 0/76px 14px; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 15'%3E%3Cg%3E%3Cpath id='s' d='M7.5 0l2.2 4.8 5.3.6-3.9 3.6 1.1 5.2-4.7-2.7-4.7 2.7 1.1-5.2L0 5.4l5.3-.6z'/%3E%3Cuse href='%23s' x='16'/%3E%3Cuse href='%23s' x='32'/%3E%3Cuse href='%23s' x='48'/%3E%3Cuse href='%23s' x='64'/%3E%3C/g%3E%3C/svg%3E") 0 0/76px 14px; }
.wpx-stars > span { position: absolute; inset: 0 auto 0 0; background: #f59e0b; }

/* Icons */
.wpx-icon { flex: none; border-radius: 12px; object-fit: cover; background: var(--wpx-soft); border: 1px solid var(--wpx-line); }
.wpx-icon--letter { display: inline-flex; align-items: center; justify-content: center; font-weight: 750; font-size: 1.4rem; color: var(--wpx-accent); background: var(--wpx-accent-soft); }

/* ---------- Hero (hub + listings) ---------- */
.wpx-hero { background: linear-gradient(180deg, var(--wpx-accent-soft) 0%, var(--wpx-bg) 100%); border-bottom: 1px solid var(--wpx-line); padding: 28px 0 40px; margin-bottom: 36px; }
.wpx-hero h1 { font-size: clamp(2rem, 4.6vw, 3.25rem); margin: .25rem 0 .75rem; max-width: 18ch; letter-spacing: -0.035em; }
.wpx-hero__lede { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--wpx-ink-2); max-width: 62ch; margin-bottom: 1.5rem; }
.wpx-hero--compact { padding-bottom: 28px; }
.wpx-hero--compact h1 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); max-width: none; margin: 0; }
.wpx-hero__cat { display: flex; align-items: center; gap: 14px; margin-bottom: .5rem; }

.wpx-bigsearch { position: relative; display: flex; max-width: 720px; background: var(--wpx-bg); border: 1px solid var(--wpx-line); border-radius: 14px; box-shadow: var(--wpx-shadow); padding: 6px; }
.wpx-bigsearch__icon { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); color: var(--wpx-muted); }
.wpx-bigsearch input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 12px 12px 12px 46px; font: inherit; font-size: 1.05rem; color: var(--wpx-ink); outline: none; }
.wpx-bigsearch button { border: 0; border-radius: 10px; background: var(--wpx-accent); color: #fff; font: inherit; font-weight: 650; padding: 0 22px; cursor: pointer; }
.wpx-quick { margin: 12px 0 0; font-size: .9rem; color: var(--wpx-muted); }
.wpx-quick a { display: inline-block; margin: 2px 4px 2px 0; padding: 2px 10px; border-radius: 999px; background: var(--wpx-bg); border: 1px solid var(--wpx-line); color: var(--wpx-ink-2); font-size: .85rem; }

.wpx-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 28px 0 0; max-width: 820px; }
.wpx-stats div { display: flex; flex-direction: column-reverse; }
.wpx-stats dt { font-size: .85rem; color: var(--wpx-muted); }
.wpx-stats dd { margin: 0; font-size: 1.6rem; font-weight: 750; letter-spacing: -0.02em; }

/* Section blocks */
.wpx-block { margin: 0 0 56px; }
.wpx-block__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 1rem; }
.wpx-block__head h2 { margin: 0; }
.wpx-block__head a { font-weight: 600; font-size: .95rem; white-space: nowrap; }
.wpx-block__sub { color: var(--wpx-muted); margin-top: -.5rem; }

/* Category tiles */
.wpx-cats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.wpx-cats a { display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--wpx-line); border-radius: var(--wpx-radius); background: var(--wpx-bg); color: var(--wpx-ink) !important; text-decoration: none !important; transition: border-color .15s, box-shadow .15s, transform .15s; }
.wpx-cats a:hover { border-color: #cbd5e1; box-shadow: var(--wpx-shadow); transform: translateY(-1px); }
.wpx-cats__icon { grid-row: span 2; width: 44px; height: 44px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.wpx-cats__name { font-weight: 650; line-height: 1.25; }
.wpx-cats__count { font-size: .8rem; color: var(--wpx-muted); }
.wpx-tint-0 { background: #eef2ff; color: #4338ca; } .wpx-tint-1 { background: #ecfdf3; color: #067647; }
.wpx-tint-2 { background: #fff7ed; color: #c2410c; } .wpx-tint-3 { background: #fdf2f8; color: #be185d; }
.wpx-tint-4 { background: #f0f9ff; color: #0369a1; } .wpx-tint-5 { background: #fefce8; color: #a16207; }
.wpx-tint-6 { background: #f5f3ff; color: #6d28d9; } .wpx-tint-7 { background: #f1f5f9; color: #334155; }

/* Plugin cards */
.wpx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.wpx-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 18px; border: 1px solid var(--wpx-line); border-radius: var(--wpx-radius); background: var(--wpx-bg); transition: border-color .15s, box-shadow .15s; }
.wpx-card:hover { border-color: #cbd5e1; box-shadow: var(--wpx-shadow); }
.wpx-card__head { display: flex; gap: 12px; align-items: center; }
.wpx-card__title { font-size: 1rem !important; margin: 0 0 2px !important; line-height: 1.3; }
.wpx-card__title a { color: var(--wpx-ink) !important; text-decoration: none !important; }
.wpx-card__title a::after { content: ""; position: absolute; inset: 0; border-radius: var(--wpx-radius); } /* whole card clickable */
.wpx-card__rating { margin: 0; font-size: .8rem; color: var(--wpx-muted); display: flex; gap: 6px; align-items: center; }
.wpx-card__desc { margin: 0; font-size: .9rem; color: var(--wpx-ink-2); flex: 1; }
.wpx-card__foot { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: .8rem; color: var(--wpx-muted); }

/* Review / tutorial cards */
.wpx-reviews { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.wpx-rcard { position: relative; display: flex; flex-direction: column; padding: 20px; border: 1px solid var(--wpx-line); border-radius: var(--wpx-radius); background: var(--wpx-bg); transition: border-color .15s, box-shadow .15s; }
.wpx-rcard:hover { border-color: #cbd5e1; box-shadow: var(--wpx-shadow); }
.wpx-rcard__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.wpx-rcard__title { font-size: 1.15rem !important; margin: 0 0 6px !important; }
.wpx-rcard__title a { color: var(--wpx-ink) !important; text-decoration: none !important; }
.wpx-rcard__title a::after { content: ""; position: absolute; inset: 0; }
.wpx-rcard__text { color: var(--wpx-ink-2); font-size: .93rem; flex: 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.wpx-rcard__meta { margin: 0; display: flex; gap: 12px; font-size: .8rem; color: var(--wpx-muted); }

/* CTA band */
.wpx-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 28px; border-radius: 16px; background: var(--wpx-ink); color: #fff; margin: 0 0 56px; }
.wpx-cta h2 { color: #fff; margin: 0 0 4px; }
.wpx-cta p { margin: 0; color: #cbd5e1; }

/* Listing filters */
.wpx-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 20px; }
.wpx-filters input[type="search"] { flex: 1 1 260px; min-width: 0; padding: 10px 14px; border: 1px solid var(--wpx-line); border-radius: var(--wpx-radius-sm); font: inherit; background: var(--wpx-bg); }
.wpx-filters select { padding: 10px; border: 1px solid var(--wpx-line); border-radius: var(--wpx-radius-sm); font: inherit; background: var(--wpx-bg); }
.wpx-check { display: inline-flex; gap: 6px; align-items: center; font-size: .95rem; }
.wpx-resultcount { margin-bottom: 12px; }
.wpx-empty { padding: 40px; text-align: center; border: 1px dashed var(--wpx-line); border-radius: var(--wpx-radius); }
.wpx-pagination { margin: 32px 0 56px; display: flex; flex-wrap: wrap; gap: 6px; }
.wpx-pagination .page-numbers { padding: 8px 14px; border: 1px solid var(--wpx-line); border-radius: var(--wpx-radius-sm); color: var(--wpx-ink); text-decoration: none; }
.wpx-pagination .current { background: var(--wpx-ink); color: #fff; border-color: var(--wpx-ink); }

/* ---------- Doc pages (plugin + hooks) ---------- */
.wpx-doc { padding-top: 24px; }
.wpx-head { padding-bottom: 0; border-bottom: 1px solid var(--wpx-line); margin-bottom: 32px; }
.wpx-head__row { display: flex; gap: 20px; align-items: flex-start; }
.wpx-head__text { min-width: 0; }
.wpx-head__title { font-size: clamp(1.8rem, 3.8vw, 2.7rem) !important; margin: .2rem 0 .5rem !important; letter-spacing: -0.03em; }
.wpx-head__lede { font-size: 1.15rem; color: var(--wpx-ink-2); max-width: 65ch; margin-bottom: .75rem; }
.wpx-meta { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 0; font-size: .9rem; color: var(--wpx-muted); }
.wpx-meta li + li::before { content: "·"; margin: 0 10px; }
.wpx-tabs { display: flex; gap: 4px; overflow-x: auto; margin-bottom: -1px; }
.wpx-tabs a { padding: 10px 14px; border-bottom: 2px solid transparent; color: var(--wpx-muted) !important; font-weight: 600; white-space: nowrap; text-decoration: none !important; }
.wpx-tabs a:hover { color: var(--wpx-ink) !important; }
.wpx-tabs a[aria-current="page"] { color: var(--wpx-ink) !important; border-bottom-color: var(--wpx-accent); }

.wpx-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 56px; align-items: start; margin-bottom: 56px; }
.wpx-main { min-width: 0; max-width: 760px; }
.wpx-section { padding: 0 0 36px; margin: 0 0 36px; border-bottom: 1px solid var(--wpx-line); scroll-margin-top: 90px; }
.wpx-section:last-of-type { border-bottom: 0; }
.wpx-lede { font-size: 1.15rem; color: var(--wpx-ink-2); }

/* Sidebar */
.wpx-aside__inner { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 20px; max-height: calc(100vh - 48px); overflow-y: auto; }
.admin-bar .wpx-aside__inner { top: 56px; }
.wpx-info { display: flex; flex-direction: column; gap: 14px; padding: 18px; border: 1px solid var(--wpx-line); border-radius: var(--wpx-radius); background: var(--wpx-bg); }
.wpx-info__list { margin: 0; display: flex; flex-direction: column; }
.wpx-info__list div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--wpx-line); font-size: .88rem; }
.wpx-info__list div:last-child { border-bottom: 0; }
.wpx-info__list dt { color: var(--wpx-muted); }
.wpx-info__list dd { margin: 0; font-weight: 600; text-align: right; }
.wpx-toc { padding-left: 2px; }
.wpx-toc__title { font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--wpx-muted); margin: 0 0 8px; }
.wpx-toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--wpx-line); }
.wpx-toc li a { display: block; padding: 5px 0 5px 14px; margin-left: -1px; border-left: 2px solid transparent; font-size: .88rem; line-height: 1.35; color: var(--wpx-muted) !important; text-decoration: none !important; }
.wpx-toc li a:hover { color: var(--wpx-ink) !important; border-left-color: #cbd5e1; }
.wpx-toc li a.is-active { color: var(--wpx-accent) !important; border-left-color: var(--wpx-accent); font-weight: 600; }
.wpx-toc__l3 a { padding-left: 26px !important; font-size: .84rem !important; }

/* Long-form reading */
.wpx-prose { font-size: 1.0625rem; line-height: 1.75; color: var(--wpx-ink-2); }
.wpx-prose > * + * { margin-top: 1.1em; }
.wpx-prose h2 { font-size: 1.6rem; margin: 2.2em 0 .6em; color: var(--wpx-ink); scroll-margin-top: 90px; }
.wpx-prose h3 { font-size: 1.25rem; margin: 1.8em 0 .5em; color: var(--wpx-ink); scroll-margin-top: 90px; }
.wpx-prose h4 { font-size: 1.05rem; margin: 1.5em 0 .4em; color: var(--wpx-ink); }
.wpx-prose > :first-child { margin-top: 0; }
.wpx-prose p, .wpx-prose ul, .wpx-prose ol { margin-bottom: 0; }
.wpx-prose ul, .wpx-prose ol { padding-left: 1.4em; }
.wpx-prose li + li { margin-top: .35em; }
.wpx-prose li::marker { color: var(--wpx-muted); }
.wpx-prose strong { color: var(--wpx-ink); }
.wpx-prose img { max-width: 100%; height: auto; border-radius: var(--wpx-radius-sm); }
.wpx-prose blockquote { margin-left: 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--wpx-accent); color: var(--wpx-ink); font-style: italic; }
.wpx-prose table { width: 100%; border-collapse: collapse; font-size: .95rem; display: block; overflow-x: auto; }
.wpx-prose th, .wpx-prose td { padding: 8px 12px; border: 1px solid var(--wpx-line); text-align: left; }
.wpx-prose th { background: var(--wpx-soft); color: var(--wpx-ink); }
.wpx-prose hr, .wpx-prose .wp-block-separator { border: 0; border-top: 1px solid var(--wpx-line); margin: 2em 0; }
.wpx-prose :not(pre) > code, .wpx-callout code, .wpx-hook__desc code { padding: .15em .4em; border-radius: 5px; background: var(--wpx-soft); border: 1px solid var(--wpx-line); color: var(--wpx-ink); }
.wpx-prose .wp-block-button__link { display: inline-block; padding: 10px 18px; border-radius: var(--wpx-radius-sm); background: var(--wpx-accent); color: #fff; text-decoration: none; font-weight: 600; }
.wpx pre { margin: 0; background: var(--wpx-code-bg); color: #e2e8f0; padding: 14px 16px; border-radius: var(--wpx-radius-sm); overflow-x: auto; font-family: var(--wpx-mono); font-size: .86rem; line-height: 1.6; white-space: pre; tab-size: 4; }
.wpx pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }

/* Steps */
.wpx-steps { list-style: none; counter-reset: step; margin: 0 0 1rem; padding: 0; }
.wpx-steps li { counter-increment: step; position: relative; padding: 2px 0 18px 48px; color: var(--wpx-ink-2); }
.wpx-steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--wpx-accent-soft); color: var(--wpx-accent); font-weight: 750; display: flex; align-items: center; justify-content: center; font-size: .9rem; }
.wpx-steps li:not(:last-child)::after { content: ""; position: absolute; left: 15px; top: 36px; bottom: 4px; width: 2px; background: var(--wpx-line); }
.wpx-steps strong { display: block; color: var(--wpx-ink); }

/* Callouts + details */
.wpx-callout { padding: 14px 16px; border-radius: var(--wpx-radius-sm); background: var(--wpx-accent-soft); border: 1px solid #c7d2fe; color: var(--wpx-ink); margin: 0 0 1.25rem; font-size: .95rem; }
.wpx-callout--warn { background: #fffbeb; border-color: #fde68a; }
.wpx-callout--danger { background: #fef2f2; border-color: #fecaca; }
.wpx-details { margin: 0 0 1rem; border: 1px solid var(--wpx-line); border-radius: var(--wpx-radius-sm); padding: 0 16px; background: var(--wpx-bg); }
.wpx-details[open] { padding-bottom: 14px; }
.wpx-details summary { cursor: pointer; font-weight: 600; padding: 12px 0; list-style-position: inside; }
.wpx-details summary .wpx-muted { font-weight: 400; }

/* Hooks */
.wpx-codepair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 1rem; }
.wpx-hooks-tools { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 0; background: var(--wpx-bg); border-bottom: 1px solid var(--wpx-line); margin-bottom: 8px; }
.admin-bar .wpx-hooks-tools { top: 32px; }
.wpx-hooks-tools input[type="search"] { flex: 1 1 260px; min-width: 0; padding: 10px 14px; border: 1px solid var(--wpx-line); border-radius: var(--wpx-radius-sm); font: inherit; }
.wpx-seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--wpx-soft); border: 1px solid var(--wpx-line); }
.wpx-seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; cursor: pointer; font: inherit; font-size: .875rem; font-weight: 600; color: var(--wpx-muted); }
.wpx-seg button.is-active { background: var(--wpx-bg); color: var(--wpx-ink); box-shadow: 0 1px 2px rgba(15, 23, 42, .08); }
.wpx-hooklist { list-style: none; margin: 8px 0 1rem; padding: 0; display: flex; flex-direction: column; gap: 22px; }
.wpx-hook { scroll-margin-top: 140px; }
.wpx-hook__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.wpx-hook__name { margin: 0 !important; font-family: var(--wpx-mono) !important; font-size: .95rem !important; font-weight: 650 !important; letter-spacing: 0 !important; word-break: break-word; }
.wpx-hook__name a { color: var(--wpx-ink) !important; text-decoration: none !important; }
.wpx-hook__name a::before { content: "#"; color: var(--wpx-line); margin-right: 6px; transition: color .15s; }
.wpx-hook__name a:hover::before, .wpx-hook:target .wpx-hook__name a::before { color: var(--wpx-accent); }
.wpx-hook:target .wpx-editor--hook { box-shadow: 0 0 0 2px var(--wpx-accent), 0 8px 30px rgba(79, 70, 229, .25); }
.wpx-hook .wpx-editor--example { margin-top: 10px; }

/* ---------- Code editor windows ---------- */
.wpx-editor {
	--ed-bg: #0d1117; --ed-bar: #161b22; --ed-line: #21262d; --ed-text: #c9d1d9; --ed-dim: #6e7681;
	position: relative; margin: 0 0 1.25rem; background: var(--ed-bg); border: 1px solid #30363d; border-radius: 12px; overflow: hidden;
	box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 10px 30px rgba(15, 23, 42, .12);
}
.wpx-hooklist .wpx-editor { margin: 0; }
.wpx-editor__bar { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 10px 0 12px; background: var(--ed-bar); border-bottom: 1px solid var(--ed-line); font-family: var(--wpx-mono); font-size: .75rem; color: #8b949e; }
.wpx-editor__dots { display: inline-flex; gap: 6px; margin-right: 4px; }
.wpx-editor__dots i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.wpx-editor__dots i:nth-child(2) { background: #febc2e; }
.wpx-editor__dots i:nth-child(3) { background: #28c840; }
.wpx-editor__tab { display: inline-flex; align-items: center; gap: 7px; align-self: stretch; padding: 0 12px; margin-bottom: -1px; background: var(--ed-bg); border: 1px solid var(--ed-line); border-bottom-color: var(--ed-bg); border-top: 2px solid #f78166; border-radius: 6px 6px 0 0; color: var(--ed-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%; }
.wpx-editor--hook .wpx-editor__tab { border-top-color: #58a6ff; }
.wpx-editor__php { display: inline-block; padding: 0 4px; border-radius: 3px; background: #7a86b8; color: #0d1117; font-size: .62rem; font-weight: 800; line-height: 1.5; text-transform: uppercase; }
.wpx-editor__meta { color: var(--ed-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wpx-editor__copy, .wpx-ex-btn { margin-left: auto; flex: none; border: 1px solid #30363d; background: #21262d; color: var(--ed-text); border-radius: 6px; font-family: var(--wpx-mono); font-size: .72rem; padding: 3px 10px; cursor: pointer; transition: background .15s, border-color .15s; }
.wpx-editor__copy:hover, .wpx-ex-btn:hover { background: #30363d; border-color: #8b949e; }
.wpx-ex-btn[aria-expanded="true"] { background: #1f6feb; border-color: #1f6feb; color: #fff; }

.wpx .wpx-code { margin: 0; padding: 14px 0; background: transparent; color: var(--ed-text); border-radius: 0; font-family: var(--wpx-mono); font-size: .84rem; line-height: 1.7; white-space: pre; overflow-x: auto; tab-size: 4; }
.wpx .wpx-code code { display: block; min-width: max-content; padding: 0 18px; font-size: inherit; color: inherit; background: none; border: 0; }
.wpx-code .ln { display: block; padding-right: 18px; }
.wpx-code .ln::before { content: attr(data-n); display: inline-block; width: 2.6em; margin-left: -6px; margin-right: 18px; text-align: right; color: #484f58; user-select: none; -webkit-user-select: none; }
.wpx .wpx-code:has(.ln) code { padding-left: 0; }
.wpx-code .ln:hover { background: rgba(110, 118, 129, .1); }

/* Syntax colours (GitHub Dark) */
.t-com { color: #8b949e; font-style: italic; }
.t-str { color: #a5d6ff; }
.t-hook { color: #7ee787; }
.t-interp { color: #ffa657; }
.t-var { color: #ffa657; }
.t-kw { color: #ff7b72; }
.t-fn { color: #d2a8ff; }
.t-num { color: #79c0ff; }
.t-op { color: #ff7b72; }
.t-pun { color: #8b949e; }

/* Typing caret */
.wpx-caret { display: inline-block; width: 8px; height: 1.15em; margin-left: 1px; vertical-align: text-bottom; background: #58a6ff; animation: wpx-blink 1s steps(1) infinite; }
@keyframes wpx-blink { 50% { opacity: 0; } }

/* Terminal one-liner */
.wpx-terminal { display: flex; align-items: center; gap: 10px; padding: 12px 16px; margin: .5rem 0 1rem; background: #0d1117; border: 1px solid #30363d; border-radius: 10px; color: #c9d1d9; font-family: var(--wpx-mono); font-size: .86rem; overflow-x: auto; white-space: nowrap; }
.wpx-terminal code { background: none !important; border: 0 !important; color: inherit !important; padding: 0 !important; }
.wpx-terminal__prompt { color: #7ee787; font-weight: 700; user-select: none; }
.wpx-change-label { font-weight: 650; margin: 10px 0 6px; }
.wpx-change-list { list-style: none; margin: 0; padding: 0; columns: 2 260px; }
.wpx-change-list li { margin: 0 0 6px; break-inside: avoid; font-size: .9rem; }
.wpx-change-list--removed code { text-decoration: line-through; color: var(--wpx-muted); }

/* Request form */
.wpx-request { background: var(--wpx-soft); padding: 28px !important; border-radius: var(--wpx-radius); border: 1px solid var(--wpx-line) !important; }
.wpx-form label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 6px; color: var(--wpx-ink); }
.wpx-form input[type="text"], .wpx-form input[type="email"], .wpx-form input[type="url"], .wpx-form select, .wpx-form textarea { width: 100%; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: var(--wpx-radius-sm); background: var(--wpx-bg); font: inherit; color: var(--wpx-ink); box-sizing: border-box; }
.wpx-form input[readonly] { background: var(--wpx-soft); color: var(--wpx-muted); }
.wpx-form p { margin: 0 0 14px; }
.wpx-form__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.wpx-consent { display: flex; gap: 10px; align-items: flex-start; }
.wpx-consent input { margin-top: 5px; }
.wpx-consent label { font-weight: 400; color: var(--wpx-ink-2); }
.wpx-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.wpx-notice { padding: 12px 16px; border-radius: var(--wpx-radius-sm); margin: 0 0 16px; border: 1px solid; }
.wpx-notice--ok { background: #ecfdf3; border-color: #abefc6; color: #054f31; }
.wpx-notice--err { background: #fef2f2; border-color: #fecaca; color: #7f1d1d; }
.wpx-form .wpx-btn--primary, .wpx-form button[type="submit"] { padding: 12px 22px; border-radius: var(--wpx-radius-sm); border: 0; background: var(--wpx-accent); color: #fff; font: inherit; font-weight: 650; cursor: pointer; }

.wpx-disclaimer { font-size: .8rem; color: var(--wpx-muted); margin: 0; }
.wpx-comments { max-width: 760px; margin-bottom: 56px; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
	.wpx-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
	.wpx-aside { order: -1; }
	.wpx-aside__inner { position: static; max-height: none; }
	.wpx-toc { display: none; }
	.wpx-main { max-width: none; }
}
@media (max-width: 640px) {
	.wpx-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.wpx-head__row { flex-direction: column; gap: 12px; }
	.wpx-head__row .wpx-icon { width: 56px; height: 56px; }
	.wpx-editor__dots { display: none; }
	.wpx-editor__tab { max-width: 55%; }
	.wpx .wpx-code { font-size: .78rem; }
	.wpx-code .ln::before { width: 2em; margin-right: 12px; }
	.wpx-bigsearch button { padding: 0 14px; }
	.wpx-bigsearch input { font-size: 1rem; padding-left: 40px; }
	.wpx-bigsearch__icon { left: 16px; }
	.wpx-request { padding: 18px !important; }
	.wpx-block__head { flex-direction: column; gap: 4px; }
	.wpx-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
	.wpx-cats a { grid-template-columns: 1fr; padding: 12px; row-gap: 6px; }
	.wpx-cats__icon { grid-row: auto; width: 34px; height: 34px; }
	.wpx-cats__icon svg { width: 18px; height: 18px; }
	.wpx-cats__name { font-size: .9rem; }
	.admin-bar .wpx-hooks-tools { top: 0; }
}
@media (prefers-reduced-motion: reduce) {
	.wpx * { transition: none !important; }
	.wpx-caret { animation: none; }
}
