:root {
	--bg: #444444;
	--panel: #0e1215;
	--muted: #98a3a9;
	--text: #eef4f7;
	--accent: #4fb0ff;
	--accent-2: #2ca5ff;
}

* {
	box-sizing: border-box;
}

html,
body {
	height: 100%;
	margin: 0;
	font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial;
	-webkit-font-smoothing: antialiased;
}

body {
	background: var(--bg);
	color: var(--text);
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 18px;
}

.container {
	width: 100%;
	max-width: 720px;
	background: #060c14;
	border-radius: 14px;
	padding: 18px;
	border: 1px solid rgba(255, 255, 255, 0.03);
	box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
}

.top-cards {
	display: flex;
	justify-content: center;
	gap: 12px;
	margin-bottom: 12px;
	flex-wrap: wrap;
}

.rate-pill {
	background: rgba(255, 255, 255, 0.07);
	padding: 8px 12px;
	border-radius: 12px;
	font-size: 14px;
	color: var(--muted);
	min-width: 140px;
	text-align: center;
	border: 1px solid rgba(255, 255, 255, 0.03);
}

.row {
	display: flex;
	gap: 10px;
	align-items: center;
	margin-bottom: 10px;
}

.input-wrap {
	position: relative;
	flex: 1;
	display: flex;
	background: rgba(255, 254, 254, 0.08);
	padding: 10px;
	border-radius: 12px;
	border: 1px solid rgba(255, 255, 255, 0.02);
	align-items: center;
}

input[type="number"] {
	flex: 1;
	border: 0;
	background: transparent;
	color: var(--text);
	font-size: 18px;
	padding: 6px 40px 6px 6px;
	outline: none;
	-webkit-appearance: none;
}

.controls {
	display: flex;
	gap: 8px;
	margin-bottom: 10px;
	align-items: center;
}

.btn {
	flex: 1;
	padding: 8px;
	border-radius: 10px;
	border: 0;
	background: linear-gradient(180deg, var(--accent), var(--accent-2));
	color: #021827;
	font-weight: 600;
	cursor: pointer;
	font-size: 18px;
}

.btn.ghost {
	background: rgb(54, 42, 42);
	color: var(--muted);
	border: 1px solid rgba(255, 255, 255, 0.04);
}

.currency-switch {
	display: flex;
	background: rgba(255, 255, 255, 0.04);
	border-radius: 10px;
	overflow: hidden;
	border: 1px solid rgba(255, 255, 255, 0.06);
	width: 100%;
	max-width: 300px;
}

.currency-switch button {
	flex: 1;
	padding: 10px;
	font-size: 14px;
	background: rgba(0, 87, 80, 0.15);
	color: var(--muted);
	border: none;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

.currency-switch button.active {
	background: var(--accent);
	color: #021827;
	font-weight: 600;
}

.result {
	margin-top: 12px;
	padding: 16px;
	border-radius: 12px;
	background: #102a2f;
	text-align: center;
}

.result .big {
	display: block;
	font-size: 32px;
	font-weight: 800;
	color: #ffffff;
	margin-top: 6px;
}

.clear-btn {
	position: absolute;
	right: 10px;
	width: 24px;
	height: 24px;
	background: rgba(255, 255, 255, 0.08);
	border: none;
	border-radius: 50%;
	color: var(--muted);
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0.7;
	transition: opacity 0.2s, background 0.2s;
}

.clear-btn:hover {
	opacity: 1;
	background: rgba(255, 255, 255, 0.15);
}

.clear-btn:active {
	background: rgba(255, 255, 255, 0.2);
}

/* transfer: стиль как у обычных валютных кнопок (иконка внутри SVG) */
.currency-switch button.transfer {
	flex: 1;
	padding: 10px;
	font-size: 14px;
	background: rgba(0, 87, 80, 0.15);
	color: var(--muted);
	border: none;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

/* иконка внутри — подстраивается под текст */
.currency-switch button.transfer svg {
	width: 16px;
	height: 16px;
	display: block;
}

/* активное состояние — совпадает с .currency-switch button.active */
.currency-switch button.transfer.active {
	background: var(--accent);
	color: #021827;
	font-weight: 600;
}

/* Адаптивность */
@media (max-width: 520px) {
	.container {
		padding: 14px;
	}

	.rate-pill {
		min-width: 120px;
		font-size: 13px;
	}

	.result .big {
		font-size: 24px;
	}

	.result {
		font-size: 16px;
		padding: 12px;
	}

	.currency-switch button.transfer { font-size: 13px; padding: 8px; }
	.currency-switch button.transfer svg { width: 14px; height: 14px; }
}

.history-section {
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.history-section:empty {
  display: none;
}

.result strong { font-weight: 700; color: var(--text); }
.history-section strong { font-weight: 700; color: var(--text); }

#rateUpdated {
	font-size: 13px;
	color: var(--muted);
	margin: 8px 0 14px;
	text-align: center;
	width: 100%;
}