.autoearn {
    margin-top: 42px;
    margin-bottom: 72px;
}

.autoearn-onboarding-open .container,
.autoearn-onboarding-open .footer {
    filter: blur(8px);
    pointer-events: none;
}

.autoearn-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
    gap: 34px;
    align-items: stretch;
}

.autoearn-header__copy,
.autoearn-ready {
    border: 2px solid #171825;
    background-color: #050508;
}

.autoearn-header__copy {
    padding: 34px 38px;
    min-height: 172px;
}

.autoearn-kicker {
    display: block;
    font-family: 'Google Sans Mono', monospace;
    font-weight: 500;
    font-size: 13px;
    line-height: 16px;
    color: #606061;
    margin-bottom: 12px;
}

.autoearn-title {
    font-family: 'Neue Machina', sans-serif;
    font-weight: 700;
    font-size: 48px;
    line-height: 50px;
    color: #ffffff;
    margin: 0;
}

.autoearn-subtitle {
    max-width: 640px;
    margin-top: 14px;
    font-family: 'Neue Machina', sans-serif;
    font-weight: 400;
    font-size: 15px;
    line-height: 18px;
    color: #606061;
}

.autoearn-summary {
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 2px solid #171825;
    background-color: #0a0a10;
}

.autoearn-summary__row {
    display: grid;
    grid-template-columns: 145px minmax(0, 1fr);
    align-items: center;
    min-height: 56px;
    border-bottom: 2px solid #171825;
}

.autoearn-summary__row:last-child {
    border-bottom: none;
}

.autoearn-summary__label {
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 18px;
    border-right: 2px solid #171825;
    font-family: 'Neue Machina', sans-serif;
    font-weight: 500;
    font-size: 12px;
    color: #606061;
}

.autoearn-summary__value {
    min-width: 0;
    padding: 0 18px;
    font-family: 'Google Sans Mono', monospace;
    font-weight: 500;
    font-size: 12px;
    line-height: 16px;
    color: #b9b9b9;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

button.autoearn-summary__value {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    border-radius: 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

button.autoearn-summary__value:disabled {
    cursor: default;
    color: #555787;
}

button.autoearn-summary__value:not(:disabled):hover,
button.autoearn-summary__value:not(:disabled):focus-visible {
    color: #ffffff;
    outline: none;
}

.autoearn-ready {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 34px;
    padding: 28px 32px;
}

.autoearn-ready__title {
    margin: 0;
    font-family: 'Neue Machina', sans-serif;
    font-weight: 700;
    font-size: 22px;
    line-height: 24px;
    color: #ffffff;
}

.autoearn-ready__actions,
.onboarding-actions,
.deposit-result__actions {
    display: flex;
    gap: 10px;
}

.panel-status {
    min-width: 0;
    font-family: 'Google Sans Mono', monospace;
    font-weight: 500;
    font-size: 12px;
    line-height: 16px;
    color: #606061;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.panel-status--ready {
    color: #a0a4fe;
}

.panel-status--error {
    color: #f87171;
}

.autoearn-action {
    height: 42px;
    min-width: 132px;
    padding: 0 16px;
    border: 2px solid #171825;
    background-color: #0a0a10;
    color: #b9b9b9;
    font-family: 'Neue Machina', sans-serif;
    font-weight: 700;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    border-radius: 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    white-space: nowrap;
}

.autoearn-action:hover:not(:disabled),
.autoearn-action:focus-visible:not(:disabled) {
    color: #ffffff;
    border-color: #34354e;
    outline: none;
}

.autoearn-action:disabled {
    color: #555787;
    cursor: default;
    opacity: 0.65;
}

.autoearn-action--primary {
    background-color: #a0a4fe;
    border-color: #898de5;
    color: #0a0a10;
}

.autoearn-action--primary:hover:not(:disabled),
.autoearn-action--primary:focus-visible:not(:disabled) {
    color: #0a0a10;
    opacity: 0.86;
}

.autoearn-action--primary:disabled {
    background-color: #0a0a10;
    border-color: #171825;
    color: #555787;
}

.autoearn-onboarding[hidden] {
    display: none;
}

.autoearn-onboarding {
    position: fixed;
    inset: 0;
    z-index: 2600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.autoearn-onboarding__backdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(5, 5, 8, 0.84);
    backdrop-filter: blur(12px);
}

.autoearn-onboarding__panel {
    position: relative;
    width: min(560px, 100%);
    max-height: min(760px, calc(100vh - 48px));
    display: flex;
    flex-direction: column;
    background-color: #0a0a10;
    border: 2px solid #171825;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.autoearn-onboarding__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 26px 30px 22px;
    border-bottom: 2px solid #171825;
}

.autoearn-onboarding__title {
    margin: 0;
    font-family: 'Neue Machina', sans-serif;
    font-weight: 700;
    font-size: 25px;
    line-height: 28px;
    color: #ffffff;
}

.autoearn-onboarding__status {
    flex: 0 0 auto;
    margin-top: 2px;
    font-family: 'Google Sans Mono', monospace;
    font-weight: 500;
    font-size: 12px;
    line-height: 16px;
    color: #606061;
}

.autoearn-onboarding__header-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.autoearn-onboarding__close {
    position: relative;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 2px solid #171825;
    background-color: #050508;
    color: #606061;
    font-family: 'Google Sans Mono', monospace;
    font-weight: 500;
    font-size: 0;
    line-height: 0;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
    border-radius: 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.autoearn-onboarding__close::before,
.autoearn-onboarding__close::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 11px;
    height: 2px;
    background-color: currentColor;
    transform-origin: center;
}

.autoearn-onboarding__close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.autoearn-onboarding__close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.autoearn-onboarding__close:hover,
.autoearn-onboarding__close:focus-visible {
    color: #ffffff;
    border-color: #34354e;
    outline: none;
}

.onboarding-progress {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    --progress-offset: 116px;
    padding: 30px 28px 22px;
}

.onboarding-progress__rail,
.onboarding-progress__fill {
    position: absolute;
    left: 58px;
    right: 58px;
    top: 45px;
    height: 2px;
}

.onboarding-progress__rail {
    background-color: #171825;
}

.onboarding-progress__fill {
    width: calc(100% - var(--progress-offset));
    right: auto;
    background-color: #a0a4fe;
    transform: scaleX(var(--progress, 0));
    transform-origin: left center;
    transition: transform 0.35s ease;
}

.onboarding-progress__step {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.onboarding-progress__dot {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #050508;
    border: 2px solid #171825;
    color: #555787;
    font-family: 'Google Sans Mono', monospace;
    font-weight: 500;
    font-size: 12px;
    line-height: 1;
}

.onboarding-progress__label {
    max-width: 96px;
    font-family: 'Neue Machina', sans-serif;
    font-weight: 700;
    font-size: 11px;
    line-height: 13px;
    color: #555787;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.onboarding-progress__step--active .onboarding-progress__dot,
.onboarding-progress__step--complete .onboarding-progress__dot,
.setup-step--complete .onboarding-progress__dot {
    border-color: #34354e;
    color: #ffffff;
}

.onboarding-progress__step--active .onboarding-progress__label,
.onboarding-progress__step--complete .onboarding-progress__label,
.setup-step--complete .onboarding-progress__label {
    color: #ffffff;
}

.onboarding-progress__step--complete .onboarding-progress__dot,
.setup-step--complete .onboarding-progress__dot {
    background-color: #a0a4fe;
    border-color: #898de5;
    color: #0a0a10;
}

.onboarding-progress__step--error .onboarding-progress__dot {
    border-color: #7f1d1d;
    color: #f87171;
}

.autoearn-onboarding__body {
    min-height: 300px;
    overflow-y: auto;
    padding: 0 30px 30px;
}

.onboarding-stage[hidden] {
    display: none;
}

.onboarding-stage {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.onboarding-stage__copy {
    max-width: 440px;
    font-family: 'Neue Machina', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 18px;
    color: #606061;
}

.autoearn-wallet-list .wallet-option {
    height: 58px;
    padding-left: 18px;
    padding-right: 18px;
}

.onboarding-facts,
.permission-flow {
    border: 2px solid #171825;
    background-color: #050508;
}

.onboarding-fact,
.permission-flow__row {
    min-height: 48px;
    display: grid;
    grid-template-columns: 148px minmax(0, 1fr);
    align-items: center;
    border-bottom: 1px solid #171825;
}

.onboarding-fact:last-child,
.permission-flow__row:last-child {
    border-bottom: none;
}

.onboarding-fact__label,
.permission-flow__label {
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 14px;
    border-right: 1px solid #171825;
    font-family: 'Neue Machina', sans-serif;
    font-weight: 500;
    font-size: 12px;
    color: #606061;
}

.onboarding-fact__value,
.permission-flow__value {
    min-width: 0;
    padding: 0 14px;
    font-family: 'Google Sans Mono', monospace;
    font-weight: 500;
    font-size: 12px;
    line-height: 16px;
    color: #b9b9b9;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.permission-flow__row--ready .permission-flow__value {
    color: #a0a4fe;
}

.permission-flow__row--error .permission-flow__value {
    color: #f87171;
}

.permission-flow__row--loading .permission-flow__value {
    color: #ffffff;
}

.onboarding-stage__status {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    border: 2px solid #171825;
    background-color: #050508;
    font-family: 'Google Sans Mono', monospace;
    font-weight: 500;
    font-size: 12px;
    line-height: 16px;
    color: #606061;
}

.onboarding-stage__status--ready {
    color: #a0a4fe;
}

.onboarding-stage__status--error {
    color: #f87171;
}

.status-spinner {
    display: none;
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    border: 2px solid #252640;
    border-top-color: #a0a4fe;
    border-radius: 50%;
    animation: autoearn-spin 0.8s linear infinite;
}

.onboarding-stage__status--loading .status-spinner {
    display: inline-block;
}

@keyframes autoearn-spin {
    to {
        transform: rotate(360deg);
    }
}

.onboarding-actions {
    margin-top: 2px;
}

.onboarding-actions .autoearn-action {
    flex: 1;
    margin: 0;
}

.onboarding-actions--split {
    margin-top: 14px;
}

.deposit-panel {
    border: 2px solid #171825;
    background-color: #050508;
}

.panel-header {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 0 18px;
    border-bottom: 2px solid #171825;
}

.panel-title {
    font-family: 'Neue Machina', sans-serif;
    font-weight: 700;
    font-size: 18px;
    line-height: 20px;
    color: #ffffff;
    margin: 0;
}

.deposit-form {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(118px, 0.8fr);
    gap: 12px;
    align-items: end;
    padding: 18px;
    border-bottom: 2px solid #171825;
}

.deposit-quote-btn {
    grid-column: 1 / -1;
    width: 100%;
}

.deposit-panel--locked .deposit-form,
.deposit-panel--locked .deposit-result {
    opacity: 0.55;
}

.autoearn-field {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.autoearn-label {
    font-family: 'Neue Machina', sans-serif;
    font-weight: 500;
    font-size: 12px;
    line-height: 14px;
    color: #606061;
}

.autoearn-select,
.autoearn-input {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    background-color: rgba(160, 164, 254, 0.03);
    border: 2px solid #171825;
    color: #b9b9b9;
    font-family: 'Google Sans Mono', monospace;
    font-weight: 500;
    font-size: 13px;
    outline: none;
    border-radius: 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.autoearn-select {
    cursor: pointer;
}

.autoearn-select:focus,
.autoearn-input:focus {
    border-color: #34354e;
}

.autoearn-select:disabled,
.autoearn-input:disabled {
    cursor: default;
    color: #555787;
}

.deposit-result {
    padding: 18px;
}

.deposit-result__row {
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid #171825;
}

.deposit-result__label,
.deposit-address__label {
    font-family: 'Neue Machina', sans-serif;
    font-weight: 500;
    font-size: 12px;
    color: #606061;
}

.deposit-result__value {
    min-width: 0;
    font-family: 'Google Sans Mono', monospace;
    font-weight: 500;
    font-size: 12px;
    color: #b9b9b9;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.deposit-address {
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
    align-items: center;
    min-height: 54px;
    border-bottom: 1px solid #171825;
}

.deposit-address__value {
    min-width: 0;
    height: 34px;
    padding: 0 12px;
    border: 2px solid #171825;
    background-color: #0a0a10;
    color: #b9b9b9;
    font-family: 'Google Sans Mono', monospace;
    font-weight: 500;
    font-size: 12px;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    border-radius: 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.deposit-address__value:hover:not(:disabled),
.deposit-address__value:focus-visible:not(:disabled) {
    color: #ffffff;
    border-color: #34354e;
    outline: none;
}

.deposit-address__value:disabled {
    cursor: default;
    color: #555787;
}

.deposit-result__actions {
    margin-top: 16px;
}

.deposit-result__actions .autoearn-action {
    flex: 1;
}

.deposit-status-log {
    min-height: 18px;
    margin-top: 14px;
    font-family: 'Google Sans Mono', monospace;
    font-weight: 500;
    font-size: 12px;
    line-height: 16px;
    color: #606061;
}

.deposit-status-log--error {
    color: #f87171;
}

.deposit-status-log--ready {
    color: #a0a4fe;
}

@media (max-width: 1160px) {
    .autoearn-header {
        grid-template-columns: 1fr;
    }

    .autoearn-summary {
        min-height: 168px;
    }
}

@media (max-width: 760px) {
    .autoearn {
        margin-top: 28px;
        margin-bottom: 48px;
    }

    .autoearn-header__copy,
    .autoearn-ready {
        padding: 28px;
    }

    .autoearn-title {
        font-size: 40px;
        line-height: 42px;
    }

    .autoearn-ready {
        align-items: stretch;
        flex-direction: column;
    }

    .autoearn-ready__actions {
        width: 100%;
    }

    .autoearn-ready__actions .autoearn-action {
        flex: 1;
    }

    .autoearn-onboarding {
        padding: 16px;
    }

    .autoearn-onboarding__header {
        padding: 22px 22px 18px;
    }

    .autoearn-onboarding__body {
        min-height: 280px;
        padding: 0 22px 24px;
    }

    .onboarding-progress {
        --progress-offset: 96px;
        padding-left: 18px;
        padding-right: 18px;
    }

    .onboarding-progress__rail,
    .onboarding-progress__fill {
        left: 48px;
        right: 48px;
    }
}

@media (max-width: 520px) {
    .autoearn-onboarding__panel {
        max-height: calc(100vh - 28px);
    }

    .autoearn-onboarding__header {
        align-items: flex-start;
    }

    .autoearn-onboarding__title {
        font-size: 22px;
        line-height: 25px;
    }

    .autoearn-onboarding__header-actions {
        align-items: center;
        gap: 12px;
    }

    .onboarding-progress__label {
        font-size: 10px;
    }

    .onboarding-fact,
    .permission-flow__row,
    .deposit-address {
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 10px 14px;
    }

    .onboarding-fact__label,
    .permission-flow__label {
        height: auto;
        padding: 0;
        border-right: none;
    }

    .onboarding-fact__value,
    .permission-flow__value {
        padding: 0;
    }

    .deposit-form {
        grid-template-columns: 1fr;
    }

    .deposit-address__value {
        width: 100%;
    }

    .onboarding-actions,
    .deposit-result__actions,
    .autoearn-ready__actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .autoearn-header__copy,
    .deposit-result {
        padding: 20px;
    }

    .autoearn-title {
        font-size: 34px;
        line-height: 36px;
    }

    .autoearn-subtitle {
        font-size: 13px;
        line-height: 17px;
    }

    .autoearn-summary__row {
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 12px 16px;
    }

    .autoearn-summary__label {
        height: auto;
        border-right: none;
        padding: 0;
    }

    .autoearn-summary__value,
    button.autoearn-summary__value {
        height: auto;
        padding: 0;
    }
}
