/* TheInstaPV Viewer - all rules are scoped to .instapv so they don't fight your theme */

.instapv {
  --ipv-grad: linear-gradient(135deg, #7c3aed 0%, #db2777 55%, #f59e0b 100%);
  --ipv-accent: #c026d3;
  --ipv-ink: #14111f;
  --ipv-muted: #6b6880;
  --ipv-line: #e8e5f0;
  --ipv-card: #ffffff;
  --ipv-soft: #f6f4fb;
  --ipv-radius: 18px;
  --ipv-shadow: 0 10px 30px -12px rgba(76, 29, 149, .25);
  color: var(--ipv-ink);
  font-family: inherit;
  line-height: 1.5;
  box-sizing: border-box;
  max-width: 1080px;
  margin: 0 auto;
}
.instapv *, .instapv *::before, .instapv *::after { box-sizing: border-box; }
.instapv button { font: inherit; cursor: pointer; }
.instapv img { max-width: 100%; display: block; }
.instapv svg { width: 1em; height: 1em; vertical-align: -.125em; }

/* ---------- hero + search ---------- */
.instapv .ipv-hero {
  background: var(--ipv-grad);
  border-radius: calc(var(--ipv-radius) + 6px);
  padding: 56px 20px 40px;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.instapv .ipv-hero::after {
  content: ""; position: absolute; inset: auto -20% -60% -20%; height: 120%;
  background: radial-gradient(closest-side, rgba(255,255,255,.18), transparent);
  pointer-events: none;
}
.instapv .ipv-title { color: #fff; font-size: clamp(28px, 5vw, 46px); line-height: 1.12; margin: 0 0 10px; font-weight: 800; letter-spacing: -.02em; }
.instapv .ipv-sub { margin: 0 auto 26px; max-width: 560px; font-size: 17px; opacity: .92; }

.instapv .ipv-search {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 6px;
  max-width: 620px; margin: 0 auto;
  background: #fff; border-radius: 999px; padding: 6px 6px 6px 20px;
  box-shadow: 0 18px 40px -14px rgba(0,0,0,.35);
}
.instapv .ipv-at { color: var(--ipv-muted); font-weight: 700; font-size: 18px; }
.instapv .ipv-input {
  flex: 1; min-width: 0; border: 0 !important; outline: 0; background: transparent !important;
  box-shadow: none !important; padding: 12px 4px !important; margin: 0 !important;
  font-size: 16px; color: var(--ipv-ink); height: auto;
}
.instapv .ipv-btn {
  border: 0; border-radius: 999px; padding: 13px 28px; min-width: 104px;
  background: var(--ipv-ink); color: #fff; font-weight: 700; font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .15s, opacity .15s;
}
.instapv .ipv-btn:hover { transform: translateY(-1px); }
.instapv .ipv-btn:disabled { opacity: .7; cursor: wait; }
.instapv .ipv-btn .ipv-spinner { display: none; }
.instapv.ipv-loading .ipv-btn .ipv-spinner { display: inline-block; }
.instapv.ipv-loading .ipv-btn .ipv-btn-text { display: none; }

.instapv .ipv-badges {
  position: relative; z-index: 1;
  list-style: none; margin: 22px 0 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; font-size: 14px; font-weight: 600;
}
.instapv .ipv-badges li::before { content: "✓ "; }

.instapv .ipv-recent { position: relative; z-index: 1; margin-top: 16px; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; font-size: 13px; }
.instapv .ipv-recent[hidden] { display: none; }
.instapv .ipv-recent button { background: rgba(255,255,255,.2); color: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; padding: 4px 12px; }
.instapv .ipv-recent button:hover { background: rgba(255,255,255,.32); }

.instapv .ipv-spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid currentColor; border-right-color: transparent;
  animation: ipv-spin .7s linear infinite; display: inline-block;
}
@keyframes ipv-spin { to { transform: rotate(360deg); } }

.instapv .ipv-error {
  margin: 18px auto 0; max-width: 620px; padding: 12px 16px; border-radius: 12px;
  background: #fff1f2; color: #9f1239; border: 1px solid #fecdd3; text-align: center; font-weight: 600;
}
.instapv .ipv-error[hidden], .instapv .ipv-result[hidden], .instapv [hidden] { display: none !important; }

/* ---------- results box for an Elementor-built search form ---------- */
.instapv.ipv-bridge { padding: 0 20px; }
.instapv.ipv-bridge .ipv-result:not([hidden]) { margin: 32px 0 40px; }
.ipv-search .ipv-btn[aria-busy="true"] { opacity: .75; cursor: wait; }

/* ---------- profile card ---------- */
.instapv .ipv-result { margin-top: 24px; scroll-margin-top: 90px; }
.instapv .ipv-profile {
  display: flex; gap: 28px; align-items: center;
  background: var(--ipv-card); border: 1px solid var(--ipv-line); border-radius: var(--ipv-radius);
  padding: 24px; box-shadow: var(--ipv-shadow);
}
.instapv .ipv-avatar {
  flex: none; width: 128px; height: 128px; border-radius: 50%; padding: 4px; border: 0;
  background: var(--ipv-grad);
}
.instapv .ipv-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 4px solid #fff; background: #eee; }
.instapv .ipv-profile-big .ipv-avatar { width: 200px; height: 200px; }
.instapv .ipv-pinfo { min-width: 0; flex: 1; }
.instapv .ipv-uname { font-size: 22px; font-weight: 800; display: flex; align-items: center; gap: 6px; word-break: break-all; }
.instapv .ipv-verified svg { width: 20px; height: 20px; }
.instapv .ipv-fname { font-weight: 600; color: var(--ipv-muted); }
.instapv .ipv-pstats { list-style: none; padding: 0; margin: 10px 0; display: flex; flex-wrap: wrap; gap: 6px 22px; color: var(--ipv-muted); }
.instapv .ipv-pstats b { color: var(--ipv-ink); font-size: 17px; }
.instapv .ipv-cat { font-size: 13px; color: var(--ipv-muted); }
.instapv .ipv-bio { white-space: pre-line; margin: 6px 0 12px; font-size: 15px; }
.instapv .ipv-btn-sm {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 999px;
  background: var(--ipv-soft); color: var(--ipv-ink); font-weight: 700; font-size: 14px; text-decoration: none;
  border: 1px solid var(--ipv-line);
}
.instapv .ipv-btn-sm:hover { background: #ede9fe; }

.instapv .ipv-private {
  margin-top: 18px; text-align: center; padding: 36px 20px; border-radius: var(--ipv-radius);
  background: var(--ipv-soft); border: 1px dashed var(--ipv-line);
}
.instapv .ipv-private svg { width: 40px; height: 40px; color: var(--ipv-muted); }
.instapv .ipv-private h3 { margin: 8px 0 4px; }
.instapv .ipv-private p { margin: 0 auto; max-width: 460px; color: var(--ipv-muted); }

/* ---------- tabs ---------- */
.instapv .ipv-tabs {
  display: flex; gap: 6px; margin: 22px 0 16px; padding: 6px; background: var(--ipv-soft);
  border-radius: 999px; overflow-x: auto; scrollbar-width: none;
}
.instapv .ipv-tabs::-webkit-scrollbar { display: none; }
.instapv .ipv-tabs button {
  flex: 1; white-space: nowrap; border: 0; background: transparent; color: var(--ipv-muted);
  padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: 15px;
}
.instapv .ipv-tabs button[aria-selected="true"] { background: var(--ipv-ink); color: #fff; }

.instapv .ipv-panel-loading, .instapv .ipv-empty {
  text-align: center; padding: 36px 16px; color: var(--ipv-muted);
  display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
}
.instapv .ipv-retry, .instapv .ipv-more {
  border: 1px solid var(--ipv-line); background: #fff; color: var(--ipv-ink);
  border-radius: 999px; padding: 8px 18px; font-weight: 700;
}
.instapv .ipv-more { display: block; margin: 20px auto 0; padding: 12px 32px; }
.instapv .ipv-more:hover, .instapv .ipv-retry:hover { background: var(--ipv-soft); }

/* ---------- grids ---------- */
.instapv .ipv-grid { display: grid; gap: 10px; grid-template-columns: repeat(3, 1fr); }
.instapv .ipv-grid + .ipv-grid { margin-top: 10px; }
.instapv .ipv-grid-story, .instapv .ipv-grid-reel { grid-template-columns: repeat(4, 1fr); }
.instapv .ipv-tile { position: relative; border-radius: 14px; overflow: hidden; background: var(--ipv-soft); }
.instapv .ipv-tile-open { display: block; width: 100%; padding: 0; border: 0; background: none; position: relative; aspect-ratio: 1 / 1; }
.instapv .ipv-grid-story .ipv-tile-open, .instapv .ipv-grid-reel .ipv-tile-open { aspect-ratio: 9 / 16; }
.instapv .ipv-tile-open img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.instapv .ipv-tile:hover img { transform: scale(1.04); }
.instapv .ipv-tbadge { position: absolute; top: 8px; right: 8px; color: #fff; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); font-size: 20px; }
.instapv .ipv-meta {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 10px 8px; text-align: left;
  color: #fff; font-size: 12px; font-weight: 700; background: linear-gradient(transparent, rgba(0,0,0,.65));
}
.instapv .ipv-tile-dl {
  position: absolute; bottom: 8px; right: 8px; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255,255,255,.92); color: var(--ipv-ink);
  font-size: 18px; box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.instapv .ipv-tile-dl:hover { background: #fff; color: var(--ipv-accent); }

/* ---------- highlights ---------- */
.instapv .ipv-hl-row { display: flex; gap: 16px; overflow-x: auto; padding: 4px 2px 12px; }
.instapv .ipv-hl { flex: none; width: 84px; border: 0; background: none; padding: 0; text-align: center; color: var(--ipv-ink); }
.instapv .ipv-hl-ring { display: block; width: 76px; height: 76px; margin: 0 auto 6px; border-radius: 50%; padding: 3px; background: var(--ipv-line); }
.instapv .ipv-hl.is-active .ipv-hl-ring, .instapv .ipv-hl:hover .ipv-hl-ring { background: var(--ipv-grad); }
.instapv .ipv-hl-ring img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 3px solid #fff; }
.instapv .ipv-hl-title { display: block; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.instapv .ipv-hl-items { margin-top: 10px; }

/* ---------- lightbox ---------- */
html.ipv-noscroll { overflow: hidden; }
.instapv.ipv-lb {
  position: fixed; inset: 0; z-index: 999999; max-width: none; margin: 0;
  background: rgba(10, 8, 18, .94); display: flex; align-items: center; justify-content: center;
}
.instapv.ipv-lb[hidden] { display: none !important; }
.instapv .ipv-lb-stage { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 64px 64px 24px; }
.instapv .ipv-lb-media { max-width: 100%; max-height: 100%; width: auto; height: auto; border-radius: 12px; object-fit: contain; background: #000; }
.instapv .ipv-lb-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: #fff; z-index: 2; }
.instapv .ipv-lb-count { flex: 1; font-size: 14px; opacity: .85; white-space: pre; }
.instapv .ipv-lb-dl { display: inline-flex; align-items: center; gap: 6px; background: var(--ipv-grad); color: #fff; text-decoration: none; padding: 9px 18px; border-radius: 999px; font-weight: 700; font-size: 14px; }
.instapv .ipv-lb-close { width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 28px; line-height: 1; }
.instapv .ipv-lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 34px; line-height: 1;
}
.instapv .ipv-lb-prev { left: 12px; }
.instapv .ipv-lb-next { right: 12px; }
.instapv .ipv-lb-nav:hover, .instapv .ipv-lb-close:hover { background: rgba(255,255,255,.26); }

/* ---------- [instapv_sections] ---------- */
.instapv.ipv-sections { margin-top: 56px; }
.instapv .ipv-block { margin: 0 0 56px; }
.instapv .ipv-block > h2 { text-align: center; font-size: clamp(24px, 3.6vw, 34px); margin: 0 0 26px; letter-spacing: -.01em; }
.instapv .ipv-steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.instapv .ipv-steps li, .instapv .ipv-feature {
  background: var(--ipv-card); border: 1px solid var(--ipv-line); border-radius: var(--ipv-radius); padding: 24px;
}
.instapv .ipv-step-n {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  background: var(--ipv-grad); color: #fff; font-weight: 800; margin-bottom: 12px;
}
.instapv .ipv-steps h3, .instapv .ipv-feature h3 { margin: 0 0 6px; font-size: 18px; }
.instapv .ipv-steps p, .instapv .ipv-feature p { margin: 0; color: var(--ipv-muted); font-size: 15px; }
.instapv .ipv-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.instapv .ipv-ic { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--ipv-soft); font-size: 24px; margin-bottom: 12px; }
.instapv .ipv-faq { max-width: 780px; margin: 0 auto; display: grid; gap: 10px; }
.instapv .ipv-faq details { background: var(--ipv-card); border: 1px solid var(--ipv-line); border-radius: 14px; padding: 0 20px; }
.instapv .ipv-faq summary { cursor: pointer; padding: 16px 0; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.instapv .ipv-faq summary::-webkit-details-marker { display: none; }
.instapv .ipv-faq summary::after { content: "+"; font-size: 22px; line-height: 1; color: var(--ipv-accent); }
.instapv .ipv-faq details[open] summary::after { content: "−"; }
.instapv .ipv-faq details p { margin: 0 0 16px; color: var(--ipv-muted); }
.instapv .ipv-disclaimer { text-align: center; font-size: 13px; color: var(--ipv-muted); }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .instapv .ipv-hero { padding: 40px 16px 30px; border-radius: var(--ipv-radius); }
  .instapv .ipv-search { padding-left: 14px; }
  .instapv .ipv-btn { padding: 12px 18px; min-width: 76px; }
  .instapv .ipv-profile { flex-direction: column; text-align: center; padding: 20px 16px; gap: 14px; }
  .instapv .ipv-uname, .instapv .ipv-pstats { justify-content: center; }
  .instapv.ipv-bridge { padding: 0 12px; }
  .instapv .ipv-avatar { width: 108px; height: 108px; }
  .instapv .ipv-profile-big .ipv-avatar { width: 170px; height: 170px; }
  .instapv .ipv-grid { gap: 4px; }
  .instapv .ipv-grid-story, .instapv .ipv-grid-reel { grid-template-columns: repeat(3, 1fr); }
  .instapv .ipv-tile { border-radius: 8px; }
  .instapv .ipv-tile-dl { width: 30px; height: 30px; font-size: 15px; bottom: 6px; right: 6px; }
  .instapv .ipv-steps, .instapv .ipv-features { grid-template-columns: 1fr; }
  .instapv .ipv-lb-stage { padding: 60px 8px 16px; }
  .instapv .ipv-lb-nav { width: 40px; height: 40px; font-size: 28px; }
}
@media (max-width: 420px) {
  .instapv .ipv-grid-story, .instapv .ipv-grid-reel { grid-template-columns: repeat(2, 1fr); }
  .instapv .ipv-lb-dl span { display: none; }
}
