.home-floating-ads {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 280px;
  max-height: calc(100vh - 120px);
  pointer-events: none;
}

.home-floating-ads[hidden],
.home-floating-ad[hidden] { display: none; }

.home-floating-ads-heading {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.home-floating-ads-heading > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid #e7ebf2;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 2px 8px #142d5010;
  color: #46536a;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.home-floating-ads-heading > span::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #2563eb;
  content: "";
}

.home-floating-ads-heading small {
  padding-left: 8px;
  border-left: 1px solid #e4e9f1;
  color: #8490a2;
  font-size: 10px;
  font-weight: 400;
}

.home-floating-ads-heading button {
  display: grid;
  flex: none;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 6px;
  border: 1px solid #e7ebf2;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px #142d5010;
  color: #6b778b;
  cursor: pointer;
  pointer-events: auto;
  transition: color .18s ease, background-color .18s ease, border-color .18s ease;
}

.home-floating-ads-heading button:hover {
  border-color: #cbd6e8;
  background: #f0f5ff;
  color: #1d4ed8;
}

.home-floating-ads-heading svg { width: 16px; height: 16px; }

.home-floating-ads-list {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  flex: 0 1 auto;
  gap: 10px;
  min-height: 0;
  max-height: 460px;
  margin: -8px;
  padding: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
  pointer-events: auto;
}

.home-floating-ad {
  overflow: hidden;
  border: 1px solid #e5eaf3;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 3px 8px #142d5010;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.home-floating-ad:has(a):hover {
  border-color: #acc4f0;
  box-shadow: 0 3px 8px #1d4ed81c;
}

.home-floating-ad a { display: block; }

.home-floating-ad img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 1;
  object-fit: contain;
}

.home-floating-ads :focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: -3px;
}

@media (max-height: 720px) {
  .home-floating-ads { bottom: 20px; max-height: calc(100vh - 100px); }
  .home-floating-ads-list { max-height: 340px; }
}

/* Keep the existing contact actions below the ads when the side rail is narrow. */
@media (max-width: 2239px) {
  .home-floating-ads { bottom: 104px; max-height: calc(100vh - 184px); }
  body:has(.home-floating-ads:not([hidden])) .contact-dock {
    right: 24px;
    bottom: 26px;
    flex-direction: row;
    width: auto;
  }
  body:has(.home-floating-ads:not([hidden])) .contact-dock button {
    flex-direction: row;
    gap: 7px;
    min-height: 48px;
    padding: 0 13px;
    font-size: 12px;
  }
  body:has(.home-floating-ads:not([hidden])) .contact-dock button.contact-dock-service {
    margin: 0 0 0 3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-floating-ads-heading button,
  .home-floating-ad { transition: none; }
}
