*, *::before, *::after {
  box-sizing: border-box;
}

body {
  padding: 8px;
}

.klipse-snippet-container {
  margin-bottom: 12px;
}

.klipse-snippet-wrapper {
  overflow: auto;
  word-wrap: normal;
}

/* Raw code shown while Klipse loads */
.klipse-snippet-wrapper > pre {
  margin: 0;
  padding: 10px 14px;
  font-family: var(--font-code);
  font-size: 18px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
}

/* The mention closes the block: the result above it loses its bottom radius. */
.klipse-snippet-container .klipse-result .cm-s-klipse-dark.CodeMirror {
  border-radius: 0;
}

.mention {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
}

.mention a {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.mention a:hover {
  text-decoration: underline;
}

.mention .edit {
  padding: 3px 10px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
}

.mention .edit:hover {
  background: var(--hover);
  border-color: var(--text);
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.klipse-snippet-container .klipse-container:has(canvas) {
  border-radius: 0;
}
