/* Nigeria FX & Remittance Converter */
.fx-tool-wrapper {
	--fx-bg: #0a0f1e;
	--fx-panel: #121a33;
	--fx-card: #172042;
	--fx-border: #2a3563;
	--fx-text: #eef1fb;
	--fx-muted: #b4bddb;
	--fx-accent: #34d399;
	--fx-accent-text: #04210f;
	--fx-amber: #fbbf24;
	--fx-focus: #93c5fd;
	--fx-warn-bg: #1d2548;

	box-sizing: border-box;
	display: flow-root;
	clear: both;
	isolation: isolate;
	position: relative;
	width: 100%;
	max-width: 960px;
	min-height: 780px;
	margin: 35px auto;
	padding: 28px 24px;
	background: var(--fx-bg);
	color: var(--fx-text);
	border: 1px solid var(--fx-border);
	border-radius: 16px;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	font-size: 16px;
	line-height: 1.6;
	overflow: hidden;
}

.fx-tool-wrapper.fx-theme-light {
	--fx-bg: #ffffff;
	--fx-panel: #f3f5fb;
	--fx-card: #ffffff;
	--fx-border: #c9d0e6;
	--fx-text: #111827;
	--fx-muted: #4b5563;
	--fx-accent: #047857;
	--fx-accent-text: #ffffff;
	--fx-amber: #92400e;
	--fx-focus: #1d4ed8;
	--fx-warn-bg: #fff7e0;
}

.fx-tool-wrapper *,
.fx-tool-wrapper *::before,
.fx-tool-wrapper *::after { box-sizing: border-box; }

/* Spacer bands: keep clickable controls away from any ad slot placed next to the widget */
.fx-tool-wrapper::before,
.fx-tool-wrapper::after { content: ""; display: block; height: 8px; }

.fx-tool-wrapper h2,
.fx-tool-wrapper h3 { color: var(--fx-text); line-height: 1.3; margin: 0 0 12px; }
.fx-tool-wrapper h2 { font-size: 1.5rem; }
.fx-tool-wrapper h3 { font-size: 1.1rem; }

.fx-header { margin-bottom: 20px; }
.fx-title { margin: 0 0 6px; }
.fx-meta { margin: 0; color: var(--fx-muted); font-size: .95rem; }
.fx-updated { display: inline-block; margin-left: 6px; }


/* Live status, countdown and progress bar */
.fx-live { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 12px; min-height: 32px; font-size: .92rem; color: var(--fx-muted); }
.fx-updated strong { color: var(--fx-text); font-weight: 600; }
.fx-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: .8rem; font-weight: 700; border: 1px solid currentColor; }
.fx-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.fx-badge-live { color: var(--fx-accent); }
.fx-badge-stale { color: var(--fx-amber); }
.fx-badge-saved { color: var(--fx-muted); }
.fx-timer { margin-left: auto; font-variant-numeric: tabular-nums; }
.fx-timer strong { color: var(--fx-text); }
.fx-bar { height: 6px; margin-top: 8px; background: var(--fx-panel); border-radius: 999px; overflow: hidden; }
.fx-bar span { display: block; height: 100%; width: 0; background: var(--fx-accent); border-radius: 999px; }
.fx-source { margin: 8px 0 0; font-size: .82rem; color: var(--fx-muted); }
@media (prefers-reduced-motion: no-preference) { .fx-bar span { transition: width 1s linear; } .fx-badge-live::before { animation: fxpulse 2s ease-in-out infinite; } }
@keyframes fxpulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
@media (max-width: 760px) { .fx-timer { margin-left: 0; width: 100%; } }

/* Form */
.fx-form {
	display: grid;
	grid-template-columns: 1.1fr 1.4fr auto 1.4fr;
	gap: 14px;
	align-items: end;
	padding: 18px;
	background: var(--fx-panel);
	border: 1px solid var(--fx-border);
	border-radius: 12px;
	margin-bottom: 8px;
}
.fx-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fx-field label { font-weight: 600; font-size: .9rem; color: var(--fx-muted); }
.fx-field-fees { grid-column: 1 / -1; }

.fx-tool-wrapper input[type="text"],
.fx-tool-wrapper select {
	width: 100%;
	min-height: 48px;
	padding: 10px 12px;
	background: var(--fx-bg);
	color: var(--fx-text);
	border: 1px solid var(--fx-border);
	border-radius: 10px;
	font: inherit;
	font-size: 1rem;
}

.fx-swap {
	min-width: 48px;
	min-height: 48px;
	padding: 0 12px;
	background: var(--fx-accent);
	color: var(--fx-accent-text);
	border: 0;
	border-radius: 10px;
	font-size: 1.4rem;
	line-height: 1;
	cursor: pointer;
}
.fx-swap:hover { filter: brightness(1.08); }

.fx-check {
	display: flex !important;
	align-items: center;
	gap: 12px;
	min-height: 44px;
	cursor: pointer;
	color: var(--fx-text) !important;
	font-size: 1rem !important;
}
.fx-check input { width: 24px; height: 24px; flex: 0 0 24px; accent-color: var(--fx-accent); margin: 0; }

.fx-tool-wrapper :focus-visible {
	outline: 3px solid var(--fx-focus);
	outline-offset: 2px;
}

.fx-status { min-height: 24px; margin: 8px 2px 12px; color: var(--fx-amber); font-weight: 600; }

/* Result cards */
.fx-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.fx-card {
	min-height: 300px;
	padding: 20px;
	background: var(--fx-card);
	border: 1px solid var(--fx-border);
	border-radius: 14px;
}
.fx-card-official { border-top: 4px solid var(--fx-accent); }
.fx-card-parallel { border-top: 4px solid var(--fx-amber); }

.fx-rate { margin: 0 0 10px; color: var(--fx-muted); font-weight: 600; }
.fx-total-label { margin: 0; font-size: .85rem; color: var(--fx-muted); text-transform: uppercase; letter-spacing: .04em; }
.fx-total { margin: 2px 0 12px; font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 700; word-break: break-word; }
.fx-card-official .fx-total { color: var(--fx-accent); }
.fx-card-parallel .fx-total { color: var(--fx-amber); }

.fx-breakdown { margin: 0 0 12px; padding: 10px 12px; background: var(--fx-panel); border-radius: 10px; font-size: .92rem; }
.fx-breakdown[hidden] { display: none; }
.fx-breakdown div { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.fx-breakdown dt { color: var(--fx-muted); }
.fx-breakdown dd { margin: 0; font-weight: 600; text-align: right; }

.fx-spread { margin: 0 0 10px; padding: 10px 12px; min-height: 48px; background: var(--fx-panel); border-left: 4px solid var(--fx-amber); border-radius: 6px; font-weight: 600; font-size: .95rem; }
.fx-spread:empty { visibility: hidden; }
.fx-note { margin: 0; font-size: .85rem; color: var(--fx-muted); }

.fx-disclaimer-short { margin: 20px 0 0; padding: 12px 14px; background: var(--fx-warn-bg); border: 1px solid var(--fx-border); border-radius: 10px; font-size: .88rem; color: var(--fx-muted); }
.fx-disclaimer-short strong { color: var(--fx-text); }

/* Editorial guide */
.fx-guide { margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--fx-border); }
.fx-guide p, .fx-guide li { color: var(--fx-text); max-width: 75ch; }
.fx-guide h3 { margin-top: 24px; }
.fx-guide ol { padding-left: 22px; }
.fx-guide li { margin-bottom: 8px; }
.fx-table-scroll { overflow-x: auto; margin: 12px 0 16px; }
.fx-guide table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: .92rem; }
.fx-guide caption { text-align: left; padding: 0 0 8px; color: var(--fx-muted); font-size: .85rem; }
.fx-guide th, .fx-guide td { padding: 10px 12px; text-align: left; vertical-align: top; border: 1px solid var(--fx-border); color: var(--fx-text); background: transparent; }
.fx-guide thead th { background: var(--fx-panel); }
.fx-disclaimer { margin-top: 28px; padding: 16px 18px; background: var(--fx-warn-bg); border: 1px solid var(--fx-border); border-left: 5px solid var(--fx-amber); border-radius: 10px; }
.fx-disclaimer h3 { margin-top: 0; }
.fx-disclaimer p { margin: 0; font-size: .92rem; }

/* Links inside the guide */
.fx-guide a { color: var(--fx-link, #7dd3fc); text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }
.fx-guide a:hover { text-decoration-thickness: 2px; }
.fx-theme-light .fx-guide a { --fx-link: #1d4ed8; }

/* Responsive */
@media (max-width: 760px) {
	.fx-tool-wrapper { padding: 20px 14px; min-height: 980px; }
	.fx-form { grid-template-columns: 1fr; }
	.fx-field-swap { align-items: center; }
	.fx-swap { width: 100%; }
	.fx-cards { grid-template-columns: 1fr; }
	.fx-card { min-height: 0; }
}

@media (prefers-reduced-motion: no-preference) {
	.fx-swap { transition: filter .15s ease; }
}
