.highlight.force-wrap pre code {
    white-space: pre-wrap !important;
    word-break: break-all !important;
}

.highlight { position: relative; }

.code-expand-btn {
  position: absolute;
  top: 0.4rem;
  right: 2.1rem;
  z-index: 1;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--md-default-fg-color--lighter);  /* faint by default */
  border-radius: 0.2rem;
  padding: 0 0.2rem;
  font-size: 1rem;
  line-height: 1.5;
  transition: color 0.25s;
}

.code-expand-btn {
  color: var(--md-default-fg-color--lighter);   /* resting */
  transition: color 0.25s;
}

:hover > .code-expand-btn {
  color: var(--md-default-fg-color--light);      /* block hover */
}

.code-expand-btn:hover {
  color: var(--md-accent-fg-color);              /* direct hover → blue */
}

.code-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 2rem;
}
.code-modal {
  background: var(--md-code-bg-color);
  width: 95vw;
  max-width: 95vw;
  max-height: 90vh;
  overflow: auto;
  border-radius: 0.2rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}
.code-modal .highlight { margin: 0; }