/* Branch-build staging indicator: the Unified Dashboard's corner badge, in the lab's own tokens.
   Fixed, so it takes no space from a full-screen surface; bottom-left on phones, bottom-right from 768px. */
.staging-watermark {
  position: fixed;
  z-index: 50;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 0.5rem);
  left: 0.5rem;
  display: flex;
  max-width: calc(100vw - 1rem);
  flex-direction: column;
  gap: 0.125rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid rgba(198, 52, 43, 0.7);
  border-radius: 0.5rem;
  background: rgba(253, 253, 252, 0.96);
  box-shadow: var(--shadow-sm);
  color: var(--danger);
  font-size: 10.5px;
  line-height: 1.25;
  pointer-events: none;
  user-select: none;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.staging-watermark .staging-commit {
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}
.staging-watermark .staging-built {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.staging-watermark .staging-close {
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
  display: flex;
  width: 1.5rem;
  height: 1.5rem;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(198, 52, 43, 0.5);
  border-radius: 999px;
  background: rgba(253, 253, 252, 0.95);
  box-shadow: var(--shadow-sm);
  color: var(--danger);
  font: 11px/1 var(--sans);
  cursor: pointer;
  pointer-events: auto;
  transition: background 0.12s, color 0.12s;
}
/* A 44px tap target around the 24px disc: the pseudo is the hit area, the visible button stays small. */
.staging-watermark .staging-close::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 999px;
}
.staging-watermark .staging-close:hover,
.staging-watermark .staging-close:focus-visible {
  background: var(--danger);
  color: var(--bg);
}
.staging-watermark .staging-close:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 2px;
}
/* On a phone the badge's two lines share one row, so the fixed badge is about 20px tall instead of 37px and clears the
   page's cards; both lines stay, and the close button keeps its 44px tap target. Desktop is unchanged. */
@media (max-width: 640px) {
  .staging-watermark {
    flex-direction: row;
    align-items: baseline;
    gap: 0.35rem;
    /* The close disc sits on the top-right corner and its 24px box reaches 16px into the badge: 1.3rem of right padding
       leaves the built time about 5px clear of the disc instead of touching it. */
    padding: 0.2rem 1.3rem 0.2rem 0.45rem;
    line-height: 1.15;
  }
  .staging-watermark .staging-built { font-size: 9.5px; }
}
/* At 320px the one-row badge must still fit calc(100vw - 1rem) with the wider right padding: the smaller built line is
   what buys the room (badge 302.6px of a 304px allowance), so the padding stays as set above. */
@media (max-width: 360px) {
  .staging-watermark .staging-built { font-size: 9px; }
}
@media (min-width: 768px) {
  .staging-watermark {
    right: 0.5rem;
    left: auto;
  }
}
