/* Camera scenes extend the existing research map. */
#research-map .rm-axis {
  --rm-scene-accent: #a8e6e2;
  --rm-scene-ink: #eaf0f8;
  --rm-scene-shadow: #131d2c;
}

#research-map .rm-axis-generation { --rm-scene-accent: #ffd6a5; }

#research-map .rm-axis-header {
  padding: 13px 14px 11px;
  border-radius: 9px;
  background: linear-gradient(160deg, var(--control-idle-bg), var(--highlight-bg));
}

#research-map .rm-axis-header h3 {
  min-height: 26px;
  margin: 10px 0 12px;
  font-size: 19px;
  line-height: 1.3;
}

#research-map .rm-axis-header .rm-viewfinder-status {
  margin-bottom: 0;
  font-size: 11px;
}

#research-map .rm-axis-header .rm-camera-grip { opacity: .22; }

#research-map .rm-focus-target.rm-live-viewfinder {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: auto;
  aspect-ratio: 800 / 621;
  margin: 0;
  overflow: hidden;
  border: 1px solid #26354a;
  border-radius: 5px;
  background: #25334b;
  color: var(--rm-scene-ink);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .1), inset 0 0 0 3px rgba(4, 10, 20, .28);
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

#research-map .rm-live-viewfinder:focus-visible {
  outline: 2px solid var(--rm-color);
  outline-offset: 4px;
}

#research-map .rm-live-viewfinder[data-dragging] { cursor: grabbing; }

#research-map .rm-camera-display {
  overflow: hidden;
  border: 1px solid #26354a;
  border-radius: 6px;
  background: #1c2838;
}

#research-map .rm-camera-display .rm-focus-target.rm-live-viewfinder {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

#research-map .rm-camera-display .rm-live-viewfinder:focus-visible {
  outline-color: var(--rm-scene-accent);
  outline-offset: -3px;
}

#research-map .rm-camera-display > .rm-viewfinder-meter {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid rgba(221, 233, 250, .12);
  border-radius: 0;
  background: #1c2838;
  color: var(--rm-scene-accent);
  box-shadow: none;
}

#research-map .rm-camera-display .rm-focus-scale {
  --rm-color: var(--rm-scene-accent);
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 4px 10px 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#research-map .rm-camera-display .rm-focus-scale::before,
#research-map .rm-camera-display .rm-focus-scale::after {
  display: none;
  content: none;
}

#research-map .rm-camera-display .rm-focus-ticks { gap: 2px; }

#research-map .rm-camera-display .rm-focus-ticks button {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  align-content: center;
  justify-content: center;
  column-gap: 1px;
  row-gap: 3px;
  min-height: 44px;
  padding: 4px 0;
  border-radius: 3px;
  color: #c3cddc;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

#research-map .rm-camera-display .rm-focus-ticks .rm-focus-unit {
  font-size: 10px;
  font-weight: 400;
}

#research-map .rm-camera-display .rm-lens-topic {
  display: block;
  flex: 0 0 100%;
  min-width: 0;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -.01em;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
  opacity: .88;
}

#research-map .rm-camera-display .rm-focus-ticks button:hover,
#research-map .rm-camera-display .rm-focus-ticks button[data-rm-active],
#research-map .rm-camera-display .rm-focus-ticks button[data-rm-preview] {
  background: color-mix(in srgb, var(--rm-scene-accent) 13%, transparent);
  color: var(--rm-scene-accent);
}

#research-map .rm-camera-display .rm-focus-range {
  width: calc(80% + 14px);
  height: 24px;
  margin: 0 calc(10% - 7px);
  color: var(--rm-scene-accent);
}

#research-map .rm-camera-display .rm-focus-range::-webkit-slider-runnable-track {
  height: 2px;
  background: #526276;
}

#research-map .rm-camera-display .rm-focus-range::-moz-range-track {
  height: 2px;
  background: #526276;
}

#research-map .rm-camera-display .rm-focus-range::-webkit-slider-thumb {
  margin-top: -6px;
  background: var(--rm-scene-accent);
}

#research-map .rm-camera-display .rm-focus-range::-moz-range-thumb {
  background: var(--rm-scene-accent);
}

#research-map .rm-camera-display .rm-focus-ticks button:focus-visible,
#research-map .rm-camera-display .rm-focus-range:focus-visible {
  outline: 2px solid var(--rm-scene-accent);
  outline-offset: 0;
}

#research-map .rm-live-scene {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

#research-map .rm-scene-world { will-change: transform; }

#research-map .rm-scene-credit {
  margin: 7px 0 0;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}
#research-map .rm-scene-credit a { color: inherit; text-underline-offset: 3px; }

#research-map .rm-scene-detection {
  fill: color-mix(in srgb, var(--rm-scene-accent) 6%, transparent);
  stroke: var(--rm-scene-accent);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

#research-map .rm-scene-grid {
  position: absolute;
  z-index: 1;
  inset: 0;
  opacity: .23;
  background:
    linear-gradient(90deg, transparent calc(100% / 3 - .5px), #f1f5ff calc(100% / 3 - .5px), #f1f5ff calc(100% / 3 + .5px), transparent calc(100% / 3 + .5px), transparent calc(200% / 3 - .5px), #f1f5ff calc(200% / 3 - .5px), #f1f5ff calc(200% / 3 + .5px), transparent calc(200% / 3 + .5px)),
    linear-gradient(transparent calc(100% / 3 - .5px), #f1f5ff calc(100% / 3 - .5px), #f1f5ff calc(100% / 3 + .5px), transparent calc(100% / 3 + .5px), transparent calc(200% / 3 - .5px), #f1f5ff calc(200% / 3 - .5px), #f1f5ff calc(200% / 3 + .5px), transparent calc(200% / 3 + .5px));
  pointer-events: none;
}

#research-map .rm-live-viewfinder .rm-framing-stage {
  z-index: 2;
  inset: 16%;
  pointer-events: none;
}

#research-map .rm-live-viewfinder .rm-framing-window {
  width: 60%;
  height: 64%;
  transition: none;
}

#research-map .rm-live-viewfinder .rm-focus-brackets {
  --rm-color: var(--rm-scene-accent);
  opacity: .9;
  background-size: 14px 1.5px, 1.5px 11px, 14px 1.5px, 1.5px 11px, 14px 1.5px, 1.5px 11px, 14px 1.5px, 1.5px 11px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .6));
}

#research-map .rm-live-viewfinder .rm-framing-window::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 9px;
  height: 9px;
  content: "";
  transform: translate(-50%, -50%);
  background:
    linear-gradient(var(--rm-scene-accent), var(--rm-scene-accent)) center / 1px 100% no-repeat,
    linear-gradient(var(--rm-scene-accent), var(--rm-scene-accent)) center / 100% 1px no-repeat;
  opacity: .7;
}

#research-map .rm-scene-topline {
  position: absolute;
  z-index: 3;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px 24px;
  background: linear-gradient(rgba(9, 16, 29, .75), transparent);
  color: #edf5fd;
  font-family: var(--font-code);
  font-size: 10px;
  line-height: 1.3;
  letter-spacing: .08em;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

#research-map .rm-scene-shot { color: var(--rm-scene-accent); }

#research-map .rm-scene-caption {
  position: absolute;
  z-index: 3;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  align-content: end;
  min-height: 53px;
  gap: 3px;
  padding: 28px 12px 11px;
  box-sizing: border-box;
  background: linear-gradient(transparent, rgba(9, 16, 29, .83));
  text-shadow: 0 1px 3px rgba(0, 0, 0, .5);
  pointer-events: none;
}

#research-map .rm-scene-kicker {
  color: var(--rm-scene-accent);
  font-family: var(--font-code);
  font-size: 10px;
  line-height: 1.3;
  letter-spacing: .08em;
  text-transform: uppercase;
}

#research-map .rm-scene-caption-title {
  display: block;
  color: #f4f7fc;
  font-size: 14px;
  font-weight: 550;
  line-height: 1.35;
}

#research-map .rm-scene-flash {
  position: absolute;
  z-index: 5;
  inset: 0;
  opacity: 0;
  background: #edf4fc;
  pointer-events: none;
}

#research-map .rm-live-viewfinder[data-captured] .rm-scene-flash {
  animation: rm-camera-shutter 340ms ease-out;
}

#research-map .rm-live-viewfinder[data-touring]::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, transparent 0%, color-mix(in srgb, var(--rm-scene-accent) 9%, transparent) 49%, color-mix(in srgb, var(--rm-scene-accent) 24%, transparent) 50%, transparent 51%);
  animation: rm-camera-scan 7s linear infinite;
  pointer-events: none;
}

#research-map .rm-scene-toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

#research-map .rm-scene-toolbar[hidden] { display: none; }

#research-map .rm-scene-toolbar button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  min-width: 0;
  min-height: 36px;
  padding: 7px 6px;
  border: 1px solid var(--control-border);
  border-radius: 6px;
  background: var(--control-idle-bg);
  color: var(--control-text);
  font: 500 14px/1.3 var(--font-sans);
  text-align: center;
  cursor: pointer;
}

#research-map .rm-scene-toolbar button:hover {
  border-color: var(--rm-color);
  background: var(--control-hover-bg);
}

#research-map .rm-scene-toolbar button:focus-visible {
  outline: 2px solid var(--rm-color);
  outline-offset: 2px;
}

#research-map .rm-scene-toolbar button:disabled { opacity: .5; cursor: default; }

#research-map .rm-scene-toolbar .rm-scene-tour[aria-pressed="true"] {
  border-color: var(--control-active-bg);
  background: var(--control-active-bg);
  color: var(--control-active-text);
}

#research-map .rm-scene-help {
  min-height: 18px;
  margin: 6px 2px 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

#research-map .rm-focus-readout {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

#research-map .rm-focus-ticks button[data-rm-preview] {
  background: rgba(255, 255, 255, .13);
  color: #fff;
}

#research-map .rm-axis:has(.rm-live-viewfinder[data-ready]) .rm-scene-capture {
  border-color: var(--rm-scene-accent);
  background: var(--rm-scene-accent);
  color: #233043;
  font-weight: 650;
}

#research-map .rm-axis:has(.rm-live-viewfinder[data-ready]) .rm-scene-capture:hover {
  background: color-mix(in srgb, var(--rm-scene-accent) 88%, white);
}

#research-map .rm-contact-sheet {
  margin-top: 7px;
  padding: 0;
  border: 0;
}

#research-map .rm-contact-sheet[hidden],
#research-map .rm-scene-reveal[hidden] { display: none; }

#research-map .rm-contact-sheet > .rm-contact-heading,
#research-map .rm-research-library > summary {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  margin: 0;
  padding: 6px 3px;
  border-radius: 4px;
  color: var(--control-text);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  list-style: none;
  cursor: pointer;
}

#research-map .rm-contact-sheet > summary::-webkit-details-marker,
#research-map .rm-research-library > summary::-webkit-details-marker { display: none; }

#research-map .rm-contact-sheet > summary::marker,
#research-map .rm-research-library > summary::marker { content: ""; }

#research-map .rm-contact-sheet > summary::after,
#research-map .rm-research-library > summary::after {
  content: "";
  flex: 0 0 6px;
  width: 6px;
  height: 6px;
  margin: -3px 3px 0 auto;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  opacity: .65;
}

#research-map .rm-contact-sheet[open] > summary::after,
#research-map .rm-research-library[open] > summary::after {
  margin-top: 3px;
  transform: rotate(225deg);
}

#research-map .rm-contact-sheet > summary:hover,
#research-map .rm-research-library > summary:hover { background: var(--control-hover-bg); }

#research-map .rm-contact-sheet > summary:focus-visible,
#research-map .rm-research-library > summary:focus-visible {
  outline: 2px solid var(--rm-color);
  outline-offset: 3px;
}

#research-map .rm-contact-sheet[open] > summary { margin-bottom: 5px; }

#research-map .rm-research-library {
  margin-top: 11px;
  padding-top: 3px;
  border-top: 1px solid var(--control-border);
}

#research-map .rm-research-library > .rm-header-controls {
  display: flex;
  justify-content: flex-end;
  min-height: 32px;
  margin-top: 8px;
}
#research-map .rm-research-library .rm-header-controls .rm-toggle-all { position: static; }

#research-map .rm-contact-sheet:not([open]) > :not(summary),
#research-map .rm-research-library:not([open]) > :not(summary) {
  display: none;
}

#research-map .rm-contact-progress {
  flex: none;
  margin-left: auto;
  color: var(--text-muted);
  font: 500 12px/1.4 var(--font-code);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

#research-map .rm-contact-sheet > summary::after { margin-left: 0; }

#research-map .rm-contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

#research-map .rm-contact-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 6px;
  min-width: 0;
  min-height: 72px;
  padding: 10px 11px;
  border: 1px dashed color-mix(in srgb, var(--rm-color) 40%, var(--bg-card));
  border-radius: 5px;
  background: var(--bg-card);
  color: var(--text-muted);
  font: 500 14px/1.35 var(--font-sans);
  text-align: left;
  cursor: pointer;
}

#research-map .rm-contact-card:hover {
  border-color: var(--rm-color);
  background: var(--control-hover-bg);
  color: var(--control-text);
}

#research-map .rm-contact-number {
  color: var(--text-muted);
  font: 500 11px/1.2 var(--font-code);
  font-variant-numeric: tabular-nums;
}

#research-map .rm-contact-label { overflow-wrap: anywhere; }

#research-map .rm-contact-card[data-discovered] {
  border-style: solid;
  border-color: color-mix(in srgb, var(--rm-scene-accent) 65%, var(--rm-color));
  background: color-mix(in srgb, var(--rm-scene-accent) 17%, var(--bg-card));
  color: var(--control-text);
}

#research-map .rm-contact-card[data-discovered] .rm-contact-number {
  color: var(--rm-color);
}

#research-map .rm-contact-card[aria-pressed="true"] {
  border-style: solid;
  border-color: var(--rm-color);
  box-shadow: inset 0 0 0 1px var(--rm-color);
}

#research-map .rm-contact-card:focus-visible {
  outline: 2px solid var(--rm-color);
  outline-offset: 2px;
}

#research-map .rm-scene-reveal {
  margin-top: 7px;
  padding: 9px 11px;
  border: 1px solid var(--control-border);
  border-left: 3px solid var(--rm-color);
  border-radius: 5px;
  background: var(--bg-card);
  color: var(--text-color);
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

#research-map .rm-reveal-topic {
  margin: 0 0 4px;
  font-size: 14px;
  line-height: 1.4;
}

#research-map .rm-reveal-topic strong { font-weight: 650; }
#research-map .rm-reveal-question { margin: 6px 0 0; color: var(--text-muted); font-size: 14px; line-height: 1.5; }

#research-map .rm-reveal-publications {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin-top: 9px;
}

#research-map .rm-reveal-group {
  min-width: 0;
  margin: 0;
  padding: 0;
}

#research-map .rm-reveal-group-title {
  margin: 0 0 4px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

#research-map .rm-reveal-paper-list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

#research-map .rm-reveal-paper-list > li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  line-height: 1.45;
}

#research-map .rm-reveal-paper {
  min-width: 0;
  max-width: 100%;
  color: var(--primary-hover);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: anywhere;
  text-underline-offset: 3px;
}

#research-map .rm-reveal-paper:hover { text-decoration: underline; }

#research-map .rm-reveal-venue {
  display: inline;
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
  white-space: normal;
}

@keyframes rm-camera-shutter {
  0% { opacity: 0; }
  15% { opacity: .7; }
  100% { opacity: 0; }
}

@keyframes rm-camera-scan {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}

@media (max-width: 900px) and (min-width: 701px) {
  #research-map .rm-axis-header { padding-inline: 10px; }
  #research-map .rm-axis-header h3 { font-size: 17px; }
  #research-map .rm-scene-topline { padding: 8px 9px 22px; font-size: 9px; }
  #research-map .rm-scene-caption { padding: 24px 9px 8px; }
}

@media (max-width: 540px) {
  #research-map .rm-axis-header { padding: 12px; }
  #research-map .rm-axis-header h3 { font-size: 18px; }
  #research-map .rm-scene-toolbar { gap: 5px; }
  #research-map .rm-scene-toolbar button { padding-inline: 4px; }
  #research-map .rm-scene-help { font-size: 12px; }
}

@media (max-width: 380px) {
  #research-map { padding-inline: 14px; }
  #research-map .rm-axis-header { padding-inline: 6px; }
  #research-map .rm-camera-display .rm-focus-scale { padding-inline: 2px; }
  #research-map .rm-camera-display .rm-focus-ticks { gap: 0; }
  #research-map .rm-camera-display .rm-lens-topic { font-size: 10px; }
}

@media (pointer: coarse) {
  #research-map .rm-camera-display .rm-focus-ticks button,
  #research-map .rm-camera-display .rm-focus-range,
  #research-map .rm-scene-toolbar button,
  #research-map .rm-contact-sheet > summary,
  #research-map .rm-research-library > summary { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  #research-map .rm-live-viewfinder::after,
  #research-map .rm-live-viewfinder .rm-scene-flash {
    animation: none !important;
  }
  #research-map .rm-scene-world { will-change: auto; }
}

@media print {
  #research-map .rm-scene-toolbar,
  #research-map .rm-scene-help,
  #research-map .rm-contact-sheet,
  #research-map .rm-scene-topline,
  #research-map .rm-live-viewfinder::after { display: none !important; }
  #research-map .rm-research-library > summary { display: none; }
  #research-map .rm-research-library::details-content { content-visibility: visible; }
  #research-map .rm-research-library:not([open]) > :not(summary) { display: block; }
  #research-map .rm-live-viewfinder { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
