#medical-cell { scroll-margin-top: 4.2rem; }
.medical-cell-art { position: relative; }
.medical-cell-lens {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* The red frame occupies x=173–342 and y=144–315 in the 506px square. */
.medical-cell-lens summary {
  position: absolute;
  left: 51%;
  top: 45.45%;
  transform: translate(-50%, -50%);
  width: 33.6%;
  height: 34%;
  min-width: 44px;
  min-height: 44px;
  display: block;
  list-style: none;
  pointer-events: auto;
  cursor: zoom-in;
}
.medical-cell-lens summary::-webkit-details-marker { display: none; }
.medical-cell-lens[open] summary { cursor: zoom-out; }
.medical-cell-lens summary:focus-visible {
  outline: 2px solid white;
  outline-offset: 2px;
  box-shadow: 0 0 0 6px #5a1824;
}
.medical-cell-action {
  position: absolute;
  left: 50%;
  bottom: calc(100% - 1px);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: .4em;
  padding: .28em .65em;
  border: 1px solid #f5d5c9;
  background: #611a29;
  color: #fff9ee;
  font: 640 clamp(.72rem, 1vw, .84rem)/1.35 var(--chapter-body, sans-serif);
  white-space: nowrap;
}
.medical-cell-action::before {
  content: "";
  width: .68em;
  height: .68em;
  background: linear-gradient(currentColor,currentColor) center/100% 2px no-repeat,
              linear-gradient(currentColor,currentColor) center/2px 100% no-repeat;
}
.medical-cell-lens[open] .medical-cell-action::before {
  background-size: 100% 2px, 0 0;
}
.medical-cell-hide, .medical-cell-lens[open] .medical-cell-show { display: none; }
.medical-cell-lens[open] .medical-cell-hide { display: inline; }
.medical-cell-detail {
  position: absolute;
  right: 2%;
  bottom: 2%;
  width: 47%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 50%;
  border: 3px solid #fff6e8;
  box-shadow: 0 0 0 2px #691e30, 0 4px 12px #30112252;
}
.gallery-slide .medical-cell-detail img {
  position: absolute;
  width: 420%;
  max-width: none;
  left: 50%;
  top: 50%;
  transform: translate(-51%, -45.5%);
  transform-origin: 51% 45.5%;
}
@media (prefers-reduced-motion: no-preference) {
  .medical-cell-lens[open] .medical-cell-detail img {
    animation: medical-cell-focus 210ms ease-out;
  }
  @keyframes medical-cell-focus {
    from { transform: translate(-51%, -45.5%) scale(.9); }
    to { transform: translate(-51%, -45.5%) scale(1); }
  }
}
/* A short phone leaves room beside the artwork for both views. */
@media (max-width: 600px) and (min-aspect-ratio: 4/7) {
  .medical-cell-detail {
    left: calc(100% + .8rem);
    right: auto;
    bottom: 50%;
    transform: translateY(50%);
    width: min(96%, calc(100vw - 2 * var(--gallery-gutter) - 100% - 1.5rem));
  }
}
@media print {
  .medical-cell-lens { display: none; }
}
