* { box-sizing: border-box; }

html {
  height: 100%;
}

body {
  margin: 0;
  font-family: system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
}

header {
  padding: 8px 12px;
  border-bottom: 1px solid #ccc;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

header button {
  padding: 6px 12px;
  cursor: pointer;
}

.main {
  flex: 1 1 0%;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

.sidebar {
  flex: 0 0 380px;
  max-width: 50vw;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  align-self: stretch;
}

.splitter {
  flex: 0 0 10px;
  align-self: stretch;
  cursor: col-resize;
  background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.08), transparent);
  touch-action: none;
}

.splitter:focus {
  outline: 2px solid #4c8bf5;
  outline-offset: -2px;
}

.splitter.is-dragging {
  background: rgba(76, 139, 245, 0.25);
}

#container {
  flex: 1 1 0%;
  min-width: 0;
  min-height: 0;
  position: relative;
}

#editor {
  display: block;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  padding: 8px;
  border: none;
  resize: horizontal;
}

.hint {
  font-size: 12px;
  color: #555;
}

.error {
  font-size: 12px;
  color: #8a1f1f;
  margin-left: auto;
  min-height: 1em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.footer {
  flex-shrink: 0;
  padding: 6px 12px;
  border-top: 1px solid #ccc;
  font-size: 12px;
  color: #666;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-credits a {
  color: #444;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-credits a:hover {
  color: #111;
}

.footer-sep {
  margin: 0 0.25em;
}

.footer-prevyo-events {
  font-weight: 600;
}

.footer-credits a.footer-github {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  vertical-align: middle;
}

.footer-credits a.footer-github:hover {
  color: #24292f;
}

.footer-github-icon {
  display: block;
}

.footer-version {
  font-variant-numeric: tabular-nums;
}

/* vis-network: node titles are plain text (not HTML); keep line breaks from \n */
div.vis-tooltip {
  white-space: pre-line;
}

@media (max-width: 900px) {
  .main {
    flex-direction: column;
    flex: 1 1 auto;
  }

  .sidebar {
    flex: 0 0 auto;
    max-width: none;
    border-bottom: 1px solid #ccc;
    align-self: stretch;
  }

  .splitter {
    display: none;
  }

  #editor {
    flex: 0 0 auto;
    min-height: 220px;
    height: 220px;
    resize: vertical;
  }
}

