/* Both company marks keep their lettering while using the active theme colours. */
body[data-theme-preset] .brand img,
body[data-theme-preset] .group-brand.bin-brand img,
body[data-theme-preset] .group-brand.booking-brand img,
body[data-theme-preset] .portal-sidebar>img,
body[data-theme-preset] .portal-gate .gate-visual>img,
body[data-theme-preset] .website-studio-brand img,
body[data-theme-preset] .invoice-head img,
body[data-theme-preset] .email-card>img,
body[data-theme-preset] .mini-head img{
  filter:none!important;
}

/* Never colour an opaque image background. The runtime converts legacy white
   logo plates to transparency first; this fallback keeps unsupported uploads
   readable instead of turning the complete rectangle into a theme colour. */
body[data-theme-preset] img[data-logo-alpha="pending"]{
  opacity:0!important;
}
body[data-theme-preset] img[data-logo-alpha="opaque"]{
  filter:none!important;
}
body[data-theme-preset] img[data-logo-alpha="transparent"]{
  opacity:1!important;
}

body[data-theme-preset] .brand img,
body[data-theme-preset] .website-studio-brand img{
  background:transparent!important;
  border-color:transparent!important;
  box-shadow:none!important;
}

/* A theme-coloured mark still needs a neutral contrast plate on dark portal
   surfaces. The plate belongs to the interface; the PNG itself stays transparent. */
body[data-theme-preset] .portal-sidebar>img,
body[data-theme-preset] .portal-gate .gate-visual>img{
  background:color-mix(in srgb,var(--cms-surface) 94%,transparent)!important;
  border:1px solid color-mix(in srgb,var(--cms-primary) 20%,transparent)!important;
  border-radius:max(8px,calc(var(--cms-card-radius) * .45))!important;
  padding:10px 14px!important;
  box-shadow:0 16px 40px color-mix(in srgb,var(--cms-dark) 30%,transparent)!important;
}

/* Keep logo proportions intact at every breakpoint and in every theme. */
body[data-theme-preset] .brand img,
body[data-theme-preset] .group-brand.bin-brand img,
body[data-theme-preset] .group-brand.booking-brand img,
body[data-theme-preset] .portal-sidebar>img,
body[data-theme-preset] .portal-gate .gate-visual>img,
body[data-theme-preset] .website-studio-brand img,
body[data-theme-preset] .invoice-head img,
body[data-theme-preset] .email-card>img{
  object-fit:contain!important;
}
