/* LondonPolonia – focused mobile fix for Fachowcy, 12 Oct 2026.
   Intentionally scoped: the homepage, all other sections and desktop layouts remain unchanged. */
@media (max-width: 560px) {
  /* The Fachowcy panel opened from the homepage: readable, compact cards. */
  html body .lp-layer [data-lp57-module="trades"].lpt:not(.lpt-list-view) .lpt-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
  html body .lp-layer [data-lp57-module="trades"].lpt:not(.lpt-list-view) .lpt-card {
    display: grid;
    grid-template-columns: clamp(104px, 36%, 138px) minmax(0, 1fr);
    align-items: stretch;
    min-width: 0;
    min-height: 156px;
    border-radius: 14px;
  }
  html body .lp-layer [data-lp57-module="trades"].lpt:not(.lpt-list-view) .lpt-cover {
    width: 100%;
    height: 100%;
    min-height: 156px;
    aspect-ratio: auto;
  }
  html body .lp-layer [data-lp57-module="trades"].lpt:not(.lpt-list-view) .lpt-cover > img {
    position: absolute; /* Portrait photos must not dictate the card's grid-row height. */
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  html body .lp-layer [data-lp57-module="trades"].lpt:not(.lpt-list-view) .lpt-card-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 11px 12px 9px;
  }
  html body .lp-layer [data-lp57-module="trades"].lpt:not(.lpt-list-view) .lpt-card-person {
    margin-bottom: 6px;
    gap: 0;
  }
  html body .lp-layer [data-lp57-module="trades"].lpt:not(.lpt-list-view) .lpt-card-person .lpt-avatar {
    display: none; /* Larger portfolio photo is already visible beside the name. */
  }
  html body .lp-layer [data-lp57-module="trades"].lpt:not(.lpt-list-view) .lpt-card-person h2 {
    font-size: 16px;
    line-height: 1.3;
  }
  html body .lp-layer [data-lp57-module="trades"].lpt:not(.lpt-list-view) .lpt-card-person h2 a {
    display: block;
    min-height: 0;
  }
  html body .lp-layer [data-lp57-module="trades"].lpt:not(.lpt-list-view) .lpt-card-body > p {
    font-size: 12px;
    line-height: 1.4;
    min-height: 0;
    margin-bottom: 7px;
  }
  html body .lp-layer [data-lp57-module="trades"].lpt:not(.lpt-list-view) .lpt-card-meta {
    gap: 5px;
    font-size: 11px;
  }
  html body .lp-layer [data-lp57-module="trades"].lpt:not(.lpt-list-view) .lpt-card-bottom {
    flex-wrap: wrap;
    gap: 3px 8px;
    margin-top: auto;
    padding-top: 5px;
  }
  html body .lp-layer [data-lp57-module="trades"].lpt:not(.lpt-list-view) .lpt-card-bottom > a {
    margin-left: auto;
    min-height: 38px;
  }
  html body .lp-layer [data-lp57-module="trades"].lpt:not(.lpt-list-view) .lpt-cover > .lpt-availability {
    top: 6px;
    left: 6px;
    max-width: calc(100% - 12px);
    white-space: normal;
    line-height: 1.2;
  }
  html body .lp-layer [data-lp57-module="trades"].lpt:not(.lpt-list-view) .lpt-cover.lpt-web-cover .lpt-web-art {
    padding: 30px 6px 10px;
    gap: 6px;
  }
  html body .lp-layer [data-lp57-module="trades"].lpt:not(.lpt-list-view) .lpt-cover.lpt-web-cover .lpt-web-art > strong {
    font-size: 13px;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  /* The public /fachowcy catalogue uses a separate renderer: fix that one too. */
  html body.public-body.public-browse-page[data-lp128-section="trades"] .public-grid.news.lp86-listings.is-cards {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
  }
  html body.public-body.public-browse-page[data-lp128-section="trades"] .lp86-listings.is-cards .public-card {
    display: grid !important;
    grid-template-columns: clamp(102px, 33vw, 126px) minmax(0, 1fr) !important;
    grid-template-rows: auto !important;
    min-height: 148px;
    align-items: stretch;
    min-width: 0;
  }
  html body.public-body.public-browse-page[data-lp128-section="trades"] .lp86-listings.is-cards .public-card-media {
    position: relative;
    width: 100% !important;
    height: 100% !important;
    min-height: 148px;
    flex-basis: auto !important;
  }
  html body.public-body.public-browse-page[data-lp128-section="trades"] .lp86-listings.is-cards .public-card-media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  html body.public-body.public-browse-page[data-lp128-section="trades"] .lp86-listings.is-cards .public-card-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 11px 12px !important;
  }
  html body.public-body.public-browse-page[data-lp128-section="trades"] .lp86-listings.is-cards .public-card h2 {
    font-size: 16px !important;
    line-height: 1.3;
    margin: 5px 0 7px;
  }
  html body.public-body.public-browse-page[data-lp128-section="trades"] .lp86-listings.is-cards .public-card-meta {
    font-size: 12px;
    line-height: 1.45;
    overflow-wrap: anywhere;
    margin-top: 2px;
  }
  html body.public-body.public-browse-page[data-lp128-section="trades"] .lp86-listings.is-cards .lp90-card-action {
    margin-top: auto;
    padding-top: 10px;
    font-size: 13px !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    line-height: 1.4;
  }
  html body.public-body.public-browse-page[data-lp128-section="trades"] .lp86-listings.is-cards .public-card:not(:has(.public-card-media)) {
    grid-template-columns: minmax(0, 1fr) !important;
    min-height: 0;
  }
}

/* 12 Oct 2026, v2: two distinct Fachowcy presentation modes.
   "Karty" = two neat portrait tiles per row; "Lista" = horizontal rows. */
@media (max-width:560px) {
  /* Homepage Fachowcy layer: ONLY card mode, never list mode. */
  html body .lp-layer [data-lp57-module="trades"].lpt:not(.lpt-list-view) .lpt-grid {
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
  }
  html body .lp-layer [data-lp57-module="trades"].lpt:not(.lpt-list-view) .lpt-card {
    display:flex;
    flex-direction:column;
    grid-template-columns:none;
    min-height:0;
    height:100%;
    border-radius:14px;
  }
  html body .lp-layer [data-lp57-module="trades"].lpt:not(.lpt-list-view) .lpt-cover {
    display:block;
    width:100%;
    height:auto;
    min-height:0;
    aspect-ratio:1.45;
    flex:0 0 auto;
  }
  html body .lp-layer [data-lp57-module="trades"].lpt:not(.lpt-list-view) .lpt-cover>img {
    position:absolute;
    inset:0;
    width:100%;height:100%;object-fit:cover;
  }
  html body .lp-layer [data-lp57-module="trades"].lpt:not(.lpt-list-view) .lpt-card-body {
    flex:1;
    padding:10px;
    min-height:0;
  }
  html body .lp-layer [data-lp57-module="trades"].lpt:not(.lpt-list-view) .lpt-card-person {
    margin-bottom:7px;
  }
  html body .lp-layer [data-lp57-module="trades"].lpt:not(.lpt-list-view) .lpt-card-person h2 {
    font-size:14px;
    line-height:1.32;
    display:-webkit-box;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:3;
    overflow:hidden;
    overflow-wrap:anywhere;
  }
  html body .lp-layer [data-lp57-module="trades"].lpt:not(.lpt-list-view) .lpt-card-body>p {
    font-size:12px;
    line-height:1.4;
    margin:0 0 7px;
    min-height:0;
    display:-webkit-box;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:2;
    overflow:hidden;
  }
  html body .lp-layer [data-lp57-module="trades"].lpt:not(.lpt-list-view) .lpt-card-meta {
    font-size:10px;
    gap:4px;
    line-height:1.35;
    display:-webkit-box;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:2;
    overflow:hidden;
  }
  html body .lp-layer [data-lp57-module="trades"].lpt:not(.lpt-list-view) .lpt-card-bottom {
    display:flex;
    align-items:center;
    gap:4px;
    flex-wrap:wrap;
    padding-top:6px;
    margin-top:auto;
    font-size:11px;
  }
  html body .lp-layer [data-lp57-module="trades"].lpt:not(.lpt-list-view) .lpt-card-bottom>a {
    margin-left:auto;
    min-height:40px;
    font-size:12px;
  }
  html body .lp-layer [data-lp57-module="trades"].lpt:not(.lpt-list-view) .lpt-cover>.lpt-availability {
    max-width:calc(100% - 12px);
    font-size:9px;
    padding:4px 6px;
  }
  html body .lp-layer [data-lp57-module="trades"].lpt:not(.lpt-list-view) .lpt-cover.lpt-web-cover .lpt-web-art {
    padding:24px 6px 6px;
    gap:4px;
  }
  /* Public /fachowcy catalogue, a different component with its own layout switch. */
  html body.public-body.public-browse-page[data-lp128-section="trades"] .public-grid.news.lp86-listings.is-cards {
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:10px!important;
  }
  html body.public-body.public-browse-page[data-lp128-section="trades"] .lp86-listings.is-cards .public-card,
  html body.public-body.public-browse-page[data-lp128-section="trades"] .lp86-listings.is-cards .public-card:not(:has(.public-card-media)) {
    display:flex!important;
    flex-direction:column!important;
    grid-template-columns:none!important;
    grid-template-rows:none!important;
    min-height:0;
    height:100%;
  }
  html body.public-body.public-browse-page[data-lp128-section="trades"] .lp86-listings.is-cards .public-card-media {
    position:relative;
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    aspect-ratio:1.45;
    flex:0 0 auto!important;
  }
  html body.public-body.public-browse-page[data-lp128-section="trades"] .lp86-listings.is-cards .public-card-media img {
    position:absolute;
    inset:0;
    width:100%;height:100%;object-fit:cover;
  }
  html body.public-body.public-browse-page[data-lp128-section="trades"] .lp86-listings.is-cards .public-card-copy {
    display:flex;
    flex:1;
    flex-direction:column;
    min-width:0;
    padding:10px!important;
  }
  html body.public-body.public-browse-page[data-lp128-section="trades"] .lp86-listings.is-cards .public-card h2 {
    font-size:14px!important;
    line-height:1.35;
    margin:4px 0 6px;
    display:-webkit-box;
    -webkit-line-clamp:3;
    -webkit-box-orient:vertical;
    overflow:hidden;
  }
  html body.public-body.public-browse-page[data-lp128-section="trades"] .lp86-listings.is-cards .public-card-meta {
    font-size:11px;
    line-height:1.4;
    overflow-wrap:anywhere;
    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
    overflow:hidden;
  }
  html body.public-body.public-browse-page[data-lp128-section="trades"] .lp86-listings.is-cards .lp90-card-action {
    padding-top:8px;
    margin-top:auto;
    font-size:12px!important;
  }
}
