.diagram-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.diagram-viewer-button {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--navy);
  cursor: pointer;
  touch-action: manipulation;
}

.diagram-viewer-button:hover {
  border-color: var(--navy);
}

html:has(.diagram-viewer[open]) {
  overflow: hidden;
}

.diagram-viewer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--navy);
  color: #fff;
}

.diagram-viewer[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.diagram-viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px clamp(12px, 3vw, 32px);
}

.diagram-viewer-bar h2 {
  font-size: clamp(16px, 2.5vw, 22px);
  letter-spacing: normal;
}

.diagram-viewer-image {
  display: grid;
  place-items: center;
  min-width: 0;
  padding: 8px clamp(12px, 3vw, 32px) 20px;
}

.diagram-viewer-image img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}
