/*
 * Shared density authority for public result cards.
 *
 * Desktop card widths are exactly 80% of the previous 330px marketplace
 * cards and 280px content cards. Mobile cards continue to fill their
 * responsive column; their media, spacing and vertical footprint are reduced
 * instead so text and existing touch targets remain usable.
 *
 * Deliberately excluded: contact/detail cards, forms, navigation, pricing,
 * reviews, administration and forum discussion rows.
 */
:root {
    --public-market-card-min: 224px;
    --public-market-card-max: 264px;
    --public-content-card-min: 208px;
    --public-content-card-max: 224px;
    --public-market-card-gap: clamp(11px, 1vw, 16px);
    --public-content-card-gap: 13px;

    /* Keep the established marketplace selectors on the same shared tokens. */
    --marketplace-card-min: var(--public-market-card-min);
    --marketplace-card-max: var(--public-market-card-max);
    --marketplace-gap: var(--public-market-card-gap);
}

/* Standard public content, article and event result cards. */
@media (min-width: 641px) {
    body:not(.admin-page) .content-card-grid:not(.marketplace-listing-grid):not(.forum-thread-card-grid):not(.people-profile-grid):not(.people-community-grid),
    body:not(.admin-page) .event-premium-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--public-content-card-min)), var(--public-content-card-max)));
        align-items: start;
        justify-content: start;
        justify-items: start;
        gap: var(--public-content-card-gap);
    }

    body:not(.admin-page) .content-card-grid:not(.marketplace-listing-grid):not(.forum-thread-card-grid):not(.people-profile-grid):not(.people-community-grid) > .content-card,
    body:not(.admin-page) .event-premium-grid > .event-premium-card {
        width: 100%;
        max-width: var(--public-content-card-max);
        min-height: 0;
        height: auto;
        padding: 8px;
        gap: 6px;
        border-radius: 12px;
    }

    body:not(.admin-page) .content-card-grid:not(.marketplace-listing-grid):not(.forum-thread-card-grid):not(.people-profile-grid):not(.people-community-grid) > .content-card > :is(.content-card__media, .card-image, .media-frame),
    body:not(.admin-page) .content-card-grid:not(.marketplace-listing-grid):not(.forum-thread-card-grid):not(.people-profile-grid):not(.people-community-grid) > .content-card > a > :is(.content-card__media, .card-image, .media-frame) {
        width: 100%;
        height: auto;
        max-height: 156px;
        aspect-ratio: 4 / 3;
    }

    body:not(.admin-page) .content-card-grid:not(.marketplace-listing-grid):not(.forum-thread-card-grid):not(.people-profile-grid):not(.people-community-grid) > .article-card > :is(.content-card__media, .card-image, .media-frame),
    body:not(.admin-page) .content-card-grid:not(.marketplace-listing-grid):not(.forum-thread-card-grid):not(.people-profile-grid):not(.people-community-grid) > .article-card > a > :is(.content-card__media, .card-image, .media-frame),
    body:not(.admin-page) .event-premium-grid > .event-premium-card .event-card-media {
        height: auto;
        max-height: 120px;
        aspect-ratio: 16 / 9;
    }

    body:not(.admin-page) .content-card-grid:not(.marketplace-listing-grid):not(.forum-thread-card-grid):not(.people-profile-grid):not(.people-community-grid) > .content-card :is(h2, h3),
    body:not(.admin-page) .event-premium-card .event-card-body h2 {
        min-height: 2.4em;
        font-size: .92rem;
        line-height: 1.2;
    }

    body:not(.admin-page) .content-card-grid:not(.marketplace-listing-grid):not(.forum-thread-card-grid):not(.people-profile-grid):not(.people-community-grid) > .content-card > p,
    body:not(.admin-page) .content-card-grid:not(.marketplace-listing-grid):not(.forum-thread-card-grid):not(.people-profile-grid):not(.people-community-grid) > .content-card .content-card__description,
    body:not(.admin-page) .event-premium-card .event-card-description {
        font-size: .78rem;
        line-height: 1.3;
        -webkit-line-clamp: 1;
    }

    body:not(.admin-page) .content-card-grid:not(.marketplace-listing-grid):not(.forum-thread-card-grid):not(.people-profile-grid):not(.people-community-grid) > .content-card > :is(.content-card__footer, .card-footer, .auction-actions),
    body:not(.admin-page) .event-premium-card .event-card-footer {
        min-height: 28px;
        gap: 6px;
        padding-top: 4px;
    }

    body:not(.admin-page) .event-premium-card .event-card-body {
        padding: 8px 9px 7px;
    }

    body:not(.admin-page) .event-premium-card .event-card-footer {
        padding: 5px 9px;
    }

    body:not(.admin-page) .event-premium-card .event-card-facts div:nth-child(n+3) {
        display: none;
    }
}

/* Marketplace catalogues use the larger 264px card family. */
body:not(.admin-page) :is(.market-grid.marketplace-layout-grid, .marketplace-listing-grid.marketplace-layout-grid) {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--public-market-card-min)), 1fr));
    gap: var(--public-market-card-gap);
}

body:not(.admin-page) .market-grid.marketplace-layout-grid > .market-card,
body:not(.admin-page) .marketplace-listing-grid.marketplace-layout-grid > :is(.market-card, .content-card) {
    width: 100%;
    max-width: var(--public-market-card-max);
}

body:not(.admin-page) .market-card__content {
    padding: 8px 10px 10px;
}

body:not(.admin-page) .market-card__title {
    font-size: .88rem;
}

body:not(.admin-page) .market-card__price {
    padding-top: 6px;
    font-size: 1.04rem;
}

body:not(.admin-page) .market-card__price-label {
    margin-top: 6px;
}

body:not(.admin-page) .market-card__meta {
    margin-top: 5px;
}

body:not(.admin-page) .market-card__auction-time,
body:not(.admin-page) .market-card__service-note {
    margin-top: 6px;
    padding-top: 0;
}

body:not(.admin-page) .marketplace-listing-grid.marketplace-layout-grid > .content-card {
    padding: 8px 10px 10px;
    gap: 6px;
    border-radius: 12px;
}

body:not(.admin-page) .marketplace-listing-grid.marketplace-layout-grid > .content-card h2,
body:not(.admin-page) .marketplace-listing-grid.marketplace-layout-grid > .content-card h3 {
    min-height: 2.35em;
    font-size: .9rem;
    line-height: 1.18;
}

body:not(.admin-page) .marketplace-listing-grid.marketplace-layout-grid > .content-card .tag-row {
    min-height: 22px;
    max-height: 46px;
}

body:not(.admin-page) .marketplace-listing-grid.marketplace-layout-grid > .content-card :is(.content-card__footer, .card-footer, .auction-actions) {
    min-height: 27px;
    padding-top: 4px;
}

body:not(.admin-page) .marketplace-listing-grid.marketplace-layout-grid > .content-card :is(.content-card__footer, .card-footer, .auction-price-box) strong {
    font-size: 1rem;
}

/* The list switch uses the same 80% vertical geometry. */
@media (min-width: 981px) {
    body:not(.admin-page) .market-layout-list .market-card__surface {
        height: 168px;
        grid-template-columns: minmax(144px, 42%) minmax(0, 1fr);
    }

    body:not(.admin-page) .market-layout-list .market-card__media {
        height: 168px;
    }

    body:not(.admin-page) .market-layout-list .market-card__gallery-controls {
        width: 42%;
        height: 168px;
        aspect-ratio: auto;
    }

    body:not(.admin-page) .market-layout-list .market-card__content {
        padding: 13px 14px;
    }

    body:not(.admin-page) .market-layout-list .market-card__title {
        font-size: 1rem;
    }

    body:not(.admin-page) .marketplace-listing-grid.marketplace-layout-list > .content-card {
        grid-template-columns: minmax(152px, 38%) minmax(0, 1fr);
        min-height: 171px;
        column-gap: 11px;
        row-gap: 5px;
        padding: 9px;
    }

    body:not(.admin-page) .marketplace-listing-grid.marketplace-layout-list > .content-card > :is(.content-card__media, .card-image, .media-frame) {
        min-height: 152px;
        max-height: 184px;
    }

    body:not(.admin-page) .marketplace-listing-grid.marketplace-layout-list > .content-card .marketplace-card__description {
        -webkit-line-clamp: 2;
    }
}

/* Profile listing cards share the content-card dimensions. */
@media (min-width: 641px) {
    body:not(.admin-page) .public-profile-listing-grid {
        grid-template-columns: repeat(auto-fill, minmax(var(--public-content-card-min), var(--public-content-card-max)));
        gap: var(--public-content-card-gap);
    }

    body:not(.admin-page) .public-profile-listing-grid > .profile-listing-card {
        max-width: var(--public-content-card-max);
        padding: 8px;
    }

    body:not(.admin-page) .profile-listing-card__body {
        gap: 6px;
    }

    body:not(.admin-page) .profile-listing-card__body h3 {
        font-size: .92rem;
    }

    body:not(.admin-page) .profile-listing-card__description {
        font-size: .76rem;
    }
}

/* People and community result cards had a wider horizontal baseline. */
@media (min-width: 768px) {
    body:not(.admin-page) :is(.people-profile-grid, .people-community-grid) {
        grid-template-columns: repeat(auto-fill, minmax(var(--public-content-card-min), var(--public-content-card-max)));
        justify-content: start;
        gap: 10px;
    }

    body:not(.admin-page) .people-hub-page :is(.people-profile-card, .people-community-card) {
        width: 100%;
        max-width: var(--public-content-card-max);
        gap: 10px;
        padding: 13px;
    }

    body:not(.admin-page) .people-hub-page .people-profile-card {
        grid-template-columns: 58px minmax(0, 1fr);
        min-height: 162px;
    }

    body:not(.admin-page) .people-profile-avatar {
        width: 56px;
        height: 56px;
    }

    body:not(.admin-page) .people-hub-page .people-community-card {
        grid-template-columns: 39px minmax(0, 1fr);
        min-height: 146px;
    }

    body:not(.admin-page) .people-community-icon {
        width: 37px;
        height: 37px;
    }
}

/* Tourist/place result cards use the same 224px desktop footprint. */
@media (min-width: 621px) {
    body:not(.admin-page) .national-card-grid {
        grid-template-columns: repeat(auto-fill, minmax(var(--public-content-card-min), var(--public-content-card-max)));
        align-items: start;
        justify-content: start;
        gap: var(--public-content-card-gap);
    }

    body:not(.admin-page) .national-card-grid > .national-card {
        width: 100%;
        max-width: var(--public-content-card-max);
    }

    body:not(.admin-page) .national-card__body {
        padding: 13px;
    }

    body:not(.admin-page) .national-card h3 {
        min-height: 0;
        margin: 4px 0;
        font-size: 1rem;
    }

    body:not(.admin-page) .national-card__description {
        min-height: 0;
        font-size: .8rem;
        -webkit-line-clamp: 2;
    }

    body:not(.admin-page) .national-card__footer {
        margin-top: 11px;
        padding-top: 10px;
    }

    body:not(.admin-page) .national-card__footer .button-small {
        min-height: 34px;
        padding: 6px 8px;
        font-size: .72rem;
        white-space: nowrap;
    }

    body:not(.admin-page) .place-card .official-source-badge {
        margin-top: 4px;
    }

    body:not(.admin-page) .place-card .national-card__description {
        margin-bottom: 6px;
    }
}

/* Mobile: keep responsive width, reduce media and vertical footprint to 80%. */
@media (max-width: 768px) {
    body:not(.admin-page) :is(.market-grid.marketplace-layout-grid, .marketplace-listing-grid.marketplace-layout-grid) {
        grid-template-columns: repeat(auto-fill, minmax(var(--public-market-card-min), 1fr));
        gap: 8px;
    }

    body:not(.admin-page) .market-grid.marketplace-layout-grid > .market-card,
    body:not(.admin-page) .marketplace-listing-grid.marketplace-layout-grid > :is(.market-card, .content-card) {
        max-width: var(--public-market-card-max);
    }

    body:not(.admin-page) .market-card__media,
    body:not(.admin-page) .marketplace-listing-grid.marketplace-layout-grid > .content-card > :is(.content-card__media, .card-image, .media-frame) {
        aspect-ratio: 5 / 3;
    }

    body:not(.admin-page) .market-card__gallery-controls {
        aspect-ratio: 5 / 3;
    }

    body:not(.admin-page) .market-card__content {
        padding: 7px 8px 8px;
    }

    body:not(.admin-page) .market-card__title {
        min-height: 2.35em;
        font-size: .82rem;
    }

    body:not(.admin-page) .market-card__price {
        padding-top: 5px;
        font-size: .96rem;
    }

    body:not(.admin-page) .market-card__price-label {
        margin-top: 5px;
    }

    body:not(.admin-page) .market-card__meta {
        margin-top: 4px;
        font-size: .62rem;
    }

    body:not(.admin-page) .market-card__auction-time,
    body:not(.admin-page) .market-card__service-note {
        margin-top: 5px;
        font-size: .62rem;
    }

    body:not(.admin-page) .marketplace-listing-grid.marketplace-layout-grid > .content-card {
        padding: 6px;
        gap: 4px;
    }

    body:not(.admin-page) .marketplace-listing-grid.marketplace-layout-grid > .content-card h2,
    body:not(.admin-page) .marketplace-listing-grid.marketplace-layout-grid > .content-card h3 {
        min-height: 2.3em;
        font-size: .82rem;
    }

    body:not(.admin-page) .marketplace-listing-grid.marketplace-layout-grid > .content-card .tag-row {
        min-height: 18px;
        max-height: 20px;
    }

    body:not(.admin-page) .marketplace-listing-grid.marketplace-layout-grid > .content-card :is(.content-card__footer, .card-footer, .auction-actions) {
        min-height: 23px;
        padding-top: 1px;
    }

    body:not(.admin-page) .marketplace-listing-grid.marketplace-layout-grid > .content-card :is(.content-card__footer, .card-footer, .auction-price-box) strong {
        font-size: .94rem;
    }

    body:not(.admin-page) .market-layout-list .market-card__surface {
        height: calc(106px + var(--market-card-typebar-height));
        grid-template-columns: 100px minmax(0, 1fr);
        grid-template-rows: var(--market-card-typebar-height) 106px;
    }

    body:not(.admin-page) .market-layout-list .market-card__typebar {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    body:not(.admin-page) .market-layout-list .market-card__media {
        height: 106px;
        aspect-ratio: auto;
    }

    body:not(.admin-page) .market-layout-list .market-card__gallery-controls {
        width: 100px;
        height: 106px;
        aspect-ratio: auto;
    }

    body:not(.admin-page) .market-layout-list .market-card__content {
        padding: 7px 9px;
    }

    body:not(.admin-page) .market-layout-list .market-card__title {
        min-height: 2.3em;
        font-size: .84rem;
    }

    body:not(.admin-page) .market-layout-list .market-card__description {
        -webkit-line-clamp: 1;
    }

    body:not(.admin-page) .marketplace-listing-grid.marketplace-layout-list > .content-card {
        grid-template-columns: clamp(86px, 25vw, 101px) minmax(0, 1fr);
        min-height: 109px;
        column-gap: 8px;
        row-gap: 2px;
        padding: 6px;
    }

    body:not(.admin-page) .marketplace-listing-grid.marketplace-layout-list > .content-card > :is(.content-card__media, .card-image, .media-frame) {
        height: clamp(83px, 24vw, 96px);
        min-height: 83px;
        max-height: 96px;
    }

    body:not(.admin-page) .marketplace-listing-grid.marketplace-layout-list > .content-card .marketplace-card__description {
        -webkit-line-clamp: 1;
    }
}

@media (max-width: 640px) {
    body:not(.admin-page) :is(.market-grid.marketplace-layout-grid, .marketplace-listing-grid.marketplace-layout-grid) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body:not(.admin-page) .market-grid.marketplace-layout-grid > .market-card,
    body:not(.admin-page) .marketplace-listing-grid.marketplace-layout-grid > :is(.market-card, .content-card) {
        max-width: none;
    }

    body:not(.admin-page) .content-card-grid.content-card-grid--mobile-list:not(.marketplace-listing-grid):not(.forum-thread-card-grid),
    body:not(.admin-page) .event-premium-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

    body:not(.admin-page) .content-card-grid--mobile-list:not(.marketplace-listing-grid):not(.forum-thread-card-grid) > .content-card,
    body:not(.admin-page) .event-premium-grid > .event-premium-card {
        grid-template-columns: 93px minmax(0, 1fr);
        min-height: 0;
        max-width: none;
        padding: 6px !important;
        gap: 3px 8px;
        border-radius: 10px;
    }

    body:not(.admin-page) .content-card-grid--mobile-list:not(.marketplace-listing-grid):not(.forum-thread-card-grid) > .content-card > :is(.content-card__media, .card-image, .media-frame),
    body:not(.admin-page) .content-card-grid--mobile-list:not(.marketplace-listing-grid):not(.forum-thread-card-grid) > .content-card > a > :is(.content-card__media, .card-image, .media-frame),
    body:not(.admin-page) .event-premium-card .event-card-media {
        width: 93px;
        height: 83px;
        min-height: 83px;
        max-height: 83px;
        aspect-ratio: auto;
    }

    body:not(.admin-page) .content-card-grid--mobile-list:not(.marketplace-listing-grid):not(.forum-thread-card-grid) > .content-card :is(h2, h3),
    body:not(.admin-page) .content-card-grid--mobile-list:not(.marketplace-listing-grid):not(.forum-thread-card-grid) > .search-result-card .search-result-body > strong,
    body:not(.admin-page) .event-premium-card .event-card-body h2 {
        min-height: 0;
        font-size: .88rem;
        line-height: 1.16;
    }

    body:not(.admin-page) .content-card-grid--mobile-list:not(.marketplace-listing-grid):not(.forum-thread-card-grid) > .content-card > p:last-of-type,
    body:not(.admin-page) .content-card-grid--mobile-list:not(.marketplace-listing-grid):not(.forum-thread-card-grid) > .content-card .content-card__description,
    body:not(.admin-page) .content-card-grid--mobile-list:not(.marketplace-listing-grid):not(.forum-thread-card-grid) > .content-card .job-compact-description {
        font-size: .72rem;
        line-height: 1.2;
    }

    body:not(.admin-page) .content-card-grid--mobile-list:not(.marketplace-listing-grid):not(.forum-thread-card-grid) > .content-card > :is(.content-card__footer, .card-footer, .auction-actions),
    body:not(.admin-page) .event-premium-card .event-card-footer {
        min-height: 24px;
        padding-top: 0;
    }

    body:not(.admin-page) .event-premium-card .event-card-body {
        padding: 0;
    }

    body:not(.admin-page) .event-premium-card .event-card-footer {
        padding: 0;
    }

    body:not(.admin-page) .public-profile-listing-grid {
        grid-template-columns: minmax(0, 80%);
        justify-content: start;
        gap: 7px;
    }

    body:not(.admin-page) .public-profile-listing-grid > .profile-listing-card {
        grid-template-columns: clamp(86px, 25vw, 99px) minmax(0, 1fr);
        padding: 6px;
        gap: 7px;
    }

    body:not(.admin-page) .public-profile-listing-grid > .profile-listing-card > .content-card__media {
        max-height: 83px;
        aspect-ratio: 4 / 3;
    }

    body:not(.admin-page) .profile-listing-card__body h3 {
        font-size: .86rem;
    }

    body:not(.admin-page) .profile-listing-card__description {
        font-size: .69rem;
        -webkit-line-clamp: 1;
    }

    body:not(.admin-page) .profile-listing-card .tag-row {
        max-height: 20px;
        flex-wrap: nowrap;
        overflow: hidden;
    }

    body:not(.admin-page) .national-card__media {
        aspect-ratio: 20 / 9;
    }

    body:not(.admin-page) .national-card__body {
        padding: 13px;
    }

    body:not(.admin-page) .national-card h3 {
        min-height: 0;
        margin: 4px 0;
        font-size: 1rem;
    }

    body:not(.admin-page) .national-card__description {
        min-height: 0;
        font-size: .8rem;
        -webkit-line-clamp: 2;
    }

    body:not(.admin-page) .national-card__footer {
        align-items: center;
        flex-direction: row;
        margin-top: 10px;
        padding-top: 9px;
    }

    body:not(.admin-page) .national-card__footer .button-small {
        flex: 0 0 auto;
        min-height: 34px;
        padding: 6px 8px;
        font-size: .72rem;
        white-space: nowrap;
    }

    body:not(.admin-page) .place-card .official-source-badge {
        margin-top: 4px;
    }

    body:not(.admin-page) .place-card .national-card__description {
        margin-bottom: 6px;
    }
}

@media (max-width: 767px) {
    body:not(.admin-page) .people-profile-grid,
    body:not(.admin-page) .people-community-grid {
        grid-template-columns: minmax(0, var(--public-content-card-max));
        justify-content: start;
        gap: 7px;
    }

    body:not(.admin-page) .people-hub-page .people-profile-card {
        width: 100%;
        max-width: var(--public-content-card-max);
        grid-template-columns: 51px minmax(0, 1fr);
        gap: 8px;
        min-height: 121px;
        padding: 9px;
    }

    body:not(.admin-page) .people-profile-avatar {
        width: 49px;
        height: 49px;
    }

    body:not(.admin-page) .people-card-description {
        display: none;
    }

    body:not(.admin-page) .people-card-cta {
        padding-top: .32rem;
    }

    body:not(.admin-page) .people-hub-page .people-community-card {
        width: 100%;
        max-width: var(--public-content-card-max);
        grid-template-columns: 36px minmax(0, 1fr);
        gap: 8px;
        min-height: 114px;
        padding: 9px;
    }

    body:not(.admin-page) .people-community-icon {
        width: 34px;
        height: 34px;
    }
}

body:not(.admin-page) .people-hub-page .people-card-description {
    display: none;
}

/* Keep the content type readable without covering the item photography. */
body:not(.admin-page) .market-card {
    --market-card-typebar-height: 30px;
}

body:not(.admin-page) .market-card__typebar {
    display: flex;
    flex: 0 0 var(--market-card-typebar-height);
    min-width: 0;
    min-height: var(--market-card-typebar-height);
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 10px;
    border-bottom: 1px solid #d9e5e8;
    background: linear-gradient(90deg, #f7fafb 0%, #edf5f6 100%);
}

body:not(.admin-page) .market-card__typebar .market-card__type {
    --market-type-accent: #173b4d;
    gap: 6px;
    min-height: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    color: #294653;
    background: transparent;
    box-shadow: none;
    font-size: .6rem;
    letter-spacing: .075em;
}

body:not(.admin-page) .market-card__typebar .market-card__type::before {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: var(--market-type-accent);
    content: "";
}

body:not(.admin-page) .market-card__typebar .market-card__type--auction { --market-type-accent: #a96513; }
body:not(.admin-page) .market-card__typebar .market-card__type--request { --market-type-accent: #315f9d; }
body:not(.admin-page) .market-card__typebar .market-card__type--service { --market-type-accent: #4f7b46; }
body:not(.admin-page) .market-card__typebar .market-card__type--job { --market-type-accent: #087f87; }
body:not(.admin-page) .market-card__typebar .market-card__type--supplier { --market-type-accent: #655b8c; }
body:not(.admin-page) .market-card__typebar .market-card__type--digital { --market-type-accent: #3b69a5; }
body:not(.admin-page) .market-card__typebar .market-card__type--shop { --market-type-accent: #4e7b58; }
body:not(.admin-page) .market-card__typebar .market-card__type--project { --market-type-accent: #745497; }
body:not(.admin-page) .market-card__typebar .market-card__type--handmade { --market-type-accent: #8b4777; }
body:not(.admin-page) .market-card__typebar .market-card__type--product { --market-type-accent: #3e6b83; }

body:not(.admin-page) .market-card__typebar .market-card__status {
    display: inline-flex;
    min-width: 0;
    min-height: 21px;
    align-items: center;
    gap: 5px;
    margin-left: auto;
    padding: 3px 8px;
    overflow: hidden;
    border: 1px solid #ead99b;
    border-radius: 999px;
    color: #7b520b;
    background: #fff7d8;
    box-shadow: none;
    font-size: .61rem;
    font-weight: 850;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body:not(.admin-page) .market-card__typebar .market-card__status > span {
    width: 6px;
    height: 6px;
    flex: 0 0 6px;
    border-radius: 50%;
    background: #c88713;
}

body:not(.admin-page) .market-card__gallery-controls {
    top: var(--market-card-typebar-height);
}

@media (min-width: 981px) {
    body:not(.admin-page) .market-layout-list .market-card__surface {
        height: auto;
        min-height: calc(168px + var(--market-card-typebar-height));
        grid-template-rows: var(--market-card-typebar-height) minmax(168px, auto);
    }

    body:not(.admin-page) .market-layout-list .market-card__typebar {
        grid-column: 1 / -1;
        grid-row: 1;
    }
}

@media (min-width: 769px) and (max-width: 980px) {
    body:not(.admin-page) .market-layout-list .market-card__surface {
        height: auto;
        min-height: calc(132px + var(--market-card-typebar-height));
        grid-template-rows: var(--market-card-typebar-height) minmax(132px, auto);
    }

    body:not(.admin-page) .market-layout-list .market-card__typebar {
        grid-column: 1 / -1;
        grid-row: 1;
    }
}

@media (max-width: 339px) {
    body:not(.admin-page) :is(.market-grid.marketplace-layout-grid, .marketplace-listing-grid.marketplace-layout-grid) {
        grid-template-columns: minmax(0, 1fr);
    }

    body:not(.admin-page) .market-card__surface {
        display: grid;
        height: auto;
        min-height: calc(132px + var(--market-card-typebar-height));
        grid-template-columns: 98px minmax(0, 1fr);
        grid-template-rows: var(--market-card-typebar-height) minmax(132px, auto);
    }

    body:not(.admin-page) .market-card__typebar {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    body:not(.admin-page) .market-card__media {
        height: 100%;
        min-height: 132px;
        aspect-ratio: auto;
    }

    body:not(.admin-page) .market-card__gallery-controls {
        width: 98px;
        height: auto;
        min-height: 132px;
        bottom: 0;
        aspect-ratio: auto;
    }

    body:not(.admin-page) .market-card__content {
        min-height: 0;
    }

    body:not(.admin-page) .market-card__meta {
        display: none;
    }

    body:not(.admin-page) .marketplace-listing-grid.marketplace-layout-grid > .content-card {
        display: grid;
        grid-template-columns: 98px minmax(0, 1fr);
        min-height: 106px;
    }

    body:not(.admin-page) .marketplace-listing-grid.marketplace-layout-grid > .content-card > :is(.content-card__media, .card-image, .media-frame) {
        grid-column: 1;
        grid-row: 1 / span 20;
        width: 100%;
        height: 94px;
        min-height: 94px;
        max-height: 94px;
        aspect-ratio: auto;
    }

    body:not(.admin-page) .marketplace-listing-grid.marketplace-layout-grid > .content-card > :not(.content-card__media):not(.card-image):not(.media-frame) {
        grid-column: 2;
        min-width: 0;
    }
}

/* Trust-profile seller context may be taller than the compact list preset.
   Let the shared card grow instead of clipping the seller below its surface. */
@media (max-width: 768px) {
    body:not(.admin-page) .market-layout-list .market-card__surface {
        height: auto;
        min-height: calc(132px + var(--market-card-typebar-height));
        grid-template-rows: var(--market-card-typebar-height) minmax(132px, auto);
    }

    body:not(.admin-page) .market-layout-list .market-card__media {
        height: 100%;
        min-height: 132px;
    }

    body:not(.admin-page) .market-layout-list .market-card__gallery-controls {
        height: auto;
        min-height: 132px;
        bottom: 0;
    }
}

/*
 * Shared catalogue layout adapters.
 *
 * Articles, events, people, communities and public-profile listings use the
 * same persisted grid/list control as the marketplace. Their card markup is
 * intentionally different, so these adapters preserve each card's semantics
 * while keeping the responsive behaviour and density consistent.
 */
body:not(.admin-page) .public-catalogue-page .marketplace-view-toolbar {
    margin-block: 12px;
}

body:not(.admin-page) .public-catalogue-grid.marketplace-layout-grid {
    align-items: start;
    justify-content: start;
}

/* Event cards keep their date and source badges in both shared layouts. */
body:not(.admin-page) .event-premium-grid.marketplace-layout-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--public-market-card-min)), 1fr));
    gap: var(--public-market-card-gap);
}

body:not(.admin-page) .event-premium-grid.marketplace-layout-grid > .event-premium-card {
    display: flex;
    width: 100%;
    max-width: var(--public-market-card-max);
    padding: 0;
    gap: 0;
}

body:not(.admin-page) .event-premium-grid.marketplace-layout-grid .event-card-media {
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    aspect-ratio: 3 / 2;
}

body:not(.admin-page) .event-premium-grid.marketplace-layout-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--public-market-card-gap);
}

body:not(.admin-page) .event-premium-grid.marketplace-layout-list > .event-premium-card {
    display: grid;
    grid-template-columns: minmax(152px, 36%) minmax(0, 1fr);
    grid-template-rows: 1fr auto;
    width: 100%;
    max-width: none;
    min-height: 168px;
    padding: 0;
    gap: 0;
}

body:not(.admin-page) .event-premium-grid.marketplace-layout-list .event-card-media {
    grid-column: 1;
    grid-row: 1 / 3;
    width: 100%;
    height: 100%;
    min-height: 168px;
    max-height: 210px;
    aspect-ratio: auto;
}

body:not(.admin-page) .event-premium-grid.marketplace-layout-list .event-card-body {
    grid-column: 2;
    grid-row: 1;
    padding: 10px 12px 7px;
}

body:not(.admin-page) .event-premium-grid.marketplace-layout-list .event-card-footer {
    grid-column: 2;
    grid-row: 2;
    min-height: 32px;
    padding: 5px 12px;
}

body:not(.admin-page) .event-premium-grid.marketplace-layout-list .event-card-description {
    min-height: 0;
    -webkit-line-clamp: 2;
}

body:not(.admin-page) .event-premium-grid.marketplace-layout-list .event-card-facts {
    margin-top: 5px;
}

/* People-hub cards have avatar/icon columns instead of rectangular media. */
body:not(.admin-page) :is(.people-profile-grid, .people-community-grid).marketplace-layout-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--public-content-card-min)), var(--public-content-card-max)));
    gap: var(--public-content-card-gap);
}

body:not(.admin-page) .people-hub-page :is(.people-profile-grid, .people-community-grid).marketplace-layout-grid > :is(.people-profile-card, .people-community-card) {
    width: 100%;
    max-width: var(--public-content-card-max);
}

body:not(.admin-page) :is(.people-profile-grid, .people-community-grid).marketplace-layout-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
}

body:not(.admin-page) .people-hub-page :is(.people-profile-grid, .people-community-grid).marketplace-layout-list > :is(.people-profile-card, .people-community-card) {
    width: 100%;
    max-width: none;
    min-height: 112px;
    padding: 12px;
    gap: 12px;
}

body:not(.admin-page) .people-hub-page .people-profile-grid.marketplace-layout-list > .people-profile-card {
    grid-template-columns: 64px minmax(0, 1fr);
}

body:not(.admin-page) .people-hub-page .people-community-grid.marketplace-layout-list > .people-community-card {
    grid-template-columns: 52px minmax(0, 1fr);
}

body:not(.admin-page) .people-hub-page .marketplace-layout-list :is(.people-profile-avatar, .people-community-icon) {
    grid-column: 1;
}

body:not(.admin-page) .people-hub-page .marketplace-layout-list :is(.people-profile-copy, .people-community-copy) {
    grid-column: 2;
}

body:not(.admin-page) .people-hub-page .marketplace-layout-list .people-card-description {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

/* Public-profile cards use one readable row per item in list mode. */
body:not(.admin-page) .public-profile-listing-grid.marketplace-layout-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--public-market-card-min)), 1fr));
    gap: var(--public-market-card-gap);
}

body:not(.admin-page) .public-profile-listing-grid.marketplace-layout-grid > .profile-listing-card {
    width: 100%;
    max-width: var(--public-market-card-max);
}

body:not(.admin-page) .public-profile-listing-grid.marketplace-layout-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
}

body:not(.admin-page) .public-profile-listing-grid.marketplace-layout-list > .profile-listing-card {
    grid-template-columns: clamp(118px, 24vw, 168px) minmax(0, 1fr);
    width: 100%;
    max-width: none;
    min-height: 132px;
    padding: 7px;
    gap: 11px;
}

body:not(.admin-page) .public-profile-listing-grid.marketplace-layout-list > .profile-listing-card > .content-card__media {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    height: 100%;
    min-height: 116px;
    max-height: 154px;
    aspect-ratio: auto;
}

body:not(.admin-page) .public-profile-listing-grid.marketplace-layout-list > .profile-listing-card > .profile-listing-card__body {
    grid-column: 2;
    grid-row: 1;
}

@media (max-width: 1180px) {
    body:not(.admin-page) .event-premium-grid.marketplace-layout-list {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 640px) {
    body:not(.admin-page) .event-premium-grid.marketplace-layout-grid,
    body:not(.admin-page) :is(.people-profile-grid, .people-community-grid).marketplace-layout-grid,
    body:not(.admin-page) .public-profile-listing-grid.marketplace-layout-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    body:not(.admin-page) .event-premium-grid.marketplace-layout-grid > .event-premium-card,
    body:not(.admin-page) .people-hub-page :is(.people-profile-grid, .people-community-grid).marketplace-layout-grid > :is(.people-profile-card, .people-community-card),
    body:not(.admin-page) .public-profile-listing-grid.marketplace-layout-grid > .profile-listing-card {
        max-width: none;
    }

    body:not(.admin-page) .event-premium-grid.marketplace-layout-grid .event-card-body {
        padding: 7px 8px 6px;
    }

    body:not(.admin-page) .event-premium-grid.marketplace-layout-grid .event-card-footer {
        min-height: 27px;
        padding: 4px 8px;
    }

    body:not(.admin-page) .event-premium-grid.marketplace-layout-grid .event-card-facts,
    body:not(.admin-page) .event-premium-grid.marketplace-layout-grid .event-card-description,
    body:not(.admin-page) .event-premium-grid.marketplace-layout-grid .event-card-footer > span,
    body:not(.admin-page) .people-hub-page .marketplace-layout-grid .people-card-description {
        display: none;
    }

    body:not(.admin-page) .people-hub-page .marketplace-layout-grid > .people-profile-card {
        grid-template-columns: 44px minmax(0, 1fr);
        min-height: 112px;
        padding: 8px;
        gap: 7px;
    }

    body:not(.admin-page) .people-hub-page .marketplace-layout-grid > .people-community-card {
        grid-template-columns: 36px minmax(0, 1fr);
        min-height: 108px;
        padding: 8px;
        gap: 7px;
    }

    body:not(.admin-page) .people-hub-page .marketplace-layout-grid .people-profile-avatar {
        width: 42px;
        height: 42px;
    }

    body:not(.admin-page) .people-hub-page .marketplace-layout-grid .people-community-icon {
        width: 34px;
        height: 34px;
    }

    body:not(.admin-page) .people-hub-page .marketplace-layout-grid :is(.people-interest-chips, .people-card-tags) {
        max-height: 22px;
        overflow: hidden;
    }

    body:not(.admin-page) .event-premium-grid.marketplace-layout-list > .event-premium-card {
        grid-template-columns: clamp(96px, 29vw, 116px) minmax(0, 1fr);
        min-height: 116px;
    }

    body:not(.admin-page) .event-premium-grid.marketplace-layout-list .event-card-media {
        min-height: 116px;
        max-height: 138px;
    }

    body:not(.admin-page) .event-premium-grid.marketplace-layout-list .event-card-body {
        padding: 7px 9px 4px;
    }

    body:not(.admin-page) .event-premium-grid.marketplace-layout-list .event-card-footer {
        min-height: 28px;
        padding: 3px 9px;
    }

    body:not(.admin-page) .event-premium-grid.marketplace-layout-list .event-card-facts,
    body:not(.admin-page) .event-premium-grid.marketplace-layout-list .event-card-description,
    body:not(.admin-page) .event-premium-grid.marketplace-layout-list .event-card-footer > span {
        display: none;
    }

    body:not(.admin-page) .people-hub-page :is(.people-profile-grid, .people-community-grid).marketplace-layout-list > :is(.people-profile-card, .people-community-card) {
        min-height: 102px;
        padding: 9px;
        gap: 9px;
    }

    body:not(.admin-page) .people-hub-page .people-profile-grid.marketplace-layout-list > .people-profile-card {
        grid-template-columns: 52px minmax(0, 1fr);
    }

    body:not(.admin-page) .people-hub-page .people-community-grid.marketplace-layout-list > .people-community-card {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    body:not(.admin-page) .public-profile-listing-grid.marketplace-layout-list > .profile-listing-card {
        grid-template-columns: clamp(94px, 29vw, 116px) minmax(0, 1fr);
        min-height: 108px;
        gap: 8px;
    }

    body:not(.admin-page) .public-profile-listing-grid.marketplace-layout-list > .profile-listing-card > .content-card__media {
        min-height: 94px;
        max-height: 116px;
    }
}

@media (max-width: 339px) {
    body:not(.admin-page) .event-premium-grid.marketplace-layout-grid,
    body:not(.admin-page) :is(.people-profile-grid, .people-community-grid).marketplace-layout-grid,
    body:not(.admin-page) .public-profile-listing-grid.marketplace-layout-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    body:not(.admin-page) .event-premium-grid.marketplace-layout-grid > .event-premium-card {
        display: grid;
        grid-template-columns: 98px minmax(0, 1fr);
        grid-template-rows: 1fr auto;
        min-height: 106px;
    }

    body:not(.admin-page) .event-premium-grid.marketplace-layout-grid .event-card-media {
        grid-column: 1;
        grid-row: 1 / 3;
        height: 106px;
        min-height: 106px;
        aspect-ratio: auto;
    }

    body:not(.admin-page) .event-premium-grid.marketplace-layout-grid .event-card-body,
    body:not(.admin-page) .event-premium-grid.marketplace-layout-grid .event-card-footer {
        grid-column: 2;
    }

    body:not(.admin-page) .event-premium-grid.marketplace-layout-grid .event-card-body {
        grid-row: 1;
    }

    body:not(.admin-page) .event-premium-grid.marketplace-layout-grid .event-card-footer {
        grid-row: 2;
    }
}
