.autoearn-market-launch {
    position: fixed;
    inset: 0;
    z-index: 2800;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

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

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

.autoearn-market-launch__panel {
    position: relative;
    width: min(620px, calc(100vw - 80px));
    max-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    border: 2px solid #171825;
    background-color: #0a0a10;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.56);
    overflow: hidden;
}

.autoearn-market-launch__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 64px;
    padding: 18px 26px;
    border-bottom: 2px solid #171825;
}

.autoearn-market-launch__title {
    display: block;
    margin: 0;
    color: #ffffff;
    font-family: "Neue Machina", sans-serif;
    font-weight: 700;
    font-size: 19px;
    line-height: 22px;
}

.autoearn-market-launch__close {
    position: relative;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 2px solid #171825;
    border-radius: 0;
    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;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

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

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

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

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

.autoearn-market-launch__body {
    min-height: 0;
    padding: 22px 26px 16px;
    overflow-y: auto;
}

.autoearn-market-launch__actions {
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 0 26px 16px;
}

.autoearn-market-launch__market {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding-bottom: 24px;
    border-bottom: 1px solid #171825;
}

.autoearn-market-launch__icon,
.autoearn-farming-market__icon {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 3px;
    object-fit: cover;
    background: #11121a;
}

.autoearn-market-launch__question {
    margin: 0;
    overflow: hidden;
    color: #e9e9ef;
    font-family: "Google Sans Mono", monospace;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
}

.autoearn-market-launch__prices {
    display: grid;
    gap: 5px;
    min-width: 88px;
    color: #8b8c9c;
    font-family: "Google Sans Mono", monospace;
    font-size: 12px;
    text-align: right;
}

.autoearn-market-launch__price strong {
    color: #c9caf4;
    font-weight: 500;
}

.autoearn-market-launch__field {
    margin-top: 24px;
}

.autoearn-market-launch__label-row,
.autoearn-market-launch__summary-row,
.autoearn-market-launch__balance-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.autoearn-market-launch__label {
    color: #9b9ca9;
    font-family: "Google Sans Mono", monospace;
    font-size: 12px;
}

.autoearn-market-launch__minimum {
    border: 0;
    background: transparent;
    color: #a0a4fe;
    font-family: "Google Sans Mono", monospace;
    font-size: 11px;
    cursor: pointer;
}

.autoearn-market-launch__input-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    height: 48px;
    margin-top: 9px;
    border: 2px solid #171825;
    background-color: #050508;
    transition: border-color 0.2s ease;
}

.autoearn-market-launch__input-wrap:focus-within {
    border-color: #34354e;
}

.autoearn-market-launch__input {
    min-width: 0;
    height: 100%;
    padding: 0 14px;
    border: 0;
    outline: none;
    background: transparent;
    color: #f3f3f8;
    font-family: "Google Sans Mono", monospace;
    font-size: 16px;
}

.autoearn-market-launch__input::-webkit-outer-spin-button,
.autoearn-market-launch__input::-webkit-inner-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.autoearn-market-launch__input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
}

.autoearn-market-launch__input-unit {
    padding: 0 14px;
    color: #7d7e8d;
    font-family: "Google Sans Mono", monospace;
    font-size: 12px;
}

.autoearn-market-launch__balance-row {
    margin-top: 8px;
    color: #676876;
    font-family: "Google Sans Mono", monospace;
    font-size: 11px;
}

.autoearn-market-launch__balance-value {
    color: #9698b5;
}

.autoearn-market-launch__summary {
    margin-top: 24px;
    padding: 16px 0;
    border-top: 1px solid #171825;
    border-bottom: 1px solid #171825;
}

.autoearn-market-launch__summary-copy {
    margin: 5px 0 0;
    color: #c1c2cf;
    font-family: "Google Sans Mono", monospace;
    font-size: 12px;
    line-height: 1.45;
}

.autoearn-market-launch__position-editor {
    margin-top: 14px;
    border: 2px solid #171825;
    background-color: #050508;
}

.autoearn-market-launch__position-editor[hidden] {
    display: none;
}

.autoearn-market-launch__position-row {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 10px;
}

.autoearn-market-launch__position-row + .autoearn-market-launch__position-row {
    border-top: 1px solid #171825;
}

.autoearn-market-launch__position-label {
    color: #747584;
    font-family: "Google Sans Mono", monospace;
    font-size: 10px;
    line-height: 1.35;
}

.autoearn-market-launch__position-options {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    min-width: 0;
}

.autoearn-market-launch__position-options button {
    min-width: 0;
    height: 31px;
    padding: 0 8px;
    border: 1px solid #2c2d40;
    border-right-width: 0;
    border-radius: 0;
    background: transparent;
    color: #777887;
    font-family: "Google Sans Mono", monospace;
    font-size: 10px;
    line-height: 1.15;
    cursor: pointer;
}

.autoearn-market-launch__position-options button:last-child {
    border-right-width: 1px;
}

.autoearn-market-launch__position-options button:hover,
.autoearn-market-launch__position-options button:focus-visible {
    color: #d7d8e2;
    outline: none;
}

.autoearn-market-launch__position-options .autoearn-market-launch__position-option--selected {
    border-color: #777bbd;
    border-right-width: 1px;
    background: rgba(160, 164, 254, 0.12);
    color: #c9caf4;
}

.autoearn-market-launch__position-options .autoearn-market-launch__position-option--selected + button {
    border-left-width: 0;
}

.autoearn-market-launch__edit {
    border: 0;
    background: transparent;
    color: #a0a4fe;
    font-family: "Google Sans Mono", monospace;
    font-size: 11px;
    cursor: pointer;
}

.autoearn-market-launch__notice {
    min-height: 18px;
    margin: 14px 0 0;
    color: #9b9ca9;
    font-family: "Google Sans Mono", monospace;
    font-size: 11px;
    line-height: 1.5;
}

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

.autoearn-market-launch__notice--error {
    color: #ff8f9c;
}

.autoearn-market-launch__submit {
    width: 100%;
    height: 42px;
    margin: 0;
    border: 2px solid #898de5;
    border-radius: 0;
    background-color: #a0a4fe;
    color: #0a0a10;
    font-family: "Neue Machina", sans-serif;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: opacity 0.2s ease, border-color 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.autoearn-market-launch__submit:hover:not(:disabled),
.autoearn-market-launch__submit:focus-visible:not(:disabled) {
    opacity: 0.86;
    outline: none;
}

.autoearn-market-launch__submit:disabled {
    border-color: #171825;
    background-color: #0a0a10;
    color: #555787;
    cursor: not-allowed;
    opacity: 0.65;
}

.autoearn-header-wallet {
    display: flex;
    align-items: center;
    gap: 0;
}

.autoearn-farming-settings {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #606061;
    cursor: pointer;
    transition: color 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

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

.autoearn-farming-settings:hover,
.autoearn-farming-settings:focus-visible {
    color: #ffffff;
    outline: none;
}

.autoearn-farming-settings__icon {
    width: 18px;
    height: 18px;
}

.autoearn-strategy-welcome--configured {
    display: none;
}

.autoearn-farming-markets {
    margin-top: 34px;
    overflow: visible;
}

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

.autoearn-farming-markets__header {
    margin-bottom: 12px;
    border: 2px solid transparent;
}

.autoearn-farming-markets__title {
    margin: 0;
    color: #eeeef4;
    font-family: "Neue Machina", sans-serif;
    font-size: 20px;
    font-weight: 700;
}

.autoearn-farming-markets__count {
    justify-self: end;
    color: #70717e;
    font-family: "Google Sans Mono", monospace;
    font-size: 11px;
}

.autoearn-farming-markets__list {
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: visible;
}

.autoearn-farming-markets__header,
.autoearn-farming-market {
    display: grid;
    grid-template-columns: minmax(360px, 1fr) 92px 112px 104px 96px 144px;
    align-items: center;
    gap: 8px;
    padding-right: 11px;
    padding-left: 11px;
}

.autoearn-farming-markets__column {
    position: relative;
    min-width: 0;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #d6d6dc;
    font-family: "Neue Machina", sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 16px;
    text-align: center;
    cursor: pointer;
    transition: color 0.2s ease;
}

.autoearn-farming-markets__column:hover,
.autoearn-farming-markets__column:focus-visible {
    color: #ffffff;
    outline: none;
}

.autoearn-farming-markets__column-text {
    grid-column: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.autoearn-farming-markets__sort-arrow {
    grid-column: 3;
    justify-self: start;
    width: 0;
    height: 0;
    margin-top: 2px;
    margin-left: 5px;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.autoearn-farming-markets__column:hover .autoearn-farming-markets__sort-arrow,
.autoearn-farming-markets__column:focus-visible .autoearn-farming-markets__sort-arrow {
    border-bottom: 5px solid currentColor;
    opacity: 0.4;
}

.autoearn-farming-markets__column.sort-desc,
.autoearn-farming-markets__column.sort-asc {
    color: #ffffff;
}

.autoearn-farming-markets__column.sort-desc .autoearn-farming-markets__sort-arrow,
.autoearn-farming-markets__column.sort-asc .autoearn-farming-markets__sort-arrow {
    opacity: 1;
}

.autoearn-farming-markets__column.sort-desc .autoearn-farming-markets__sort-arrow {
    border-top: 5px solid currentColor;
    border-bottom: 0;
}

.autoearn-farming-markets__column.sort-asc .autoearn-farming-markets__sort-arrow {
    border-top: 0;
    border-bottom: 5px solid currentColor;
}

.autoearn-farming-market {
    position: relative;
    height: 64px;
    margin-top: -2px;
    border: 2px solid #171825;
    background-color: #0a0a10;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.autoearn-farming-market:first-child {
    margin-top: 0;
}

.autoearn-farming-market:hover {
    z-index: 2;
    filter: brightness(1.15);
}

.autoearn-farming-market::after {
    content: '';
    position: absolute;
    top: 0;
    right: -72px;
    width: 72px;
    height: 100%;
    pointer-events: auto;
}

.autoearn-farming-market--has-error {
    height: 82px;
}

.autoearn-farming-market__identity {
    display: grid;
    grid-template-columns: 41px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.autoearn-farming-market__icon {
    width: 41px;
    height: 41px;
    border-radius: 0;
}

.autoearn-farming-market .market-image--farming {
    width: 41px;
    height: 41px;
    flex-basis: 41px;
    border: 0;
    border-radius: 0;
    background: #0d0e15;
}

.autoearn-farming-market .market-image__placeholder {
    border-radius: 0;
}

.autoearn-farming-market__question {
    margin: 0;
    overflow: hidden;
    color: #eeeef4;
    font-family: "Google Sans Mono", monospace;
    font-size: 12px;
    font-weight: 400;
    line-height: 14px;
    text-transform: uppercase;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.autoearn-farming-market__status {
    display: block;
    margin-top: 3px;
    overflow: hidden;
    color: #b4b5c0;
    font-family: "Google Sans Mono", monospace;
    font-size: 9px;
    line-height: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.autoearn-farming-market__status--healthy {
    color: #79dc9c;
}

.autoearn-farming-market__status--starting {
    color: #bfc1ff;
}

.autoearn-farming-market__status--waiting,
.autoearn-farming-market__status--paused {
    color: #dfcd81;
}

.autoearn-farming-market__status--managing {
    color: #e2a06f;
}

.autoearn-farming-market__status--exiting,
.autoearn-farming-market__status--attention {
    color: #c98790;
}

.autoearn-farming-market__metric {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.autoearn-farming-market__metric-value {
    overflow: hidden;
    color: #d4d4dd;
    font-family: "Google Sans Mono", monospace;
    font-size: 12px;
    line-height: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.autoearn-farming-market__price {
    position: relative;
    width: 80px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    color: #d4d4dd;
    font-family: "Google Sans Mono", monospace;
    font-size: 12px;
    line-height: 14px;
}

.autoearn-farming-market__price-line {
    display: flex;
    align-items: center;
    width: 48px;
    margin-left: 6px;
    color: #d4d4dd;
    font-family: "Google Sans Mono", monospace;
    font-size: 12px;
    font-weight: 400;
    line-height: 14px;
}

.autoearn-farming-market__price-label {
    width: 12px;
    flex: 0 0 12px;
    text-align: left;
}

.autoearn-farming-market__spread {
    position: absolute;
    left: 52px;
    top: 50%;
    transform: translateY(-50%);
    color: #a5a6b0;
    font-size: 10px;
    line-height: 12px;
    white-space: nowrap;
}

.autoearn-farming-market__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.autoearn-farming-market__error {
    position: absolute;
    left: 64px;
    right: 184px;
    bottom: 5px;
    margin: 0;
    color: #ff8f9c;
    font-family: "Google Sans Mono", monospace;
    font-size: 9px;
    line-height: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.autoearn-farming-markets__error {
    margin: 0;
    padding: 16px 18px;
    border: 2px solid #171825;
    background: #0a0a10;
    color: #ff8f9c;
    font-family: "Google Sans Mono", monospace;
    font-size: 11px;
    line-height: 1.5;
}

.autoearn-farming-market__action.autoearn-action {
    min-width: 68px;
    height: 32px;
    padding: 0 11px;
    font-size: 11px;
}

.autoearn-farming-market__action-spinner.status-spinner {
    display: inline-block;
    width: 13px;
    height: 13px;
    vertical-align: middle;
}

.autoearn-farming-market__external-actions {
    position: absolute;
    right: -64px;
    top: 50%;
    z-index: 10;
    display: flex;
    gap: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-50%);
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.autoearn-farming-market:hover .autoearn-farming-market__external-actions,
.autoearn-farming-market:focus-within .autoearn-farming-market__external-actions {
    opacity: 1;
    visibility: visible;
}

.autoearn-farming-market__external-action {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}

.autoearn-farming-market__external-action img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    filter: brightness(0) saturate(100%) invert(32%) sepia(15%) saturate(800%) hue-rotate(201deg);
    transition: filter 0.2s ease;
}

.autoearn-farming-market__external-action:hover img,
.autoearn-farming-market__external-action:focus-visible img {
    filter: brightness(0) saturate(100%) invert(65%) sepia(15%) saturate(800%) hue-rotate(201deg);
}

.autoearn-farming-market__external-action:focus-visible {
    outline: none;
}

@media (max-width: 1400px) {
    .autoearn-market-launch {
        display: none;
    }
}
