/* Inline "Run" / "Open in Playground" controls for ```prism blocks
   (see theme/prism-run.js). Both are green icon-buttons of the same family. */
.prism-run-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: -0.4rem 0 0.6rem 0;
}

.prism-run-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font: inherit;
  font-size: 0.82em;
  line-height: 1.4;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid #2c8a5d;
  border-radius: 6px;
  padding: 0.2rem 0.7rem;
  background: #2f6f4f;
  color: #fff;
}
.prism-run-btn:hover {
  background: #37865f;
}
.prism-run-btn:active {
  background: #296446;
}
.prism-run-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

/* "Open in Playground": same green family, slightly lighter to distinguish.
   Anchor needs link-state selectors to outrank the mdbook theme's a:link. */
.prism-run-open,
.prism-run-open:link,
.prism-run-open:visited,
.prism-run-open:hover {
  color: #fff !important;
  text-decoration: none;
}
.prism-run-open {
  background: #2a6147;
}
.prism-run-open:hover {
  background: #34795a;
}

.prism-run-ico {
  flex: 0 0 auto;
  display: block;
}

.prism-run-out {
  margin: 0 0 1rem 0;
  padding: 0.6rem 0.8rem;
  border-left: 3px solid #2f6f4f;
  background: var(--sidebar-bg, #14191f);
  color: var(--sidebar-fg, #c8c9db);
  white-space: pre-wrap;
  font-size: 0.85em;
  border-radius: 0 4px 4px 0;
}
.prism-run-out.prism-run-err {
  border-left-color: #c0392b;
  color: #e88;
}

/* A ghosted Run button: the example compiles but is not run inline. */
.prism-run-btn.prism-run-ghost {
  opacity: 0.5;
  cursor: not-allowed;
  background: #3a3f45;
  border-color: #4a5058;
}

/* Status pills: a small icon-only badge, one soft pastel per category, with the
   description on hover (title tooltip). Same size and shape for every state so
   the row of blocks reads consistently. */
.prism-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 1.45rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: help;
  font-size: 1rem;
  line-height: 1;
  font-weight: 600;
}

/* Instant styled tooltip above the pill on hover (the native `title` delay is
   too long and easy to miss). */
.prism-chip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: #12161c;
  color: #d6d8e0;
  border: 1px solid #333a44;
  border-radius: 6px;
  padding: 0.3rem 0.6rem;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
  z-index: 30;
}
/* A small arrow joining the bubble to the pill. */
.prism-chip::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #333a44;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
  z-index: 30;
}
.prism-chip:hover::after,
.prism-chip:hover::before {
  opacity: 1;
}
.prism-chip .prism-run-ico {
  flex: 0 0 auto;
  display: block;
  width: 15px;
  height: 15px;
}
.prism-chip-check {
  color: #9edcbf;
  background: rgba(122, 197, 164, 0.16);
  border-color: rgba(122, 197, 164, 0.34);
}
.prism-chip-cfail {
  color: #e8cf99;
  background: rgba(219, 189, 122, 0.16);
  border-color: rgba(219, 189, 122, 0.34);
}
.prism-chip-ignore {
  color: #b6bcc4;
  background: rgba(160, 168, 178, 0.14);
  border-color: rgba(160, 168, 178, 0.3);
}
.prism-chip-err {
  color: #eaa6a0;
  background: rgba(216, 138, 130, 0.16);
  border-color: rgba(216, 138, 130, 0.34);
}
.prism-chip-sig {
  color: #c7bcef;
  background: rgba(174, 160, 224, 0.16);
  border-color: rgba(174, 160, 224, 0.34);
}

/* The content-hash pill: a subdued, monospace sibling of the Σ badge. Auto width
   for the short digest, quiet grey so it reads as metadata, not a status. */
.prism-hash {
  width: auto;
  padding: 0 0.55rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #9aa0ab;
  background: rgba(160, 168, 178, 0.1);
  border-color: rgba(160, 168, 178, 0.22);
}

/* Copyable elements (hash pills) invite a click and confirm with a brief
   "Copied" bubble, reusing the chip tooltip machinery. */
.prism-copyable {
  cursor: pointer;
}
.prism-hash:hover {
  color: #c2c7d0;
  border-color: rgba(160, 168, 178, 0.4);
}
.prism-chip.prism-copied::after,
.prism-chip.prism-copied::before {
  opacity: 1;
}
