.magicbean-media {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  overscroll-behavior: contain;
  background: #111;
  color: #f5f5f5;
}

.magicbean-media[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.magicbean-media-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--color-secondary-bg);
  color: var(--color-text);
}

#magicbean-media-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.magicbean-media-bar .ui.button {
  margin: 0;
}

.magicbean-media-content {
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  min-width: 0;
  min-height: 0;
  padding: 0.75rem;
}

.magicbean-media-content :is(img, video) {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.magicbean-media [hidden] {
  display: none;
}
