/* Market UI: the product block under the hero of regional pages (en-gb first).
   Cards live in templates/includes/market_ui/, every value comes from the market
   profile (core/markets.py). Bento rhythm: one wide dark card, light cards around
   it; 24px outer radius, 16px inner panels that run off the bottom edge;
   monospace figures; status chips; scheme pills. Text is 11px minimum. */

@font-face {
	font-family: "Source Code Pro";
	font-style: normal;
	font-weight: 400 600;
	font-display: swap;
	src: url("../fonts/source-code-pro-latin.c701418e2f54.woff2") format("woff2");
}

.mu {
	--mu-dark: #0a0b0c;
	--mu-dark-card: #15171a;
	--mu-dark-panel: #0a0b0c;
	--mu-dark-line: rgba(255, 255, 255, .09);
	--mu-dark-muted: rgba(255, 255, 255, .56);
	--mu-light-card: #f1f3f4;
	--mu-light-line: #e7e9ec;
	--mu-ink: #0a0b0c;
	--mu-muted: #646b76;
	--mu-green: #56d3a2;
	--mu-green-ink: #17805a;
	--mu-amber-ink: #8a5a00;
	--mu-mono: "Source Code Pro", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-feature-settings: "tnum";
}

/* Section header */
.mu-kicker {
	display: inline-flex;
	align-items: center;
	gap: .5rem;
	font-family: var(--mu-mono);
	font-size: .75rem;
	font-weight: 500;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--mu-muted);
}

.mu-kicker::before {
	content: "";
	width: 3px;
	height: .875rem;
	border-radius: 2px;
	background: var(--mu-green);
}

/* Grid */
.mu-grid {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	gap: 1.25rem;
}

.mu-span-12 { grid-column: span 12; }
.mu-span-8 { grid-column: span 8; }
.mu-span-6 { grid-column: span 6; }
.mu-span-4 { grid-column: span 4; }

@media (max-width: 991.98px) {
	.mu-span-8, .mu-span-6, .mu-span-4 { grid-column: span 6; }
	.mu-span-8 { grid-column: span 12; }
}

@media (max-width: 767.98px) {
	.mu-grid { gap: 1rem; }
	.mu-span-8, .mu-span-6, .mu-span-4 { grid-column: span 12; }
}

/* Cards */
.mu-card {
	position: relative;
	display: flex;
	flex-direction: column;
	min-width: 0;
	overflow: hidden;
	border-radius: 1.5rem;
	background: var(--mu-light-card);
	color: var(--mu-ink);
}

.mu-card--dark {
	background: var(--mu-dark-card);
	color: #fff;
}

.mu-card-head {
	padding: 1.75rem 1.75rem 0;
}

.mu-card-head .mu-kicker { margin-bottom: .75rem; }
.mu-card--dark .mu-kicker { color: var(--mu-dark-muted); }

.mu-card-title {
	max-width: 26rem;
	margin: 0;
	font-size: 1.25rem;
	font-weight: 600;
	line-height: 1.35;
	color: inherit;
}

.mu-card--dark .mu-card-title { color: #fff; }

.mu-card-text {
	max-width: 28rem;
	margin: .5rem 0 0;
	font-size: .9375rem;
	line-height: 1.5;
	color: var(--mu-muted);
}

.mu-card--dark .mu-card-text { color: var(--mu-dark-muted); }

/* Stage: where the panels sit; they run off the bottom edge of the card. */
.mu-stage {
	position: relative;
	flex: 1 1 auto;
	display: flex;
	align-items: stretch;
	gap: 1rem;
	min-height: 17.5rem;
	margin-top: 1.5rem;
	padding: 0 1.75rem;
	margin-bottom: -1px;
}

.mu-stage--tall { min-height: 21rem; }
.mu-stage--flush { padding-bottom: 1.75rem; }

.mu-stage > .mu-panel { flex: 1 1 0; min-width: 0; }
.mu-stage > .mu-panel--narrow { flex: 0 0 42%; }

.mu-panel {
	position: relative;
	border-radius: 1rem 1rem 0 0;
	background: #fff;
	border: 1px solid var(--mu-light-line);
	border-bottom: 0;
	box-shadow: 0 1px 2px rgba(10, 11, 12, .04), 0 12px 32px -12px rgba(10, 11, 12, .14);
	overflow: hidden;
}

.mu-stage--flush .mu-panel {
	border-radius: 1rem;
	border-bottom: 1px solid var(--mu-light-line);
}

.mu-card--dark .mu-panel {
	background: var(--mu-dark-panel);
	border-color: var(--mu-dark-line);
	box-shadow: none;
}

.mu-panel--offset { margin-top: 2.25rem; }

.mu-panel-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: .75rem;
	padding: .875rem 1rem;
	border-bottom: 1px solid var(--mu-light-line);
	font-size: .875rem;
	font-weight: 600;
}

.mu-card--dark .mu-panel-head { border-color: var(--mu-dark-line); color: #fff; }

.mu-panel-head .mu-meta { font-weight: 400; }

.mu-panel-body { padding: 1rem; }

/* Text atoms */
.mu-mono { font-family: var(--mu-mono); font-feature-settings: "tnum", "zero"; }

.mu-meta {
	font-size: .75rem;
	line-height: 1.35;
	color: var(--mu-muted);
}

.mu-card--dark .mu-meta { color: var(--mu-dark-muted); }

.mu-label {
	display: block;
	margin-bottom: .125rem;
	font-size: .75rem;
	color: var(--mu-muted);
}

.mu-card--dark .mu-label { color: var(--mu-dark-muted); }

.mu-value {
	display: block;
	font-size: .875rem;
	font-weight: 600;
	color: inherit;
	overflow-wrap: anywhere;
}

.mu-amount {
	font-family: var(--mu-mono);
	font-size: .875rem;
	font-weight: 500;
	white-space: nowrap;
}

.mu-amount--in { color: var(--mu-green-ink); }
.mu-card--dark .mu-amount--in { color: var(--mu-green); }

.mu-big {
	font-family: var(--mu-mono);
	font-size: 1.625rem;
	font-weight: 500;
	letter-spacing: -.02em;
	line-height: 1.2;
	white-space: nowrap;
}

/* Pills and chips */
.mu-pills { display: flex; flex-wrap: wrap; gap: .375rem; }

.mu-pill {
	display: inline-flex;
	align-items: center;
	padding: .1875rem .5625rem;
	border-radius: 999px;
	background: var(--mu-light-card);
	font-family: var(--mu-mono);
	font-size: .6875rem;
	font-weight: 500;
	line-height: 1.4;
	color: var(--mu-ink);
	white-space: nowrap;
}

.mu-card--dark .mu-pill {
	background: rgba(255, 255, 255, .08);
	color: rgba(255, 255, 255, .88);
}

.mu-chip {
	display: inline-flex;
	align-items: center;
	gap: .25rem;
	padding: .125rem .5rem;
	border-radius: 999px;
	font-size: .6875rem;
	font-weight: 600;
	line-height: 1.45;
	white-space: nowrap;
	background: rgba(86, 211, 162, .16);
	color: var(--mu-green-ink);
}

.mu-card--dark .mu-chip { background: rgba(86, 211, 162, .14); color: var(--mu-green); }

.mu-chip--wait { background: #f1f3f4; color: var(--mu-muted); }
.mu-card--dark .mu-chip--wait { background: rgba(255, 255, 255, .08); color: var(--mu-dark-muted); }

.mu-chip--warn { background: #fdf2d3; color: var(--mu-amber-ink); }

.mu-chip i { font-size: .8125rem; }

.mu-dot {
	width: .4375rem;
	height: .4375rem;
	border-radius: 50%;
	background: var(--mu-green);
	flex: 0 0 auto;
}

.mu-live .mu-dot { animation: mu-pulse 2.4s ease-in-out infinite; }

/* Lists of rows (feeds, ledgers) */
.mu-rows { margin: 0; padding: 0; list-style: none; }

.mu-row {
	display: flex;
	align-items: center;
	gap: .75rem;
	padding: .75rem 1rem;
	border-bottom: 1px solid var(--mu-light-line);
}

.mu-card--dark .mu-row { border-color: var(--mu-dark-line); }

.mu-row:last-child { border-bottom: 0; }

.mu-row-main { flex: 1 1 auto; min-width: 0; }

.mu-row-main .mu-value {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.mu-row-end {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: .25rem;
	flex: 0 0 auto;
}

.mu-avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 2rem;
	height: 2rem;
	border-radius: 50%;
	background: var(--mu-light-card);
	font-size: .6875rem;
	font-weight: 700;
	color: var(--mu-ink);
}

.mu-card--dark .mu-avatar { background: rgba(255, 255, 255, .08); color: #fff; }

.mu-avatar--rail {
	width: auto;
	min-width: 3rem;
	padding: 0 .4375rem;
	border-radius: .5rem;
	font-family: var(--mu-mono);
	font-size: .6875rem;
	font-weight: 600;
}

.mu-rows--enter .mu-row:first-child { animation: mu-enter .6s cubic-bezier(.2, .7, .2, 1) both .4s; }

/* Key-value grid */
.mu-dl {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: .875rem 1rem;
	margin: 0;
}

.mu-dl > div { min-width: 0; }
.mu-dl dd { margin: 0; }
.mu-dl .mu-wide { grid-column: span 2; }

.mu-divider {
	height: 1px;
	margin: 1rem 0;
	background: var(--mu-light-line);
}

.mu-card--dark .mu-divider { background: var(--mu-dark-line); }

/* Form-like fields (CoP, FX) */
.mu-field {
	padding: .5rem .75rem;
	border: 1px solid var(--mu-light-line);
	border-radius: .625rem;
	background: #fff;
}

.mu-field + .mu-field { margin-top: .5rem; }

.mu-match {
	display: flex;
	gap: .625rem;
	margin-top: .75rem;
	padding: .75rem;
	border-radius: .75rem;
	background: #fdf6e3;
	font-size: .8125rem;
	line-height: 1.4;
	color: var(--mu-ink);
}

.mu-match i { font-size: 1.125rem; color: var(--mu-amber-ink); }
.mu-match--ok { background: rgba(86, 211, 162, .14); }
.mu-match--ok i { color: var(--mu-green-ink); }

.mu-actions { display: flex; gap: .5rem; margin-top: .75rem; }

.mu-btn {
	flex: 1 1 0;
	padding: .5rem .75rem;
	border-radius: 999px;
	border: 1px solid var(--mu-light-line);
	background: #fff;
	font-size: .75rem;
	font-weight: 600;
	text-align: center;
	color: var(--mu-ink);
}

.mu-btn--primary { border-color: var(--mu-ink); background: var(--mu-ink); color: #fff; }

/* Meter (safeguarding, card spend) */
.mu-meter {
	height: .375rem;
	border-radius: 999px;
	background: var(--mu-light-line);
	overflow: hidden;
}

.mu-meter > span {
	display: block;
	height: 100%;
	border-radius: inherit;
	background: var(--mu-green);
	transform-origin: left;
	animation: mu-grow 1.2s cubic-bezier(.2, .7, .2, 1) both .3s;
}

.mu-card--dark .mu-meter { background: rgba(255, 255, 255, .1); }

/* Toggle rows (card controls) */
.mu-toggle {
	position: relative;
	flex: 0 0 auto;
	width: 1.875rem;
	height: 1.125rem;
	border-radius: 999px;
	background: var(--mu-green);
}

.mu-toggle::after {
	content: "";
	position: absolute;
	top: .1875rem;
	right: .1875rem;
	width: .75rem;
	height: .75rem;
	border-radius: 50%;
	background: #fff;
}

.mu-toggle--off { background: var(--mu-gray, #d2d7dd); }
.mu-toggle--off::after { right: auto; left: .1875rem; }

/* Payment card */
.mu-paycard {
	position: relative;
	aspect-ratio: 1.586;
	max-width: 17rem;
	padding: 1rem 1.125rem;
	border-radius: 1rem;
	background:
		radial-gradient(120% 90% at 100% 0%, rgba(86, 211, 162, .55) 0%, rgba(86, 211, 162, 0) 55%),
		#0a0b0c;
	color: #fff;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	box-shadow: 0 18px 40px -18px rgba(10, 11, 12, .55);
}

.mu-paycard .mu-meta { color: rgba(255, 255, 255, .62); }

.mu-chip-ic {
	width: 1.75rem;
	height: 1.25rem;
	border-radius: .25rem;
	background: linear-gradient(135deg, #e9d9a6, #b8a05c);
}

/* Code window */
.mu-code {
	margin: 0;
	padding: 1rem;
	font-family: var(--mu-mono);
	font-size: .75rem;
	line-height: 1.65;
	color: rgba(255, 255, 255, .82);
	white-space: pre;
	overflow: hidden;
	background: transparent;
	border: 0;
	border-radius: 0;
}

.mu-code .k { color: #9fe7c9; }
.mu-code .s { color: #f4d06b; }
.mu-code .m { color: #56d3a2; font-weight: 600; }
.mu-code .c { color: rgba(255, 255, 255, .45); }

.mu-window-dots { display: inline-flex; gap: .3125rem; }

.mu-window-dots span {
	width: .5rem;
	height: .5rem;
	border-radius: 50%;
	background: rgba(255, 255, 255, .18);
}

.mu-panel--code { background: var(--mu-dark); border-color: var(--mu-dark); }
.mu-panel--code .mu-panel-head { border-color: rgba(255, 255, 255, .09); color: rgba(255, 255, 255, .6); font-family: var(--mu-mono); font-size: .75rem; font-weight: 400; }

/* Proof pills under the hero (dark band) */
.mu-proof {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: .75rem;
}

.mu-proof-item {
	display: flex;
	align-items: center;
	gap: .75rem;
	min-width: 0;
	padding: .75rem 1rem .75rem .75rem;
	border-radius: 999px;
	background: rgba(255, 255, 255, .06);
	border: 1px solid rgba(255, 255, 255, .08);
}

.mu-proof-item > .mu-ic {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 50%;
	background: rgba(86, 211, 162, .14);
	padding: .5625rem;
	color: var(--mu-green);
}

.mu-proof-item > span { min-width: 0; }

.mu-proof-item strong {
	display: block;
	font-family: var(--mu-mono);
	font-size: .875rem;
	font-weight: 500;
	color: #fff;
}

.mu-proof-item span { display: block; font-size: .75rem; color: rgba(255, 255, 255, .62); }

@media (max-width: 991.98px) {
	.mu-proof { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 575.98px) {
	.mu-proof { grid-template-columns: minmax(0, 1fr); }
	.mu-card-head { padding: 1.375rem 1.25rem 0; }
	.mu-stage { padding: 0 1.25rem; min-height: 0; }
	.mu-stage--flush { padding-bottom: 1.25rem; }
	.mu-big { font-size: 1.375rem; }
}

/* The wide card stacks its two panels on small screens. */
@media (max-width: 767.98px) {
	.mu-stage--split { flex-direction: column; align-items: stretch; }
	.mu-stage--split > .mu-panel { flex: 0 0 auto; }
	.mu-stage--split > .mu-panel--narrow { flex-basis: auto; border-radius: 1rem; border-bottom: 1px solid var(--mu-dark-line); }
	.mu-stage--split .mu-panel--offset { margin-top: 0; }
}

@keyframes mu-pulse {
	0%, 100% { box-shadow: 0 0 0 0 rgba(86, 211, 162, .55); }
	50% { box-shadow: 0 0 0 .3125rem rgba(86, 211, 162, 0); }
}

@keyframes mu-enter {
	from { opacity: 0; transform: translateY(-.5rem); }
	to { opacity: 1; transform: none; }
}

@keyframes mu-grow {
	from { transform: scaleX(0); }
	to { transform: scaleX(1); }
}

@media (prefers-reduced-motion: reduce) {
	.mu-live .mu-dot,
	.mu-rows--enter .mu-row:first-child,
	.mu-meter > span { animation: none; }
}

/* Hero of a regional home page */
.mu-hero::before {
	content: "";
	position: absolute;
	inset: -20% -10% auto;
	height: 90%;
	background: radial-gradient(50% 60% at 50% 0%, rgba(86, 211, 162, .16), rgba(86, 211, 162, 0) 70%);
	pointer-events: none;
}

.mu-hero::after {
	content: "";
	position: absolute;
	inset: 0;
	background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
	background-size: 48px 48px;
	-webkit-mask-image: radial-gradient(70% 70% at 50% 30%, #000, transparent);
	mask-image: radial-gradient(70% 70% at 50% 30%, #000, transparent);
	pointer-events: none;
}

.mu-kicker--dark { color: rgba(255, 255, 255, .62); }

.mu-ic { flex: 0 0 auto; }
.mu-chip .mu-ic { width: .8125rem; height: .8125rem; }
.mu-match > .mu-ic { width: 1.125rem; height: 1.125rem; color: var(--mu-amber-ink); }
.mu-match--ok > .mu-ic { color: var(--mu-green-ink); }

/* Card head with a figure on the right (wide cards) */
.mu-card-head--split {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem 2rem;
}

.mu-head-aside { text-align: right; }
.mu-head-aside .mu-big { color: #fff; }

@media (max-width: 767.98px) {
	.mu-head-aside { text-align: left; }
}

/* A row of daily results (safeguarding history) */
.mu-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .375rem; }

.mu-day {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: .25rem;
	padding: .375rem 0;
	border-radius: .5rem;
	background: rgba(86, 211, 162, .12);
	font-size: .6875rem;
	color: var(--mu-green-ink);
}

.mu-day .mu-ic { width: .75rem; height: .75rem; }

/* Hero scenes (templates/includes/market_ui/art_*.html) */
.mu-art { position: relative; }

.mu-window { border: 1px solid rgba(255, 255, 255, .1); border-radius: 1.25rem; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .8); }

.mu-window-bar {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: .75rem 1rem;
	border-bottom: 1px solid var(--mu-dark-line);
}

.mu-window-body { display: flex; min-height: 22rem; }

.mu-side {
	display: flex;
	flex-direction: column;
	gap: .25rem;
	flex: 0 0 9.5rem;
	padding: 1rem .75rem;
	border-right: 1px solid var(--mu-dark-line);
	font-size: .8125rem;
	color: var(--mu-dark-muted);
}

.mu-side span { padding: .375rem .625rem; border-radius: .5rem; }
.mu-side .is-active { background: rgba(86, 211, 162, .14); color: var(--mu-green); font-weight: 600; }

.mu-window-main { flex: 1 1 auto; min-width: 0; padding: 1.25rem; }
.mu-window-main .mu-big { color: #fff; }

.mu-panel--round { border-radius: 1rem; border-bottom: 1px solid var(--mu-dark-line); }

@media (max-width: 575.98px) {
	.mu-side { display: none; }
	.mu-window-body { min-height: 0; }
}

.mu-phones {
	position: relative;
	display: flex;
	justify-content: center;
	align-items: flex-start;
	padding: 1rem 0 2rem;
}

.mu-phone {
	position: relative;
	z-index: 2;
	width: 17.5rem;
	max-width: 100%;
	padding: 1.25rem 1.125rem;
	border: 6px solid #1d1f23;
	border-radius: 2.25rem;
	background: #fff;
	color: var(--mu-ink);
	box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .8);
}

.mu-phone .mu-row { border-color: var(--mu-light-line); }
.mu-phone .mu-label, .mu-phone .mu-meta { color: var(--mu-muted); }

.mu-phone--back {
	z-index: 1;
	width: 15.5rem;
	margin: 3.5rem 0 0 -1.5rem;
	padding-left: 2.25rem;
	border-color: #2a2d33;
	background: #f7f8f9;
}

.mu-phone-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }

.mu-paycard--sm { max-width: none; padding: .75rem .875rem; border-radius: .875rem; }

@media (max-width: 575.98px) {
	.mu-phone--back { display: none; }
}

.mu-steps .mu-row { gap: .875rem; }
.mu-steps .mu-chip { min-width: 4.25rem; justify-content: center; }

.mu-card--dark .mu-btn { background: rgba(255, 255, 255, .06); border-color: var(--mu-dark-line); color: #fff; }
.mu-card--dark .mu-btn--primary { background: var(--mu-green); border-color: var(--mu-green); color: var(--mu-ink); }

/* A light phone inside a dark (dark-mode) hero: reset the theme's dark-mode colours. */
.mu .mu-phone {
	--si-body-color: #646b76;
	--si-heading-color: #0a0b0c;
	--si-gray-900: #0a0b0c;
	--si-gray-800: #242529;
	--si-gray-700: #646b76;
	--si-gray-600: #898c96;
	--si-border-color: #e7e9ec;
}

.mu .mu-phone .mu-value,
.mu .mu-phone .mu-big,
.mu .mu-phone .mu-amount,
.mu .mu-phone .mu-avatar,
.mu .mu-phone .mu-btn { color: var(--mu-ink); }
.mu .mu-phone .mu-amount--in { color: var(--mu-green-ink); }
.mu .mu-phone .mu-btn--primary { color: #fff; }
.mu .mu-phone .mu-label, .mu .mu-phone .mu-meta { color: var(--mu-muted); }
.mu .mu-phone .mu-paycard, .mu .mu-phone .mu-paycard .mu-mono { color: #fff; }
.mu .mu-phone .mu-paycard .mu-meta { color: rgba(255, 255, 255, .62); }
.mu .mu-phone .mu-chip { color: var(--mu-green-ink); }

/* Dark cards and scenes inside a dark-mode hero: the theme colours every span. */
.mu .mu-card--dark .mu-value,
.mu .mu-card--dark .mu-big,
.mu .mu-card--dark .mu-amount,
.mu .mu-card--dark .mu-panel-head > span:first-child { color: #fff; }
.mu .mu-card--dark .mu-amount--in { color: var(--mu-green); }
.mu .mu-card--dark .mu-label,
.mu .mu-card--dark .mu-meta,
.mu .mu-card--dark .mu-side span { color: var(--mu-dark-muted); }
.mu .mu-card--dark .mu-side .is-active,
.mu .mu-card--dark .mu-chip { color: var(--mu-green); }
.mu .mu-card--dark .mu-avatar,
.mu .mu-card--dark .mu-pill { color: rgba(255, 255, 255, .88); }
.mu .mu-proof-item strong { color: #fff; }
.mu .mu-proof-item span span { color: rgba(255, 255, 255, .62); }

.mu-row-main .mu-meta { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
