/* index4: live report iframe preview (replaces HTML mockup) */

#results .bp-report-iframe-frame {
  overflow: hidden;
}

#results .bp-report-browserbar {
  display: flex;
  position: relative;
  z-index: 3;
  gap: 12px;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-bottom: 1px solid #e9ebf2;
  background: #f7f8fc;
}

#results .bp-report-browser-address {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: #5c5f78;
  white-space: nowrap;
}

#results .bp-report-browser-address > span {
  overflow: hidden;
  text-overflow: ellipsis;
}

#results .bp-report-browser-open {
  pointer-events: auto;
}

#results .bp-report-iframe-shell {
  position: relative;
  height: 900px;
  overflow: hidden;
  background: #f7f8fc;
}

#results .bp-report-iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
  pointer-events: auto;
  opacity: 1;
  transition: opacity 280ms ease;
}

#results .bp-report-iframe-shell.is-loading .bp-report-iframe {
  opacity: 0;
  pointer-events: none;
}

/* Loading skeleton while the live report iframe boots */
#results .bp-report-iframe-skeleton {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  padding: 28px 24px 32px;
  background: #fff;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 220ms ease,
    visibility 220ms ease;
}

#results .bp-report-iframe-shell.is-loading .bp-report-iframe-skeleton {
  opacity: 1;
  visibility: visible;
}

#results .bp-report-iframe-skeleton-inner {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 14px;
}

#results .bp-report-skel-line,
#results .bp-report-skel-card,
#results .bp-report-skel-block,
#results .bp-report-skel-row {
  border-radius: 10px;
  background: linear-gradient(
    90deg,
    #eef0f5 0%,
    #f7f8fb 45%,
    #eef0f5 100%
  );
  background-size: 200% 100%;
  animation: bp-report-skel-shimmer 1.35s ease-in-out infinite;
}

#results .bp-report-skel-eyebrow {
  width: 34%;
  height: 12px;
}

#results .bp-report-skel-title {
  width: 72%;
  height: 28px;
  margin-top: 4px;
}

#results .bp-report-skel-title-sm {
  width: 54%;
  height: 18px;
}

#results .bp-report-skel-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 10px;
}

#results .bp-report-skel-card {
  height: 88px;
  border-radius: 14px;
}

#results .bp-report-skel-block {
  width: 100%;
  height: 120px;
  margin-top: 8px;
  border-radius: 16px;
}

#results .bp-report-skel-block-lg {
  height: 180px;
}

#results .bp-report-skel-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

#results .bp-report-skel-row {
  height: 42px;
  border-radius: 12px;
}

#results .bp-report-skel-row:nth-child(2) {
  width: 94%;
}

#results .bp-report-skel-row:nth-child(3) {
  width: 88%;
}

#results .bp-report-skel-row:nth-child(4) {
  width: 80%;
}

@keyframes bp-report-skel-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

@media (prefers-reduced-motion: reduce) {
  #results .bp-report-skel-line,
  #results .bp-report-skel-card,
  #results .bp-report-skel-block,
  #results .bp-report-skel-row {
    animation: none;
  }
}

/* Custom scrollbar — visible only while the user is manually scrolling */
#results .bp-report-iframe-scrollbar {
  position: absolute;
  top: 10px;
  right: 6px;
  bottom: 10px;
  z-index: 4;
  width: 5px;
  border-radius: 999px;
  background: rgba(34, 36, 76, 0.06);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

#results .bp-report-iframe-shell.is-user-scrolling .bp-report-iframe-scrollbar {
  opacity: 1;
}

#results .bp-report-iframe-scrollbar-thumb {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 28px;
  border-radius: 999px;
  background: rgba(34, 36, 76, 0.35);
}

/* Shield removed — pointer events go through to the report */
#results .bp-report-iframe-shield {
  display: none;
}

/* Feature list: vertically centered beside the report frame */
#results .bp-report-showcase {
  align-items: center;
  margin-top: 0;
}

#results .bp-report-feature-list {
  padding-top: 0;
}

#results .bp-report-features {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#results .bp-report-feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  gap: 14px;
  align-items: start;
  min-height: 0;
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
  padding: 18px 18px 18px 16px;
  cursor: pointer;
  box-shadow: none;
  transition:
    border-color 200ms ease,
    background-color 200ms ease,
    box-shadow 220ms ease,
    transform 200ms ease;
}

#results .bp-report-feature:first-child {
  min-height: 0;
}

#results .bp-report-feature-icon,
#results .bp-report-feature-chapter {
  display: none !important;
}

#results .bp-report-feature-arrow {
  display: grid !important;
  width: 18px;
  height: 18px;
  place-items: center;
  margin-top: 8px;
  color: #9ca3af;
  opacity: 0.85;
  transition:
    color 200ms ease,
    opacity 200ms ease,
    transform 200ms ease;
}

#results .bp-report-feature-copy {
  min-width: 0;
}

#results .bp-report-feature-copy p {
  max-width: none;
}

#results .bp-report-feature-title {
  color: #737373;
  transition: color 180ms ease;
}

#results .bp-report-feature:hover,
#results .bp-report-feature:focus-visible,
#results .bp-report-feature.is-preview {
  border-color: rgba(34, 36, 76, 0.14);
  background: #fff;
  box-shadow: 0 6px 18px rgba(34, 36, 76, 0.06);
  transform: translateY(-1px);
}

#results .bp-report-feature:hover .bp-report-feature-title,
#results .bp-report-feature:focus-visible .bp-report-feature-title,
#results .bp-report-feature.is-preview .bp-report-feature-title,
#results .bp-report-feature.is-active .bp-report-feature-title {
  color: #242424;
}

#results .bp-report-feature:hover .bp-report-feature-arrow,
#results .bp-report-feature:focus-visible .bp-report-feature-arrow,
#results .bp-report-feature.is-preview .bp-report-feature-arrow,
#results .bp-report-feature.is-active .bp-report-feature-arrow {
  color: #737373;
  opacity: 1;
  transform: translateX(2px);
}

#results .bp-report-feature.is-active,
#results .bp-report-feature.is-active:hover,
#results .bp-report-feature.is-active:focus-visible,
#results .bp-report-feature.is-active.is-preview {
  border-color: rgba(34, 36, 76, 0.16);
  background: #fff;
  box-shadow:
    0 1px 2px rgba(34, 36, 76, 0.04),
    0 10px 28px rgba(34, 36, 76, 0.08);
  transform: none;
}

#results .bp-report-feature:focus-visible {
  outline: 2px solid rgba(2, 135, 237, 0.45);
  outline-offset: 2px;
}

@media (max-width: 991px) {
  #results .bp-report-iframe-shell {
    height: min(72vh, 740px);
  }
}

/* Mini HTML mockups — desktop hides them; mobile shows inside each card */
#results .bp-report-feature-mock {
  display: none;
}

@media (max-width: 767px) {
  /* No live iframe on mobile — cards carry their own HTML mockups */
  #results .bp-report-preview-column {
    display: none !important;
  }

  #results .bp-report-showcase {
    display: block !important;
    gap: 0 !important;
    margin-top: 0 !important;
  }

  #results .bp-report-feature-list {
    position: static;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
  }

  #results .bp-report-feature-list > .cards-dots {
    display: none !important;
  }

  /* Hide trust badge card on mobile — already covered earlier on the page */
  #results .bp-report-feature[data-feature-kind="badge"] {
    display: none !important;
  }

  /* Vertical card stack */
  #results .bp-report-features {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 1rem;
    overflow: visible !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  #results .bp-report-feature,
  #results .bp-report-feature:first-child {
    flex: none !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start;
    align-items: stretch;
    gap: 0;
    height: auto;
    margin: 0 !important;
    padding: 1.15rem 1.1rem 1.15rem !important;
    border: 1px solid #ededed !important;
    border-radius: 16px;
    background: #fff !important;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.09) !important;
    transform: none !important;
    cursor: default;
    text-align: left;
  }

  #results .bp-report-feature:hover,
  #results .bp-report-feature:focus-visible,
  #results .bp-report-feature.is-preview,
  #results .bp-report-feature.is-active,
  #results .bp-report-feature.is-active:hover {
    border-color: #ededed !important;
    background: #fff !important;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.09) !important;
    transform: none !important;
  }

  #results .bp-report-feature-arrow {
    display: none !important;
  }

  #results .bp-report-feature-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  /* Match homepage body typography */
  #results .bp-report-feature-title {
    color: #242424 !important;
    font-size: var(--text-md, 1.0625rem);
    font-weight: var(--weight-bold, 700);
    line-height: var(--leading-snug, 1.35);
    letter-spacing: -0.02em;
  }

  #results .bp-report-feature-copy p {
    margin-top: 0.4rem;
    margin-bottom: 0;
    color: var(--color-text-body, #737373) !important;
    font-size: var(--text-sm, 0.875rem);
    font-weight: var(--weight-regular, 400);
    line-height: var(--leading-relaxed, 1.65);
  }

  #results .bp-report-feature-stats {
    display: none !important;
  }

  #results .bp-report-feature-mock {
    display: block;
    margin-top: 0.95rem;
  }

  #results .bp-mini-mock {
    display: block;
    border: 1px solid #e8eaf0;
    border-radius: 14px;
    background: #f7f8fc;
    padding: 0.85rem 0.9rem;
    overflow: hidden;
  }

  #results .bp-mini-mock-head,
  #results .bp-mini-mock-kicker {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
    color: #8a8ea3;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
  }

  /* Reach — traffic bars */
  #results .bp-mini-mock--reach {
    background: linear-gradient(165deg, #1b1b3a 0%, #22244c 100%);
    border-color: transparent;
    color: #fff;
  }

  #results .bp-mini-mock--reach .bp-mini-mock-head {
    color: rgba(255, 255, 255, 0.55);
  }

  #results .bp-mini-traf {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr) auto;
    gap: 0.45rem;
    align-items: center;
    padding: 0.28rem 0;
  }

  #results .bp-mini-traf-name {
    overflow: hidden;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  #results .bp-mini-traf-track {
    display: block;
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
  }

  #results .bp-mini-traf-track i {
    display: block;
    width: var(--w, 50%);
    height: 100%;
    border-radius: inherit;
  }

  #results .bp-mini-traf-val {
    color: rgba(255, 255, 255, 0.78);
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: right;
  }

  /* AI citation distribution */
  #results .bp-mini-ai-bar {
    display: flex;
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: #e6e8f0;
    margin-bottom: 0.75rem;
  }

  #results .bp-mini-ai-bar i {
    display: block;
    min-width: 4px;
  }

  #results .bp-mini-ai-legend {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem 0.75rem;
  }

  #results .bp-mini-ai-legend > span {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: #5c5f78;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
  }

  #results .bp-mini-ai-legend > span i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
  }

  #results .bp-mini-ai-legend b {
    margin-left: auto;
    color: #242424;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
  }

  /* Rankings — query bar | rank | platform */
  #results .bp-mini-rank-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 0.5rem;
    align-items: center;
    padding: 0.4rem 0;
    border-top: 1px solid #e8eaf0;
  }

  #results .bp-mini-rank-row:first-of-type {
    border-top: 0;
    padding-top: 0;
  }

  #results .bp-mini-rank-query {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid #e4e7ef;
    border-radius: 999px;
    background: #fff;
    padding: 0.35rem 0.65rem 0.35rem 0.5rem;
    color: #242424;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #results .bp-mini-rank-query svg {
    flex-shrink: 0;
    color: #9aa0b5;
  }

  #results .bp-mini-rank-pos {
    display: grid;
    place-items: center;
    min-width: 2rem;
    height: 1.7rem;
    border-radius: 8px;
    background: #eef6ff;
    color: #0287ed;
    font-size: 11px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
  }

  #results .bp-mini-rank-pub {
    min-width: 2.75rem;
    color: #5c5f78;
    font-size: 11px;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
  }

  #results .bp-mini-rank-favicon {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    background: #fff;
    object-fit: contain;
  }

  /* Publications list */
  #results .bp-mini-pub-row {
    display: flex;
    gap: 0.7rem;
    align-items: center;
    padding: 0.55rem 0;
    border-top: 1px solid #e8eaf0;
  }

  #results .bp-mini-pub-row:first-of-type {
    border-top: 0;
    padding-top: 0;
  }

  #results .bp-mini-pub-favicon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 8px;
    background: #fff;
    object-fit: contain;
  }

  #results .bp-mini-pub-meta {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    gap: 0.3rem;
  }

  #results .bp-mini-pub-meta b {
    color: #242424;
    font-size: 12px;
    font-weight: 700;
  }

  #results .bp-mini-pub-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.35rem;
    color: #737373;
    font-size: 11px;
    font-weight: 500;
  }

  #results .bp-mini-pub-stats span {
    min-width: 0;
  }

  #results .bp-mini-pub-stats strong {
    color: #242424;
    font-weight: 700;
  }

  /* As Seen On badge */
  #results .bp-mini-mock--badge {
    background: #fff;
    padding: 1rem;
  }

  #results .bp-mini-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.55rem;
    border: 1px solid #e8eaf0;
    border-radius: 12px;
    background: #fafbfc;
    padding: 1rem 0.85rem 0.85rem;
    box-shadow: 0 8px 20px rgba(34, 36, 76, 0.06);
  }

  #results .bp-mini-badge-label {
    color: #8a8ea3;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  #results .bp-mini-badge-logos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem 0.65rem;
  }

  #results .bp-mini-badge-logos span {
    color: #242424;
    font-size: 12px;
    font-weight: 700;
  }

  #results .bp-mini-badge-verify {
    color: #17865f;
    font-size: 10px;
    font-weight: 600;
  }
}

#results .bp-report-format-mobile {
  display: none;
}

@media (max-width: 767px) {
  #results .bp-report-format-actions {
    display: none !important;
  }

  #results .bp-report-format-mobile {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
    margin-bottom: 1.25rem;
    padding: 0;
  }

  #results .bp-report-format-mobile .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 320px;
    text-align: center;
  }

  /* Free space on mobile: slide the sticky Get Started banner away while
     Report & Results is on screen (works with the existing .is-visible enter). */
  .mobile-banner.is-visible.is-results-hidden {
    visibility: hidden;
    pointer-events: none;
    opacity: 0;
    transform: translateY(calc(100% + env(safe-area-inset-bottom, 0px)));
    transition: transform 0.32s cubic-bezier(0.22, 0.61, 0.36, 1),
                opacity 0.2s ease,
                visibility 0s linear 0.32s;
  }
}

@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
  .mobile-banner.is-visible.is-results-hidden {
    transition: none;
  }
}

