:root {
    --page-width: 390px;
    --text-main: #1a1f2f;
    --text-muted: #7f8698;
    --line: #d7dce8;
    --blue: #2f6bff;
    --button-start: #2463f3;
    --button-end: #7650ff;
    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 {
    display: block;
    margin: 0 0 8px;
    font-size: 13px;
    line-height: 1.2;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.01em;
}

/* Address field */

.address-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;
    height: 62px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px 0 16px;
}

.address-input {
    min-width: 0;
    flex: 1 1 auto;
    color: var(--text-main);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.005em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    user-select: all;
}

.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 {
    width: 100%;
    height: 100%;
    display: block;
}

/* Network pill */

.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);
    cursor: default;
}

.network-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    overflow: hidden;
    flex: 0 0 auto;
}

.network-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.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);
}

/* Approval field */

.desc-field {
    width: 100%;
    background: #ffffff;
    border: 1.6px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 1px 1px rgba(17, 24, 39, 0.02);
    height: 62px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px 0 16px;
}

.desc-text {
    flex: 1 1 auto;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: 0.005em;
    margin: 0;
    border: 0;
    outline: 0;
    background: transparent;
    padding: 0;
    min-width: 0;
    caret-color: var(--blue);
    -moz-appearance: textfield;
}

.desc-text::placeholder {
    color: #b9bfce;
}

.desc-text::-webkit-outer-spin-button,
.desc-text::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.desc-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    padding-left: 8px;
    white-space: nowrap;
}

.desc-token {
    font-size: 15px;
    font-weight: 700;
    color: #636b80;
    letter-spacing: 0.01em;
}

.desc-badge {
    font-size: 15px;
    font-weight: 700;
    color: var(--blue);
}

.desc-field {
    pointer-events: none;
    user-select: none;
}

.link {
    border: 0;
    background: none;
    padding: 0 0 0 8px;
    font-weight: 700;
    color: var(--blue);
    cursor: pointer;
}

.link:disabled {
    opacity: 0.4;
    cursor: default;
}

.warning {
    margin-top: 10px;
    font-size: 13px;
    color: #b4540a;
}

/* Spacer & bottom bar */

.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 */

.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;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
    transition: transform 140ms ease, box-shadow 140ms ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.primary-button:active {
    transform: translateY(1px);
}

.primary-button:disabled {
    opacity: 0.8;
    cursor: default;
    box-shadow: none;
}

/* Transaction status — plain colored text, no background box */

.tx-status {
    margin-top: 16px;
    font-size: 13px;
    line-height: 1.4;
    font-weight: 600;
    word-break: break-word;
}

.tx-status.pending {
    color: #8a6400;
}

.tx-status.success {
    color: #17683f;
}

.tx-status.error {
    color: #b3263b;
}

.tx-status a {
    color: inherit;
    text-decoration: underline;
}

.hidden {
    display: none !important;
}

@media (max-width: 360px) {
    .screen {
        padding-left: 12px;
        padding-right: 12px;
    }

    .address-input,
    .network-name {
        font-size: 14px;
    }

    .page-spacer {
        min-height: 24px;
    }
}
