/* Blacklist DB — tokens and the pieces shown across the forum: reason
   badges, topic/profile flag, member notice and the board panel.
   Neutrals follow Zeina (gray / slate); colour is reserved for reasons
   and the red "listed" signal. */

.bldb,
.bldb-flag,
.bldb-notice,
.bldb-widget {
	--bldb-ink: #18181b;
	--bldb-sub: #52525b;
	--bldb-mute: #8b8b94;
	--bldb-card: #fff;
	--bldb-well: #f4f4f5;
	--bldb-line: #e4e4e7;
	--bldb-line-strong: #d4d4d8;
	--bldb-hover: #f4f4f5;
	--bldb-track: #f4f4f5;
	--bldb-raise: #fff;
	--bldb-solid: var(--bldb-ink);
	/* Reason colours (RGB triplets): deep, desaturated tones that read as
	   labels rather than alarms. Dark mode uses the light tints. */
	--bldb-r-scam: 180 35 24;
	--bldb-r-resell: 181 71 8;
	--bldb-r-leak: 2 106 162;
	--bldb-r-spam: 78 91 166;
	--bldb-r-fake: 105 65 198;
	--bldb-r-other: 71 84 103;
	--bldb-on-solid: #fff;
	--bldb-accent: rgba(var(--color-primary, 37, 99, 235), 1);
	--bldb-accent-soft: rgba(var(--color-primary, 37, 99, 235), 0.1);
	--bldb-red: #ef4444;
	--bldb-red-ink: #dc2626;
	--bldb-red-soft: #fef2f2;
	--bldb-danger: #b42318;
	--bldb-danger-hover: #912018;
	--bldb-shadow: 0 1px 2px rgb(24 24 27 / 0.04), 0 8px 24px -14px rgb(24 24 27 / 0.12);
	--bldb-shadow-hover: 0 2px 4px rgb(24 24 27 / 0.05), 0 18px 36px -16px rgb(24 24 27 / 0.2);
	--bldb-r: 16px;
	--bldb-r-sm: 10px;
	--bldb-ease: cubic-bezier(0.23, 1, 0.32, 1);
	--bldb-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

html.dark .bldb,
html.dark .bldb-flag,
html.dark .bldb-notice,
html.dark .bldb-widget {
	--bldb-ink: #f1f5f9;
	--bldb-sub: #a1aab8;
	--bldb-mute: #6b7586;
	--bldb-card: #0f172a;
	/* Zeina's dark page is #1b2335 and its cards #0f172a: wells sit below the
	   card, hovers are tinted with the accent so they never read as the page. */
	--bldb-well: #0b1222;
	--bldb-line: #1e293b;
	--bldb-line-strong: #2c3a52;
	--bldb-hover: rgba(var(--color-primary-dark, 96, 165, 250), 0.08);
	--bldb-track: #080e1b;
	--bldb-raise: #1e293b;
	/* Filled buttons take the theme accent in dark mode instead of turning white. */
	--bldb-solid: rgba(var(--color-primary, 37, 99, 235), 1);
	--bldb-r-scam: 253 162 155;
	--bldb-r-resell: 247 178 122;
	--bldb-r-leak: 124 212 253;
	--bldb-r-spam: 179 184 219;
	--bldb-r-fake: 189 180 254;
	--bldb-r-other: 152 162 179;
	--bldb-on-solid: #fff;
	--bldb-accent: rgba(var(--color-primary-dark, var(--color-primary, 96, 165, 250)), 1);
	--bldb-accent-soft: rgba(var(--color-primary-dark, var(--color-primary, 96, 165, 250)), 0.14);
	--bldb-red: #f87171;
	--bldb-red-ink: #fca5a5;
	--bldb-red-soft: rgb(239 68 68 / 0.13);
	--bldb-danger: #c2362b;
	--bldb-danger-hover: #a52b22;
	--bldb-shadow: 0 1px 2px rgb(0 0 0 / 0.3);
	--bldb-shadow-hover: 0 18px 36px -16px rgb(0 0 0 / 0.6);
}

.bldb-i {
	display: inline-block;
	flex: none;
	width: 1.125rem;
	height: 1.125rem;
	vertical-align: -0.2em;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.75;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* ---------- Reason badges: the first thing read after a name ---------- */

.bldb-reasons { display: inline-flex; flex-wrap: wrap; gap: 0.375rem; }
.bldb-reason {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	height: 1.375rem;
	padding: 0 0.5rem;
	border-radius: 6px;
	background: rgb(var(--c) / 0.07);
	box-shadow: inset 0 0 0 1px rgb(var(--c) / 0.2);
	color: rgb(var(--c));
	font-size: 0.71875rem;
	font-weight: 650;
	line-height: 1;
	letter-spacing: 0.01em;
	white-space: nowrap;
}
.bldb-reason::before { content: ""; width: 0.375rem; height: 0.375rem; border-radius: 2px; background: currentColor; }
.bldb-reason b { font-weight: 700; opacity: 0.65; }
/* Every place a reason is coloured: badges, filter chips, report choices. */
.bldb-reason, .bldb-choice, .bldb-seg a[data-reason] { --c: var(--bldb-r-other); }
.bldb-reason--scam, .bldb-choice--scam, .bldb-seg a[data-reason="scam"] { --c: var(--bldb-r-scam); }
.bldb-reason--resell, .bldb-choice--resell, .bldb-seg a[data-reason="resell"] { --c: var(--bldb-r-resell); }
.bldb-reason--leak, .bldb-choice--leak, .bldb-seg a[data-reason="leak"] { --c: var(--bldb-r-leak); }
.bldb-reason--spam, .bldb-choice--spam, .bldb-seg a[data-reason="spam"] { --c: var(--bldb-r-spam); }
.bldb-reason--fake, .bldb-choice--fake, .bldb-seg a[data-reason="fake"] { --c: var(--bldb-r-fake); }
html.dark .bldb-reason { background: rgb(var(--c) / 0.1); box-shadow: inset 0 0 0 1px rgb(var(--c) / 0.22); }

/* ---------- Flag next to a listed poster / member ---------- */

.bldb-flag {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	margin-top: 0.375rem;
	height: 1.5rem;
	padding: 0 0.5625rem 0 0.4375rem;
	border-radius: 999px;
	background: var(--bldb-red-soft);
	color: var(--bldb-red-ink);
	font-size: 0.75rem;
	font-weight: 700;
	text-decoration: none;
	transition: background-color 150ms ease;
}
.bldb-flag .bldb-i { width: 0.875rem; height: 0.875rem; stroke-width: 2.25; }
.bldb-flag:hover { background: rgb(239 68 68 / 0.2); color: var(--bldb-red-ink) !important; text-decoration: none; }

/* ---------- Notice on a listed member's profile ---------- */

.bldb-notice {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin: 0 0 1rem;
	padding: 0.875rem 1rem;
	border-radius: var(--bldb-r);
	background: var(--bldb-red-soft);
	color: var(--bldb-ink);
	font-size: 0.875rem;
	line-height: 1.5;
}
.bldb-notice > .bldb-i { width: 2rem; height: 2rem; padding: 0.4375rem; border-radius: 10px; background: var(--bldb-danger); color: #fff; stroke-width: 2.25; }
.bldb-notice strong { color: var(--bldb-red-ink); font-weight: 700; }
.bldb-notice p { margin: 0; color: var(--bldb-sub); }
.bldb-notice a { margin-inline-start: auto; flex: none; padding: 0.4375rem 0.875rem; border-radius: 10px; background: var(--bldb-danger); color: #fff; font-weight: 600; text-decoration: none; white-space: nowrap; }

.bldb-notice a:hover { color: #fff !important; background: var(--bldb-danger-hover); }

/* ---------- Live status dot ---------- */

.bldb-live { position: relative; display: inline-block; flex: none; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: #22c55e; }
.bldb-live::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: #22c55e; animation: bldb-pulse 2.2s cubic-bezier(0, 0, 0.2, 1) infinite; }
@keyframes bldb-pulse {
	0% { opacity: 0.55; transform: scale(1); }
	75%, 100% { opacity: 0; transform: scale(2.75); }
}

/* ---------- Board panel: command bar ----------
   The section is only the size container; .bldb-w is the bar. Wide, it is
   one pill (brand | search | count). Narrow (sidebar, phone) it becomes a
   compact card: brand and count on top, search below. */

.bldb-widget { container: bldbw / inline-size; margin: 0.5rem 0 1rem; color: var(--bldb-ink); font-size: 0.875rem; line-height: 1.4; }
.bldb-widget--side { margin: 0; }
.bldb-widget a, .bldb-widget a:hover { text-decoration: none; }

.bldb-w { display: flex; align-items: center; gap: 0.375rem; height: 3.75rem; padding: 0.375rem; border: 1px solid var(--bldb-line); border-radius: 14px; background: var(--bldb-card); box-shadow: var(--bldb-shadow); transition: border-color 150ms ease, box-shadow 150ms ease; }
.bldb-w:focus-within { border-color: var(--bldb-accent); box-shadow: var(--bldb-shadow), 0 0 0 3px var(--bldb-accent-soft); }

.bldb-w-brand { display: inline-flex; align-items: center; gap: 0.5rem; flex: none; height: 100%; padding: 0 0.875rem 0 0.375rem; border-inline-end: 1px solid var(--bldb-line); color: var(--bldb-ink) !important; }
.bldb-w-mark { display: grid; place-items: center; flex: none; width: 2.25rem; height: 2.25rem; border-radius: 9px; background: var(--bldb-danger); color: #fff; }
.bldb-w-mark .bldb-i { width: 1.0625rem; height: 1.0625rem; stroke-width: 2.25; }
.bldb-w-name { font-weight: 750; letter-spacing: -0.01em; }

.bldb-w-search { display: flex; align-items: center; gap: 0.625rem; flex: 1; min-width: 0; height: 100%; margin: 0; padding: 0 0 0 0.75rem; color: var(--bldb-mute); }
.bldb-w-search > .bldb-i { flex: none; width: 1.125rem; height: 1.125rem; }
/* The theme rings every focused search input; the bar above is the only ring. */
.bldb-w-search input, .bldb-w-search input:focus { width: 0; min-width: 0; flex: 1; height: 100%; margin: 0; padding: 0; border: 0 !important; border-radius: 0; background: transparent; color: var(--bldb-ink); font: inherit; font-size: 0.9375rem; box-shadow: none !important; outline: none !important; -webkit-appearance: none; appearance: none; }
.bldb-w-search input::placeholder { color: var(--bldb-mute); opacity: 1; }
.bldb-w-search input::-webkit-search-cancel-button { display: none; }
.bldb-widget .bldb-w-search button { display: inline-flex; align-items: center; justify-content: center; flex: none; height: 2.5rem; margin: 0; padding: 0 1.125rem; border: 0; border-radius: 9px; background: var(--bldb-solid); color: var(--bldb-on-solid); font: inherit; font-size: 0.875rem; font-weight: 650; line-height: 1; text-transform: none; white-space: nowrap; box-shadow: none; cursor: pointer; transition: transform 120ms var(--bldb-ease), opacity 150ms ease; }
.bldb-widget .bldb-w-search button:hover { opacity: 0.88; color: var(--bldb-on-solid); }
.bldb-widget .bldb-w-search button:active { transform: scale(0.97); }

.bldb-w-stat { display: inline-flex; align-items: center; gap: 0.375rem; flex: none; height: 100%; padding: 0 0.625rem 0 0.875rem; border-inline-start: 1px solid var(--bldb-line); color: var(--bldb-sub) !important; font-size: 0.8125rem; white-space: nowrap; }
.bldb-w-stat b { color: var(--bldb-ink); font-weight: 750; }
.bldb-w-stat > .bldb-i { width: 0.875rem; height: 0.875rem; color: var(--bldb-mute); transition: transform 150ms var(--bldb-ease); }
.bldb-w-stat:hover > .bldb-i { transform: translateX(2px); }

@container bldbw (max-width: 520px) {
	.bldb-w { flex-wrap: wrap; height: auto; gap: 0.25rem; padding: 0.5rem; border-radius: 14px; }
	.bldb-w-brand { order: 1; height: 2.5rem; padding-inline-end: 0.25rem; border: 0; }
	.bldb-w-stat { order: 2; height: 2.5rem; margin-inline-start: auto; padding-inline: 0.5rem 0.25rem; border: 0; }
	.bldb-w-search { order: 3; flex-basis: 100%; height: 2.875rem; padding: 0 0.3125rem 0 0.75rem; border-radius: 10px; background: var(--bldb-well); }
	.bldb-widget .bldb-w-search button { height: 2.25rem; padding: 0 0.875rem; border-radius: 8px; font-size: 0.8125rem; }
}

/* Row inside Zeina's "Information" block */
.bldb-statrow { display: flex; gap: 1rem; }
.bldb-statrow-icon { display: grid; place-items: center; flex: none; width: 2rem; height: 2rem; margin-top: 0.125rem; border-radius: 9px; background: #b42318; color: #fff; }
.bldb-statrow-icon .bldb-i { width: 1.125rem; height: 1.125rem; stroke-width: 2.25; }
.bldb-statrow-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1rem; }
.bldb-statrow-meta > span { display: inline-flex; align-items: center; gap: 0.4375rem; }

@media (max-width: 640px) {
	.bldb-notice { flex-wrap: wrap; }
	.bldb-notice a { width: 100%; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
	.bldb-live::after { animation: none; }
}
