/* =============================================================================
   The member profile.

   Built on the platform's own tokens (--mena-*), so it follows the light/dark
   switch in the navbar without knowing anything about it. Where a token might
   be missing — the profile page could be rendered on a site where the theme
   plugin is off — every var() carries a fallback, because a profile with no
   colours at all is worse than one that is merely not themed.
   ========================================================================== */

.csp {
	--csp-bg: var(--mena-bg, #fff);
	--csp-card: var(--mena-elevated, #fff);
	--csp-soft: var(--mena-surface, #f7f7f9);
	--csp-line: var(--mena-border, #e6e6ec);
	--csp-line-soft: var(--mena-border-soft, #f0f0f4);
	--csp-text: var(--mena-text, #1a1a1a);
	--csp-text-2: var(--mena-text-2, #3f4650);
	--csp-muted: var(--mena-muted, #8898aa);
	--csp-gold: var(--mena-gold, #ffd014);
	--csp-on-gold: var(--mena-on-gold, #1a1a1a);
	--csp-rose: var(--mena-rose, #f5365c);
	--csp-green: var(--mena-green, #17bf63);
	--csp-r: 16px;

	/* Wide enough for the card and the settings columns, narrow enough to read.
	   The container around it is now the site's, so this is a measure rather
	   than a width. */
	max-width: 1040px;
	margin: 0 auto;
	color: var(--csp-text);
	font-family: inherit;
}

/*
 * The same page width as the home page and an article.
 *
 * Both of those set --mena-page and hand it to WordPress's own content-size
 * token, which every constrained block on the page already reads — the theme's
 * files and anything authored in the site editor alike. Copying that here is
 * what makes a profile sit in the same container as the rest of the site
 * instead of in a narrower one of its own; the alternative was overriding
 * .entry-content by hand, which only ever matches the markup you happened to
 * test against.
 */
body.csp-page {
	--mena-page: 1364px;
	--wp--style--global--content-size: var(--mena-page);
}

/*
 * The masthead stays.
 *
 * A profile is a page you scroll — a timeline, then settings — and the way back
 * to the rest of the site should not be a scroll to the top. Sticky rather than
 * fixed, so it takes its own space in the flow and nothing has to be padded
 * down by a magic number that changes with the logo.
 */
/*
 * Named several ways on purpose. A block theme's header is a template part, a
 * classic one calls it .site-header or #masthead, and a child theme may do
 * either — one selector is one guess, and this has to work on the theme that is
 * actually installed.
 */
body.csp-page header.wp-block-template-part,
body.csp-page .wp-site-blocks > header,
body.csp-page > header,
body.csp-page .site-header,
body.csp-page #masthead {
	/* The timeline page's masthead rules come with the mena-timeline class the
	   plugin now puts on the body; this only makes it stay. */
	position: sticky !important;
	top: 0;
	z-index: 60;
	background: var(--mena-bg, #fff);
	box-shadow: 0 1px 0 var(--mena-border, #e6e6ec);
}

/* WordPress's own bar is already fixed at the top for signed-in staff. */
body.csp-page.admin-bar header.wp-block-template-part,
body.csp-page.admin-bar .wp-site-blocks > header,
body.csp-page.admin-bar > header,
body.csp-page.admin-bar .site-header,
body.csp-page.admin-bar #masthead { top: 32px; }

@media (max-width: 782px) {
	body.csp-page.admin-bar header.wp-block-template-part,
	body.csp-page.admin-bar .wp-site-blocks > header,
	body.csp-page.admin-bar > header,
	body.csp-page.admin-bar .site-header,
	body.csp-page.admin-bar #masthead { top: 46px; }
}

/* A sticky ancestor cannot hold a sticky child in place, and block themes wrap
   everything in a couple of groups. These are containers, not scrollers. */
body.csp-page .wp-site-blocks { overflow: visible !important; }

/* "الملف الشخصي" in the masthead, over a card that already says whose profile
   this is. The article masthead does not carry a title either. */
body.csp-page header.wp-block-template-part .wp-block-post-title,
body.csp-page .wp-site-blocks > .wp-block-group:first-child .wp-block-post-title {
	display: none !important;
}

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

/* ----------------------------------------------------------------- layout */

/*
 * The card on the reading edge, everything else beside it.
 *
 * First in the source and first in the grid, so it lands on the right in Arabic
 * and on the left in English without either being written down — the column
 * order follows the document's direction, which is the one thing on the page
 * guaranteed to be correct.
 */
.csp-layout {
	display: grid;
	grid-template-columns: 340px minmax(0, 1fr);
	gap: 22px;
	align-items: start;
}

/*
 * Sticky, not fixed: it holds its place in the grid, so the column below it
 * cannot slide underneath. The offset clears the site masthead, which is itself
 * sticky — override --csp-top if that bar ever changes height.
 */
.csp-side { position: sticky; top: var(--csp-top, 84px); min-width: 0; }
.csp-main { min-width: 0; }

/* One column below the width where two would squeeze the timeline. The card
   goes back to being a header, and stops sticking — a header that follows you
   down a phone screen is a header in the way. */
@media (max-width: 1000px) {
	.csp-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
	.csp-side { position: static; }
}

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

.csp-hero {
	border: 1px solid var(--csp-line);
	border-radius: var(--csp-r);
	background: var(--csp-card);
	overflow: hidden;
}

/* Drawn from the member's own id: two profiles side by side should not look
   like the same empty template. */
.csp-hero__cover {
	height: 150px;
	background:
		radial-gradient(120% 150% at 85% 0%, hsl(var(--csp-hue, 45) 42% 36% / .9), transparent 62%),
		radial-gradient(120% 150% at 10% 100%, hsl(calc(var(--csp-hue, 45) + 45) 38% 24% / .95), transparent 58%),
		linear-gradient(120deg, #12141a, #1f222a);
}

/* The face sits half over the banner, the way it does everywhere this pattern
   is used — it is what tells you the picture belongs to the page rather than to
   the band above it. */
.csp-hero__bar {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 12px;
	padding: 0 20px;
	margin-top: -46px;
}

/* In the column, the card is read top to bottom: face, then name, then the one
   button — side by side they would each get half of 340px. */
@media (min-width: 1001px) {
	.csp-layout .csp-hero__cover { height: 112px; }
	.csp-layout .csp-hero__bar { margin-top: -40px; padding: 0 18px; }
	.csp-layout .csp-face { width: 96px; height: 96px; }
	.csp-layout .csp-id { padding: 12px 18px 18px; }
	.csp-layout .csp-name { font-size: 19px; }

	/* Small enough to sit beside a 96px face in a 340px column. */
	.csp-layout .csp-hero__bar .csp-btn { height: 34px; padding: 0 14px; font-size: 13px; }

	.csp-layout .csp-stats { gap: 14px; font-size: 13px; }
	.csp-layout .csp-facts { gap: 5px 12px; font-size: 12.5px; }
}

.csp-face {
	display: block;
	width: 116px;
	height: 116px;
	border-radius: 50%;
	overflow: hidden;
	flex: none;
	background: var(--csp-soft);
	border: 4px solid var(--csp-card);
	box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
}

.csp-face img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: 50%;
}

.csp-facepick { flex: none; margin: 0; }

/* Your own face is a button. The camera says so on hover and on focus, and the
   whole circle is the target rather than a small icon in a corner. */
.csp-face--mine { position: relative; cursor: pointer; display: block; }

.csp-face__cam {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: rgba(10, 11, 13, .55);
	color: #fff;
	opacity: 0;
	transition: opacity .15s ease;
}

.csp-face__cam svg { width: 30px; height: 30px; }

.csp-face--mine:hover .csp-face__cam,
.csp-face--mine:focus-within .csp-face__cam { opacity: 1; }

/* While the file is on its way up. */
.csp-facepick.is-sending .csp-face__cam { opacity: 1; }
.csp-facepick.is-sending .csp-face { animation: csp-pulse 1s ease-in-out infinite; }

@keyframes csp-pulse { 50% { opacity: .6; } }

/* A camera on a picture is not obvious on a phone, where there is no hover. */
@media (hover: none) {
	.csp-face--mine .csp-face__cam {
		inset: auto 0 0 auto;
		width: 34px;
		height: 34px;
		border: 3px solid var(--csp-card);
		background: var(--csp-gold);
		color: var(--csp-on-gold);
		opacity: 1;
	}

	.csp-face--mine .csp-face__cam svg { width: 17px; height: 17px; }
}

.csp-hero__bar .csp-btn { margin-bottom: 10px; }

.csp-id { padding: 12px 20px 18px; }

.csp-name {
	display: flex;
	align-items: center;
	gap: 7px;
	margin: 0;
	font-size: 21px;
	font-weight: 800;
	line-height: 1.3;
	color: var(--csp-text);
}

/*
 * The tick on the hero card.
 *
 * It is the platform's mark now — .mw-verified, drawn from the same <symbol>
 * the feed uses, so the badge on this card and the badge on the post below it
 * are one picture rather than two that nearly match.
 *
 * The size is stated here because the name it sits beside is 21px, half again
 * the .82rem the feed rows run at; the feed's 1.1em against that would be 23px.
 * .86em puts it at 18px, which is the same relationship to its text.
 *
 * .csp-badge is the flat fallback, for a site without the platform plugin.
 */
.csp-name .mw-verified,
.csp-badge { width: .86em; height: .86em; flex: none; }

/* Under the name, on the same edge as the name. The handle's own characters
   run the other way; the line does not. */
.csp-at {
	margin: 2px 0 0;
	font-size: 14px;
	color: var(--csp-muted);
}

.csp-bio {
	margin: 12px 0 0;
	font-size: 14.5px;
	line-height: 1.85;
	color: var(--csp-text-2);
	white-space: pre-line;
}

.csp-facts {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 16px;
	margin: 12px 0 0;
	padding: 0;
	list-style: none;
	font-size: 13px;
	color: var(--csp-muted);
}

.csp-facts li { display: inline-flex; align-items: center; gap: 6px; }

/* The flag is a character, not a picture: the device draws its own, nothing is
   shipped, and nothing has to be updated when a country changes its flag. */
.csp-flag { font-size: 16px; line-height: 1; }

.csp-facts__hint { color: var(--csp-gold); }

/* The one link on the card, so it looks like one. */
.csp-x {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--csp-text-2) !important;
	text-decoration: none !important;
}

.csp-x svg { width: 13px; height: 13px; flex: none; }
.csp-x:hover { color: var(--csp-gold) !important; }

/* The three numbers, in the row where a social profile always puts them. */
.csp-stats {
	display: flex;
	flex-wrap: wrap;
	gap: 18px;
	margin: 14px 0 0;
	padding: 0;
	list-style: none;
	font-size: 13.5px;
	color: var(--csp-muted);
}

.csp-stats b {
	color: var(--csp-text);
	font-weight: 800;
	font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------- tabs */

.csp-tabs {
	display: flex;
	gap: 4px;
	margin: 14px 0 0;
	border-bottom: 1px solid var(--csp-line);
}

.csp-tab {
	position: relative;
	padding: 12px 16px;
	font-size: 14px;
	font-weight: 700;
	color: var(--csp-muted) !important;
	text-decoration: none !important;
	transition: color .15s ease;
}

.csp-tab:hover { color: var(--csp-text) !important; }
.csp-tab.is-on { color: var(--csp-text) !important; }

/* The underline is the tab, so it is drawn on the border the row already has
   rather than added under it — no layout shift when the current tab changes. */
.csp-tab.is-on::after {
	content: "";
	position: absolute;
	inset-inline: 12px;
	bottom: -1px;
	height: 3px;
	border-radius: 3px;
	background: var(--csp-gold);
}

/* ------------------------------------------------------------------- feed */

.csp-feed { display: grid; }

.csp-post {
	display: grid;
	grid-template-columns: 44px minmax(0, 1fr);
	gap: 12px;
	padding: 16px 4px;
	border-bottom: 1px solid var(--csp-line-soft);
}

.csp-post:last-child { border-bottom: 0; }

.csp-post__face {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	overflow: hidden;
	background: var(--csp-soft);
}

.csp-post__face img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }

.csp-post__main { min-width: 0; }

.csp-post__by {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
	font-size: 13.5px;
	color: var(--csp-muted);
}

.csp-post__by b { color: var(--csp-text); font-weight: 700; }
.csp-post__by .csp-badge { width: 1em; height: 1em; }
.csp-post__by em { font-style: normal; margin-inline-start: auto; font-size: 12.5px; }

.csp-post__body {
	margin: 6px 0 0;
	font-size: 15px;
	line-height: 1.85;
	color: var(--csp-text);
	overflow-wrap: anywhere;
}

/* Pictures in the shape the app gives them: one fills, two split, three and
   four make a block. Nothing is cropped to a square it was not taken as. */
.csp-shots {
	display: grid;
	gap: 3px;
	margin-top: 10px;
	border-radius: 14px;
	overflow: hidden;
	max-height: 420px;
}

.csp-shots img { width: 100%; height: 100%; object-fit: cover; display: block; }
.csp-shots--1 { grid-template-columns: 1fr; }
.csp-shots--2 { grid-template-columns: 1fr 1fr; aspect-ratio: 16 / 9; }
.csp-shots--3 { grid-template-columns: 1fr 1fr; aspect-ratio: 16 / 9; }
.csp-shots--3 img:first-child { grid-row: span 2; }
.csp-shots--4 { grid-template-columns: 1fr 1fr; aspect-ratio: 1 / 1; }

.csp-post__counts {
	display: flex;
	gap: 16px;
	margin-top: 10px;
	font-size: 12.5px;
	color: var(--csp-muted);
	font-variant-numeric: tabular-nums;
}

.csp-post__counts a { color: var(--csp-gold) !important; text-decoration: none !important; }

/* ------------------------------------------------------------------- feed */

/*
 * The platform's feed, in the profile's column.
 *
 * mena-timeline already unwraps it from its card and lets the page's own
 * scrollbar drive the endless loading. These two say the same thing again for
 * the profile's own container, so nothing here gets a height it has to scroll
 * inside — the whole point of the ask.
 */
.csp-main .mw-feed,
.csp-main .mw-feed__scroll {
	max-height: none !important;
	overflow: visible !important;
}

/* The composer is a card and the tabs are a rule above it; without this they
   touch and the two read as one control. */
.csp-main .mw-feed,
.csp-main .mw-composer:first-child { margin-top: 18px; }

.csp-main .mw-feed > :first-child { margin-top: 0; }

/* ------------------------------------------------------------------ votes */

.csp-votes { list-style: none; margin: 0; padding: 0; display: grid; }

.csp-vote { padding: 14px 4px; border-bottom: 1px solid var(--csp-line-soft); }
.csp-vote:last-child { border-bottom: 0; }

.csp-vote__q { display: flex; align-items: baseline; gap: 10px; }
.csp-vote__q b { font-size: 14.5px; font-weight: 700; color: var(--csp-text); }
.csp-vote__q em { font-style: normal; margin-inline-start: auto; font-size: 12px; color: var(--csp-muted); }

/* The way back to the poll itself, at the end of the line it belongs to. */
.csp-go {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	flex: none;
	border-radius: 50%;
	color: var(--csp-muted) !important;
	text-decoration: none !important;
	transition: background .15s ease, color .15s ease;
}

.csp-go svg { width: 18px; height: 18px; }

.csp-go:hover, .csp-go:focus-visible {
	background: color-mix(in srgb, var(--csp-gold) 16%, transparent);
	color: var(--csp-gold) !important;
}

/* The answer given, marked on the reading edge — a list of questions without
   the answers is a list of things you have to open. */
.csp-vote__a {
	margin: 8px 0 0;
	padding: 8px 12px;
	border-inline-start: 3px solid var(--csp-green);
	border-radius: 8px;
	background: var(--csp-soft);
	font-size: 13.5px;
	color: var(--csp-text-2);
}

/* --------------------------------------------------------------- settings */

/*
 * Two columns. The profile form is long and the other three are short, so a
 * single stack puts the password field several screens below the picture. The
 * form used most often takes the wider column.
 */
/* One column. Beside a sticky card the content column is around 680px, and two
   columns of forms in that is two narrow columns rather than one readable one. */
.csp-sets {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	align-items: start;
	gap: 14px;
	padding-top: 16px;
}

.csp-sets__main, .csp-sets__side { display: grid; gap: 14px; align-content: start; min-width: 0; }

.csp-card {
	padding: 18px 20px 20px;
	border: 1px solid var(--csp-line);
	border-radius: var(--csp-r);
	background: var(--csp-card);
}

/* A rule under the title, so a card reads as a thing with a heading rather than
   as a heading that happens to have fields under it. */
.csp-card__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin: 0 0 16px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--csp-line-soft);
}

.csp-card__head h2 {
	margin: 0;
	font-size: 15.5px;
	font-weight: 800;
	color: var(--csp-text);
	line-height: 1.4;
}

.csp-card__head > span { font-size: 12px; color: var(--csp-muted); }

/* The one change a member gets, said where the change is made. */
.csp-once {
	padding: 3px 9px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--csp-gold) 18%, transparent);
	color: var(--csp-gold);
	font-size: 11px;
	font-weight: 700;
	white-space: nowrap;
}

.csp-card form { display: grid; gap: 14px; }

/* The button belongs to the form, not to the field above it: divided off and
   pushed to the end, the way a card ends everywhere else on the platform. */
.csp-card__foot {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 2px;
	padding-top: 14px;
	border-top: 1px solid var(--csp-line-soft);
}

.csp-field { display: grid; gap: 7px; }

.csp-field > span {
	font-size: 12.5px;
	font-weight: 700;
	color: var(--csp-muted);
}

/*
 * Sized here rather than inherited. The theme styles inputs for its own forms,
 * and a profile that adopts them gets three different field heights on one
 * card — so these win outright.
 */
.csp .csp-field input,
.csp .csp-field textarea {
	width: 100% !important;
	max-width: none !important;
	min-height: 46px;
	margin: 0 !important;
	padding: 12px 15px !important;
	border: 1px solid var(--mena-control-border, #cfd4dd) !important;
	border-radius: 12px !important;
	background: var(--mena-control-bg, #fff) !important;
	color: var(--csp-text) !important;
	font-family: inherit !important;
	font-size: 14.5px !important;
	line-height: 1.7 !important;
	box-shadow: none !important;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.csp .csp-field textarea { resize: vertical; min-height: 104px; }

.csp .csp-field input:focus,
.csp .csp-field textarea:focus {
	outline: none !important;
	border-color: var(--csp-gold) !important;
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--csp-gold) 26%, transparent) !important;
}

.csp .csp-field input:disabled {
	background: var(--csp-soft) !important;
	color: var(--csp-text-2) !important;
	cursor: not-allowed;
	-webkit-text-fill-color: var(--csp-text-2);
	opacity: 1;
}

.csp-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

@media (max-width: 520px) {
	.csp-pair { grid-template-columns: 1fr; }
}

.csp-note, .csp-field em { font-style: normal; font-size: 12px; line-height: 1.7; color: var(--csp-muted); margin: 0; }

.csp-count { font-size: 11.5px; color: var(--csp-muted); justify-self: start; font-variant-numeric: tabular-nums; }
.csp-count.is-full { color: var(--csp-rose); }

.csp-locked {
	margin: 0 0 8px;
	padding: 12px 15px;
	border: 1px dashed var(--csp-line);
	border-radius: 12px;
	background: var(--csp-soft);
	color: var(--csp-text-2);
	font-size: 15px;
	font-weight: 700;
	unicode-bidi: plaintext;
}

/* --------------------------------------------------------------- controls */

.csp-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 40px;
	padding: 0 20px;
	border: 1px solid transparent;
	border-radius: 999px;
	background: var(--csp-gold);
	color: var(--csp-on-gold) !important;
	font-family: inherit;
	font-size: 14px;
	font-weight: 700;
	text-decoration: none !important;
	cursor: pointer;
	justify-self: start;
	transition: filter .15s ease, background .15s ease;
}

.csp-btn:hover { filter: brightness(1.06); }

.csp-btn--ghost {
	background: transparent;
	border-color: var(--csp-line);
	color: var(--csp-text) !important;
}

.csp-btn--ghost:hover { background: var(--csp-soft); }

.csp-btn--warn { background: var(--csp-rose); color: #fff !important; }

/* Said to a screen reader, not drawn. Themes usually ship this; the profile
   cannot assume it is one of them. */
.csp .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* ---------------------------------------------------------------- notices */

.csp-said {
	margin: 0 0 14px;
	padding: 12px 16px;
	border-radius: 12px;
	font-size: 14px;
	font-weight: 600;
	border: 1px solid transparent;
}

.csp-said--ok {
	background: color-mix(in srgb, var(--csp-green) 14%, transparent);
	border-color: color-mix(in srgb, var(--csp-green) 40%, transparent);
	color: var(--csp-green);
}

.csp-said--bad {
	background: color-mix(in srgb, var(--csp-rose) 12%, transparent);
	border-color: color-mix(in srgb, var(--csp-rose) 38%, transparent);
	color: var(--csp-rose);
}

.csp-empty {
	margin: 0;
	padding: 44px 20px;
	text-align: center;
	color: var(--csp-muted);
	font-size: 14px;
}

.csp--out { padding: 24px; text-align: center; color: var(--csp-muted); }

/* ------------------------------------------------------------------ small */

@media (max-width: 600px) {
	.csp-hero__cover { height: 120px; }
	.csp-face { width: 92px; height: 92px; }
	.csp-hero__bar { margin-top: -38px; padding: 0 14px; }
	.csp-id { padding: 12px 14px 16px; }
	.csp-pair { grid-template-columns: 1fr; }
	.csp-tab { padding: 12px 11px; font-size: 13.5px; }
	.csp-post { grid-template-columns: 38px minmax(0, 1fr); gap: 10px; }
	.csp-post__face { width: 38px; height: 38px; }
}

/* ---------------------------------------------------------------- points */

/*
 * The ledger behind the number on the card.
 *
 * Three columns on one line — what it was for, when, and how much — because a
 * score history is scanned down the amounts rather than read across. The
 * reasons vary in length and the figures do not, so the figure column is the
 * one pinned to the edge and the reason takes whatever is left.
 */
/*
 * Clear of the tab strip.
 *
 * The card was sitting on the rule the tabs are drawn on, so the underline
 * marking the current tab ran straight into the card's own border and the two
 * read as one thick line. The other tabs open onto a feed with its own spacing;
 * this one opens onto a card, which has none of its own.
 */
.csp-points { margin-top: 18px; }

.csp-points__sum {
	font-size: 22px;
	font-weight: 800;
	line-height: 1;
	color: var(--mena-gold-text, #a97d00);
	font-variant-numeric: tabular-nums;
}

.csp-points__sum.is-down { color: var(--mena-rose, #f5365c); }

.csp-points__none {
	margin: 0;
	padding: 26px 0;
	text-align: center;
	font-size: 13.5px;
	color: var(--csp-muted);
}

.csp-ledger {
	list-style: none;
	margin: 0;
	padding: 0;
}

.csp-ledger__row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto auto;
	align-items: baseline;
	gap: 12px;
	padding: 11px 0;
}

.csp-ledger__row + .csp-ledger__row { border-top: 1px solid var(--csp-line-soft); }

/* A revoked award keeps its row — the history is the point — but it should not
   read as something still earned. */
.csp-ledger__row.is-void { opacity: .5; }

.csp-ledger__what {
	font-size: 13.5px;
	font-weight: 600;
	color: var(--csp-text);
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.csp-ledger__when {
	font-style: normal;
	font-size: 12px;
	color: var(--csp-muted);
	white-space: nowrap;
}

.csp-ledger__n {
	min-width: 58px;
	text-align: end;
	font-size: 13.5px;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	color: var(--mena-green, #17bf63);
}

.csp-ledger__n.is-down { color: var(--mena-rose, #f5365c); }

@media (max-width: 480px) {
	.csp-ledger__row {
		grid-template-columns: minmax(0, 1fr) auto;
	}

	.csp-ledger__when { grid-column: 1; font-size: 11.5px; }
	.csp-ledger__n { grid-row: 1 / span 2; align-self: center; }
	.csp-ledger__what { white-space: normal; }
}

/* ================================== the profile, on a phone */

/*
 * The camera badge sits ON the edge of the face, not inside it.
 *
 * .csp-face clips to a circle so the avatar is round whatever shape the file
 * is — and that same clip was eating the badge, which is positioned at the
 * corner of the face's box and so lies mostly outside the circle. The picture
 * keeps its own border-radius, so dropping the clip on the label costs nothing
 * and lets the badge out.
 */
@media (hover: none) {
	.csp-face--mine { overflow: visible; }
	.csp-face--mine img { border-radius: 50%; }

	.csp-face--mine .csp-face__cam {
		inset: auto 0 2px auto;
		box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
	}
}

/* A pencil and a word, spaced as one thing. */
.csp-btn--edit {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.csp-btn--edit .bi { font-size: .95em; line-height: 1; }

/*
 * More room between the cover and the button.
 *
 * The bar aligns its children to the bottom, so a top margin on the button
 * would do nothing — the face sets the row's height and the button is already
 * as low as the row allows. Taking the bottom margin off is what moves it down
 * and opens the gap above it.
 */
.csp-hero__bar .csp-btn { margin-bottom: 0; }

@media (max-width: 900px) {
	/*
	 * The page gutter goes, rather than every child breaking out of it.
	 *
	 * Everything on this page is meant to be full width, and the first version
	 * of this did it with a negative margin on each piece — a container padding
	 * its children and the children un-padding themselves, two rules cancelling
	 * out and a third to write every time something new is added. Taking the
	 * 5vw off the group once is the same result with nothing to keep in sync.
	 *
	 * :not() so the header keeps its own: that group holds the sticky bar,
	 * whose contents are laid out against that padding.
	 */
	.csp-page .wp-site-blocks > .wp-block-group:not(:has(header.wp-block-template-part)) {
		padding-inline: 0 !important;
	}

	/* No card, no edges — on a phone the profile is the page rather than
	   something sitting on it. */
	.csp-hero {
		border-inline: 0;
		border-radius: 0;
	}

	/*
	 * The tabs stay under the bar.
	 *
	 * --mena-barh is what the site's sticky header actually leaves on screen —
	 * the header's height less the utility strip it hides above the viewport —
	 * measured and published by mena-menu.js. Without it the tabs pin to the
	 * top and the header sits over them.
	 */
	.csp-tabs {
		position: sticky;
		top: var(--mena-barh, 0px);
		z-index: 30;
		margin-top: 0;
		padding-inline: 12px;
		background: var(--csp-card);
	}

	/* Enough that names and text do not sit against the glass, now that the
	   page itself gives them nothing. */
	.csp-post { padding-inline: 14px; }
}
