.heimu {
  --heimu-bg: #252525;
  --heimu-text: #f5f5f5;
  --heimu-link: #add8e6;
  position: relative;
  display: inline-block;
  max-width: 100%;
  padding: 0.02em 0.2em;
  border-radius: 4px;
  background-color: var(--heimu-bg);
  color: var(--heimu-text);
  vertical-align: baseline;
  cursor: pointer;
  touch-action: manipulation;
}

[data-theme="dark"] .heimu {
  --heimu-bg: #454b55;
  --heimu-text: #e5e9ef;
  --heimu-link: #b9dce5;
}

.heimu > .heimu-toggle {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  cursor: inherit;
}

.heimu > .heimu-toggle:focus-visible {
  outline: 2px solid var(--theme-color, #28c28c);
  outline-offset: 3px;
}

.heimu > .heimu-content {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

/* Opacity also conceals emoji, code backgrounds and coloured descendants. */
.heimu .heimu-content,
.heimu .heimu-content * {
  color: var(--heimu-text) !important;
  text-shadow: none !important;
}

.heimu .heimu-content a {
  color: var(--heimu-link) !important;
}

.heimu .heimu-content code {
  background-color: rgba(255, 255, 255, 0.08);
}

.heimu.is-revealed > .heimu-content {
  opacity: 1;
  pointer-events: auto;
}

.heimu.is-revealed > .heimu-toggle {
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .heimu > .heimu-content {
    transition: none;
  }
}
