* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  background: #0c0c14;
}

body {
  min-height: 100vh;
  margin: 0;
  background: #0c0c14;
  color: #f9fafb;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.diagram-viewer {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px;
}

.diagram-viewer-header {
  width: min(100%, 1840px);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
}

.diagram-viewer-header a {
  color: #f9fafb;
  font-size: 14px;
  text-decoration-color: rgba(249, 250, 251, 0.5);
  text-underline-offset: 3px;
}

.diagram-viewer-header a:hover,
.diagram-viewer-header a:focus-visible {
  text-decoration-color: currentColor;
}

.diagram-viewer h1 {
  margin: 0;
  font-size: clamp(16px, 2vw, 22px);
  letter-spacing: 0.04em;
  text-align: right;
}

#diagram-viewer-image {
  display: block;
  width: min(100%, 1840px);
  height: auto;
}

#diagram-viewer-image[hidden] {
  display: none;
}

#diagram-viewer-error {
  margin: auto;
  color: #f9fafb;
  font-size: 18px;
}

@media (max-width: 600px) {
  .diagram-viewer {
    padding: 14px;
  }

  .diagram-viewer-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .diagram-viewer h1 {
    text-align: left;
  }
}
