/**
 * kw-to-kva desktop sidebar pilot (≥1100px).
 *
 * Layout: inputs + About full width; split only Result + completion
 * ("What next?" + Copy/Share/Export). Sticky ends there — charts/FAQ are full width.
 * Sidebar order: Related Tools → Ad (300×250 MREC, filled only) → Related Guides.
 */
.tool-desktop-split {
  display: block;
}

.tool-desktop-split__sidebar {
  display: none;
}

.tool-sidebar-card {
  margin: 0 0 0.85rem;
  padding: 0.85rem 1rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

/* Never let ad / commercial CSS hide Tools or Guides */
.tool-desktop-split__sidebar .tool-sidebar-card {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.tool-sidebar-card__title {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}

.tool-sidebar-card__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tool-sidebar-card__list li {
  margin: 0;
  padding: 0;
  border-bottom: 1px solid #f1f5f9;
}

.tool-sidebar-card__list li:last-child {
  border-bottom: none;
}

.tool-sidebar-card__list a {
  display: block;
  padding: 0.55rem 0;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
  color: #1d4ed8;
  text-decoration: none;
}

.tool-sidebar-card__list a:hover {
  color: #1e40af;
  text-decoration: underline;
}

.tool-sidebar-ad {
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.75rem 0.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

/*
 * AdSense will not fill units inside display:none.
 * - default (no pending/filled): collapsed
 * - data-ad-pending / data-ad-filled: keep 300×250 in layout
 * - hidden / data-ad-empty: collapsed (rules below win)
 */
.tool-sidebar-ad:not([data-ad-filled="1"]):not([data-ad-pending="1"]) {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  min-height: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
}

.tool-sidebar-ad[data-ad-pending="1"],
.tool-sidebar-ad[data-ad-filled="1"] {
  display: block !important;
  visibility: visible;
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
  margin: 0 0 0.85rem !important;
  padding: 0.65rem 0.75rem 0.75rem !important;
  border: 1px solid #e2e8f0 !important;
}

/* empty/hidden must win over filled/pending if both somehow set */
.tool-sidebar-ad[hidden],
.tool-sidebar-ad[data-ad-empty="1"] {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  min-height: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
}

.tool-sidebar-ad__label {
  margin: 0 0 0.45rem;
  font-size: 0.6875rem;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  font-weight: 600;
}

.tool-sidebar-ad__mount {
  box-sizing: border-box;
  width: 300px;
  max-width: 100%;
  min-height: 250px;
  height: 250px;
  margin: 0 auto;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
}

.tool-sidebar-ad__mount.commercial-panel__mount--active,
.tool-sidebar-ad__mount.commercial-panel__mount--mrec {
  border-style: solid;
  border-color: #e2e8f0;
}

.tool-sidebar-ad__mount .adsbygoogle {
  display: inline-block !important;
  width: 300px !important;
  height: 250px !important;
  max-width: 100%;
  overflow: hidden;
}

.tool-sidebar-ad__mount iframe {
  width: 300px !important;
  height: 250px !important;
  max-width: 100%;
  border: 0;
}

@media (min-width: 1100px) {
  .tool-desktop-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 1.25rem;
    /* stretch so sidebar column = main height; sticky needs that travel room */
    align-items: stretch;
  }

  .tool-desktop-split__main {
    min-width: 0;
  }

  .tool-desktop-split__sidebar {
    display: block;
    align-self: stretch;
    min-height: 100%;
  }

  /* Stick while scrolling Result → next-action / copy-share-export only.
   * Pack is short (Tools + optional ad + Guides) — no inner scroll/scrollbar. */
  .tool-desktop-split__sidebar-sticky {
    position: sticky;
    top: 88px; /* below sticky site header */
    z-index: 1;
    max-height: none;
    overflow: visible;
  }

  /* Desktop: no result-area commercial — sidebar owns the ad slot */
  body[data-tool="kw-to-kva"] .tool-page-layout--sidebar-pilot .completion-zone__commercial {
    display: none !important;
  }

  /* Avoid duplicate Related Tools list on desktop */
  body[data-tool="kw-to-kva"] .tool-page-layout--sidebar-pilot #related-tools-ssr {
    display: none;
  }
}

@media (max-width: 1099.98px) {
  .tool-desktop-split__sidebar {
    display: none !important;
  }
}
