.microscope-heading {
  padding: clamp(1.25rem, 3vw, 2rem);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
}

.microscope-heading h2 {
  margin-bottom: 0.45rem;
  font-size: clamp(1.6rem, 3.5vw, 2.5rem);
  letter-spacing: -0.045em;
}

.microscope-heading p:last-child {
  max-width: none;
  margin-bottom: 0;
  color: var(--navy-650);
  font-size: 0.95rem;
}

.microscope-feedback-row {
  min-height: 74px;
  padding: 0.9rem clamp(1.25rem, 3vw, 2rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--line);
  background: #fbfdfa;
}

.microscope-feedback-row p {
  margin: 0;
  color: var(--navy-650);
  font-size: 1rem;
  font-weight: 750;
}

.microscope-feedback-row p.is-success {
  color: #216b43;
}

.microscope-feedback-row p.is-error {
  color: #a74448;
}

.microscope-workspace {
  padding: clamp(1rem, 3vw, 2rem);
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(360px, 1.3fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  border-top: 1px solid var(--line);
  background:
    linear-gradient(rgb(11 30 45 / 2%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(11 30 45 / 2%) 1px, transparent 1px),
    #fbfdfa;
  background-size: 30px 30px;
}

.microscope-controls {
  display: grid;
  align-content: start;
  gap: 1.2rem;
}

.microscope-control,
.range-control {
  display: grid;
  gap: 0.5rem;
  color: var(--navy-800);
  font-size: 0.96rem;
  font-weight: 800;
}

.microscope-control select {
  width: 100%;
  min-height: 3.15rem;
  padding: 0.65rem 2.4rem 0.65rem 0.85rem;
  border: 1px solid #cfe1d6;
  border-radius: 0.8rem;
  color: var(--navy-950);
  background: var(--surface);
  font: inherit;
}

.lens-control {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.lens-control legend {
  margin-bottom: 0.5rem;
  color: var(--navy-800);
  font-size: 0.96rem;
  font-weight: 800;
}

.lens-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.lens-button {
  min-height: 2.85rem;
  padding: 0.65rem 1rem;
  border: 1px solid #cfe1d6;
  border-radius: 999px;
  color: var(--navy-800);
  background: var(--surface);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 850;
  cursor: pointer;
  transition:
    border-color 150ms ease,
    color 150ms ease,
    background 150ms ease,
    transform 150ms ease;
}

.lens-button:hover {
  border-color: #28784c;
  background: #f0f9f3;
  transform: translateY(-1px);
}

.lens-button.is-selected {
  border-color: #28784c;
  color: white;
  background: #28784c;
}

.range-control > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.range-control output {
  min-width: 2.4rem;
  color: var(--navy-650);
  font-weight: 750;
  text-align: right;
}

.range-control input {
  width: 100%;
  accent-color: #28784c;
  cursor: pointer;
}

.range-control input:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.microscope-stage {
  min-width: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.85rem;
}

.microscope-view-shell {
  width: min(100%, 590px);
  aspect-ratio: 1;
  position: relative;
  overflow: hidden;
  border: 10px solid var(--navy-950);
  border-radius: 50%;
  background: #dcebe4;
  box-shadow:
    inset 0 0 0 3px rgb(255 255 255 / 65%),
    0 20px 45px rgb(11 30 45 / 18%);
}

#specimen-view {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  filter:
    brightness(var(--view-brightness, 1))
    blur(var(--view-blur, 2px));
  touch-action: none;
  transform: scale(1.02);
  user-select: none;
}

#specimen-view.is-dragging {
  cursor: grabbing;
}

.view-details {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy-950);
  font-size: 1rem;
  font-weight: 850;
}

.microscope-page button:focus-visible,
.microscope-page select:focus-visible,
.microscope-page input:focus-visible {
  outline: 3px solid var(--aqua-deep);
  outline-offset: 3px;
}

@media (max-width: 780px) {
  .microscope-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 1rem;
  }

  .microscope-workspace {
    grid-template-columns: 1fr;
  }

  .microscope-stage {
    grid-row: 1;
  }

  .microscope-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .microscope-feedback-row {
    align-items: stretch;
    flex-direction: column;
  }

  .microscope-feedback-row .reset-button {
    align-self: flex-start;
  }

  .microscope-controls {
    grid-template-columns: 1fr;
  }

  .microscope-view-shell {
    border-width: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lens-button {
    transition: none;
  }
}
