:root {
	--page-width: 390px;
	--text-main: #1a1f2f;
	--text-muted: #7f8698;
	--line: #d7dce8;
	--line-soft: #eceff5;
	--blue: #2f6bff;
	--button-start: #2463f3;
	--button-end: #7650ff;
	--shadow: 0 16px 28px rgba(88, 97, 255, 0.24);
	--toast-shadow: 0 16px 32px rgba(26, 31, 47, 0.14);
	font-synthesis-weight: none;
}

* {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	min-height: 100%;
	background: #ffffff;
	color: var(--text-main);
	font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

body {
	display: flex;
	justify-content: center;
	overflow-x: hidden;
}

button,
input {
	font: inherit;
}

button {
	appearance: none;
	-webkit-appearance: none;
}

input {
	appearance: none;
	-webkit-appearance: none;
}

.screen {
	width: min(100%, var(--page-width));
	min-height: 100vh;
	min-height: 100dvh;
	padding: 18px 16px max(18px, env(safe-area-inset-bottom));
	display: flex;
	flex-direction: column;
	background: #ffffff;
}

.form-shell {
	padding-top: 2px;
}

.field-block + .field-block {
	margin-top: 16px;
}

.field-label {
	margin: 0 0 8px;
	font-size: 13px;
	line-height: 1.2;
	font-weight: 600;
	color: var(--text-muted);
	letter-spacing: 0.01em;
}

.address-field,
.amount-field {
	position: relative;
	width: 100%;
	background: #ffffff;
	border: 1.6px solid var(--line);
	border-radius: 14px;
	box-shadow: 0 1px 1px rgba(17, 24, 39, 0.02);
	overflow: hidden;
}

.address-field {
	height: 62px;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 0 12px 0 16px;
}

.address-input,
.amount-input {
	border: 0;
	outline: 0;
	background: transparent;
	color: var(--text-main);
	min-width: 0;
	padding: 0;
	width: 100%;
	caret-color: var(--blue);
}

.address-input {
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0.005em;
	flex: 1 1 auto;
}

.address-input::placeholder,
.amount-input::placeholder {
	color: #cfd5e3;
}

.text-action,
.network-pill {
	border: 0;
	background: transparent;
	padding: 0;
	margin: 0;
	cursor: pointer;
}

.text-action {
	color: var(--blue);
	font-size: 15px;
	font-weight: 700;
	line-height: 1;
	white-space: nowrap;
	flex: 0 0 auto;
}

.addr-usdt-icon {
	width: 26px;
	height: 26px;
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	overflow: hidden;
}

.addr-usdt-icon svg,
.network-icon svg,
.amount-icon svg {
	width: 100%;
	height: 100%;
	display: block;
}

.network-block {
	margin-top: 20px;
}

.network-pill {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	height: 48px;
	padding: 4px 14px 4px 4px;
	border-radius: 999px;
	border: 1.6px solid #dfe3eb;
	background: #ffffff;
	color: var(--text-main);
}

.network-icon {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	overflow: hidden;
	flex: 0 0 auto;
}

.network-name {
	font-size: 15px;
	font-weight: 700;
	letter-spacing: -0.01em;
}

.network-caret {
	font-size: 12px;
	line-height: 1;
	color: #9299ac;
	transform: translateY(1px);
}

.amount-block {
	margin-top: 0;
}

.amount-field {
	height: 62px;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 0 12px 0 16px;
	transition: border-color 160ms ease;
}

.amount-icon {
	display: none;
}

.amount-input {
	flex: 1 1 auto;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0.005em;
}

.amount-input::placeholder {
	color: #cfd5e3;
	font-weight: 600;
}

.amount-actions {
	display: inline-flex;
	align-items: center;
	gap: 14px;
	margin-left: auto;
	padding-left: 8px;
	white-space: nowrap;
}

.token-code {
	font-size: 15px;
	font-weight: 700;
	color: #636b80;
	letter-spacing: 0.01em;
}

.max-action {
	font-size: 15px;
}

.page-spacer {
	flex: 1 1 auto;
	min-height: 40px;
}

.bottom-bar {
	padding-top: 12px;
	padding-bottom: max(10px, env(safe-area-inset-bottom));
}

.primary-button {
	width: 100%;
	height: 54px;
	border: 0;
	border-radius: 14px;
	background: linear-gradient(92deg, var(--button-start) 0%, var(--button-end) 100%);
	color: #ffffff;
	font-size: 16px;
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	box-shadow: 0 6px 18px rgba(36, 99, 243, 0.38);
	cursor: pointer;
	-webkit-font-smoothing: antialiased;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
	transition: transform 140ms ease, box-shadow 140ms ease;
}

.primary-button:active {
	transform: translateY(1px);
}

.primary-button:disabled {
	opacity: 0.8;
	cursor: default;
	box-shadow: none;
}

.toast {
	position: fixed;
	left: 50%;
	bottom: calc(96px + env(safe-area-inset-bottom));
	transform: translateX(-50%);
	width: calc(min(100vw, var(--page-width)) - 32px);
	padding: 14px 16px;
	border-radius: 16px;
	font-size: 14px;
	line-height: 1.4;
	font-weight: 600;
	box-shadow: var(--toast-shadow);
	background: rgba(27, 35, 58, 0.92);
	color: #ffffff;
	z-index: 20;
}

.toast[data-type="success"] {
	background: rgba(20, 118, 77, 0.94);
}

.toast[data-type="error"] {
	background: rgba(164, 40, 40, 0.95);
}

@media (max-width: 360px) {
	.screen {
		padding-left: 12px;
		padding-right: 12px;
	}

	.address-input,
	.text-action,
	.max-action,
	.network-name,
	.token-code {
		font-size: 16px;
	}

	.amount-input {
		font-size: 30px;
	}

	.amount-field::before {
		width: 94px;
	}

	.amount-field::after {
		width: 92px;
	}

	.page-spacer {
		min-height: 24px;
	}

	.primary-button {
		height: 66px;
		font-size: 17px;
	}
}