:root{
    --panel-size: clamp(680px, 80vw, 980px);
}

html, body { margin: 0; height: 100%; background: #fff; }
#app { position: fixed; inset: 0; width: calc(100vw - var(--panel-size)); height: 100vh;}

*[hidden],
.tabs,
.panel[hidden]{
    display: none;
}

body.designer-box:before,
body.layout-designer:before,
body.designer:before{
    content: '';
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background: #000;
    opacity: 0.3;
    z-index: 3;
}


#editorPanel{
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
}

button.outlined{
    border: 1px solid #e0e0e0;
    background: transparent;
    color: #000;
}

.swal-footer .swal-button.swal-button--checkout:hover,
.swal-footer .swal-button.swal-button--checkout{
    background-color: transparent;
}



button.outlined:hover{
    background: #e0e0e0;
}

button.warning{
    background: #FFC107;
}

.separator{
    height: 1px;
    border-radius: 10em;
    width: 80%;
    margin: 8px auto;
    background: #e0e0e0;
}

input[disabled]{
    opacity: .5;
}
#app{
    border-right: 1px solid #f0f0f0;
}

.layersBox,
.canvasBox{
    border: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0;
}


/*
.canvasBox .preview-and-controlls canvas{
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}
*/

.canvasBox{
    flex-direction: row;
    align-items: center;
    /*align-items: flex-start;*/
}

.panel{
    border-radius: 12px;
    padding: 2px;
    display: block;
    width: 100%;
    box-sizing: border-box;
    border: 0;
    background: #fff;
}

#wrapEditorCanvas{
    width: 100%;
    height: auto;
}

.modeRow{
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: sticky;
    top: 16px;
    padding-left: 16px;
    z-index: 2;
}

.fieldRow,
.sliderRow{
    width: 100%;
}

.background-tools{
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-content: center;
    align-items: center;
}
.hud {
    width: var(--panel-size);
    overflow: hidden;
    overflow-y: auto;
    height: calc(100vh - 28px);
    right: auto;
    left: 16px;
    top: 16px;
    max-height: calc(100vh - 16px);
    background: rgba(255, 255, 255, .60);
}

.hud > .panel{
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    height: 100%;
    overflow: hidden;
    overflow-y: auto;
}

#editorCanvas{
    aspect-ratio: auto;
    width: inherit;
    max-width: unset;
    height: inherit;
    width: 100%!important;
    height: auto;
}

#panel1 {
    display: flex;
    align-items: center;
}

.editorWrap,
.editorGrid {
    display: flex;
    grid-template-columns: 320px 1fr;
    gap: 10px;
    align-items: start;
    flex-direction: column;
    flex-wrap: wrap;
    flex: 0 0 100%;
}

.editorWrap{
    margin: 0;
}

.configuration-options{
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}


button, select,
input[type="color"],
input[type="text"],
input[type="number"]{
    border-radius: 6px;
    width: 100%;

}

select,
input[type="color"],
input[type="text"],
input[type="number"]{
    background-color: #f0f0f0;
}

input[type="number"]{
    padding-right: 0;
    width: 48px;
    min-width: 48px;
    max-width: 48px;
}


button{
    box-shadow: none;
    border-radius: 10em;
    font-size: 16px;
    font-weight: 400;
}

.cover-panel-title .as-btn{
    display: none;
}

.as-btn:hover,
button:hover{
    transform: scale(1.05);
}

.cover-panel-title .as-btn:hover{
    transform: translate(120%, 0) scale(1.05);
}

.cover-panel-title .as-btn:active{
    transform: translate(120%, 0) scale(0.95);
}

.as-btn:active,
button:active{
    transform: scale(0.95);
}

input[type="text"]{
    width: 100%;
}

input[type="color"]{
    height: 32px;
    width: 48px;
    padding: 0 2px;
    border-radius: 6px;
    min-width: 48px;
    min-height: 39px;
    cursor: pointer;
}

input[type="range"] + span{
    min-width: 50px;
    max-width: 50px;
    margin: 4px 0;
}

.pill{
    border-radius: 4px;
}

.controlls{
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    row-gap: 64px;
    padding: 0 16px 0 32px;
    width: 40%;
    position: sticky;
    top: 16px;
}

.add-text-and-images-wrapper{
    width: 100%;
}

.controlls .row{
    display: flex;
    flex-direction: row;
    gap: inherit;
    align-items: flex-start;
    width: 100%;
}

.controlls .row.borders{
    width: 100%;
    row-gap: 0;
}

.controlls .row > *{
    display: flex;
    flex-direction: row;
    gap: inherit;
}


.font-tools > .col{
    flex: 0 0 100%;
}

.font-tools gs-fonts,
.text-and-color input[type="text"]{
    flex: 0 0 150px;
}

.controlls .layer-list,
.controlls .text-and-color{
    display: flex;
    flex-direction: row;
    align-content: center;
    align-items: center;
    flex: 0 0 100%;
}

.controlls .layer-list{
    flex: 0 0 100%;
}

.layersList {
    width: 100%;
}

.layer-list-controlls{
    display: flex;
    flex-direction: column;
    row-gap: 4px;
    position: absolute;
    right: 12px;
}

.controlls .row.layersBox{
    align-items: center;
}

.layer-list-controlls > button{
    border: 0;
    padding: 0;
    margin: 0;
    height: 12px;
}

.layerItem{
    border-radius: 3px;
    padding: 0.5em 1em;
}

.layerName{
    white-space: normal;
    line-height: 1;
}

.layerItem.active{
    border: 1px solid #2196F3;
    box-shadow: none;
}

.layerItem button .icon,
.layerItem button{
    border: 0;
    height: 0.8em;
    width: 0.8em;
    font-size: 0.8em;
    cursor: pointer;
}

#closePanel{
    font-family: sans-serif;
    position: absolute;
    top: 0;
    right: 1em;
    width: 1em;
    height: 1em;
    line-height: 1;
    padding: 0;
    font-size: 16px;
    background: transparent;
    color: #000;
    border: 0;
    box-shadow: none;
    transition: transform 0.1s ease-in-out;
}

#closePanel svg{
    vector-effect: non-scaling-stroke;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

#closePanel:hover{
    transform: scale(1.2) rotate(90deg);
}

#closePanel:active{
    transform: scale(0.95) rotate(0deg);
}

.controlls .row > .as-flex-row-centered{
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.edge-borders-color-wrapper{
    --width: 32px;
    --height: 32px;
    --spine: 8px;
    width: var(--width);
    height: var(--height);
    position: relative;
    margin: 48px auto 0;
}

.edge-borders-color-wrapper input{
    position: absolute;
    visibility: hidden;
}

.edge-borders-color-wrapper .border{
    width: var(--width);
    height: var(--spine);
    position: absolute;
    border: 1px solid #999;
    margin: 0;
    cursor: pointer;
}

.edge-borders-color-wrapper .border:hover{
    border-color: #2196F3;
}

.edge-borders-color-wrapper .border.lato-cover{
    width: var(--width);
    height: var(--height);
    position: relative;
}


.edge-borders-color-wrapper .border.lato-1{
    transform: translate(0, calc(-100% - 1px));
}

.edge-borders-color-wrapper .border.lato-2{
    transform-origin: 0 0;
    left: var(--width);
    width: var(--height);
    transform: rotate(90deg) translate(0, calc(-100% - 1px));
}

.edge-borders-color-wrapper .border.lato-3{
    top: var(--height);
    transform: translate(0, 1px);
}

.edge-borders-color-wrapper .border.lato-4{
    transform-origin: 0 0;
    left: 0;
    width: var(--height);
    transform: rotate(-90deg) translate(-100%, calc(-100% - 1px));
}

.edge-borders-color-wrapper .clear{
    width: 12px;
    height: 12px;
    position: absolute;
    cursor: pointer;
    border-radius: 10em;
    background: transparent;
    font-size: 8px;
    text-align: center;
    line-height: 12px;
    color: #666;
    outline: 1px solid #ccc;
}

.edge-borders-color-wrapper .clear:hover{
    background: #f00;
    color: #fff;
}

.edge-borders-color-wrapper .clear[data-position='top']{
    left: 50%;
    top: 0;
    transform: translate(-50%, calc(-1 * var(--spine) - 26px));
}

.edge-borders-color-wrapper .clear[data-position='left']{
    transform: translate(calc(-1 * var(--spine) - 26px), -50%);

    top: 50%;
    left: 0;
}

.edge-borders-color-wrapper .clear[data-position='right']{
    right: 0;
    top: 50%;
    transform:  translate(calc(var(--spine) + 26px), -50%);
}

.edge-borders-color-wrapper .clear[data-position='bottom']{
    bottom: 0;
    left: 50%;
    transform:  translate( -50%, calc(var(--spine) + 26px));
}

.edge-borders-color-wrapper[data-labbratura="false"] .clear,
.edge-borders-color-wrapper[data-labbratura="false"] .border.lato-1,
.edge-borders-color-wrapper[data-labbratura="false"] .border.lato-2,
.edge-borders-color-wrapper[data-labbratura="false"] .border.lato-3,
.edge-borders-color-wrapper[data-labbratura="false"] .border.lato-4{
    display: none!important;
}


.swal-content .icon{
    display: block;
    margin: 2rem auto 1rem;
}

.swal-icon:first-child {
    margin-top: 0;
    transform: translate(0, 12px) scale(0.7);
    transform-origin: 50% 100%;
}

.swal-icon{
    -webkit-animation: none!important;
    animation: none!important;
}

.swal-title{
    color: #000;
}

.swal-content .info{
    font-size: 1rem;
    line-height: 1.2em;
}

.swal-content progress {
    margin: 1rem auto;
}

.swal-footer{
    display: flex;
    justify-content: center;
}

.swal-footer .swal-button {
    background-color: #000;
    border-radius: 10em;
}

.swal-footer .swal-button:hover {
    background-color: #000;
    opacity: 0.8;
}