/* Evidence controls extend the shared Pearl Play media system. */
body.pearl-play .er-comparison-tabs[hidden],
body.pearl-play .er-image-navigation[hidden],
body.pearl-play .er-tabs-active > .sw-figure[hidden] { display: none !important; }
body.pearl-play .er-comparison-tabs {
  display: grid;
  grid-template-columns: repeat(var(--er-tab-count, 2), minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  align-items: stretch;
}
body.pearl-play .er-comparison-tab {
  min-height: 48px;
  padding: 10px 9px;
  border: 1px solid var(--control-line, #778793);
  border-radius: 8px;
  background: transparent;
  color: var(--ink, #263345);
  font: 500 13px/1.45 var(--body, Manrope, sans-serif);
  text-align: center;
  overflow-wrap: anywhere;
  cursor: pointer;
}
body.pearl-play .er-comparison-tab[aria-selected="true"] {
  color: #fcfaf7;
  background: var(--ink, #263345);
  border-color: var(--ink, #263345);
}
body.pearl-play .er-comparison-tab:focus-visible,
body.pearl-play .er-reader :is(button,a,.image-stage):focus-visible {
  outline: 2px solid #865d76;
  outline-offset: 4px;
}
body.pearl-play .sw-compare.er-tabs-active {
  grid-template-columns: minmax(0, 1fr);
  gap: 25px;
  position: relative;
}
body.pearl-play .sw-compare.er-tabs-active > .sw-figure { min-height: var(--er-panel-height, 0); }
body.pearl-play .sw-compare.er-tabs-active > .er-panel-measuring {
  display: block !important;
  position: absolute !important;
  inset: auto auto auto 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  min-height: 0 !important;
}

body.pearl-play .image-dialog.er-reader {
  width: min(calc(100vw - 32px), 1180px);
  height: min(940px, calc(100dvh - 32px));
  max-height: calc(100dvh - 32px);
  padding: 20px;
  overflow: hidden;
  border-radius: 18px;
  box-sizing: border-box;
}
body.pearl-play .image-dialog.er-reader[open] { display: flex; flex-direction: column; }
body.pearl-play .er-reader .image-toolbar { display: flex; flex: 0 0 auto; gap: 16px; padding-bottom: 12px; align-items: flex-start; flex-wrap: nowrap; }
body.pearl-play .er-reader .image-toolbar h2 { font: 600 20px/1.3 var(--body, Manrope, sans-serif); margin: 5px 0 0; max-width: 65ch; overflow-wrap: anywhere; }
body.pearl-play .er-reader .image-toolbar > div { display: flex; flex: 0 0 auto; margin: 0; }
body.pearl-play .er-reader :is(.er-view-modes,.er-image-navigation) { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
body.pearl-play .er-reader .er-view-modes { padding-bottom: 12px; }
body.pearl-play .er-reader :is(.er-view-modes,.er-image-navigation) button,
body.pearl-play .er-reader [data-image-close] {
  min-height: 44px;
  padding: 9px 13px;
  border: 1px solid var(--control-line, #778793);
  border-radius: 7px;
  color: var(--ink, #263345);
  background: #fffdfa;
  font: 500 13px/1.4 var(--body, Manrope, sans-serif);
  cursor: pointer;
}
body.pearl-play .er-reader .er-view-modes button[aria-pressed="true"] { color: #fcfaf7; background: var(--ink, #263345); border-color: var(--ink, #263345); }
body.pearl-play .er-reader button:disabled { opacity: .5; cursor: default; }
body.pearl-play .er-reader .er-image-navigation { justify-content: space-between; padding: 0 0 10px; }
body.pearl-play .er-reader .er-image-counter { font: 500 13px/1.4 var(--body, Manrope, sans-serif); color: var(--ink, #263345); }
body.pearl-play .er-reader .image-stage {
  flex: 1 1 0;
  height: 0;
  max-height: none;
  min-height: 100px;
  padding: 12px;
  overflow: auto;
  overscroll-behavior: contain;
  background: #f1f0ed;
  border: 1px solid #c3cacf;
  border-radius: 8px;
  box-sizing: border-box;
}
body.pearl-play .er-reader .image-stage img {
  display: block;
  object-fit: contain;
  margin: 0 auto;
  max-width: none;
  max-height: none;
  width: auto;
  height: auto;
}
body.pearl-play .er-reader .image-stage img[hidden] { display: none; }
body.pearl-play .er-reader .image-stage[data-image-mode="width"] img { width: min(100%, var(--er-original-width, 100%)); height: auto; }
body.pearl-play .er-reader .image-stage[data-image-mode="overview"] img { width: auto; height: auto; max-width: 100%; max-height: var(--er-stage-content-height, 60dvh); }
body.pearl-play .er-reader .image-stage[data-image-mode="actual"] img { width: auto; height: auto; max-width: none; max-height: none; }
body.pearl-play .er-reader .image-description { flex: 0 0 auto; font: 400 13px/1.55 var(--body, Manrope, sans-serif); margin: 11px 0 0; max-height: 4.7em; overflow: auto; }
body.pearl-play .er-reader .er-image-hint { flex: 0 0 auto; font: 400 12px/1.5 var(--body, Manrope, sans-serif); color: #596473; margin: 6px 0 0; }
body.pearl-play .er-reader .image-original { flex: 0 0 auto; font-size: 13px; min-height: 36px; align-self: flex-start; }

@media (max-width: 600px) {
  body.pearl-play .image-dialog.er-reader { width: calc(100vw - 16px); height: calc(100dvh - 16px); max-height: calc(100dvh - 16px); padding: 12px; border-radius: 14px; }
  body.pearl-play .er-reader .image-toolbar { gap: 12px; }
  body.pearl-play .er-reader .image-toolbar h2 { font-size: 17px; line-height: 1.35; margin-top: 2px; }
  body.pearl-play .er-reader .er-view-modes { gap: 6px; }
  body.pearl-play .er-reader .er-view-modes button { flex: 1 1 0; padding-inline: 7px; }
  body.pearl-play .er-reader .image-stage { padding: 8px; }
  body.pearl-play .er-reader .image-description { font-size: 13px; }
}
@media print {
  body.pearl-play .er-comparison-tabs { display: none !important; }
  body.pearl-play .er-tabs-active > .sw-figure[hidden] { display: block !important; }
}
