.atc-market .atc-market-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    padding: clamp(17px, 3vw, 30px);
    border: 1px solid var(--market-line);
    border-radius: 18px;
    background: #edf5fb;
}

body .atc-market .atc-market-title {
    margin: 0 !important;
    color: #173a56 !important;
    font-size: clamp(25px, 3vw, 36px) !important;
}

.atc-market .atc-market-heading p {
    margin: 7px 0 0;
    color: #3c5d75;
}

.atc-market :is(.atc-market-primary, .atc-market-pagination a, .atc-market-guest-actions a) {
    min-height: 44px;
}

.atc-market a:focus-visible,
.atc-market button:focus-visible,
.atc-market summary:focus-visible {
    outline: 2px solid #176eb3;
    outline-offset: 2px;
}

.atc-market .atc-market-search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px;
    align-items: end;
    padding: 13px;
    border: 1px solid var(--market-line);
    border-radius: 13px;
    background: #fff;
}

.atc-market-search-row label {
    display: grid;
    gap: 5px;
    min-width: 0;
    font-weight: 650;
}

.atc-market-search-row input {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 46px;
    padding: 8px 11px;
    border: 1px solid #91a9bb;
    border-radius: 8px;
    background: #fff;
    color: #173a56;
    font: inherit;
    font-size: 16px;
}

body .atc-market .atc-market-filter-panel {
    margin: 10px 0 12px !important;
}

.atc-market .atc-market-filter-panel > summary {
    min-height: 46px;
}

.atc-market .atc-market-filter-panel > summary:focus-visible {
    outline-offset: -3px;
}

.atc-market .atc-market-card-body small {
    color: #49657b;
}

.atc-market .atc-market-image-empty {
    background: linear-gradient(145deg, #eef5fa, #e3eff7);
    color: #405e75;
    font-size: 13px;
    font-weight: 650;
}

.atc-market .atc-market-detail-gallery > .atc-market-image-empty {
    grid-column: 1 / -1;
    min-height: 180px;
    border-radius: 13px;
}

.atc-market .atc-market-empty {
    padding: clamp(19px, 3vw, 35px) 15px;
}

body .atc-market .atc-market-empty h2 {
    margin-bottom: 7px;
    font-size: clamp(19px, 2vw, 23px) !important;
}

.atc-market .atc-market-empty p:last-child {
    margin-bottom: 0;
}

.atc-market .atc-market-empty a,
.atc-market .atc-market-actions a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: #145b93;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.atc-market .atc-market-guest-notice {
    margin-top: 18px;
}

.atc-market .atc-market-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 15px;
}

.atc-market-form label {
    min-width: 0;
}

.atc-market-form label small {
    color: #49657b;
    font-size: 13px;
    font-weight: 500;
}

.atc-market-form :is(input[type="file"], select, textarea) {
    width: 100%;
    min-width: 0;
}

.atc-market-form input[type="file"]::file-selector-button {
    max-width: 100%;
    padding: 7px;
}

@media (max-width: 640px) {
    body .atc-market .atc-market-tabs {
        gap: 4px;
    }

    .atc-market .atc-market-tabs a {
        display: grid;
        align-content: center;
        min-height: 44px;
        line-height: 1.25;
    }

    .atc-market .atc-market-heading > .atc-market-primary,
    .atc-market .atc-market-actions > .atc-market-primary {
        width: 100%;
    }

    .atc-market .atc-market-form-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    body .atc-market .atc-market-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    body .atc-market .atc-market-card {
        display: grid !important;
        grid-template-columns: minmax(0, 32%) minmax(0, 1fr);
        align-items: stretch;
    }

    body .atc-market .atc-market-card .atc-market-photo {
        position: relative;
        grid-column: 1;
        grid-row: 1;
        aspect-ratio: auto !important;
        min-width: 0;
        min-height: 112px;
        width: 100% !important;
        max-width: 100%;
    }

    .atc-market .atc-market-photo > :is(img, .atc-market-image-empty) {
        position: absolute;
        inset: 0;
        min-height: 0;
    }

    body .atc-market .atc-market-card .atc-market-card-body {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
        min-height: 0 !important;
        padding: 11px 12px !important;
    }

    body .atc-market .atc-market-card .atc-market-photo img {
        padding: 5px !important;
    }

    .atc-market .atc-market-card .atc-market-sold {
        top: 5px;
        left: 5px;
    }
}
