:root {
	--bg: #0f172a;
	--panel: rgba(255, 255, 255, 0.08);
	--panel-strong: rgba(255, 255, 255, 0.13);
	--border: rgba(255, 255, 255, 0.16);
	--text: #f8fafc;
	--muted: #94a3b8;
	--accent: #38bdf8;
	--accent-2: #a78bfa;
	--success: #22c55e;
	--danger: #fb7185;
	--shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* {
	box-sizing: border-box;
}

html {
	min-height: 100%;
}

body {
	margin: 0;
	min-height: 100vh;
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	color: var(--text);
	background:
		radial-gradient(circle at top left, rgba(56, 189, 248, 0.25), transparent 34rem),
		radial-gradient(circle at bottom right, rgba(167, 139, 250, 0.22), transparent 32rem),
		var(--bg);
}

button,
input {
	font: inherit;
}

button {
	border: 0;
	cursor: pointer;
}

input {
	width: 100%;
	border: 0;
	outline: 0;
	background: transparent;
	color: var(--text);
	font-size: 24px;
	font-weight: 800;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
	appearance: none;
	margin: 0;
}

input[type="number"] {
	appearance: textfield;
	-moz-appearance: textfield;
}

::selection {
	background: var(--accent);
	color: #020617;
}

.app {
	position: relative;
	width: min(1120px, calc(100% - 32px));
	margin: 0 auto;
	padding: 56px 0;
}

.top-actions {
	position: absolute;
	top: 24px;
	right: 0;
}

.api-button {
	padding: 10px 16px;
	border: 1px solid rgba(56, 189, 248, 0.35);
	border-radius: 999px;
	background: rgba(56, 189, 248, 0.12);
	color: var(--text);
	font-size: 14px;
	font-weight: 800;
	backdrop-filter: blur(14px);
}

.api-button:hover {
	background: rgba(56, 189, 248, 0.2);
	border-color: rgba(56, 189, 248, 0.55);
}

.hero {
	display: grid;
	gap: 16px;
	margin-bottom: 32px;
	padding-right: 80px;
}

.badge {
	width: fit-content;
	padding: 8px 12px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.06);
	color: var(--accent);
	font-weight: 700;
	font-size: 13px;
}

h1,
h2,
h3,
p {
	margin-top: 0;
}

h1 {
	max-width: 780px;
	margin-bottom: 0;
	font-size: clamp(34px, 6vw, 68px);
	line-height: 0.95;
	letter-spacing: -0.06em;
}

.hero p {
	max-width: 700px;
	margin-bottom: 0;
	color: var(--muted);
	font-size: 18px;
	line-height: 1.65;
}

.grid {
	display: grid;
	grid-template-columns: 1fr 2fr;
	gap: 18px;
	align-items: stretch;
}

.conversion-group {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 18px;
}

.card {
	position: relative;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	padding: 22px;
	border: 1px solid var(--border);
	border-radius: 28px;
	background: linear-gradient(180deg, var(--panel-strong), var(--panel));
	box-shadow: var(--shadow);
	backdrop-filter: blur(18px);
}

.card::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(135deg, rgba(56, 189, 248, 0.18), transparent 42%);
	pointer-events: none;
}

.card > * {
	position: relative;
}

.card h2 {
	margin-bottom: 8px;
	font-size: 20px;
	letter-spacing: -0.03em;
}

.card p {
	min-height: 52px;
	margin-bottom: 18px;
	color: var(--muted);
	line-height: 1.55;
	font-size: 14px;
}

.field {
	display: grid;
	gap: 8px;
}

label {
	color: #cbd5e1;
	font-size: 13px;
	font-weight: 700;
}

.input-wrap {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 16px;
	border: 1px solid var(--border);
	border-radius: 18px;
	background: rgba(15, 23, 42, 0.54);
}

.input-wrap:focus-within {
	border-color: rgba(56, 189, 248, 0.6);
	background: rgba(15, 23, 42, 0.78);
}

.input-wrap span {
	color: var(--muted);
	font-weight: 800;
}

.result {
	margin-top: 18px;
	padding: 18px;
	border-radius: 22px;
	background: rgba(20, 25, 37, 0.94);
	border: 1px solid rgba(56, 189, 248, 0.22);
}

.result small {
	display: block;
	margin-bottom: 6px;
	color: var(--muted);
	font-weight: 700;
}

.result strong {
	display: block;
	font-size: clamp(30px, 4vw, 44px);
	line-height: 1;
	letter-spacing: -0.05em;
	word-break: break-word;
}

.result em {
	display: block;
	margin-top: 8px;
	color: var(--success);
	font-style: normal;
	font-size: 13px;
	font-weight: 800;
}

.settings {
	grid-column: 1 / -1;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 14px;
	padding: 18px;
	border: 1px solid var(--border);
	border-radius: 28px;
	background: rgba(255, 255, 255, 0.06);
	backdrop-filter: blur(18px);
}

.setting {
	display: grid;
	gap: 7px;
}

.setting input {
	padding: 12px 14px;
	border: 1px solid var(--border);
	border-radius: 16px;
	background: rgba(15, 23, 42, 0.6);
	font-size: 16px;
	letter-spacing: -0.02em;
}

.setting input:focus {
	border-color: rgba(56, 189, 248, 0.6);
	background: rgba(15, 23, 42, 0.78);
}

.note {
	margin: 18px 0 0;
	color: var(--muted);
	font-size: 13px;
	line-height: 1.6;
}

.inside-card {
	margin-top: auto;
	padding-top: 12px;
	font-size: 12px;
	line-height: 1.5;
}

.accent {
	color: var(--accent);
}

.modal {
	position: fixed;
	inset: 0;
	z-index: 20;
	display: none;
	place-items: center;
	padding: 20px;
	background: rgba(2, 6, 23, 0.72);
	backdrop-filter: blur(10px);
}

.modal.is-open {
	display: grid;
}

.modal-panel {
	width: min(780px, 100%);
	max-height: min(760px, calc(100vh - 40px));
	display: flex;
	flex-direction: column;
	overflow: hidden;
	padding: 0;
	border: 1px solid var(--border);
	border-radius: 28px;
	background: linear-gradient(180deg, #1e293b, #0f172a);
	box-shadow: var(--shadow);
}

.modal-header {
	flex: 0 0 auto;
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 18px;
	padding: 24px;
	border-bottom: 1px solid var(--border);
	background: #1e293b;
}

.modal-header h2 {
	margin-bottom: 0;
	font-size: 28px;
	letter-spacing: -0.04em;
}

.modal-header p {
	margin: 6px 0 0;
	color: var(--muted);
	line-height: 1.5;
}

.modal-body {
	flex: 1 1 auto;
	min-height: 0;
	overflow: auto;
	padding: 24px;
}

.close-button {
	flex: 0 0 auto;
	width: 38px;
	height: 38px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.08);
	color: var(--text);
	font-size: 22px;
	line-height: 1;
}

.close-button:hover {
	background: rgba(255, 255, 255, 0.14);
}

.api-section {
	display: grid;
	gap: 10px;
	margin-top: 16px;
}

.api-section:first-child {
	margin-top: 0;
}

.api-section h3 {
	margin-bottom: 0;
	color: var(--accent);
	font-size: 16px;
}

code,
pre {
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

pre {
	overflow: auto;
	margin: 0;
	padding: 16px;
	border: 1px solid rgba(56, 189, 248, 0.18);
	border-radius: 18px;
	background: rgba(2, 6, 23, 0.62);
	color: #e2e8f0;
	font-size: 13px;
	line-height: 1.6;
}

.inline-code {
	padding: 2px 6px;
	border-radius: 7px;
	background: rgba(255, 255, 255, 0.08);
	color: var(--accent);
}

@media (max-width: 900px) {
	.app {
		padding-top: 32px;
	}

	.top-actions {
		position: static;
		margin-bottom: 20px;
	}

	.hero {
		padding-right: 0;
	}

	.grid,
	.conversion-group,
	.settings {
		grid-template-columns: 1fr;
	}

	.card p {
		min-height: auto;
	}
}

@media (max-width: 520px) {
	.app {
		width: min(100% - 20px, 1120px);
		padding-bottom: 32px;
	}

	.card,
	.settings,
	.modal-panel {
		border-radius: 22px;
	}

	.card {
		padding: 18px;
	}

	.hero p {
		font-size: 16px;
	}

	input {
		font-size: 22px;
	}

	.modal {
		padding: 10px;
	}

	.modal-header,
	.modal-body {
		padding: 18px;
	}
}