/* Sandbox mode (?sandbox): a slim warning-coloured bar fixed under the header. */
.sandbox-bar {
  position: fixed;
  inset: calc(var(--header-height) + env(safe-area-inset-top)) 0 auto;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  height: var(--sandbox-height);
  padding: 0 var(--space-2);
  background: var(--warning);
  color: var(--on-warning);
  font-size: var(--text-sm);
}

.sandbox-bar[hidden] {
  display: none;
}

.sandbox-label {
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* Controls fill the bar's height so they stay comfortable tap targets. */
.sandbox-date,
.sandbox-reset,
.sandbox-exit {
  height: var(--sandbox-height);
  padding: 0 var(--space-2);
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
}

/* The date may shrink; reset and exit must always stay whole. */
.sandbox-date {
  flex: 0 1 auto;
  min-width: 0;
  margin-left: auto;
  color-scheme: light;
}

.sandbox-reset,
.sandbox-exit {
  flex: none;
}

.sandbox-exit {
  display: inline-flex;
  align-items: center;
}

/* On narrow phones the yellow bar alone signals test mode; the label stays for screen readers. */
@media (max-width: 400px) {
  .sandbox-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}
