.editor-header {
    display: flex;
    align-items: center;
    width: 100%;
    height: 50px;
    margin: 0;
    padding: 15px;
    border-bottom: 1px solid var(--theme-dark-shadow-color);
    box-sizing: border-box;
}

.editor-header-left {
    width: 20%;
}

.editor-header-center {
    width: 60%;
}

.editor-header-right {
    width: unset;
}

.editor-header div {
    display: flex;
    justify-content: center;
    align-items: center;
}

.editor-header label {
    font-size: var(--font-size-l);
    font-weight: 600;
    text-align: center;
    width: 100%;
    cursor: pointer;
}

.editor-header button {
    display: flex;
    align-items: center;
    flex-direction: row;
    text-overflow: ellipsis;
    white-space: nowrap;
    border: 2px solid var(--theme-component-color-primary);
    background-color: var(--theme-component-color-primary-50);
    transition: all 0.2s;
    padding: 3px 10px;
    cursor: pointer;
    height: 32px;
    min-width: 42px;
    margin: 0 5px;
}

.editor-header button:hover {
    background-color: var(--theme-component-color-primary);
    border-color: var(--theme-component-color-primary-dark);
    text-decoration: none;
}

.editor-page {
    display: flex;
    flex-direction: row;
    justify-content: center;
}

.editor-page-content {
    display: block;
    box-sizing: border-box;
    margin: 50px  0 0 0;
    width: 100%;
    max-width: 1000px;
}

.editor-container {
    padding: 20px;
    position: relative;
    -webkit-user-select:none;
    -moz-user-select:none;
    -ms-user-select:none;
    user-select:none;
}

/*.editor-product-backdrop {*/
/*    position: relative;*/
/*    object-position: center;*/
/*    z-index: -10;*/
/*}*/

.editor-loader {
    position: absolute;
    left: 50%;
    top: 50%;

    width: 100px;
    height: 100px;

    display: none;
}

.editor-loader-image {
    width: 80px;
}

.editor-blocks {
    /*max-height: 80vh;*/
    /*aspect-ratio: 1;*/
}

.edit-zoom-container {
    overflow: hidden;
}

.edit-product-area {
    width: 100%;
    height: 100%;
    /*background-position: center;*/
    background-position: top;
    background-size: cover;
    background-repeat: no-repeat;

    border-radius: 5px;
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
    overflow: hidden;

    /*aspect-ratio: 1;*/
    display: flex;

    transition:  all 0.3s ease-in-out;
}

.edit-window {
    display: flex;
    width: 100%;
    position:relative;
    border: 1px solid #a0a0a0;
    border-radius: 4px;
    background-color: #eeeeee;
    overflow: hidden;
    box-sizing: border-box;
}

.edit-bg-target {
    position: absolute;
    top:0;
    left:0;
    width: 100%;
    height: 100%;
    z-index: 0;
    padding: 0;
    margin: 0;
    transform: scale(1.0);
}

.edit-fg-target {
    position: relative;
    top:0;
    left:0;
    width: 100%;
    height: 100%;
    z-index: 5;
    padding: 0;
    margin: 0;
    transform: scale(1.0);
}

.edit-mask-layer {
    position: relative;
    top:0;
    left:0;
    width: 100%;
    height: 100%;
    z-index: 5;
    padding: 0;
    margin: 0;
    transform: scale(1.0);
    mask-size: 100%;
}

.mask-image {
    position: relative;
    top:0;
    left:0;
    width:100%;
    /*height: 100%;*/
    z-index: 10;
    pointer-events: none;
}

/* Canvas */

#editor-canvas {
    width: 100%;
    height: 100%;
    outline: 1px solid #bbb;
    touch-action: none;
}

.drag-border-ol {
    position: absolute;
    pointer-events: none;
    border: 1px dashed white;
    mix-blend-mode: difference;
    z-index: 100;
    transform-origin: center center;
}

.dashed-border {
    /*width: 100px;*/
    /*height: 100px;*/
    /* dashed border */
    /*background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' stroke='%23333' stroke-width='4' stroke-dasharray='6%2c 14' stroke-dashoffset='0' stroke-linecap='square'/%3e%3c/svg%3e");*/
}

.items-panel {
    display: flex;
    flex-direction: column;
    padding: 10px;
    /*outline: 1px solid #bbb;*/
    /*border-radius: 4px;*/
    margin: 0 10px 0 0;
    transition: all 0.5s;
}

.items-panel button {
    height: 44px;
    width: 88px;

    padding: 4px 4px;
    margin: 5px 5px 0 0;
    transition: all 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    background-color: var(--theme-light-shadow-color);
    border: 1px solid var(--theme-dark-shadow-color);
    border-radius: 50px;
}

.items-panel button:hover {
    /*background-color: var(--theme-component-color-primary-25);*/
    color: var(--theme-component-color-primary-dark);
}

#panel-control  {
    display: none;
}

#panel-tray {
    padding-bottom: 10px;
}

.panel-tray-hide {
    display: block;
}

.items-panel label {
    font-size: var(--font-size-xs);
}

.ctrl-panel {
    display: flex;
    flex-direction: row;
    padding: 10px;

    /*outline: 1px solid #bbb;*/
    border-radius: 4px;
    margin: 10px 0 0 0;

    flex-wrap: nowrap;
}

.ctrl-panel input[radio] {

}

.ctrl-panel input[range] {

}

/* Element */

.element {
    cursor: grab;
    padding: inherit;
}

.element-active {
    cursor: grabbing;
}

.selected {
    outline: 1px dotted dodgerblue;
}

.text-element {
    white-space: nowrap;
}

.image-element {
    mix-blend-mode: multiply;
}

.background-element {
    z-index: 0;
}

.foreground-element {
    z-index: 20;
}

/* Dialog(s) */

.dlg {
    min-width: 100px;
    min-height: 200px;

    max-width: 600px;
    max-height: 380px;

    background: #fff;
    color: #111;
    color-scheme: light;

    input {
        color: #111;
        background: #fff;
    }

    textarea {
        color: #111;
        background: #fff;
    }
}

.dlg button {
    width: 50px;
    padding: 5px;
    margin: 5px;
}

.dlg-content {
    width: 100%;
    height: 100%;
    padding: 10px;
    box-sizing: border-box;
}

.dlg-textbox {
    width: 100%;
    font-size: 1.5em;
    padding: 8px;
    margin: 5px;
    box-sizing: border-box;
}

.dlg-selector {
    width: 100%;
    font-size: 1em;
    margin: 5px;
}

.dlg-color-picker {
    width: 100%;
    height: 40px;
    margin: 5px;
}

.dlg-btn-container {
    display: flex;
    align-self: end;
    justify-content: end;
    width: 100%;
    margin: 5px;
}

.dlg-ctrl-container {
    display: flex;
    flex-direction: column;
    margin: 10px 0 0 0;
}

.dlg-ctrl-container label {
    font-size: var(--font-size-l);
    font-weight: var(--font-weight-bold);
}

/* Stamp dialog */

.dlg-scroll-container {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    height: 100%;
    overflow-y: scroll;
}

.dlg-scroll-container img {
    aspect-ratio: auto;
    object-fit: contain;
    border: 1px solid lightgray;
    border-radius: 3px;
    margin: 3px;
    padding: 3px;
    width: 100px;
    height: 100px;
}

.dlg-scroll-container img:hover {
    border: 1px solid black;
    cursor: pointer;
}

/* Help dialog */

.hlp-dlg {
    box-sizing: border-box;
    width: fit-content;
    height: fit-content;

    background: #fff;
    color: #111;
    color-scheme: light;

    input {
        color: #111;
        background: #fff;
    }
}

.hlp-dlg-control-container {
    margin: 5px 0 0 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: right;
}

.hlp-dlg-title-container {
    margin: 5px 0 0 0;
    display: flex;
    flex-direction: row;
    align-items: center;
}

.hlp-dlg-title-container h3 {
    margin: 10px 0 4px 8px;
}

.hlp-dlg-text-container {
    margin: 5px 0 0 0;
    display: flex;
    flex-direction: column;
}

.hlp-dlg-text-container label {
    margin: 5px 5px 0 0;
}

.hlp-dlg label {
    margin: 5px 0 0 0;
}

.hlp-dlg-button {
    display: flex;
    align-items: center;
    flex-direction: row;
    text-overflow: ellipsis;
    white-space: nowrap;
    border: 2px solid var(--theme-component-color-primary);
    background-color: var(--theme-component-color-primary-50);
    transition: all 0.2s;
    padding: 3px 10px;
    cursor: pointer;
}

.hlp-dlg-button:hover {
    background-color: var(--theme-component-color-primary);
    border-color: var(--theme-component-color-primary-dark);
    text-decoration: none;
}

/* Suggestion dialog */

.suggest-dlg {
    /*min-width: 100px;*/
    /*min-height: 200px;*/

    /*max-width: 600px;*/
    /*max-height: 400px;*/

    box-sizing: border-box;
    width: fit-content;
    height: fit-content;

    background: #fff;
    color: #111;
    color-scheme: light;

    input {
        color: #111;
        background: #fff;
    }
}

.suggest-dlg button {
    width: 100%;
    padding: 5px;
    margin: 10px 0 0 0;

    font-size: var(--font-size-l);
    font-weight: 600;
    cursor: pointer;
}

.suggest-dlg-content {
    width: 100%;
    padding: 0;
    margin: 10px 0 0 0;
    box-sizing: border-box;
    font-size: var(--font-size-xxl);
}

.suggest-dlg-content label {
    margin: 2px 8px 2px 0;
    font-size: var(--font-size-m);
    font-weight: 600;
}

.suggest-dlg-instruction-container {
    margin: 5px 0 0 0;
}

.suggest-dlg-instruction-container label {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-normal);
}

.suggest-dlg-selector {
    width: 100%;
    font-size: 1em;
    margin: 2px 0;
}

.suggest-dlg-textbox {
    width: 100%;
    font-size: 1em;
    padding: 5px;
    margin: 5px 0;
    box-sizing: border-box;
}

/* Set placeholders dialog */

.set-dlg {
    /*min-width: 100px;*/
    /*min-height: 200px;*/

    /*max-width: 600px;*/
    /*max-height: 400px;*/

    box-sizing: border-box;
    width: fit-content;
    height: fit-content;

    background: #fff;
    color: #111;
    color-scheme: light;

    input {
        color: #111;
        background: #fff;
    }
}

.set-dlg-button {
    display: flex;
    align-items: center;
    flex-direction: row;
    text-overflow: ellipsis;
    white-space: nowrap;
    border: 2px solid var(--theme-component-color-primary);
    background-color: var(--theme-component-color-primary-50);
    transition: all 0.2s;
    padding: 3px 10px;
    cursor: pointer;
    height: 32px;
    min-width: 42px;
    margin: 0 5px;

    width: 100%;
    justify-content: center;

    font-size: var(--font-size-xl);
    font-weight: 600;
}

.set-dlg-button:hover {
    background-color: var(--theme-component-color-primary);
    border-color: var(--theme-component-color-primary-dark);
    text-decoration: none;
}

.set-dlg-content {
    width: 100%;
    padding: 0;
    margin: 10px 0 30px 0;
    box-sizing: border-box;
    /*font-size: var(--font-size-xxl);*/
}

.set-dlg-title-container {
    margin: 5px 0 0 0;
    display: flex;
    flex-direction: row;
    align-items: center;
}

.set-dlg-title-container h3 {
    margin: 10px 0 4px 8px;
}

.set-dlg-text-container {
    margin: 10px 0 20px 0;
    display: flex;
    flex-direction: column;
}

.set-dlg-container {
    margin: 5px 0 0 0;
    display: flex;
    align-items: center;
}

.set-dlg-placeholder-container {
    margin: 10px 0 0 0;
    display: flex;
    align-items: baseline;
}

.set-dlg-placeholder-bullet {
    margin: 0;
    flex-grow: 0;
}

.set-dlg-placeholder-container-prompt {
    margin: 0 0 0 10px;
    flex-grow: 0;
}

.set-dlg-placeholder-container input {
    padding: 3px 5px;
    margin: 0 0 0 20px;
    flex-grow: 1;
    max-width: 50%;
}

.set-dlg-placeholder-container label {}

.set-dlg-instruction-container label {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-normal);
}

/* Preview dialog */

.preview-dlg {
    /*min-width: 100px;*/
    /*min-height: 200px;*/

    /*max-width: 600px;*/
    /*max-height: 400px;*/

    box-sizing: border-box;
    width: fit-content;
    height: fit-content;

    background: #fff;
    color: #111;
    color-scheme: light;

    input {
        color: #111;
        background: #fff;
    }
}

.preview-dlg-button {
    display: flex;
    align-items: center;
    flex-direction: row;
    text-overflow: ellipsis;
    white-space: nowrap;
    border: 2px solid var(--theme-component-color-primary);
    background-color: var(--theme-component-color-primary-50);
    transition: all 0.2s;
    padding: 3px 10px;
    cursor: pointer;
    height: 32px;
    min-width: 42px;
    width: 30%;
    justify-content: center;
    font-size: var(--font-size-xl);
    font-weight: 600;
    margin: 0 auto;
}

.preview-dlg-button:hover {
    background-color: var(--theme-component-color-primary);
    border-color: var(--theme-component-color-primary-dark);
    text-decoration: none;
}

.preview-dlg-content {
    width: 100%;
    padding: 0;
    margin: 10px 0 30px 0;
    box-sizing: border-box;
}

.preview-dlg-figure-container {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

.preview-dlg-figure-container figure {
    display: flex;
    flex-direction: column;
    margin: 0;
}

.preview-dlg-figure-container img {
    max-width: 250px;
    border-radius: 5px;
    margin: 0 0 10px 0;
}

.preview-dlg-title-container {
    margin: 5px 0 0 0;
    display: flex;
    flex-direction: row;
    align-items: center;
}

.preview-dlg-title-container h3 {
    margin: 10px 0 4px 8px;
}

.preview-dlg-text-container {
    margin: 10px 0 20px 0;
    display: flex;
    flex-direction: column;
}

.preview-dlg-container {
    margin: 5px 0 0 0;
    display: flex;
    align-items: center;
}

.preview-dlg-placeholder-container {
    margin: 10px 0 0 0;
    display: flex;
    align-items: baseline;
}

.preview-dlg-instruction-container label {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-normal);
}

/* Media queries */

@media only screen and (max-width: 800px) {
    body {
        touch-action: none;
    }

    .items-panel {
        margin: 10px 0;
        /*flex-direction: column;*/
        justify-content: center;
        flex-wrap: wrap;
        /*background-color: var(--theme-base-color);*/
        /*border: 1px solid var(--theme-light-shadow-color);*/
        /*border-radius: var(--theme-border-radius);*/

        position: absolute;
        top: -60px;
        z-index: 99999;

        padding: 6px;

        background-color: var(--theme-light-shadow-color);
        border: 1px solid var(--theme-dark-shadow-color);
        border-radius: 40px;
    }

    .items-panel button {
        padding: 2px;
        margin: 2px 2px 2px 2px;
        height: 25px;
        width: 30px;

        border: none;
        background: none;
    }

    #panel-tray button {
        height: 40px;
    }

    #panel-control  {
        display: flex;
    }

    .panel-tray-hide {
        display: none;
    }

    .editor-blocks {
        /*max-height: unset;*/
        flex-direction: column-reverse;
    }

    .editor-container {
        padding: 5px;
    }

    .ctrl-panel {
        flex-wrap: wrap;
    }

    .hlp-dlg {
        width: 90%;
    }

    .set-dlg {
        width: 90%;
    }

    .set-dlg-content {
        /*font-size: var(--font-size-xxl);*/
    }

    .preview-dlg-figure-container {
        flex-direction: column;
        align-items: center;
        max-height: 45vh;
        overflow-y: scroll;
    }

    .preview-dlg-figure-container figure {
        flex-direction: column;
        width: 100%;
        align-items: center;
    }
}