:root {
	--wx-bg: #F3F4F7;
	--wx-surface: #FFFFFF;
	--wx-ink: #12161C;
	--wx-accent: #1652E0;
	--wx-accent-press: #1247C4;
	--wx-muted: #5B6472;
	--wx-border: #E1E4EA;
	--wx-success: #0E8F6A;
	--wx-error: #B3261E;
	--wx-radius-sm: 8px;
	--wx-radius-md: 12px;
	--wx-sp-sm: 8px;
	--wx-sp-md: 16px;
	--wx-sp-lg: 32px;
	--wx-sp-xl: 64px;
	--wx-font-heading: 'Switzer', system-ui, sans-serif;
	--wx-font-body: 'General Sans', system-ui, sans-serif;
}

.wx-widget {
	font-family: var(--wx-font-body);
	color: var(--wx-ink);
	background: var(--wx-surface);
	border: 1px solid var(--wx-border);
	border-radius: var(--wx-radius-md);
	padding: var(--wx-sp-lg);
	max-width: 720px;
	margin: 0 auto;
	box-shadow: 0 12px 32px -16px rgba(18, 22, 28, 0.18);
}

.wx-widget * { box-sizing: border-box; }

.wx-widget__form {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	gap: var(--wx-sp-md);
	align-items: end;
}

.wx-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.wx-field label {
	font-size: 13px;
	font-weight: 500;
	color: var(--wx-muted);
	letter-spacing: 0.01em;
}

.wx-field__row { display: flex; gap: var(--wx-sp-sm); align-items: stretch; }
.wx-field__row--single { display: block; }

/* Both controls share one height/padding/line-height contract so SEND
   and RECEIVE always read as one polished control, not two different
   widgets bolted together — this is also what fixes the vertical
   clipping the RECEIVE select previously had. */
.wx-amount {
	font-family: var(--wx-font-body);
	font-size: 16px;
	line-height: 1.3;
	color: var(--wx-ink);
	background: var(--wx-surface);
	border: 1px solid var(--wx-border);
	border-radius: var(--wx-radius-sm);
	padding: 12px 14px;
	flex: 1 1 auto;
	min-width: 80px;
	width: auto;
	font-variant-numeric: tabular-nums;
}

.wx-amount:focus-visible,
.wx-asset-trigger:focus-visible,
.wx-swap:focus-visible,
.wx-cta:focus-visible,
.wx-flow-back:focus-visible,
.wx-quote__continue:focus-visible {
	outline: 2px solid var(--wx-accent);
	outline-offset: 2px;
}

/* ------------------------------------------------------------------ */
/* Rich asset picker — icon + ticker + full name + network, native vs
   wrapped always disambiguated. Fixed height/padding/line-height, no
   browser-native select chrome to fight with. */
/* ------------------------------------------------------------------ */

.wx-asset-picker {
	position: relative;
	flex: 0 0 auto;
	min-width: 188px;
}
.wx-field__row--single .wx-asset-picker { width: 100%; min-width: 0; }

.wx-asset-trigger {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	min-height: 48px;
	padding: 10px 12px;
	border: 1px solid var(--wx-border);
	border-radius: var(--wx-radius-sm);
	background: var(--wx-surface);
	font-family: var(--wx-font-body);
	font-size: 15px;
	line-height: 1.3;
	color: var(--wx-ink);
	cursor: pointer;
	text-align: left;
}
.wx-asset-trigger:hover { border-color: #C7CCD6; }
.wx-asset-trigger[aria-expanded="true"] { border-color: var(--wx-accent); }

.wx-asset-icon {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 24px;
	padding: 0 6px;
	border-radius: 6px;
	background: var(--wx-bg);
	border: 1px solid var(--wx-border);
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: var(--wx-ink);
	font-family: var(--wx-font-heading);
}

.wx-asset-trigger__label {
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wx-asset-chevron {
	flex: 0 0 auto;
	width: 8px; height: 8px;
	border-right: 1.5px solid var(--wx-muted);
	border-bottom: 1.5px solid var(--wx-muted);
	transform: rotate(45deg);
	margin-top: -4px;
}

.wx-asset-listbox {
	position: absolute;
	top: calc(100% + 6px);
	left: 0; right: 0;
	z-index: 20;
	margin: 0;
	padding: 6px;
	list-style: none;
	background: var(--wx-surface);
	border: 1px solid var(--wx-border);
	border-radius: var(--wx-radius-sm);
	box-shadow: 0 16px 36px -14px rgba(18, 22, 28, 0.3);
	max-height: 280px;
	overflow-y: auto;
}

.wx-asset-option {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 9px 10px;
	border-radius: 8px;
	cursor: pointer;
	font-size: 14px;
	line-height: 1.3;
}
.wx-asset-option:hover,
.wx-asset-option:focus { background: var(--wx-bg); outline: none; }
.wx-asset-option.is-selected { background: rgba(22, 82, 224, 0.08); font-weight: 600; }
.wx-asset-option__label { flex: 1; }

.wx-swap {
	width: 44px;
	height: 44px;
	border-radius: 999px;
	border: 1px solid var(--wx-border);
	background: var(--wx-surface);
	color: var(--wx-ink);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	margin-bottom: 2px;
	transition: transform 0.15s ease, background-color 0.15s ease;
}
.wx-swap:hover { background: var(--wx-bg); }
.wx-swap:active { transform: rotate(180deg); }
.wx-swap svg {
	display: block !important;
	width: 20px !important;
	height: 20px !important;
	max-width: none !important;
	flex-shrink: 0 !important;
	overflow: visible !important;
	color: var(--wx-ink) !important;
}
.wx-swap svg path {
	stroke: currentColor !important;
	fill: none !important;
}

.wx-cta {
	grid-column: 1 / -1;
	font-family: var(--wx-font-heading);
	font-weight: 600;
	font-size: 16px;
	color: #fff;
	background: var(--wx-accent);
	border: none;
	border-radius: 10px;
	padding: 14px var(--wx-sp-md);
	cursor: pointer;
	transition: background-color 0.15s ease;
}
.wx-cta:hover { background: var(--wx-accent-press); }
.wx-cta:disabled { opacity: 0.65; cursor: progress; }

.wx-form-error {
	grid-column: 1 / -1;
	color: var(--wx-error);
	font-size: 14px;
	margin: 0;
}

.wx-results { margin-top: var(--wx-sp-lg); }

.wx-notice {
	font-size: 14px;
	color: var(--wx-muted);
	background: var(--wx-bg);
	border-radius: var(--wx-radius-sm);
	padding: var(--wx-sp-md);
	margin: 0;
}

.wx-quote-list { display: flex; flex-direction: column; gap: var(--wx-sp-md); }

.wx-quote {
	padding: var(--wx-sp-md) 0;
	border-top: 1px solid var(--wx-border);
}
.wx-quote-list > .wx-quote:first-child { border-top: none; }

.wx-quote--best {
	border: 1px solid var(--wx-border);
	border-radius: var(--wx-radius-md);
	padding: var(--wx-sp-md);
	box-shadow: 0 10px 28px -18px rgba(18, 22, 28, 0.35);
}

.wx-quote__header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.wx-quote__provider { font-size: 13px; font-weight: 600; color: var(--wx-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.wx-quote--best .wx-quote__provider { color: var(--wx-ink); }

.wx-quote__amount {
	font-family: var(--wx-font-heading);
	font-weight: 600;
	font-size: 28px;
	line-height: 1.1;
	margin: 0;
	font-variant-numeric: tabular-nums;
}
.wx-quote--best .wx-quote__amount { font-size: 34px; }
.wx-quote__ticker { color: var(--wx-muted); font-size: 16px; font-weight: 500; }

.wx-quote__diff { margin: 4px 0 0; font-size: 14px; color: var(--wx-muted); font-weight: 500; }
.wx-quote__diff--best { color: var(--wx-success); }

.wx-quote__status-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }

.wx-badge {
	font-size: 12px;
	font-weight: 500;
	padding: 4px 10px;
	border-radius: 999px;
	background: var(--wx-bg);
	color: var(--wx-muted);
	border: 1px solid var(--wx-border);
	white-space: nowrap;
}
.wx-badge--best { background: var(--wx-success); color: #fff; border-color: var(--wx-success); font-size: 11px; padding: 3px 9px; }
.wx-badge--native { color: var(--wx-ink); }

/* Compact stacked detail list — deliberately NOT a 3-column grid, so a
   provider whose API doesn't itemize fees (SimpleSwap) reads as a
   normal, complete card instead of three empty boxes. */
.wx-quote__meta {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 14px 0 0;
	padding-top: 10px;
	border-top: 1px solid var(--wx-border);
}
.wx-quote__meta-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.wx-quote__meta-row dt { font-size: 12.5px; color: var(--wx-muted); margin: 0; flex: 0 0 auto; }
.wx-quote__meta-row dd { font-size: 12.5px; color: var(--wx-ink); margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.wx-quote__meta-note {
	display: block;
	font-size: 11px;
	font-weight: 500;
	color: var(--wx-success);
	margin-top: 2px;
}

/* Identity requirements line + expandable privacy disclosure. Deliberately
   styled as neutral/informational (not success-green like the fee
   "already included" note) — this is compliance context, not a positive
   claim, and must never visually imply one provider is "more private"
   than another; the wording itself carries all the meaning. */
.wx-quote__identity {
	margin: 10px 0 0;
	font-size: 12.5px;
	line-height: 1.5;
}
.wx-quote__identity-label { color: var(--wx-muted); }
.wx-quote__identity-value { color: var(--wx-ink); font-weight: 500; }

.wx-privacy-details {
	margin-top: 8px;
	padding-top: 8px;
	border-top: 1px solid var(--wx-border);
}
.wx-privacy-details summary {
	cursor: pointer;
	font-size: 12.5px;
	font-weight: 600;
	color: var(--wx-muted);
	list-style: none;
}
.wx-privacy-details summary::-webkit-details-marker { display: none; }
.wx-privacy-details summary::before { content: '+ '; }
.wx-privacy-details[open] summary::before { content: '\2212 '; }
.wx-privacy-details__body { margin-top: 10px; }

.wx-policy-fields { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.wx-policy-field dt {
	font-size: 11.5px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	color: var(--wx-muted);
	margin: 0 0 2px;
}
.wx-policy-field dd {
	font-size: 12.5px;
	color: var(--wx-ink);
	margin: 0;
	line-height: 1.5;
}
.wx-policy-field__detail { font-size: 12px; color: var(--wx-muted); margin: 4px 0 0; line-height: 1.5; }
.wx-policy-field__meta { font-size: 11px; color: var(--wx-muted); margin: 4px 0 0; word-break: break-all; }
.wx-policy-field__meta a { color: var(--wx-accent); text-decoration: underline; }

.wx-policy-notes-title {
	font-size: 11.5px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	color: var(--wx-muted);
	margin: 14px 0 6px;
}
.wx-policy-notes { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.wx-policy-notes li { font-size: 12px; color: var(--wx-muted); line-height: 1.5; }

.wx-quote__continue {
	margin-top: 12px;
	width: 100%;
	padding: 10px;
	border-radius: var(--wx-radius-sm);
	border: 1px solid var(--wx-border);
	background: var(--wx-surface);
	color: var(--wx-ink);
	font-weight: 600;
	font-size: 13px;
	cursor: pointer;
	font-family: var(--wx-font-body);
}
.wx-quote__continue:hover { background: var(--wx-bg); }
.wx-quote--best .wx-quote__continue { background: var(--wx-accent); border-color: var(--wx-accent); color: #fff; }
.wx-quote--best .wx-quote__continue:hover { background: var(--wx-accent-press); }

.wx-fee-help { margin-top: var(--wx-sp-md); border-top: 1px solid var(--wx-border); padding-top: var(--wx-sp-sm); }
.wx-fee-help summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--wx-muted); list-style: none; }
.wx-fee-help summary::-webkit-details-marker { display: none; }
.wx-fee-help summary::before { content: '+ '; }
.wx-fee-help[open] summary::before { content: '\2212 '; }
.wx-fee-help__body { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.wx-fee-help__body p { font-size: 12.5px; color: var(--wx-muted); margin: 0; line-height: 1.5; }
.wx-fee-help__body strong { color: var(--wx-ink); }

.wx-failures { list-style: none; margin: var(--wx-sp-md) 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.wx-failures__item { font-size: 13px; color: var(--wx-muted); }

/* ------------------------------------------------------------------ */
/* Embedded exchange-flow (address → review → create) */
/* ------------------------------------------------------------------ */

.wx-flow-step__title { font-family: var(--wx-font-heading); font-size: 18px; font-weight: 600; margin: 0 0 var(--wx-sp-md); }

.wx-flow-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: var(--wx-sp-md); }
.wx-flow-field label { font-size: 13px; font-weight: 500; color: var(--wx-muted); }
.wx-flow-field input {
	font-family: var(--wx-font-body);
	font-size: 15px;
	line-height: 1.3;
	padding: 12px 14px;
	border: 1px solid var(--wx-border);
	border-radius: var(--wx-radius-sm);
	color: var(--wx-ink);
}
.wx-flow-field__help { font-size: 12px; color: var(--wx-muted); margin: 0; }
.wx-flow-field__status { font-size: 12px; margin: 0; min-height: 15px; }
.wx-flow-field__status--valid { color: var(--wx-success); }
.wx-flow-field__status--invalid { color: var(--wx-error); }
.wx-flow-field__status--unknown { color: var(--wx-muted); }

.wx-flow-note { font-size: 12px; color: var(--wx-muted); margin: 4px 0; line-height: 1.5; }

.wx-flow-actions { display: flex; gap: var(--wx-sp-sm); margin-top: var(--wx-sp-md); }
.wx-flow-actions .wx-cta { flex: 1; grid-column: auto; }
.wx-flow-back {
	padding: 12px 18px;
	border-radius: 10px;
	border: 1px solid var(--wx-border);
	background: var(--wx-surface);
	color: var(--wx-ink);
	font-weight: 600;
	font-family: var(--wx-font-body);
	cursor: pointer;
}
.wx-flow-back:hover { background: var(--wx-bg); }

.wx-review-rows { display: flex; flex-direction: column; gap: 0; margin: 0 0 var(--wx-sp-md); }
.wx-review-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; padding: 8px 0; border-bottom: 1px solid var(--wx-border); }
.wx-review-row dt { color: var(--wx-muted); margin: 0; }
.wx-review-row dd { margin: 0; color: var(--wx-ink); text-align: right; font-variant-numeric: tabular-nums; word-break: break-all; max-width: 60%; }

.wx-review-disclosure { background: var(--wx-bg); border-radius: var(--wx-radius-sm); padding: var(--wx-sp-md); margin-bottom: var(--wx-sp-md); }
.wx-review-disclosure__title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--wx-muted); margin: 0 0 6px; }
.wx-review-disclosure p { font-size: 13px; color: var(--wx-ink); margin: 0 0 10px; line-height: 1.5; }
.wx-review-terms-link { font-size: 12.5px; color: var(--wx-accent); text-decoration: underline; }
.wx-review-affiliate { font-size: 12px; color: var(--wx-muted); margin: 10px 0 0; line-height: 1.5; }

.wx-flow-disabled { background: var(--wx-bg); border-radius: var(--wx-radius-md); padding: var(--wx-sp-lg); text-align: center; }
.wx-flow-disabled__title { font-family: var(--wx-font-heading); font-weight: 600; font-size: 16px; margin: 0 0 8px; }
.wx-flow-disabled p { font-size: 13.5px; color: var(--wx-muted); margin: 0 0 var(--wx-sp-md); line-height: 1.5; }

/* ------------------------------------------------------------------ */
/* Deposit / transaction-result display */
/* ------------------------------------------------------------------ */

.wx-deposit-preview {
	font-family: var(--wx-font-body);
	color: var(--wx-ink);
	background: var(--wx-surface);
	border: 1px solid var(--wx-border);
	border-radius: var(--wx-radius-md);
	padding: var(--wx-sp-lg);
}
.wx-deposit-amount { font-family: var(--wx-font-heading); font-size: 28px; font-weight: 600; margin: 0 0 var(--wx-sp-md); }

/* ------------------------------------------------------------------ */
/* Transaction expiry / send-by timer. One compact, quiet element by
   default (guidance/countdown states) that only escalates visually when
   genuinely close to or past the deadline — never a giant banner, per
   the brief's mobile guidance. expiry_type/expiry_is_hard from the
   backend (Transaction_Expiry_Type::*) are the only vocabulary this
   ever branches on. */
/* ------------------------------------------------------------------ */

.wx-expiry {
	display: flex;
	flex-direction: column;
	gap: 4px;
	background: var(--wx-bg);
	border: 1px solid var(--wx-border);
	border-radius: var(--wx-radius-sm);
	padding: 10px 12px;
	margin: 0 0 var(--wx-sp-md);
}
.wx-expiry__head { display: flex; align-items: center; gap: 8px; }
.wx-expiry__dot {
	flex: 0 0 auto;
	width: 8px; height: 8px;
	border-radius: 999px;
	background: var(--wx-accent);
}
.wx-expiry__label {
	font-size: 13px;
	font-weight: 600;
	color: var(--wx-ink);
	font-variant-numeric: tabular-nums;
}
.wx-expiry__detail { font-size: 12px; color: var(--wx-muted); margin: 0; line-height: 1.5; }
.wx-expiry__actions:empty { display: none; }
.wx-expiry__actions { margin-top: 4px; }
.wx-expiry__action { grid-column: auto; width: auto; padding: 8px 14px; font-size: 13px; }

/* No reliable hard deadline — calm and informational, no urgency color. */
.wx-expiry--guidance .wx-expiry__dot { background: var(--wx-muted); }

/* Approaching the deadline (last WX_EXPIRY_WARN_SECONDS) — just enough
   color to be noticeable without becoming alarming. */
.wx-expiry--warn { border-color: var(--wx-error); background: rgba(179, 38, 30, 0.06); }
.wx-expiry--warn .wx-expiry__dot { background: var(--wx-error); }
.wx-expiry--warn .wx-expiry__label { color: var(--wx-error); }

/* Expired — visually distinct; copy itself (not color alone) makes clear
   the rate/quote is no longer guaranteed. */
.wx-expiry--expired { border-color: var(--wx-error); background: rgba(179, 38, 30, 0.08); }
.wx-expiry--expired .wx-expiry__dot { background: var(--wx-error); }
.wx-expiry--expired .wx-expiry__label { color: var(--wx-error); }

/* Deposit already detected — reassuring, not alarming; the countdown is
   no longer the relevant signal once a deposit is visible. */
.wx-expiry--detected { border-color: var(--wx-success); background: rgba(14, 143, 106, 0.06); }
.wx-expiry--detected .wx-expiry__dot { background: var(--wx-success); }
.wx-expiry--detected .wx-expiry__label { color: var(--wx-success); }

.wx-deposit-qr { display: flex; justify-content: center; padding: var(--wx-sp-md) 0; }
.wx-deposit-address { display: flex; align-items: center; gap: 8px; background: var(--wx-bg); border-radius: var(--wx-radius-sm); padding: 10px 12px; margin-bottom: var(--wx-sp-md); }
.wx-deposit-address code { flex: 1; font-size: 12.5px; word-break: break-all; }
.wx-copy-btn { flex: 0 0 auto; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--wx-border); background: var(--wx-surface); color: var(--wx-ink); font-size: 12px; font-weight: 600; cursor: pointer; font-family: var(--wx-font-body); }
.wx-copy-btn:hover { background: var(--wx-bg); }

.wx-skeleton {
	height: 92px;
	border-radius: var(--wx-radius-md);
	background: linear-gradient(90deg, var(--wx-bg) 25%, #EAEBEF 37%, var(--wx-bg) 63%);
	background-size: 400% 100%;
	animation: wx-shimmer 1.4s ease infinite;
	margin-bottom: var(--wx-sp-sm);
}
@keyframes wx-shimmer {
	0% { background-position: 100% 50%; }
	100% { background-position: 0 50%; }
}
@media (prefers-reduced-motion: reduce) {
	.wx-skeleton { animation: none; background: var(--wx-bg); }
	.wx-swap:active { transform: none; }
}

.wx-sr-only {
	position: absolute;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media (max-width: 640px) {
	.wx-widget { padding: var(--wx-sp-md); border-radius: var(--wx-radius-md); box-shadow: none; }
	.wx-widget__form { grid-template-columns: 1fr; }
	.wx-swap { justify-self: center; margin: -4px 0; }
	.wx-quote__amount { font-size: 24px; }
	.wx-field__row { flex-wrap: wrap; }
	.wx-asset-picker { min-width: 140px; flex: 1 1 140px; }
	.wx-amount { flex: 1 1 100px; }
	.wx-flow-actions { flex-direction: column-reverse; }
	.wx-review-row { flex-direction: column; gap: 2px; }
	.wx-review-row dd { text-align: left; max-width: 100%; }
	.wx-expiry { padding: 8px 10px; }
	.wx-expiry__label { font-size: 12.5px; }
}
