tb-stack, tb-scene, tb-pointer {
  display: block;
}

tb-stack {
  margin-block: 1rem;
  border: 1px solid var(--color-background-border, #aaa);
  border-radius: .4rem;
  padding: 1rem;
}

tb-scene {
  margin-block: 1rem;
}

tb-scene[hidden], .tb-stack__controls[hidden], .tb-scene__caption[hidden],
.tb-stack__scene-caption[hidden] {
  display: none;
}

.tb-stack__caption, .tb-scene__caption {
  font-weight: bold;
}

.tb-stack__controls {
  border-bottom: 1px solid var(--color-background-border, #aaa);
  padding-bottom: .75rem;
}

.tb-stack__scene-caption {
  margin: 0 0 .75rem;
}

.tb-stack__navigation {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: .5rem;
}

.tb-stack__controls button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 2.75rem;
  min-height: 2.75rem;
  cursor: pointer;
  font: inherit;
}

.tb-stack__controls button svg {
  width: 1.25rem;
  height: 1.25rem;
}

.tb-stack__controls button:disabled {
  cursor: default;
}

.tb-stack__controls button:focus-visible {
  outline: 2px solid var(--color-brand-primary, #1f6feb);
  outline-offset: 2px;
}

.tb-stack__status {
  margin: 0;
  padding-block: .5rem;
  white-space: nowrap;
}

.tb-pointer__marker {
  display: inline-flex;
  align-items: center;
  font-weight: bold;
}

.tb-pointer__marker--down {
  flex-direction: column;
}

.tb-pointer__marker--left {
  flex-direction: row-reverse;
  gap: .35rem;
}

.tb-pointer__arrow {
  font-size: 1.5rem;
  line-height: 1;
}

.tb-pointer__description--placed, .tb-stack__status-caption {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.tb-pointer__caption {
  display: block;
  font-size: .85em;
}

tb-array .tb-array__pointers > td, tb-array td.tb-array__pointers {
  border: none;
  vertical-align: bottom;
}

tb-array .tb-array__end {
  border-style: dashed;
  color: var(--color-foreground-secondary, #555);
}
