/* Example report viewer: /example/creative-testing and /example/brand-lift.
   Presentation only. A slim bar (the mark, the report's name, a Canvas · A4
   switch), then the report fills the rest of the screen. No nav, no footer,
   no signup: the report is the page.

   Two views, chosen by the URL hash (#a4, else Canvas):
   - Canvas: the report itself in a full-height same-origin iframe. The shell
     never scrolls; the report scrolls inside its own frame.
   - A4: the printed pages as images, stacked like paper, with the choice of
     report and branding and a PDF to take away. The shell scrolls. */

.xv {
  --xv-bar-h: 52px;
  background: var(--d-bg);
  color: var(--d-ink);
}
.xv [hidden] {
  display: none !important;
}

/* ── the bar ─────────────────────────────────────────────────────── */
.xv-bar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 14px;
  height: var(--xv-bar-h);
  padding: 0 16px;
  background: var(--d-bg);
  border-bottom: 1px solid var(--d-hair-2);
}
.xv-mark {
  flex: none;
  display: flex;
  border-radius: 50%;
}
.xv-mark img {
  width: 28px;
  height: 28px;
}
.xv-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font: 600 14px/1.2 var(--sans);
  letter-spacing: -0.01em;
  color: var(--d-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.xv-title span {
  font-weight: 400;
  color: var(--d-ink-mid);
}
.xv-title span::before {
  content: '· ';
}

/* ── segmented switches (the bar is dark, the A4 bar light) ─────── */
.xv-seg {
  flex: none;
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--d-hair-2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}
.xv-seg a,
.xv-seg button {
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--d-ink-soft);
  font: 500 13px/1 var(--sans);
  padding: 7px 14px;
  cursor: pointer;
}
/* hover never repaints the chosen item */
.xv-seg a:not([aria-current='true']):hover,
.xv-seg button:not([aria-pressed='true']):hover {
  color: var(--d-ink);
}
.xv-seg [aria-current='true'],
.xv-seg [aria-pressed='true'] {
  background: var(--d-ink);
  color: var(--d-bg);
}
.xv-seg--light {
  border-color: var(--hair-2);
  background: var(--bg);
}
.xv-seg--light button {
  color: var(--ink-soft);
}
.xv-seg--light button:not([aria-pressed='true']):hover {
  color: var(--ink);
}
.xv-seg--light [aria-pressed='true'] {
  background: var(--ink);
  color: var(--bg);
}
.xv a:focus-visible,
.xv button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Canvas: the report fills what the bar leaves ────────────────── */
.xv[data-xv-mode='canvas'] {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
.xv[data-xv-mode='canvas'] .xv-main {
  flex: 1;
  min-height: 0;
}
.xv-canvas {
  height: 100%;
}
.xv-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--bg-2);
}

/* ── A4: the printed pages, like paper on a desk ─────────────────── */
.xv-a4 {
  min-height: calc(100vh - var(--xv-bar-h));
  background: var(--bg-3);
  color: var(--ink);
}
.xv-a4-bar {
  position: sticky;
  top: var(--xv-bar-h);
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 12px;
  padding: 10px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--hair-2);
}
.xv-pdf {
  font: 500 13px/1 var(--sans);
  color: var(--accent-ink);
  padding: 10px 16px;
  border: 1px solid var(--hair-2);
  border-radius: 999px;
  background: var(--bg);
}
.xv-pdf:hover {
  border-color: var(--accent);
}
.xv-pages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: 28px 16px 72px;
}
.xv-page {
  width: 100%;
  max-width: 880px;
  height: auto;
  aspect-ratio: 1240 / 1754;
  background: #fff;
  box-shadow:
    0 1px 2px rgba(11, 12, 14, 0.08),
    0 18px 40px -18px rgba(11, 12, 14, 0.38);
}

/* ── phones ──────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .xv-bar {
    gap: 10px;
  }
  .xv-title {
    display: flex;
    flex-direction: column;
    font-size: 13px;
  }
  .xv-title span {
    font: 500 10px/1.4 var(--mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .xv-title span::before {
    content: none;
  }
  .xv-seg a,
  .xv-seg button {
    font-size: 12px;
    padding: 7px 12px;
  }
  .xv-a4-bar {
    gap: 8px;
    padding: 8px 16px;
  }
  .xv-pdf {
    font-size: 12px;
    padding: 9px 14px;
  }
  .xv-pages {
    gap: 14px;
    padding: 14px 16px 48px;
  }
}
