* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    font-family: -apple-system, 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    background: #f2f3f5;
    min-height: 100vh;
    color: #1a1a1a;
    font-size: 15px;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
}

.status-bar-placeholder {
    height: env(safe-area-inset-top, 0px);
}

.nav {
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: #f2f3f5;
}

.nav-title {
    font-size: 17px;
    font-weight: 600;
    color: #1a1a1a;
    letter-spacing: .2px;
}

.content {
    padding: 8px 0 100px;
}

.card {
    background: #fff;
    margin: 8px 12px 0;
    border-radius: 12px;
    overflow: hidden;
}

.field-label {
    font-size: 15px;
    color: #1a1a1a;
    font-weight: 500;
    padding: 12px 16px 6px;
}

.amount-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.addr-body {
    padding: 14px 16px;
}

.addr-text {
    font-size: 15px;
    color: #1a1a1a;
    line-height: 1.5;
    word-break: break-all;
}

.addr-text .addr-bold {
    font-weight: 700;
}

.token-sel {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 15px;
    color: #1a1a1a;
    font-weight: 500;
}

.amount-row {
    display: flex;
    align-items: center;
    padding: 6px 16px;
    gap: 8px;
}

#amount-input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    font-size: 32px;
    font-weight: 300;
    color: #1a1a1a;
    background: transparent;
    font-family: inherit;
    padding: 4px 0;
}

#amount-input::placeholder {
    color: #c8c8cc;
}

#amount-input.is-zero {
    color: #c8c8cc;
}

.all-btn {
    flex-shrink: 0;
    background: #fff;
    border: 1.5px solid #1677ff;
    border-radius: 20px;
    font-size: 14px;
    color: #1677ff;
    padding: 5px 14px;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    font-weight: 500;
}

.balance-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px 14px;
    font-size: 15px;
    color: #8c8c8c;
    border-top: 1px solid #f2f3f5;
}

.balance-row .val {
    color: #1a1a1a;
    font-size: 15px;
    font-weight: 400;
}

.fee-label-row {
    display: flex;
    align-items: center;
    gap: 5px;
}

.fee-label-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.help-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1.5px solid #c8c8cc;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #c8c8cc;
    font-weight: 600;
    line-height: 1;
    flex-shrink: 0;
}

.refresh {
    display: flex;
    align-items: center;
    color: #8c8c8c;
    font-size: 12px;
    font-weight: 400;
}

.refresh-icon {
    position: relative;
    width: 14px;
    height: 14px;
    margin-right: 4px;
}

.refresh-circle {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid #e0e0e0;
    border-top-color: #1677ff;
    border-radius: 50%;
}

.sol-logo {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sol-logo svg {
    width: 22px;
    height: 22px;
}

.fee-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #f2f3f5;
    min-height: 50px;
}

.fee-row:last-child {
    border-bottom: none;
}

.fee-row-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 15px;
    color: #1a1a1a;
}

.pay-method-right {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 15px;
    color: #1a1a1a;
    font-weight: 400;
}

.net-fee-right {
    display: flex;
    align-items: center;
    gap: 3px;
}

.fee-dollar {
    font-size: 12px;
    color: #8c8c8c;
}

.fee-sol {
    font-size: 15px;
    color: #1a1a1a;
    font-weight: 500;
}

.fee-row-total .fee-row-label,
.fee-row-total .fee-sol {
    font-weight: 700;
}

.fee-sub {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 6px 8px;
    padding: 14px 16px;
    font-size: 13px;
    color: #8c8c8c;
}

.fee-sub .fee-value {
    text-align: right;
    white-space: nowrap;
}

.fee-sub .amount {
    color: #8c8c8c;
}

.fee-sub .unit {
    color: #1a1a1a;
    margin-left: 4px;
}

.advanced-row {
    padding: 10px 16px 6px;
    text-align: right;
    font-size: 14px;
    color: #1677ff;
    cursor: pointer;
}

.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 16px calc(8px + env(safe-area-inset-bottom, 8px));
    background: #f2f3f5;
}

.confirm-button {
    display: block;
    width: 100%;
    height: 52px;
    background: #1677ff;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 17px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: opacity .15s;
    letter-spacing: .3px;
}

.confirm-button:active {
    opacity: .85;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .4);
    backdrop-filter: blur(2px);
    display: none;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid rgba(22, 119, 255, .2);
    border-top-color: rgba(22, 119, 255, .95);
    animation: txSpin .75s linear infinite;
}

@keyframes txSpin {
    to { transform: rotate(360deg); }
}

.tx-success-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10001;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .35);
}

.tx-success-overlay.is-visible {
    display: flex;
}

.tx-success-box {
    background: #fff;
    border-radius: 16px;
    padding: 32px 24px 20px;
    width: 80%;
    max-width: 300px;
    text-align: center;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .15);
    animation: boxIn .18s ease-out;
}

@keyframes boxIn {
    from { transform: scale(.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.tx-success-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #1677ff;
    color: #fff;
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    line-height: 1;
}

.tx-success-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 16px;
}

.tx-success-btn {
    width: 100%;
    border: none;
    border-radius: 10px;
    background: #1677ff;
    color: #fff;
    padding: 13px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}
