/* Multi-line code blocks */
pre {
  white-space: pre-wrap !important;
  word-wrap: break-word !important;
  max-width: 100%;
  overflow-x: hidden !important;
  position: static !important; /* Change to static to remove from stacking context */
}

pre code {
  white-space: pre-wrap !important;
  word-break: break-word !important;
  width: 100%;
  display: inline-block;
  position: static !important;
}

/* Inline code blocks */
p code {
  white-space: normal !important;
  word-break: normal !important;
  width: auto !important;
  display: inline !important;
  background-color: rgba(175, 184, 193, 0.2);
  padding: 0.2em 0.4em;
  border-radius: 6px;
}

/* Target the popup container specifically */
div[role="dialog"],
.md-dialog,
.md-tooltip,
.md-overlay {
  position: relative !important;
  z-index: 100000 !important; /* Very high z-index */
}

/* Ensure code blocks inside popups behave properly */
div[role="dialog"] pre,
.md-dialog pre {
  position: relative !important;
  z-index: 1 !important;
}