/* Shared marketplace grids: product-like entities are tiles; workflow entities stay rows. */
:root{--market-card-min:250px;--market-card-gap:16px;--market-media-ratio:4/3}
.catalog-result-list,.my-offers-list,.favorite-offer-grid,.favorite-company-grid,.company-result-list,.company-market-offers{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,var(--market-card-min)),1fr));gap:var(--market-card-gap);align-items:stretch}
.catalog-result-list>.catalog-empty,.my-offers-list>.my-offers-empty,.favorite-offer-grid>.favorites-empty,.favorite-company-grid>.favorites-empty,.company-result-list>.catalog-empty,.company-market-offers>.company-market-empty{grid-column:1/-1}
.catalog-result-row{position:relative;display:flex;min-width:0;min-height:0;overflow:hidden;flex-direction:column;padding:0;border-radius:14px;box-shadow:0 1px 3px rgba(19,43,34,.04);transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease}
.catalog-result-row:hover{transform:translateY(-2px);border-color:#a9cdbf;box-shadow:0 10px 26px rgba(19,43,34,.08)}
.catalog-result-media{width:100%;height:auto;aspect-ratio:var(--market-media-ratio);align-self:auto;border-radius:0}.catalog-result-main{flex:1;padding:16px 16px 12px}.catalog-result-main>h2{margin:9px 0 0;font-size:17px;line-height:1.28}.catalog-result-main>p{min-height:40px;margin:8px 0;font-size:12px;line-height:1.45;-webkit-line-clamp:2}.catalog-result-company{margin-top:auto;padding-top:10px}.catalog-result-company>.catalog-company-avatar{width:34px;height:34px}.catalog-result-company strong{font-size:12px}.catalog-result-company small{font-size:10px}
.catalog-result-side{position:static;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px 10px;align-items:center;padding:0 16px 16px;border:0}.catalog-result-side>.catalog-favorite{position:absolute;top:10px;right:10px;z-index:3;width:38px;height:38px;border:1px solid rgba(255,255,255,.85);background:rgba(255,255,255,.92);box-shadow:0 2px 8px rgba(16,38,30,.12)}.catalog-deal-badge{grid-column:1;margin:0;justify-self:start}.catalog-side-rating{grid-column:2;margin:0;font-size:14px}.catalog-side-rating>svg{width:17px;height:17px}.catalog-result-side .catalog-result-price{grid-column:1/-1;margin:2px 0 0}.catalog-result-side .catalog-result-price strong{font-size:18px}.catalog-result-side>.button{grid-column:1/-1;min-height:40px}
.company-result-card{position:relative;display:flex;min-width:0;min-height:260px;flex-direction:column;gap:0;padding:18px;border-radius:14px;transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease}.company-result-card:hover{transform:translateY(-2px);border-color:#a9cdbf;box-shadow:0 10px 26px rgba(19,43,34,.08)}.company-result-identity{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:12px;padding-right:36px}.company-result-identity>.company-favorite-mini{position:absolute;top:14px;right:14px}.company-result-main{flex:1;margin-top:14px;padding:14px 0 0;border-top:1px solid var(--c-border);border-left:0}.company-result-main>p{font-size:12px;-webkit-line-clamp:3}.company-result-tags{margin-top:10px}.company-result-footer{display:flex;align-items:stretch;justify-content:flex-end;flex-direction:column;gap:10px;margin-top:auto;padding:14px 0 0;border-top:1px solid var(--c-border);border-left:0}.company-result-facts{grid-template-columns:1fr}.company-result-footer .button{min-height:40px}
.favorite-offer-grid{--market-card-min:260px}.favorite-offer-card{display:flex;height:auto;min-height:390px;flex-direction:column;border-radius:14px}.favorite-offer-gallery,.favorite-offer-placeholder{width:100%;height:auto;min-height:0;aspect-ratio:var(--market-media-ratio);margin:0;padding:8px}.favorite-offer-copy{flex:1;min-height:190px;padding:14px}.favorite-offer-copy h2{margin-right:34px;font-size:16px}.favorite-offer-copy>p{min-height:36px;margin-right:0;-webkit-line-clamp:2}.favorite-offer-copy footer{grid-template-columns:minmax(0,1fr) auto;margin-top:10px}.favorite-offer-copy footer .button{grid-column:1/-1;width:100%}.favorite-company-card{display:flex;min-height:260px;flex-direction:column;gap:12px;padding:18px 46px 18px 18px;border-radius:14px}.favorite-company-card>.directory-avatar{width:70px;height:70px}.favorite-company-card>div{display:flex;min-width:0;flex:1;flex-direction:column}.favorite-company-card footer{align-items:flex-start;flex-wrap:wrap;margin-top:auto}.favorite-company-card footer .button{width:100%;margin-left:0}
.my-offers-list{--market-card-min:280px}.my-offer-row{display:flex;min-width:0;min-height:0;overflow:hidden;flex-direction:column;gap:0;padding:0;border-radius:14px}.my-offer-image{width:100%;height:auto;aspect-ratio:var(--market-media-ratio);align-self:auto;border-radius:0}.my-offer-info{flex:1;padding:15px}.my-offer-info h2{font-size:17px}.my-offer-info>p{min-height:38px;font-size:12px}.owner-offer-metrics{grid-template-columns:repeat(2,minmax(0,1fr));margin-top:auto}.owner-offer-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;padding:12px 15px 15px;border-top:1px solid var(--c-border);border-left:0}.owner-offer-actions .button{min-height:39px}.owner-offer-actions [data-owner-offer-message]{grid-column:1/-1}
.company-market-offers{--market-card-min:270px}.company-market-offer{display:flex;min-width:0;min-height:0;overflow:hidden;flex-direction:column;gap:0;padding:0;border-radius:12px}.company-market-offer-media{width:100%;height:auto;min-height:0;aspect-ratio:var(--market-media-ratio)}.company-market-offer-copy{flex:1;padding:16px}.company-market-offer-copy h2{padding-right:34px;font-size:16px}.company-market-offer-copy>p{min-height:38px}.company-market-offer-save{position:absolute;right:10px;bottom:10px;margin:0;background:rgba(255,255,255,.9);border-radius:50%}.company-market-all-offers{justify-self:center}
@media(min-width:761px){.catalog-result-list{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(min-width:1280px){.company-result-list{grid-template-columns:repeat(3,minmax(0,1fr))}.my-offers-list{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:760px){:root{--market-card-gap:12px}.catalog-result-list,.my-offers-list,.favorite-offer-grid,.favorite-company-grid,.company-result-list,.company-market-offers{grid-template-columns:repeat(2,minmax(0,1fr))}.catalog-result-main{padding:12px}.catalog-result-side{padding:0 12px 12px}.catalog-result-main>p,.company-result-main>p,.favorite-offer-copy>p,.my-offer-info>p{display:none}.catalog-result-tags,.company-result-tags{display:none}.catalog-result-side>.button{min-height:38px}.owner-offer-actions{grid-template-columns:1fr}.owner-offer-actions [data-owner-offer-message]{grid-column:auto}.my-offer-info{padding:12px}.owner-offer-metrics{display:none}}
@media(max-width:480px){.catalog-result-list,.my-offers-list,.favorite-offer-grid,.favorite-company-grid,.company-result-list,.company-market-offers{grid-template-columns:1fr}.catalog-result-main>p,.company-result-main>p,.favorite-offer-copy>p,.my-offer-info>p{display:-webkit-box}.owner-offer-metrics{display:grid}}
/* Equal-height catalog card content and exchange intent. */
.catalog-result-main{display:flex;flex:0 0 294px;height:294px;overflow:visible;flex-direction:column}
.catalog-result-main>h2{display:-webkit-box;height:48px;min-height:48px;margin-bottom:2px;overflow:hidden;line-height:1.35;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.catalog-result-main>p{display:-webkit-box;height:52px;min-height:52px;overflow:hidden;-webkit-line-clamp:3;-webkit-box-orient:vertical}
.catalog-result-company{height:44px;min-height:44px;margin-top:10px}
.catalog-result-side{flex:1;grid-template-rows:auto 64px 40px;align-content:start}
.catalog-deal-badge{grid-column:1;grid-row:1}
.catalog-side-rating{grid-column:2;grid-row:1}
.catalog-exchange-interest{height:62px;min-height:62px;margin-top:8px;padding:8px 10px;overflow:hidden;border-radius:8px;background:var(--c-brand-50)}
.catalog-exchange-interest small,.catalog-exchange-interest strong{display:block}
.catalog-exchange-interest small{color:var(--c-text-muted);font-size:10px}
.catalog-exchange-interest strong{margin-top:2px;color:var(--c-brand-700);font-size:12px;line-height:1.3}
.catalog-exchange-interest p{display:-webkit-box;margin:4px 0 0;overflow:hidden;color:var(--c-text-muted);font-size:10px;line-height:1.35;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.catalog-exchange-interest.is-purchase{background:var(--c-surface-subtle)}
.catalog-result-side .catalog-result-price{grid-column:1/-1;grid-row:2;height:64px;min-height:64px;overflow:hidden}
.catalog-result-side>.button{grid-column:1/-1;grid-row:3;height:40px;margin-top:0}
@media(max-width:760px){.catalog-result-main{height:230px;flex-basis:230px}.catalog-result-main>p{display:none;height:0;min-height:0}.catalog-result-side{grid-template-rows:auto 58px 38px}.catalog-exchange-interest{height:62px;min-height:62px}}
@media(max-width:480px){.catalog-result-main{height:294px;flex-basis:294px}.catalog-result-main>p{display:-webkit-box;height:52px;min-height:52px}.catalog-result-side{grid-template-rows:auto 64px 40px}}

.catalog-deal-badge{display:flex;max-width:100%;align-items:flex-start;flex-direction:column;gap:2px;white-space:normal}
.catalog-deal-badge>b{font-size:11px;line-height:1.2}
.catalog-deal-badge>small{overflow:hidden;max-width:100%;color:var(--c-brand-700);font-size:9px;font-weight:700;line-height:1.25;text-overflow:ellipsis;white-space:nowrap}

/* Catalog card collision guard: global typography must not compress card rows. */
.catalog-result-main{flex-basis:306px;height:306px}
.catalog-result-main>.catalog-result-tags,.catalog-result-main>h2,.catalog-result-main>p,.catalog-result-main>.catalog-exchange-interest,.catalog-result-main>.catalog-result-company{flex:none}
body .catalog-result-main>h2{height:50px;min-height:50px;margin:9px 0 2px;font-size:18px;line-height:1.32;-webkit-line-clamp:2}
body .catalog-result-main>p{height:52px;min-height:52px;margin:8px 0;font-size:13px;line-height:1.45}
.catalog-result-tags .catalog-owner-tag{position:absolute;top:12px;right:58px;z-index:3;width:auto;margin:0;padding:7px 10px;border-color:rgba(255,255,255,.88);background:rgba(255,255,255,.94)!important;box-shadow:0 2px 8px rgba(16,38,30,.12);white-space:nowrap}
@media(max-width:760px){.catalog-result-main{height:242px;flex-basis:242px}body .catalog-result-main>p{display:none;height:0;min-height:0;margin:0}}
@media(max-width:480px){.catalog-result-main{height:306px;flex-basis:306px}body .catalog-result-main>p{display:-webkit-box;height:52px;min-height:52px;margin:8px 0}}

/* Exchange target is card content, not part of the deal-format badge. */
.catalog-result-main{flex-basis:236px;height:236px}
.catalog-result-side{grid-template-rows:auto 62px 64px 40px}
.catalog-exchange-interest{grid-column:1/-1;grid-row:2;height:62px;min-height:62px;margin:0;padding:7px 0 0;border-radius:0;background:transparent;border-top:1px solid var(--c-border)}
.catalog-exchange-interest.is-purchase{background:transparent}
.catalog-exchange-interest small{font-size:11px}
.catalog-exchange-interest strong{margin-top:3px;color:var(--c-text);font-size:18px;line-height:1.25}
.catalog-exchange-interest p{display:none}
.catalog-result-side .catalog-result-price{grid-row:3}
.catalog-result-side>.button{grid-row:4}
@media(max-width:760px){.catalog-result-main{height:172px;flex-basis:172px}.catalog-result-side{grid-template-rows:auto 62px 58px 38px}}
@media(max-width:480px){.catalog-result-main{height:236px;flex-basis:236px}.catalog-result-side{grid-template-rows:auto 62px 64px 40px}}
/* Stable catalog footer, company review balance and achievement row. */
.catalog-result-main{flex-basis:264px;height:264px}
.catalog-result-company{display:flex;height:68px;min-height:68px;align-items:center;gap:9px}
.catalog-company-avatar-link{display:flex;flex:none;border-radius:50%}
.catalog-company-copy{display:flex;min-width:0;flex:1;flex-direction:column}
.catalog-company-name-row{display:flex;min-width:0;align-items:flex-start;gap:7px}
.catalog-company-name{display:-webkit-box;min-width:0;flex:1;overflow:hidden;color:var(--c-text);font-size:12px;font-weight:800;line-height:1.25;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.catalog-company-review-balance{display:inline-flex;flex:none;align-items:center;gap:1px;padding-top:1px;font-size:11px;font-weight:800;white-space:nowrap}
.catalog-company-review-balance b{color:var(--c-brand-700)}
.catalog-company-review-balance span{color:var(--c-text-muted);font-weight:500}
.catalog-company-review-balance em{color:#c94b3f;font-style:normal}
.catalog-company-review-balance:hover{text-decoration:underline}
.catalog-company-achievements{display:flex;height:18px;align-items:center;gap:5px;margin-top:3px;overflow:hidden}
.catalog-company-achievement{width:17px;height:17px;display:inline-grid;place-items:center;flex:none;color:var(--c-brand-700)}
.catalog-company-achievement svg{width:16px;height:16px;overflow:visible;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.catalog-company-achievement svg{fill:none}
.catalog-deal-badge{grid-column:1/-1;max-width:none;flex-direction:row;white-space:nowrap}
.catalog-result-side{min-height:222px;align-content:stretch}
.catalog-result-side>.button{align-self:end;margin-top:auto}
@media(max-width:760px){.catalog-result-main{height:200px;flex-basis:200px}.catalog-result-company{height:68px;min-height:68px}.catalog-result-side{min-height:210px}}
@media(max-width:480px){.catalog-result-main{height:264px;flex-basis:264px}}

/* Refined company alignment and compact barter target. */
.catalog-result-company{align-items:flex-start}
.catalog-company-avatar-link{align-self:flex-start}
.catalog-company-city-row{display:flex;min-width:0;align-items:center;justify-content:space-between;gap:7px}
.catalog-company-city-row>small{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.catalog-company-review-balance{margin-left:auto;padding-top:0}
.catalog-result-side{grid-template-rows:auto 48px 64px 40px}
.catalog-exchange-interest{height:48px;min-height:48px;display:flex;grid-row:2;align-items:flex-start;flex-direction:column;justify-content:center;gap:2px;padding:5px 0;border-top:1px solid var(--c-border)}
.catalog-exchange-interest small{font-size:10px;line-height:1.25}
.catalog-exchange-interest span{display:block;max-width:100%;overflow:hidden;color:var(--c-text);font-size:12px;font-weight:700;line-height:1.3;text-overflow:ellipsis;white-space:nowrap}
.catalog-exchange-interest strong{display:none}
@media(max-width:760px){.catalog-result-side{grid-template-rows:auto 48px 58px 38px}}
@media(max-width:480px){.catalog-result-side{grid-template-rows:auto 48px 64px 40px}}
/* Deal value precedes the barter target for barter and mixed offers. */
.catalog-result-side{grid-template-rows:auto 64px 48px 40px}
.catalog-result-side .catalog-result-price{grid-row:2}
.catalog-exchange-interest{grid-row:3}
@media(max-width:760px){.catalog-result-side{grid-template-rows:auto 58px 48px 38px}}
@media(max-width:480px){.catalog-result-side{grid-template-rows:auto 64px 48px 40px}}
/* Company name gets a full row; logo moves beside city and achievements. */
.catalog-result-main{flex-basis:294px;height:294px}
.catalog-result-company{height:98px;min-height:98px;display:flex;align-items:stretch;flex-direction:column;gap:5px}
.catalog-result-company>.catalog-company-name{width:100%;min-height:30px;display:-webkit-box;flex:none;font-size:13px;line-height:1.2;-webkit-line-clamp:2}
.catalog-company-lower{display:flex;min-width:0;align-items:flex-start;gap:9px}
.catalog-company-avatar-link .catalog-company-avatar{width:42px;height:42px}
.catalog-company-lower .catalog-company-copy{min-height:42px;justify-content:flex-start}
@media(max-width:760px){.catalog-result-main{height:230px;flex-basis:230px}.catalog-result-company{height:98px;min-height:98px}}
@media(max-width:480px){.catalog-result-main{height:294px;flex-basis:294px}}
/* Clear favorite control on company profile offer cards. */
.company-market-offer-save{position:absolute;right:12px;bottom:12px;display:grid;width:38px;height:38px;margin:0;padding:0;place-items:center;border:0;border-radius:10px;background:rgba(255,255,255,.94);box-shadow:0 2px 10px rgba(16,35,27,.08);color:var(--c-text-muted);cursor:pointer;appearance:none}
.company-market-offer-save svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.company-market-offer-save:hover,.company-market-offer-save:focus-visible{background:var(--c-brand-50);color:var(--c-brand-700)}
.company-market-offer-save:focus-visible{outline:2px solid var(--c-brand-600);outline-offset:2px}

/* The company page has a sidebar, so auto-fill may incorrectly collapse offers to one oversized tile. */
.company-market-layout .company-market-offers{grid-template-columns:repeat(2,minmax(0,1fr))}
@media(max-width:700px){.company-market-layout .company-market-offers{grid-template-columns:1fr}}
.company-market-offer-save.is-favorite{background:var(--c-brand-50);color:var(--c-brand-700)}
.company-market-offer-save.is-favorite svg{fill:currentColor}

/* Company profile uses the catalog offer card without repeating company identity. */
.company-market-offers .company-catalog-offer{width:100%}
.catalog-result-row .catalog-result-media,.my-offer-row .my-offer-image,.favorite-offer-card .favorite-offer-gallery{width:100%;max-width:none;height:230px;min-height:230px;aspect-ratio:auto;align-self:stretch}
.catalog-result-row .catalog-result-media img,.my-offer-row .my-offer-image img,.favorite-offer-card .favorite-offer-gallery img{width:100%;max-width:none;height:100%;object-fit:cover}
.company-market-offers .company-catalog-offer .catalog-result-main{height:196px;flex-basis:196px}
.company-market-offers .company-catalog-offer .catalog-result-main>p{height:72px;min-height:72px;-webkit-line-clamp:4}
.company-market-offers .company-catalog-offer .catalog-result-side{min-height:222px}
@media(max-width:760px){.company-market-offers .company-catalog-offer .catalog-result-main{height:172px;flex-basis:172px}.company-market-offers .company-catalog-offer .catalog-result-main>p{display:none;height:0;min-height:0}.company-market-offers .company-catalog-offer .catalog-result-side{min-height:210px}}
@media(max-width:480px){.company-market-offers .company-catalog-offer .catalog-result-main{height:196px;flex-basis:196px}.company-market-offers .company-catalog-offer .catalog-result-main>p{display:-webkit-box;height:72px;min-height:72px}}

/* Shared offer-card gallery contract. */
[data-card-gallery]{position:relative;overflow:hidden;touch-action:pan-y}
.catalog-result-media img,.my-offer-image img,.favorite-offer-gallery img,.company-market-offer-media img{display:block;width:100%;height:100%;object-fit:cover}
.favorite-offer-gallery{display:block;padding:0}
.catalog-gallery-dots{position:absolute;right:12px;bottom:12px;left:12px;z-index:2;display:flex;justify-content:center;gap:4px;pointer-events:none}
.catalog-gallery-dots i{width:7px;height:7px;flex:0 0 7px;border-radius:50%;background:rgba(255,255,255,.88);box-shadow:0 1px 3px rgba(0,0,0,.28)}
.catalog-gallery-dots i.is-active{background:var(--c-brand-600)}
.company-market-offer-media .catalog-gallery-dots{top:auto;right:12px;bottom:12px;left:12px;width:auto;height:auto;display:flex;grid-template-columns:none;align-items:center;justify-content:center;gap:4px;padding:0;border:0;background:transparent;color:inherit;font-size:inherit;font-weight:inherit}
.company-market-offer-media .catalog-gallery-dots i{display:block;width:7px;height:7px;min-width:7px;min-height:7px;flex:0 0 7px}
.company-market-offer-save:disabled{cursor:wait;opacity:.65}

/* Single-column mobile cards should follow their content instead of reserving desktop copy space. */
@media(max-width:480px){.catalog-result-row .catalog-result-main{height:auto;min-height:0;flex:0 0 auto}.catalog-result-row .catalog-result-company{height:auto;min-height:76px;margin-bottom:0}}
