.jupyter-matplotlib {
    width: auto;
    height: auto;
    flex: 1 1 auto;
}

/* Toolbar */

.jupyter-matplotlib-toolbar {
    position: absolute;
    overflow: visible;
    z-index: 100;
}

.jupyter-matplotlib-toolbar-fadein-fadeout {
    transition: visibility 0.5s linear, opacity 0.5s linear;
}

.jupyter-matplotlib-button {
    width: calc(var(--jp-widgets-inline-width-tiny) / 2 - 2px);
    padding: 0 !important;
}

/* Figure */

.jupyter-matplotlib-figure {
    width: fit-content;
    height: auto;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.jupyter-matplotlib-canvas-container {
    overflow: auto;
}

.jupyter-matplotlib-canvas-div {
    margin: 2px;
    flex: 1 1 auto;
}

.jupyter-matplotlib-header {
    width: 100%;
    text-align: center;
}

.jupyter-matplotlib-footer {
    width: 100%;
    text-align: center;
    min-height: var(--jp-widgets-inline-height);
}
