/*
	Discord Status Badges — standalone page styling.

	Deliberately does NOT build on discord_formats/discord_limits: this page is
	a product page (try it, copy a URL) rather than a reference table, so it
	uses its own layout. Only the shared design tokens from main.css are reused
	so light/dark and the theme picker keep working.
*/

.badges-page {
	--bp-blurple: #5865f2;
	--bp-surface: light-dark(rgba(255, 255, 255, 0.72), rgba(20, 22, 40, 0.66));
	--bp-surface-strong: light-dark(rgba(255, 255, 255, 0.9), rgba(26, 29, 51, 0.85));
	--bp-border: light-dark(rgba(24, 26, 54, 0.12), rgba(255, 255, 255, 0.12));
	--bp-border-strong: light-dark(rgba(24, 26, 54, 0.2), rgba(255, 255, 255, 0.2));
	--bp-muted: color-mix(in srgb, var(--text-color) 62%, transparent);
	--bp-radius: 18px;
}

.badges-shell {
	width: min(1600px, 100% - clamp(1.5rem, 5vw, 4rem));
	margin-inline: auto;
	padding-block: clamp(2rem, 6vw, 4rem) 5rem;
	display: flex;
	flex-direction: column;
	gap: clamp(1.75rem, 4vw, 2.75rem);
	/* Long URLs and badge rows must scroll inside their own containers rather
	   than pushing the page sideways. */
	min-width: 0;
	overflow-x: clip;
}

/* ---------------------------------------------------------------- hero --- */

.bp-hero {
	display: grid;
	gap: var(--space-7);
	max-width: 46rem;
}

.bp-hero h1 {
	margin: 0;
	font-size: clamp(2rem, 5.5vw, 3.1rem);
	line-height: 1.1;
	letter-spacing: -0.02em;
}

.bp-hero p {
	margin: 0;
	max-width: 38rem;
	color: var(--bp-muted);
	font-size: clamp(1rem, 1.6vw, 1.1rem);
	line-height: 1.65;
}

/*
	Row of live badges under the hero — the page's own proof it works. Sits on
	its own tinted plate so the badges read as a specimen rather than as
	stray images floating on the page background.
*/
.bp-hero-strip {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-5) var(--space-6);
	align-items: center;
	width: fit-content;
	max-width: 100%;
	margin-top: var(--space-2);
	padding: var(--space-7) var(--space-8);
	border: 1px solid var(--bp-border);
	border-radius: 14px;
	background: var(--bp-surface);
	backdrop-filter: blur(10px);
}

.bp-refresh-all {
	display: inline-flex;
	align-items: center;
	gap: var(--space-3);
	flex: 0 0 auto;
	padding: var(--space-5) var(--space-7);
	color: var(--text-color);
	background: var(--bp-surface-strong);
	border: 1px solid var(--bp-border-strong);
	border-radius: 12px;
	font: inherit;
	font-size: 0.85rem;
	font-weight: 700;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.bp-refresh-all:hover {
	border-color: color-mix(in srgb, var(--bp-blurple) 45%, transparent);
	background: color-mix(in srgb, var(--bp-blurple) 10%, var(--bp-surface-strong));
}

.bp-refresh-all i {
	transition: transform 0.5s ease;
}

.bp-refresh-all--spin i {
	transform: rotate(360deg);
}

.bp-hero-strip img {
	height: 1.4rem;
	width: auto;
}

/* ------------------------------------------------------------- steps --- */

.bp-steps {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
	gap: var(--space-7);
	padding: 0;
	margin: 0;
	list-style: none;
	counter-reset: bp-step;
}

.bp-step {
	position: relative;
	display: grid;
	gap: var(--space-4);
	align-content: start;
	padding: var(--space-10) var(--space-9);
	background: var(--bp-surface);
	border: 1px solid var(--bp-border);
	border-radius: var(--bp-radius);
	backdrop-filter: blur(10px);
}

.bp-step::before {
	counter-increment: bp-step;
	content: counter(bp-step);
	display: grid;
	place-items: center;
	width: 1.9rem;
	height: 1.9rem;
	border-radius: 50%;
	background: color-mix(in srgb, var(--bp-blurple) 18%, transparent);
	border: 1px solid color-mix(in srgb, var(--bp-blurple) 42%, transparent);
	color: color-mix(in srgb, var(--bp-blurple) 78%, var(--text-color));
	font-size: 0.85rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.bp-step h2 {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 700;
}

.bp-step__label {
	position: absolute;
	top: var(--space-10);
	right: var(--space-9);
	color: var(--bp-muted);
	font-size: 0.68rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.bp-step p {
	margin: 0;
	color: var(--bp-muted);
	font-size: 0.93rem;
	line-height: 1.6;
}

/* The invite is the one true prerequisite, so its step is accented. */
.bp-step--invite {
	border-color: color-mix(in srgb, var(--bp-blurple) 38%, transparent);
	background:
		linear-gradient(180deg, color-mix(in srgb, var(--bp-blurple) 10%, transparent), transparent 60%),
		var(--bp-surface);
}

.bp-invite-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-3);
	justify-self: start;
	margin-top: var(--space-2);
	padding: var(--space-5) var(--space-8);
	border: none;
	border-radius: 12px;
	background: var(--bp-blurple);
	color: #fff;
	font-weight: 700;
	font-size: 0.95rem;
	text-decoration: none;
	transition: background 0.15s ease, transform 0.15s ease;
}

.bp-invite-button:hover {
	background: color-mix(in srgb, var(--bp-blurple) 84%, #000);
	transform: translateY(-1px);
}

.bp-invite-button[hidden] {
	display: none;
}

.bp-invite-button i {
	font-size: 1em;
}

/* The manual invite when it stands alone — same weight, outlined. */
.bp-invite-button--alt {
	background: color-mix(in srgb, var(--bp-blurple) 14%, transparent);
	border: 1px solid color-mix(in srgb, var(--bp-blurple) 45%, transparent);
	color: var(--text-color);
}

.bp-invite-button--alt:hover {
	background: color-mix(in srgb, var(--bp-blurple) 26%, transparent);
}

/*
	Opt-in switch for the automatic server join. Ticked by default because it
	is the path that actually makes the badges work; unticking downgrades the
	button to a plain sign-in.
*/
.bp-toggle {
	display: flex;
	align-items: flex-start;
	gap: var(--space-5);
	margin-top: var(--space-2);
	padding: var(--space-6) var(--space-7);
	border: 1px solid color-mix(in srgb, var(--bp-blurple) 30%, transparent);
	border-radius: 12px;
	background: color-mix(in srgb, var(--bp-blurple) 8%, transparent);
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.bp-primary-action {
	display: grid;
	gap: var(--space-4);
	padding: var(--space-4);
	border: 1px solid color-mix(in srgb, var(--bp-blurple) 34%, transparent);
	border-radius: 15px;
	background: color-mix(in srgb, var(--bp-blurple) 6%, transparent);
}

.bp-primary-action .bp-toggle {
	margin: 0;
	padding: var(--space-4);
	border: 0;
	background: transparent;
}

.bp-primary-action .bp-invite-button {
	justify-self: stretch;
	margin: 0;
}

.bp-toggle:hover {
	border-color: color-mix(in srgb, var(--bp-blurple) 46%, transparent);
}

/* The native control stays focusable but the track/thumb are what show. */
.bp-toggle input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}

.bp-toggle__track {
	position: relative;
	flex: 0 0 auto;
	width: 2.35rem;
	height: 1.35rem;
	margin-top: 0.1rem;
	border-radius: 999px;
	background: color-mix(in srgb, var(--text-color) 26%, transparent);
	transition: background 0.18s ease;
}

.bp-toggle__thumb {
	position: absolute;
	top: 0.19rem;
	left: 0.19rem;
	width: 0.97rem;
	height: 0.97rem;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
	transition: transform 0.18s ease;
}

.bp-toggle input:checked + .bp-toggle__track {
	background: var(--bp-blurple);
}

.bp-toggle input:checked + .bp-toggle__track .bp-toggle__thumb {
	transform: translateX(1rem);
}

.bp-toggle input:focus-visible + .bp-toggle__track {
	outline: 2px solid color-mix(in srgb, var(--bp-blurple) 65%, transparent);
	outline-offset: 2px;
}

.bp-toggle__copy {
	display: grid;
	gap: 2px;
	min-width: 0;
}

.bp-toggle__copy strong {
	font-size: 0.9rem;
	font-weight: 700;
}

.bp-toggle__copy small {
	color: var(--bp-muted);
	font-size: 0.8rem;
	line-height: 1.5;
}

/*
	Manual alternatives to the one-click join. Collapsed by default so step 1
	presents a single recommended action instead of a stack of links.
*/
.bp-alts {
	margin-top: var(--space-2);
}

.bp-alts summary {
	display: inline-flex;
	align-items: center;
	gap: var(--space-3);
	color: var(--bp-muted);
	font-size: 0.85rem;
	font-weight: 700;
	cursor: pointer;
	list-style: none;
	user-select: none;
}

.bp-alts summary::-webkit-details-marker {
	display: none;
}

.bp-alts summary::before {
	content: "\f105";
	font-family: "Font Awesome 6 Free";
	font-weight: 900;
	transition: transform 0.15s ease;
}

.bp-alts summary > i {
	display: grid;
	place-items: center;
	width: 1.7rem;
	height: 1.7rem;
	border-radius: 8px;
	background: var(--bp-surface-strong);
	font-size: 0.75rem;
}

.bp-alts[open] summary::before {
	transform: rotate(90deg);
}

.bp-alts summary:hover {
	color: var(--text-color);
}

.bp-alts__list {
	display: grid;
	gap: var(--space-4);
	margin-top: var(--space-5);
}

.bp-alts__item {
	display: flex;
	align-items: flex-start;
	gap: var(--space-5);
	padding: var(--space-6) var(--space-7);
	border: 1px solid var(--bp-border);
	border-radius: 12px;
	background: var(--bp-surface-strong);
	color: var(--text-color);
	text-decoration: none;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.bp-alts__item:hover {
	border-color: color-mix(in srgb, var(--bp-blurple) 45%, transparent);
	background: color-mix(in srgb, var(--bp-blurple) 10%, var(--bp-surface-strong));
}

.bp-alts__item > i {
	flex: 0 0 auto;
	margin-top: 0.15em;
	color: color-mix(in srgb, var(--bp-blurple) 72%, var(--text-color));
}

.bp-alts__item span {
	display: grid;
	gap: 2px;
	min-width: 0;
}

.bp-alts__item strong {
	font-size: 0.9rem;
	font-weight: 700;
}

.bp-alts__item small {
	color: var(--bp-muted);
	font-size: 0.8rem;
	line-height: 1.5;
}

/* Signed in with the join unticked — the button has nothing left to do. */
.bp-is-disabled {
	opacity: 0.5;
	pointer-events: none;
}

/* Secondary path — manual invite, always available. */
.bp-invite-link {
	display: inline-flex;
	align-items: center;
	gap: var(--space-3);
	margin-top: var(--space-2);
	color: var(--bp-muted);
	font-size: 0.85rem;
	font-weight: 700;
	text-decoration: none;
}

.bp-invite-link:hover {
	color: var(--text-color);
	text-decoration: underline;
}

/* Step 1 once the visitor already shares a server — nothing left to do. */
.bp-step--done {
	border-color: color-mix(in srgb, #3ba55d 42%, transparent);
	background:
		linear-gradient(180deg, color-mix(in srgb, #3ba55d 12%, transparent), transparent 60%),
		var(--bp-surface);
}

.bp-step--done::before {
	content: "\f00c";
	font-family: "Font Awesome 6 Free";
	font-weight: 900;
	background: color-mix(in srgb, #3ba55d 20%, transparent);
	border-color: color-mix(in srgb, #3ba55d 46%, transparent);
	color: light-dark(#1a7f4b, #6ee7a8);
}

.bp-status {
	display: inline-flex;
	align-items: center;
	gap: var(--space-3);
	margin: var(--space-2) 0 0;
	font-size: 0.88rem;
	font-weight: 700;
}

.bp-status--ok {
	color: light-dark(#1a7f4b, #6ee7a8);
}

/* Result of the opt-in join, shown after the redirect back. */
.bp-banner {
	display: flex;
	align-items: center;
	gap: var(--space-5);
	margin: 0;
	padding: var(--space-7) var(--space-8);
	border-radius: 14px;
	border: 1px solid var(--bp-border-strong);
	background: var(--bp-surface);
	font-size: 0.92rem;
	line-height: 1.55;
	backdrop-filter: blur(10px);
}

.bp-banner i {
	flex: 0 0 auto;
	font-size: 1.1rem;
}

.bp-banner--ok {
	border-color: color-mix(in srgb, #3ba55d 45%, transparent);
	background: color-mix(in srgb, #3ba55d 12%, var(--bp-surface));
}

.bp-banner--ok i {
	color: light-dark(#1a7f4b, #6ee7a8);
}

.bp-banner--error {
	border-color: color-mix(in srgb, #ed4245 45%, transparent);
	background: color-mix(in srgb, #ed4245 12%, var(--bp-surface));
}

.bp-banner--error i {
	color: light-dark(#c0292c, #ff8b8d);
}

/* Inline id form living inside step 2. */
.bp-id-form {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-3);
	margin-top: var(--space-2);
}

.bp-id-form input {
	flex: 1 1 11rem;
	min-width: 0;
	padding: var(--space-5) var(--space-6);
	color: var(--text-color);
	background: var(--bp-surface-strong);
	border: 1px solid var(--bp-border-strong);
	border-radius: 12px;
	font: inherit;
	font-size: 0.95rem;
	font-variant-numeric: tabular-nums;
}

.bp-id-form input:focus-visible {
	outline: 2px solid color-mix(in srgb, var(--bp-blurple) 65%, transparent);
	outline-offset: 1px;
}

.bp-id-form button {
	padding: var(--space-5) var(--space-8);
	color: var(--text-color);
	background: color-mix(in srgb, var(--bp-blurple) 16%, transparent);
	border: 1px solid color-mix(in srgb, var(--bp-blurple) 40%, transparent);
	border-radius: 12px;
	font: inherit;
	font-weight: 700;
	font-size: 0.95rem;
	cursor: pointer;
	transition: background 0.15s ease;
}

.bp-id-form button:hover {
	background: color-mix(in srgb, var(--bp-blurple) 28%, transparent);
}

.bp-id-note {
	margin: 0;
	font-size: 0.82rem;
	color: var(--bp-muted);
}

.bp-id-note code {
	font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------- badge cards --- */

.bp-section-title {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: var(--space-5);
	margin: 0 0 var(--space-3);
	font-size: 1.5rem;
	letter-spacing: -0.01em;
}

.bp-section-heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-5);
	margin-bottom: var(--space-3);
}

.bp-section-heading .bp-section-title {
	margin-bottom: 0;
}

.bp-section-title small {
	font-size: 0.9rem;
	font-weight: 400;
	color: var(--bp-muted);
}

/*
	Deliberately NOT subgrid. Sharing tracks would align the bands, but it
	also couples the cards' heights: expanding one card's options stretches
	the shared row and opens a matching gap in the untouched card beside it.
	Each card is independent, and the head band instead reserves a fixed
	min-height so the previews still line up across a row.
*/
.bp-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr));
	gap: var(--space-9);
	align-items: start;
}

.bp-card {
	display: flex;
	flex-direction: column;
	min-width: 0;
	background: var(--bp-surface);
	border: 1px solid var(--bp-border);
	border-radius: var(--bp-radius);
	overflow: hidden;
	backdrop-filter: blur(10px);
	scroll-margin-top: 5rem;
}

.bp-card__head {
	display: flex;
	align-items: flex-start;
	gap: var(--space-5);
	min-width: 0;
	padding: var(--space-9) var(--space-9) var(--space-5);
}

/*
	Reserves room for a two-line summary — the longest any badge has — so the
	previews line up across a row without coupling the cards' heights. Sits on
	the copy itself so a one-line summary doesn't pad out the whole band.
*/
.bp-card__head > div {
	min-width: 0;
	min-height: 4.5rem;
}

.bp-card__head i {
	flex: 0 0 auto;
	margin-top: 0.15em;
	font-size: 1.05rem;
	color: color-mix(in srgb, var(--bp-blurple) 72%, var(--text-color));
}

.bp-card__head h3 {
	margin: 0;
	font-size: 1.1rem;
	font-weight: 700;
}

.bp-card__head p {
	margin: var(--space-1) 0 0;
	color: var(--bp-muted);
	font-size: 0.9rem;
	line-height: 1.55;
}

/*
	Live preview. The checker pattern keeps a badge with transparent corners
	legible on either theme without needing a solid plate behind it.
*/
.bp-preview {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	/* Hug the badge instead of stretching the checkerboard across the card. */
	align-self: flex-start;
	width: calc(100% - var(--space-9) * 2);
	max-width: calc(100% - var(--space-9) * 2);
	margin-inline: var(--space-9);
	padding: var(--space-5) var(--space-6);
	border-radius: 12px;
	border: 1px solid var(--bp-border);
	background-color: light-dark(#f2f3f9, #0d0f1d);
	background-image:
		linear-gradient(45deg, var(--bp-border) 25%, transparent 25%),
		linear-gradient(-45deg, var(--bp-border) 25%, transparent 25%),
		linear-gradient(45deg, transparent 75%, var(--bp-border) 75%),
		linear-gradient(-45deg, transparent 75%, var(--bp-border) 75%);
	background-size: 14px 14px;
	background-position: 0 0, 0 7px, 7px -7px, -7px 0;
	overflow-x: auto;
}

.bp-preview img {
	height: 1.55rem;
	width: auto;
	max-width: none;
}

/*
	The card's last grid cell: URL row plus the (expandable) options panel.
	Keeping them in one cell means opening the options grows only this card,
	leaving the neighbouring card's shared subgrid tracks untouched.
*/
.bp-card__foot {
	min-width: 0;
	margin-top: auto;
	padding: var(--space-6) var(--space-9) var(--space-9);
}

/* URL + copy button. */
.bp-url {
	display: flex;
	align-items: stretch;
	gap: var(--space-3);
	min-width: 0;
}

.bp-url code {
	flex: 1 1 auto;
	min-width: 0;
	padding: var(--space-5) var(--space-6);
	border-radius: 10px;
	border: 1px solid var(--bp-border);
	background: light-dark(rgba(15, 18, 40, 0.05), rgba(0, 0, 0, 0.28));
	font-family: var(--codeblock-font-family);
	font-size: 0.8rem;
	line-height: 1.5;
	white-space: nowrap;
	overflow-x: auto;
	scrollbar-width: thin;
}

.bp-copy {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	padding: 0 var(--space-6);
	color: var(--text-color);
	background: var(--bp-surface-strong);
	border: 1px solid var(--bp-border-strong);
	border-radius: 10px;
	font: inherit;
	font-size: 0.8rem;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.bp-copy:hover {
	background: color-mix(in srgb, var(--bp-blurple) 20%, var(--bp-surface-strong));
}

.bp-copy[data-copied="true"] {
	color: light-dark(#1a7f4b, #6ee7a8);
	border-color: color-mix(in srgb, currentColor 45%, transparent);
}

/*
	Options are secondary — most people copy the URL and never touch them, so
	they collapse instead of pushing five tables into the page.
*/
.bp-options {
	min-width: 0;
	margin-top: var(--space-6);
	border-top: 1px solid var(--bp-border);
	padding-top: var(--space-5);
}

.bp-options summary {
	display: flex;
	align-items: center;
	gap: var(--space-3);
	color: var(--bp-muted);
	font-size: 0.85rem;
	font-weight: 700;
	cursor: pointer;
	list-style: none;
	user-select: none;
}

.bp-options summary::-webkit-details-marker {
	display: none;
}

.bp-options summary::before {
	content: "\f105";
	font-family: "Font Awesome 6 Free";
	font-weight: 900;
	transition: transform 0.15s ease;
}

.bp-options[open] summary::before {
	transform: rotate(90deg);
}

.bp-options summary:hover {
	color: var(--text-color);
}

/*
	Live controls rather than a read-only table — each row is a label plus the
	input that writes that query param onto the badge above.
*/
.bp-params {
	display: grid;
	gap: var(--space-5);
	margin-top: var(--space-6);
}

.bp-param {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 13rem);
	gap: var(--space-4) var(--space-6);
	align-items: center;
}

.bp-param label {
	display: grid;
	gap: 2px;
	min-width: 0;
	font-size: 0.82rem;
	cursor: pointer;
}

.bp-param label code {
	font-family: var(--codeblock-font-family);
	font-size: 0.78rem;
	font-weight: 700;
	color: color-mix(in srgb, var(--bp-blurple) 62%, var(--text-color));
}

.bp-param label > span {
	color: var(--bp-muted);
	line-height: 1.45;
}

.bp-param label code:only-child {
	font-size: 0.8rem;
}

.bp-param input[type="text"],
.bp-param select {
	min-width: 0;
	padding: var(--space-4) var(--space-5);
	color: var(--text-color);
	background: var(--bp-surface-strong);
	border: 1px solid var(--bp-border-strong);
	border-radius: 9px;
	font: inherit;
	font-size: 0.82rem;
}

.bp-param input[type="text"]:focus-visible,
.bp-param select:focus-visible {
	outline: 2px solid color-mix(in srgb, var(--bp-blurple) 60%, transparent);
	outline-offset: 1px;
}

.bp-param input[type="checkbox"] {
	justify-self: start;
	width: 1.15rem;
	height: 1.15rem;
	accent-color: var(--bp-blurple);
	cursor: pointer;
}

/* Free-text field beside a swatch: defaults aren't always hex. */
.bp-color {
	display: flex;
	gap: var(--space-3);
	min-width: 0;
}

.bp-color input[type="text"] {
	flex: 1 1 auto;
}

.bp-color input[type="color"] {
	flex: 0 0 auto;
	width: 2.2rem;
	height: 2.2rem;
	padding: 2px;
	background: var(--bp-surface-strong);
	border: 1px solid var(--bp-border-strong);
	border-radius: 9px;
	cursor: pointer;
}

.bp-reset {
	justify-self: start;
	margin-top: var(--space-2);
	padding: var(--space-3) var(--space-6);
	color: var(--bp-muted);
	background: transparent;
	border: 1px solid var(--bp-border-strong);
	border-radius: 9px;
	font: inherit;
	font-size: 0.78rem;
	font-weight: 700;
	cursor: pointer;
	transition: color 0.15s ease, border-color 0.15s ease;
}

.bp-reset:hover {
	color: var(--text-color);
	border-color: color-mix(in srgb, var(--bp-blurple) 50%, transparent);
}

/* -------------------------------------------------------- sign-in --- */

.bp-signin {
	display: flex;
	align-items: center;
	gap: var(--space-4);
	margin: 0;
	font-size: 0.85rem;
	color: var(--bp-muted);
}

.bp-signin__link {
	display: inline-flex;
	align-items: center;
	gap: var(--space-3);
	padding: var(--space-3) var(--space-6);
	color: var(--text-color);
	background: var(--bp-surface-strong);
	border: 1px solid color-mix(in srgb, var(--bp-blurple) 34%, transparent);
	border-radius: 10px;
	font-weight: 700;
	text-decoration: none;
	transition: background 0.15s ease;
}

.bp-signin__link:hover {
	background: color-mix(in srgb, var(--bp-blurple) 18%, var(--bp-surface-strong));
}

/*
	Icon aligned to the first line rather than the block's centre — the text
	wraps to two lines in a narrow step card.
*/
.bp-id-note--signed-in {
	display: flex;
	align-items: baseline;
	gap: var(--space-3);
	color: light-dark(#1a7f4b, #6ee7a8);
}

.bp-id-note--signed-in i {
	flex: 0 0 auto;
}

/* --------------------------------------------------------- credit --- */

.bp-credit {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: var(--space-7) var(--space-9);
	padding: clamp(1.5rem, 4vw, 2.5rem);
	border: 1px solid color-mix(in srgb, var(--bp-blurple) 32%, transparent);
	border-radius: var(--bp-radius);
	background:
		linear-gradient(120deg, color-mix(in srgb, #00add8 15%, transparent), transparent 58%),
		var(--bp-surface);
	box-shadow: inset 0 1px 0 color-mix(in srgb, white 10%, transparent);
	backdrop-filter: blur(10px);
}

.bp-credit__mark {
	display: grid;
	place-items: center;
	width: 4.5rem;
	height: 4.5rem;
	border: 1px solid color-mix(in srgb, #00add8 38%, transparent);
	border-radius: 18px;
	background: color-mix(in srgb, #00add8 12%, var(--bp-surface-strong));
	color: light-dark(#007d9d, #67ddfa);
	font-size: 2.25rem;
}

.bp-credit__copy {
	flex: 1 1 22rem;
	min-width: 0;
}

.bp-credit__copy h2 {
	margin: var(--space-2) 0 var(--space-3);
	font-size: 1.15rem;
}

.bp-credit__eyebrow {
	color: light-dark(#007d9d, #67ddfa);
	font-size: 0.7rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.bp-credit__actions {
	display: grid;
	justify-items: end;
	gap: var(--space-4);
}

.bp-credit__copy p {
	margin: 0;
	color: var(--bp-muted);
	font-size: 0.92rem;
	line-height: 1.6;
}

/* Links written into the blurb copy itself. */
.bp-credit__copy a {
	color: color-mix(in srgb, var(--bp-blurple) 72%, var(--text-color));
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 2px;
	text-decoration-thickness: 1px;
	text-decoration-color: color-mix(in srgb, var(--bp-blurple) 40%, transparent);
}

.bp-credit__copy a:hover {
	text-decoration-color: currentColor;
}

.bp-credit__link {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	gap: var(--space-3);
	padding: var(--space-5) var(--space-8);
	color: #fff;
	background: var(--bp-blurple);
	border-radius: 12px;
	font-weight: 700;
	font-size: 0.9rem;
	text-decoration: none;
	white-space: nowrap;
	transition: background 0.15s ease, transform 0.15s ease;
}

.bp-credit__link:hover {
	background: color-mix(in srgb, var(--bp-blurple) 84%, #000);
	transform: translateY(-1px);
}

/* --------------------------------------------------------- json card --- */

.bp-json {
	display: grid;
	gap: var(--space-6);
	padding: var(--space-10) var(--space-9);
	background: var(--bp-surface);
	border: 1px solid var(--bp-border);
	border-radius: var(--bp-radius);
	backdrop-filter: blur(10px);
	min-width: 0;
	overflow: hidden;
}

.bp-json h2 {
	margin: 0;
	font-size: 1.15rem;
}

.bp-json p {
	margin: 0;
	color: var(--bp-muted);
	font-size: 0.93rem;
	line-height: 1.6;
}

.bp-json .bp-url {
	margin: 0;
}

.bp-schema {
	margin-top: var(--space-6);
	border-top: 1px solid var(--bp-border);
	padding-top: var(--space-5);
}

.bp-schema summary {
	display: flex;
	align-items: center;
	gap: var(--space-3);
	color: var(--bp-muted);
	font-size: 0.85rem;
	font-weight: 700;
	cursor: pointer;
	list-style: none;
	user-select: none;
}

.bp-schema summary::-webkit-details-marker {
	display: none;
}

.bp-schema summary::before {
	content: "\f105";
	font-family: "Font Awesome 6 Free";
	font-weight: 900;
	transition: transform 0.15s ease;
}

.bp-schema[open] summary::before {
	transform: rotate(90deg);
}

.bp-schema summary:hover {
	color: var(--text-color);
}

.bp-schema__groups {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 23rem), 1fr));
	gap: var(--space-5);
	margin-top: var(--space-6);
}

.bp-schema__group {
	padding: var(--space-6);
	border: 1px solid var(--bp-border);
	border-radius: 12px;
	background: light-dark(rgba(15, 18, 40, 0.025), rgba(0, 0, 0, 0.14));
}

.bp-schema__group h3 {
	margin: 0 0 var(--space-5);
	font-size: 0.9rem;
}

.bp-schema__group dl {
	display: grid;
	grid-template-columns: minmax(8.5rem, auto) 1fr;
	gap: var(--space-4) var(--space-6);
	margin: 0;
	font-size: 0.82rem;
	line-height: 1.5;
}

.bp-schema__group dt {
	font-family: var(--codeblock-font-family);
	font-weight: 700;
	color: color-mix(in srgb, var(--bp-blurple) 65%, var(--text-color));
}

.bp-schema__group dd {
	margin: 0;
	color: var(--bp-muted);
}

.bp-schema__note {
	margin: var(--space-6) 0 0;
	color: var(--bp-muted);
	font-size: 0.82rem;
	line-height: 1.55;
}

.bp-schema__note a {
	color: color-mix(in srgb, var(--bp-blurple) 70%, var(--text-color));
}

.bp-json__preview {
	display: grid;
	gap: var(--space-5);
	justify-items: start;
	min-width: 0;
	width: 100%;
	max-width: 100%;
}

/*
	The payload can be long and deeply nested, so it scrolls in both axes
	inside its own box rather than stretching the card.
*/
.bp-json__out {
	box-sizing: border-box;
	display: block;
	width: 0;
	min-width: 100%;
	max-width: 100%;
	max-height: 22rem;
	margin: 0;
	padding: var(--space-6) var(--space-7);
	border: 1px solid var(--bp-border);
	border-radius: 12px;
	background: light-dark(rgba(15, 18, 40, 0.05), rgba(0, 0, 0, 0.28));
	color: var(--text-color);
	font-family: var(--codeblock-font-family);
	font-size: 0.78rem;
	line-height: 1.55;
	white-space: pre;
	overflow: auto;
	scrollbar-width: thin;
}

.bp-json__out[hidden] {
	display: none;
}

/* ------------------------------------------------------------ footer --- */

.bp-footer {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: var(--space-6);
	padding-top: var(--space-8);
	border-top: 1px solid var(--bp-border);
	color: var(--bp-muted);
	font-size: 0.85rem;
	line-height: 1.6;
}

.bp-footer p {
	margin: 0;
	max-width: 44rem;
}

.bp-footer a {
	color: color-mix(in srgb, var(--bp-blurple) 70%, var(--text-color));
}

@media (max-width: 640px) {
	.badges-shell {
		width: min(100% - 1.25rem, 34rem);
		padding-block: 1.5rem 3rem;
		gap: var(--space-9);
	}

	.bp-hero {
		justify-items: center;
		max-width: none;
		text-align: center;
	}

	.bp-hero h1 {
		font-size: clamp(1.8rem, 9vw, 2.35rem);
	}

	.bp-hero p {
		font-size: 0.96rem;
	}

	.bp-preview {
		width: calc(100% - var(--space-7) * 2);
		max-width: calc(100% - var(--space-7) * 2);
		margin-inline: var(--space-7);
	}

	.bp-card__head,
	.bp-card__foot {
		padding-inline: var(--space-7);
	}

	.bp-url {
		flex-wrap: wrap;
	}

	.bp-copy {
		padding: var(--space-4) var(--space-6);
	}

	.bp-param {
		grid-template-columns: minmax(0, 1fr);
	}

	.bp-refresh-all {
		width: 100%;
		justify-content: center;
	}

	.bp-section-heading {
		align-items: center;
		flex-direction: column;
		text-align: center;
	}

	.bp-schema__group dl {
		grid-template-columns: minmax(0, 1fr);
		gap: var(--space-2);
	}

	.bp-schema__group dd + dt {
		margin-top: var(--space-3);
	}

	.bp-alts__item {
		flex-direction: column;
		gap: var(--space-3);
	}

	.bp-credit {
		grid-template-columns: minmax(0, 1fr);
		align-items: center;
		/* Without this the copy block keeps its 22rem flex-basis and stretches
		   the column, leaving a large gap above the button. */
		gap: var(--space-6);
		padding: var(--space-7);
		text-align: center;
	}

	.bp-credit__mark { margin-inline: auto; }

	.bp-credit__copy {
		flex: 0 0 auto;
	}

	.bp-credit__actions {
		width: 100%;
		justify-items: center;
	}

	.bp-credit__link {
		width: 100%;
		justify-content: center;
	}

	/* Badge rows scroll instead of widening the page. */
	.bp-hero-strip {
		box-sizing: border-box;
		flex-wrap: nowrap;
		overflow-x: auto;
		width: 100%;
		max-width: 100%;
	}

	.bp-step,
	.bp-json {
		padding: var(--space-8) var(--space-7);
	}

	.bp-step h2,
	.bp-step > p,
	.bp-status {
		text-align: center;
		justify-self: center;
	}

	.bp-id-form { grid-template-columns: minmax(0, 1fr); }
	.bp-id-form button { width: 100%; }
	.bp-signin { justify-content: center; flex-wrap: wrap; }
	.bp-footer { justify-content: center; text-align: center; }

	.bp-toggle {
		gap: var(--space-4);
	}
}
