/* Shown on every page of the demo academy only. */
.jj-demo-badge {
  position: fixed;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2400;
  margin: 0;
  padding: 5px 12px;
  border-radius: var(--jj-radius-pill);
  background: var(--jj-warning-bg);
  color: var(--jj-warning-fg);
  border: 1px solid #f0cf85;
  font:
    600 12px/1.4 "Pretendard Variable",
    Pretendard,
    system-ui,
    sans-serif;
  box-shadow: 0 4px 14px rgb(25 38 63 / 12%);
  pointer-events: none;
  white-space: nowrap;
  max-width: calc(100vw - 24px);
  overflow: hidden;
  text-overflow: ellipsis;
}
@media print {
  .jj-demo-badge {
    display: none;
  }
}
.jj-demo-badge b {
  font-weight: 700;
}
@media (max-width: 640px) {
  .jj-demo-badge {
    top: auto;
    bottom: calc(76px + env(safe-area-inset-bottom));
    left: 12px;
    transform: none;
    padding: 3px 9px;
    font-size: 11px;
    opacity: 0.92;
  }
  .jj-demo-badge span {
    display: none;
  }
}

/* Family pages: a small inline pill above the header, never over content. */
body:has(#family-root) {
  display: flex;
  flex-direction: column;
}
body:has(#family-root) .jj-demo-badge {
  position: static;
  order: -1;
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transform: none;
  margin: 12px 16px 0;
  padding: 3px 10px;
  border-color: var(--jj-warning-bg);
  box-shadow: none;
  font-size: 12px;
  opacity: 1;
}
body:has(#family-root) .jj-demo-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
body:has(#family-root) .jj-demo-badge span {
  display: none;
}
body:has(#family-root) #family-root {
  width: 100%;
}
