.marketplace-page {
    display: flex;
    flex-direction: column;
    gap: 28px;
    max-width: 1240px;
    margin: 0 auto;
    padding: clamp(18px, 3vw, 34px) 0 44px;
    color: #182033;
}

.marketplace-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.7fr);
    gap: clamp(20px, 4vw, 44px);
    align-items: stretch;
    padding: clamp(28px, 4vw, 48px);
    border: 1px solid #d9e2ef;
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(248, 250, 252, 0.96), rgba(239, 246, 255, 0.92)),
        #f8fafc;
}

.marketplace-hero__copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.marketplace-eyebrow {
    margin: 0 0 8px;
    color: #0f766e;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.marketplace-hero h1,
.marketplace-detail h1 {
    margin: 0;
    color: #111827;
    font-size: clamp(2rem, 4vw, 3.3rem);
    line-height: 1.05;
    font-weight: 850;
}

.marketplace-hero p:not(.marketplace-eyebrow) {
    max-width: 680px;
    margin: 18px 0 0;
    color: #526072;
    font-size: 1.03rem;
    line-height: 1.7;
}

.marketplace-search,
.marketplace-filters,
.marketplace-side-panel {
    border: 1px solid #d8e0ea;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

.marketplace-search {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
    padding: 20px;
}

.marketplace-search__label,
.marketplace-filters label {
    color: #334155;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.marketplace-search__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.marketplace-search input,
.marketplace-filters input,
.marketplace-filters select {
    width: 100%;
    min-height: 42px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #111827;
    padding: 10px 12px;
    font: inherit;
}

.marketplace-search input:focus,
.marketplace-filters input:focus,
.marketplace-filters select:focus {
    outline: 3px solid rgba(14, 165, 233, 0.18);
    border-color: #0ea5e9;
}

.marketplace-search button,
.marketplace-filter-submit,
.marketplace-pagination button,
.marketplace-filter-head button {
    min-height: 42px;
    border: 1px solid #0f172a;
    border-radius: 6px;
    background: #0f172a;
    color: #fff;
    padding: 0 18px;
    font-weight: 800;
    cursor: pointer;
}

.marketplace-search__quick {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.marketplace-search__quick button,
.marketplace-filter-head button {
    min-height: 34px;
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #334155;
    padding: 0 12px;
    font-size: 0.84rem;
}

.marketplace-body {
    display: grid;
    grid-template-columns: minmax(240px, 290px) minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.marketplace-filters {
    position: sticky;
    top: 82px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
}

.marketplace-filter-head,
.marketplace-results__head,
.marketplace-section-head,
.marketplace-card__top,
.marketplace-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.marketplace-filter-head h2,
.marketplace-results__head h2,
.marketplace-section-head h2 {
    margin: 0;
    color: #111827;
    font-size: 1.25rem;
    font-weight: 850;
}

.marketplace-filter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.marketplace-filter-submit {
    width: 100%;
    margin-top: 4px;
}

.marketplace-results {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.marketplace-results__meta {
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 700;
}

.marketplace-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.marketplace-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    border: 1px solid #dde5ef;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.marketplace-card--match {
    min-width: 280px;
    max-width: 360px;
    border-color: #b7e4dc;
    background: linear-gradient(180deg, #ffffff, #f4fffc);
}

.marketplace-card h3 {
    margin: 0;
    color: #111827;
    font-size: 1.02rem;
    font-weight: 850;
    line-height: 1.3;
}

.marketplace-card p {
    margin: 0;
    color: #556274;
    font-size: 0.92rem;
    line-height: 1.6;
}

.marketplace-badge,
.marketplace-status {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    border-radius: 999px;
    padding: 0 10px;
    font-size: 0.74rem;
    font-weight: 850;
}

.marketplace-badge {
    background: #e0f2fe;
    color: #075985;
}

.marketplace-badge--score {
    background: #ccfbf1;
    color: #115e59;
}

.marketplace-status {
    background: #f1f5f9;
    color: #475569;
}

.marketplace-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
}

.marketplace-meta div {
    min-width: 0;
}

.marketplace-meta dt {
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.marketplace-meta dd {
    margin: 3px 0 0;
    color: #182033;
    font-size: 0.88rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.marketplace-card__foot {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 700;
}

.marketplace-card__foot > div {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.marketplace-link,
.marketplace-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    border-radius: 6px;
    padding: 0 12px;
    font-size: 0.86rem;
    font-weight: 850;
    text-decoration: none;
}

.marketplace-link {
    color: #0f172a;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
}

.marketplace-primary {
    color: #fff;
    background: #007D84;
    border: 1px solid #007D84;
}

.marketplace-primary--wide,
.marketplace-link--wide {
    width: 100%;
}

.marketplace-matches {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.marketplace-section-head {
    align-items: flex-end;
}

.marketplace-section-head > p {
    max-width: 460px;
    margin: 0;
    color: #64748b;
    line-height: 1.5;
}

.marketplace-match-row {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.marketplace-reasons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.marketplace-reasons span {
    border-radius: 999px;
    background: #ecfdf5;
    color: #166534;
    padding: 5px 9px;
    font-size: 0.74rem;
    font-weight: 800;
}

.marketplace-state {
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    padding: 34px 20px;
    color: #475569;
    text-align: center;
}

.marketplace-state h3 {
    margin: 0 0 8px;
    color: #111827;
}

.marketplace-state p {
    margin: 0;
}

.marketplace-state--error {
    border-color: #fecaca;
    background: #fff1f2;
    color: #991b1b;
}

.marketplace-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding-top: 8px;
}

.marketplace-pagination button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.marketplace-back {
    color: #334155;
    font-weight: 800;
    text-decoration: none;
}

.marketplace-detail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: 22px;
    align-items: start;
}

.marketplace-detail__main {
    display: flex;
    flex-direction: column;
    gap: 20px;
    border: 1px solid #dde5ef;
    border-radius: 8px;
    background: #fff;
    padding: clamp(24px, 4vw, 40px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.marketplace-detail__lead {
    margin: 0;
    color: #475569;
    font-size: 1.02rem;
    line-height: 1.75;
}

.marketplace-detail__section {
    border-top: 1px solid #e2e8f0;
    padding-top: 18px;
}

.marketplace-detail__section h2 {
    margin: 0 0 12px;
    color: #111827;
    font-size: 1.05rem;
}

.marketplace-detail__section p {
    margin: 0;
    color: #475569;
    line-height: 1.7;
}

.marketplace-meta--detail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.marketplace-side-panel {
    position: sticky;
    top: 82px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
}

.marketplace-side-panel h2 {
    margin: 0;
    color: #111827;
    font-size: 1.2rem;
}

.marketplace-side-panel dl {
    display: grid;
    gap: 12px;
    margin: 0;
}

.marketplace-side-panel dt {
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.marketplace-side-panel dd {
    margin: 2px 0 0;
    color: #111827;
    font-weight: 750;
    overflow-wrap: anywhere;
}

@media (max-width: 980px) {
    .marketplace-hero,
    .marketplace-body,
    .marketplace-detail {
        grid-template-columns: 1fr;
    }

    .marketplace-hero {
        grid-template-columns: 1fr;
    }

    .marketplace-filters,
    .marketplace-side-panel {
        position: static;
    }

    .marketplace-match-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .marketplace-page {
        padding-inline: 12px;
        gap: 18px;
    }

    .marketplace-hero,
    .marketplace-detail__main,
    .marketplace-search,
    .marketplace-filters,
    .marketplace-side-panel,
    .marketplace-card {
        border-radius: 10px;
    }

    .marketplace-hero {
        padding: 20px 16px;
    }

    .marketplace-hero h1,
    .marketplace-detail h1 {
        font-size: clamp(1.55rem, 7vw, 2.1rem);
    }

    .marketplace-search__row,
    .marketplace-grid,
    .marketplace-meta,
    .marketplace-meta--detail,
    .marketplace-filter-grid {
        grid-template-columns: 1fr;
    }

    .marketplace-search__row {
        display: grid;
        gap: 10px;
    }

    .marketplace-search__row button,
    .marketplace-search__quick {
        width: 100%;
    }

    .marketplace-search__quick {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .marketplace-search__quick button {
        flex: 1 1 auto;
        min-width: calc(50% - 4px);
    }

    .marketplace-card__foot,
    .marketplace-results__head,
    .marketplace-section-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .marketplace-card__foot > div {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .marketplace-filters {
        padding: 16px;
    }

    .marketplace-filters select,
    .marketplace-filters input {
        width: 100%;
        max-width: 100%;
    }
}
