/* Load after the page styles. Official logo files keep their native geometry. */
.ac-brand-logo {
  --brand-scale: 1;
  --brand-slot-height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: min(100%, calc(var(--brand-width) * var(--brand-scale)));
  max-width: 100%;
  height: var(--brand-slot-height);
  min-width: 0;
  flex: 0 1 auto;
  vertical-align: middle;
  line-height: 0;
}
.ac-brand-logo .ac-competitor-logo {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  object-fit: contain;
  object-position: left center;
}

/* Cards reserve a balanced space for each brand, including long wordmarks. */
.ac-compare-card { container-type: inline-size; }
.ac-cover-compare {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 12px minmax(0, 1fr);
  align-items: center;
  justify-content: initial;
  gap: 12px;
  padding: 24px 16px;
}
.ac-cover-compare .ac-compare-logo {
  min-width: 0;
  justify-content: center;
  font-size: 20px;
  gap: 5px;
  white-space: nowrap;
}
.ac-cover-compare .ac-compare-logo img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  flex: none;
}
.ac-cross {
  display: grid;
  place-items: center;
  align-self: center;
  justify-self: center;
  width: 100%;
  height: 20px;
  min-width: 0;
  line-height: 1;
}
.ac-cross-icon {
  display: block;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}
.ac-cover-compare .ac-cross {
  color: #a2b6e7;
  text-align: center;
}
.ac-compare-hero-art > .ac-cross { height: 22px; }
.ac-compare-hero-art .ac-cross-icon { width: 20px; height: 20px; }
.ac-cover-compare > .ac-brand-logo {
  --brand-scale: .84;
  --brand-slot-height: 50px;
  justify-self: center;
}
.ac-cover-compare .ac-brand-logo .ac-competitor-logo { object-position: center; }

/* Catalogue tiles and the interactive comparison matrix share one rhythm. */
.ac-competitor-brand,
.ac-matrix-brand {
  display: flex;
  align-items: center;
  min-width: 0;
  height: 48px;
}
.ac-competitor-brand .ac-brand-logo,
.ac-matrix-brand .ac-brand-logo {
  --brand-scale: .86;
  --brand-slot-height: 48px;
}
.ac-competitor-grid > a { min-width: 0; }

/* Keep Beeving's symbol and name on the same baseline as the other wordmark. */
.ac-compare-hero-art {
  container-type: inline-size;
  grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
}
.ac-compare-hero-art > div { min-width: 0; }
.ac-compare-hero-art > div:first-child {
  flex-direction: row;
  gap: 6px;
}
.ac-compare-hero-art > div:first-child > img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex: none;
}
.ac-compare-hero-art > div:first-child > strong {
  font-size: 26px;
  line-height: 1;
  white-space: nowrap;
  overflow-wrap: normal;
}
.ac-compare-hero-art .ac-brand-logo {
  --brand-scale: 1.1;
  --brand-slot-height: 64px;
}
.ac-compare-hero-art .ac-brand-logo .ac-competitor-logo { object-position: center; }

/* Table labels remain readable within the existing horizontally scrollable table. */
.ac-comparison-table thead th:nth-child(2) {
  font-size: 16px;
  white-space: nowrap;
}
.ac-comparison-table thead th:nth-child(2) > img {
  width: 25px;
  height: 25px;
  margin-right: 6px;
  object-fit: contain;
  vertical-align: middle;
}
.ac-comparison-table thead .ac-brand-logo {
  --brand-scale: .75;
  --brand-slot-height: 44px;
}
.ac-comparison-table thead .ac-brand-logo .ac-competitor-logo {
  width: 100%;
  height: 100%;
  margin: 0;
}
.ac-related-brand { min-width: 0; flex-wrap: wrap; }
.ac-related-brand .ac-brand-logo {
  --brand-scale: .68;
  --brand-slot-height: 38px;
}

/* The square Beeving symbols include their original transparent safety margin. */
:is(.site-header, .site-footer) .brand > img {
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  flex: none;
}
:is(.showcase, .app-sidebar) .product-mark,
.scene-brand > img {
  aspect-ratio: 1;
  object-fit: contain;
  flex-shrink: 0;
}

/* Provider artwork has different internal safety margins. */
.provider img,
.sc-compat > .container > div > img {
  display: block;
  width: 26px;
  height: 26px;
  max-width: none;
  object-fit: contain;
  flex: none;
}
:is(.provider, .sc-compat > .container > div) > img[src$="/provider-gmail.svg"] {
  width: 28px;
  height: 28px;
}
.provider > img[src$="/provider-google.png"] { width: 24px; height: 24px; }

/* Legacy brand downloads and editorial fallbacks keep explicit, modest caps. */
.lg-content img[src^="/assets/legacy/"][alt^="Beeving"] {
  width: min(216px, 100%);
  height: auto;
  max-height: 64px;
  object-fit: contain;
  border-radius: 0;
}
.lg-content img[src$="/01ed021aecb63a83da.png"],
.lg-content img[src$="/49f8a97be59104c7a6.png"],
.lg-content img[src$="/5242e46c9a65c1f773.png"] {
  background: #223249;
  box-shadow: 0 0 0 12px #223249;
  border-radius: 2px;
  margin-block: 30px;
}
.lg-content .lg-brand-mark,
.lg-content img:is([src$="/beeving-mark.svg"], [src$="/mark-crm.svg"], [src$="/mark-newsletter.svg"]) {
  width: 72px;
  height: 72px;
  max-width: 100%;
  object-fit: contain;
  margin-block: 20px;
}

@container (max-width: 300px) {
  .ac-cover-compare .ac-compare-logo { font-size: 17px; gap: 4px; }
  .ac-cover-compare .ac-compare-logo img { width: 22px; height: 22px; }
  .ac-cover-compare .ac-cross { font-size: 16px; }
}
@container (max-width: 360px) {
  .ac-compare-hero-art > div:first-child > img { width: 27px; height: 27px; }
  .ac-compare-hero-art > div:first-child > strong { font-size: 19px; }
}
@media (max-width: 640px) {
  .ac-competitor-brand .ac-brand-logo { --brand-scale: .8; }
  .provider img,
  .sc-compat > .container > div > img { width: 23px; height: 23px; }
  :is(.provider, .sc-compat > .container > div) > img[src$="/provider-gmail.svg"] { width: 25px; height: 25px; }
}
