/* page2: findings (#analysis, a night band)

   The carousel reads as one dark instrument panel: a control strip above it (finding name, counter, square
   arrows), then per slide a white plate that carries the figure (charts and images are drawn on white) beside
   the reading copy in light text. Template rules use !important heavily, so most declarations here must too. */

/* ---------- band frame (the template forces every .section to white) ---------- */
body.p2 main > #analysis.section {
  padding: var(--p2-section-y) 0 !important;
  background: var(--p2-night) !important;
  color: var(--p2-on-night);
  border-top: 1px solid var(--p2-night);
}

body.p2 main > #analysis > .container {
  width: 100% !important;
  max-width: var(--p2-wrap) !important;
  padding: 0 var(--p2-gutter) !important;
}

body.p2 #analysis .section-heading { margin: 0 !important; }
body.p2 #analysis .section-heading > .column,
body.p2 #analysis .section-heading > .column.is-four-fifths {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
body.p2 #analysis .p2-eyebrow { letter-spacing: 0.14em !important; }

/* ---------- control strip: finding name left, counter and square arrows right ---------- */
body.p2 #analysis .findings-heading-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px 40px;
  column-gap: 8px;
  align-items: center;
  height: 72px;
  margin: 40px 0 0;
  padding: 0 0 0 1px;
  border-top: 1px solid var(--p2-night-line);
}

body.p2 #analysis .findings-current-title {
  grid-column: 1;
  grid-row: 1;
  overflow: hidden;
  margin: 0 !important;
  padding-right: 120px;
  font: 500 12.5px/1.4 var(--p2-mono) !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left !important;
  color: var(--p2-on-night) !important;
}

body.p2 #analysis .findings-heading-arrow {
  position: relative;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: var(--p2-radius);
  background: transparent;
  color: var(--p2-on-night);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

body.p2 #analysis [data-findings-prev] { grid-column: 2; grid-row: 1; }
body.p2 #analysis [data-findings-next] { grid-column: 3; grid-row: 1; }

/* the "<" / ">" glyphs stay in the markup for text browsers; a drawn chevron replaces them on screen */
body.p2 #analysis .findings-heading-arrow span { font-size: 0 !important; line-height: 0 !important; }

body.p2 #analysis .findings-heading-arrow::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-bottom: 1.5px solid currentColor;
  border-left: 1.5px solid currentColor;
  transform: translate(-30%, -50%) rotate(45deg);
}

body.p2 #analysis [data-findings-next]::before { transform: translate(-70%, -50%) rotate(-135deg); }

body.p2 #analysis .findings-heading-arrow:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

body.p2 #analysis .findings-heading-arrow:focus-visible {
  outline: 2px solid var(--p2-accent-night);
  outline-offset: 2px;
  border-color: #fff;
  color: #fff;
}

/* ---------- the panel ---------- */
body.p2 #analysis .findings-carousel {
  position: relative;
  left: auto;
  display: block;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  border: 1px solid var(--p2-night-line);
  border-radius: var(--p2-radius-lg);
  background: var(--p2-night-2);
  transform: none;
}

/* live counter ("1 / 3"), lifted into the control strip just left of the arrows */
body.p2 #analysis .findings-status {
  position: absolute;
  top: -73px;
  right: 104px;
  width: auto;
  height: 72px;
  overflow: visible;
  clip: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font: 400 12.5px/1 var(--p2-mono);
  letter-spacing: 0.08em !important;
  font-variant-numeric: tabular-nums;
  color: var(--p2-on-night-muted);
  white-space: nowrap;
}

body.p2 #analysis .findings-status::before {
  content: "Finding";
  font-size: 11.5px;
  letter-spacing: 0.12em !important;
  text-transform: uppercase;
}

body.p2 #analysis .findings-viewport {
  width: 100% !important;
  max-width: none !important;
  min-height: 0 !important;
  margin: 0 !important;
}

body.p2 #analysis .findings-slide {
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) !important;
  gap: 0 !important;
  align-items: stretch !important;
  min-height: 620px !important;
  padding: 0 !important;
}

body.p2 #analysis .findings-figure {
  display: flex;
  max-width: none !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 24px !important;
}

/* white plate: every figure sits on the surface it was drawn for */
body.p2 #analysis .findings-slide .findings-image-frame {
  flex: 1 1 auto;
  display: flex;
  align-items: center !important;
  justify-content: center !important;
  min-width: 0;
  min-height: 0 !important;
  padding: 24px !important;
  border: 1px solid var(--p2-line);
  border-radius: var(--p2-radius);
  background: var(--p2-surface) !important;
  background-color: var(--p2-surface) !important;
}

body.p2 #analysis .findings-slide .findings-image-frame img {
  display: block;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
}

body.p2 #analysis .findings-image-frame .osci-figure-link { display: block; width: 100%; }

body.p2 #analysis .findings-image-frame .osci-figure-link:focus-visible { outline-offset: 4px; }

/* ---------- embedded score/token sweep (slide 1) ---------- */
body.p2 #analysis .findings-slide .findings-image-frame-sweep {
  align-items: center !important;
  padding: 20px 20px 12px !important;
}

body.p2 #analysis .benchmark-sweep-embed {
  width: 100%;
  max-width: none;
  margin: 0 !important;
}

body.p2 #analysis .benchmark-sweep-embed .benchmark-chart-wrap {
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible;
}

body.p2 #analysis .benchmark-sweep-embed .benchmark-sweep-controls {
  justify-content: flex-start !important;
  margin: 0 0 8px !important;
}

body.p2 #analysis .benchmark-sweep-embed .benchmark-axis-controls { gap: 20px !important; }
body.p2 #analysis .benchmark-sweep-embed .benchmark-control-group { gap: 8px !important; }

body.p2 #analysis .benchmark-control-label {
  font: 500 11.5px/1 var(--p2-mono) !important;
  letter-spacing: 0.12em !important;
  color: var(--p2-muted) !important;
}

body.p2 #analysis .benchmark-segmented,
body.p2 #analysis .benchmark-segmented.is-y-axis {
  display: inline-flex !important;
  gap: 0 !important;
  padding: 0 !important;
  border: 1px solid var(--p2-line-strong) !important;
  border-radius: var(--p2-radius) !important;
  background: var(--p2-surface) !important;
  overflow: hidden;
}

body.p2 #analysis .benchmark-metric-btn {
  min-width: 0 !important;
  height: 28px !important;
  padding: 0 12px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--p2-ink-2) !important;
  font: 500 12px/1 var(--p2-mono) !important;
  box-shadow: none !important;
}

body.p2 #analysis .benchmark-metric-btn + .benchmark-metric-btn { border-left: 1px solid var(--p2-line) !important; }

body.p2 #analysis .benchmark-metric-btn:hover { background: var(--p2-surface-2) !important; color: var(--p2-ink) !important; }

body.p2 #analysis .benchmark-metric-btn[aria-pressed="true"] {
  background: var(--p2-ink) !important;
  color: #fff !important;
}

body.p2 #analysis .benchmark-metric-btn:focus-visible { outline-offset: -2px; }

body.p2 #analysis .benchmark-tooltip {
  border: 1px solid var(--p2-line-strong);
  border-radius: var(--p2-radius);
  background: var(--p2-surface);
  box-shadow: none;
  color: var(--p2-ink);
  font-family: var(--p2-display) !important;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

body.p2 #analysis .benchmark-tooltip.is-pinned { border-color: var(--p2-ink); }

/* ---------- static figures (slides 2 and 3) ---------- */
body.p2 #analysis .findings-image-frame-heatmap img {
  width: 100%;
  max-width: 640px;
  max-height: 520px;
  height: auto;
  margin: 0 auto;
}

body.p2 #analysis .findings-image-frame-wide img {
  width: 100%;
  max-height: none;
  height: auto;
}

/* ---------- reading copy ---------- */
body.p2 #analysis .findings-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0 !important;
  margin: 0;
  padding: 40px 44px 40px 36px !important;
  border-left: 1px solid var(--p2-night-line);
  color: var(--p2-on-night) !important;
  font-family: var(--p2-serif) !important;
  font-size: 1.1rem !important;
  line-height: 1.6 !important;
}

body.p2 #analysis .findings-copy h3 {
  margin: 0 0 20px;
  font: 600 1.75rem/1.14 var(--p2-display) !important;
  font-stretch: 96%;
  letter-spacing: -0.018em !important;
  color: #fff !important;
  text-wrap: balance;
}

body.p2 #analysis .findings-copy p {
  max-width: 62ch;
  margin: 0;
  font: 400 1.125rem/1.6 var(--p2-serif);
  color: var(--p2-on-night);
}

body.p2 #analysis .findings-points {
  gap: 12px;
  max-width: 62ch;
  margin: 22px 0 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--p2-night-line);
}

body.p2 #analysis .findings-points li {
  padding-left: 22px;
  font: 400 1.03rem/1.55 var(--p2-serif);
  color: #c9cec8;
}

body.p2 #analysis .findings-points li::before {
  top: 0.78em;
  width: 10px;
  height: 1px;
  border-radius: 0;
  background: var(--p2-on-night-muted);
}

body.p2 #analysis .findings-copy .findings-note {
  margin: 22px 0 0 !important;
  font: 400 12px/1.5 var(--p2-mono) !important;
  letter-spacing: 0.02em !important;
  color: var(--p2-on-night-muted) !important;
}

/* ---------- stacked slide (wide figure above, copy below in two columns) ---------- */
body.p2 #analysis .findings-slide.findings-slide-stacked {
  grid-template-columns: minmax(0, 1fr) !important;
  align-items: start !important;
}

body.p2 #analysis .findings-slide-stacked .findings-figure { padding-bottom: 0 !important; }

body.p2 #analysis .findings-slide-stacked .findings-image-frame { padding: 28px 32px !important; }

body.p2 #analysis .findings-slide-stacked .findings-copy {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  column-gap: 56px;
  align-content: start;
  max-width: none !important;
  margin: 0 !important;
  padding: 36px 44px 44px 24px !important;
  border-left: 0;
}

body.p2 #analysis .findings-slide-stacked .findings-copy h3 { grid-column: 1; grid-row: 1 / span 3; margin: 0; }
body.p2 #analysis .findings-slide-stacked .findings-copy > :not(h3) { grid-column: 2; }

/* ---------- narrower desktops ---------- */
@media (max-width: 1240px) {
  body.p2 #analysis .findings-slide {
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr) !important;
    min-height: 600px !important;
  }
  body.p2 #analysis .findings-copy { padding: 32px 32px 32px 28px !important; }
  body.p2 #analysis .findings-copy h3 { font-size: 1.55rem !important; }
}

@media (prefers-reduced-motion: reduce) {
  body.p2 #analysis .findings-heading-arrow { transition: none; }
}
