.galaxy {
    margin-bottom: 0;
    width: 100%;
    max-width: 100%;
    overflow: visible !important;
    border: 1px solid var(--jp-border-color1);
    border-radius: 2px;
    background: var(--jp-layout-color0);
    font-size: 10pt;
}

/* Fixes CSS issues in JupyterLab 3.4 */
.galaxy *, .galaxy ::before, ::after {
    box-sizing: unset;
}

.galaxy .galaxy-header {
    background-color: var(--jp-layout-color4);
    color: #FFFFFF;
    padding: 7px;
}

.galaxy-logo {
    height: 20px !important;
    padding-right: 10px;
}

.galaxy-logo-hidden {
    visibility: hidden;
    width: 0;
}

.galaxy-title {
    margin: 0;
    line-height: 25px;
    position: absolute;
    font-size: 1.1em;
}

.galaxy-subtitle {
    position: absolute;
    right: 75px;
    text-align: right;
    line-height: 25px;
    font-size: 0.9em;
}

.galaxy-controls {
    position: absolute;
    right: 5px;
    top: 5px;
    text-align: right;
}

.galaxy-controls > button {
    border-width: 1px;
    width: 25px;
    padding-right: 0;
    padding-left: 0;
    height: 25px;
    border-radius: 2px;
    color: var(--jp-ui-font-color1);
    background-color: var(--jp-layout-color0);
    border-color: var(--jp-border-color2);
}

.galaxy-controls > button.galaxy-gear {
    width: 30px;
}

.galaxy-menu {
    display: block;
    position: absolute;
    top: 28px;
    right: 0;
    margin: 0;
    background: var(--jp-layout-color0);
    color: var(--jp-ui-font-color0);
    border: solid 1px var(--jp-border-color1);
    padding: 5px 0 5px 0;
    list-style-type: none;
    cursor: pointer;
    z-index: 4;
    white-space: nowrap;
}

.galaxy-menu > li {
    padding: 3px 10px 3px 10px;
}

.galaxy-menu > li:hover {
    background-color: var(--jp-layout-color2);
}

.galaxy-body {
    padding: 10px;
    position: relative;
}

.galaxy .galaxy-description {
    position: relative;
    left: -10px;
    top: -10px;
    width: 100%;
    background-color: var(--jp-layout-color2);
    padding: 10px;
}

.galaxy-toggle {
	display: block;
	height: auto;
	opacity: 1;
	overflow: hidden;
	transition: height 350ms ease-in-out, opacity 750ms ease-in-out;
}

.galaxy-toggle.galaxy-hidden {
	display: none;
	height: 0;
    min-height: 0;
	opacity: 0;
    overflow: hidden;
}

div.jp-Cell-inputWrapper.galaxy-hidden ~ div.jp-Cell-outputWrapper {
  margin-top: 30px;
}

.galaxy div.widget-box,
.galaxy div.widget-gridbox {
    overflow: visible !important;
}

.galaxy.jupyter-widgets-disconnected::before,
.galaxy .jupyter-widgets-disconnected::before {
    position: absolute;
}

.galaxy-disconnected {
    display: none;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--jp-ui-inverse-font-color3);
    z-index: 2;
}

.jupyter-widgets-disconnected > .galaxy-disconnected {
    display: block;
}

.galaxy-disconnected > .galaxy-panel {
    width: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
}

.galaxy-panel {
    margin-bottom: 0;
    width: 100%;
    max-width: 100%;
    overflow: visible !important;
    border: 1px solid var(--jp-border-color0);
    border-radius: 2px;
    background-color: var(--jp-layout-color1);
}

div.galaxy-connect,
div.galaxy-panel-button {
    text-align: center;
    margin-top: 10px;
}

button.galaxy-connect,
button.galaxy-panel-button {
    background-color: var(--jp-layout-color4);
    color: #FFFFFF;
    border: 1px solid var(--jp-border-color1);
    padding: 6px 12px;
    font-size: 0.9em;
    cursor: pointer;
}


/* Hack fix for floating menus */

div.jupyter-widgets,
.lm-Widget.jp-OutputPrompt.jp-OutputArea-prompt,
.lm-Widget.p-Widget.jp-OutputArea,
.lm-Widget.lm-Widget.jp-OutputArea,
.lm-Widget.lm-Panel.jp-OutputArea,
.lm-Widget.lm-Panel.jp-OutputArea-child,
.lm-Widget.lm-Panel.jp-OutputArea-output,
.lm-Widget.jp-OutputArea.jp-Cell-outputArea {
    overflow: visible !important;
}