:root {
	--fuji-currency-accent: #12578f;
	--fuji-currency-text: #202124;
	--fuji-currency-muted: #676b70;
	--fuji-currency-border: #e4e5e7;
	--fuji-currency-surface: #fff;
	--fuji-currency-selected: #edf5fc;
	--fuji-currency-focus: #1769aa;
}

.fuji-currency-ui {
	display: flex;
	align-items: center;
	height: 100%;
}

.header-currency-item {
	display: flex;
	align-items: center;
	height: 40px;
	margin-right: 6px !important;
	padding-right: 6px !important;
	border-right: 1px solid #e0e3e7;
}

.fuji-currency-ui__trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 5px;
	min-width: 76px;
	height: 40px;
	padding: 0 5px;
	margin: 0;
	border: 0;
	border-radius: 4px;
	background: transparent;
	box-shadow: none;
	color: var(--fuji-currency-text);
	font: inherit;
	font-size: 13px;
	font-weight: 500;
	letter-spacing: .025em;
	line-height: 1;
	text-transform: none;
	cursor: pointer;
	transition: background-color 140ms ease, color 140ms ease;
}

.fuji-currency-ui__trigger:hover,
.fuji-currency-ui__trigger[aria-expanded="true"] {
	background: transparent;
	color: #155fa7;
}

.fuji-currency-ui__trigger:focus-visible,
.fuji-currency-ui__close:focus-visible,
.fuji-currency-ui__option:focus-visible {
	outline: 2px solid var(--fuji-currency-focus);
	outline-offset: 2px;
}

.fuji-currency-ui__trigger-flag {
	font-size: 16px;
	font-weight: 400;
	line-height: 1;
}

.fuji-currency-ui__trigger-code {
	white-space: nowrap;
}

.fuji-currency-ui__chevron {
	width: 10px;
	height: 7px;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.5;
	transition: transform 140ms ease;
}

.fuji-currency-ui__trigger[aria-expanded="true"] .fuji-currency-ui__chevron {
	transform: rotate(180deg);
}

.fuji-currency-ui__panel {
	position: fixed;
	z-index: 99999;
	top: var(--fuji-currency-panel-top, 80px);
	left: var(--fuji-currency-panel-left, auto);
	width: min(330px, calc(100vw - 32px));
	max-height: min(620px, var(--fuji-currency-panel-max-height, calc(100dvh - 32px)));
	overflow: hidden;
	border: 1px solid var(--fuji-currency-border);
	border-radius: 10px;
	background: var(--fuji-currency-surface);
	box-shadow: 0 18px 48px rgba(16, 20, 24, .18), 0 3px 10px rgba(16, 20, 24, .08);
	color: var(--fuji-currency-text);
	font-family: inherit;
	animation: fuji-currency-popover-in 150ms ease-out;
}

.fuji-currency-ui__panel[hidden] {
	display: none !important;
}

.fuji-currency-ui__panel-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 14px;
	padding: 17px 18px 13px;
	border-bottom: 1px solid var(--fuji-currency-border);
}

.fuji-currency-ui__title {
	margin: 0;
	color: var(--fuji-currency-text);
	font-size: 16px;
	font-weight: 500;
	letter-spacing: 0;
	line-height: 1.25;
}

.fuji-currency-ui__description {
	max-width: 240px;
	margin: 5px 0 0;
	color: var(--fuji-currency-muted);
	font-size: 11px;
	font-weight: 400;
	line-height: 1.45;
}

.fuji-currency-ui__close {
	display: inline-flex;
	flex: 0 0 32px;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	margin: -6px -7px 0 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	box-shadow: none;
	color: #4c5055;
	cursor: pointer;
}

.fuji-currency-ui__close:hover {
	background: #f3f4f5;
	color: #151719;
}

.fuji-currency-ui__close svg {
	width: 16px;
	height: 16px;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-width: 1.7;
}

.fuji-currency-ui__options {
	max-height: min(500px, calc(var(--fuji-currency-panel-max-height, 620px) - 83px));
	padding: 6px;
	margin: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.fuji-currency-ui__option {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	min-height: 47px;
	padding: 6px 10px;
	margin: 0;
	border: 0;
	border-radius: 8px;
	background: transparent;
	box-shadow: none;
	color: var(--fuji-currency-text);
	font: inherit;
	text-align: left;
	text-transform: none;
	cursor: pointer;
	transition: background-color 120ms ease;
}

.fuji-currency-ui__option:hover {
	background: #f6f6f7;
}

.fuji-currency-ui__option.is-current {
	background: var(--fuji-currency-selected);
}

.fuji-currency-ui__option-flag {
	display: flex;
	flex: 0 0 26px;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 24px;
	font-size: 18px;
	line-height: 1;
}

.fuji-currency-ui__option-copy {
	display: flex;
	flex: 1 1 auto;
	min-width: 0;
	flex-direction: column;
	gap: 2px;
}

.fuji-currency-ui__option-name {
	overflow: hidden;
	font-size: 12px;
	font-weight: 500;
	line-height: 1.35;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.fuji-currency-ui__option-meta {
	color: var(--fuji-currency-muted);
	font-size: 11px;
	font-weight: 400;
	letter-spacing: .045em;
	line-height: 1.35;
}

.fuji-currency-ui__check {
	flex: 0 0 20px;
	width: 20px;
	height: 20px;
	fill: none;
	stroke: var(--fuji-currency-accent);
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 2;
	opacity: 0;
}

.fuji-currency-ui__option.is-current .fuji-currency-ui__check {
	opacity: 1;
}

@keyframes fuji-currency-popover-in {
	from {
		opacity: 0;
		transform: translateY(-5px) scale(.985);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

@media (max-width: 849px) {
	.header-currency-item {
		height: 44px;
		margin-right: 3px !important;
		padding-right: 3px !important;
		border-right: 1px solid #e0e3e7;
	}

	.header-main .fuji-currency-ui__trigger {
		gap: 5px;
		min-width: 62px;
		height: 40px;
		padding: 0 3px;
		font-size: 11px;
		letter-spacing: .025em;
	}

	.header-main .fuji-currency-ui__trigger-flag {
		font-size: 14px;
	}

	.header-main .fuji-currency-ui__chevron {
		width: 8px;
		height: 6px;
	}

	.fuji-currency-ui__panel {
		top: var(--fuji-currency-panel-top, 99px);
		left: var(--fuji-currency-panel-left, 8px);
		width: min(330px, calc(100vw - 16px));
		max-height: var(--fuji-currency-panel-max-height, calc(100dvh - 107px));
		border: 1px solid var(--fuji-currency-border);
		border-radius: 10px;
		box-shadow: 0 18px 48px rgba(16, 20, 24, .18), 0 3px 10px rgba(16, 20, 24, .08);
		animation: fuji-currency-popover-in 150ms ease-out;
	}

	.fuji-currency-ui__panel-header {
		padding: 17px 18px 13px;
	}

	.fuji-currency-ui__options {
		max-height: calc(var(--fuji-currency-panel-max-height, 520px) - 83px);
		padding: 6px;
	}

	.fuji-currency-ui__option {
		min-height: 47px;
	}
}

@media (max-width: 360px) {
	.header-main .fuji-currency-ui__trigger {
		gap: 4px;
		min-width: 59px;
		padding-right: 4px;
		padding-left: 4px;
		font-size: 10px;
	}

	.header-main .fuji-currency-ui__trigger-flag {
		font-size: 13px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.fuji-currency-ui__panel,
	.fuji-currency-ui__chevron {
		animation: none;
		transition: none;
	}
}
