.inwindow {
    position: absolute;
    background: #FFFFFF;
    /*border: 1px solid #EEEEEE;*/
    border-radius: 3px;
    display: flex;
    flex-flow: column;
    box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.4);
    overflow: visible;
    border: 1px solid #BBB;
    z-index: 9997;
}

    .inwindow.ontop {
        z-index: 9998;
    }

    .inwindow:not(.ontop) {
        filter: brightness(90%);
    }

    /*.inwindow:not(.ontop) .inwindow-wrap {
        filter: blur(2px) opacity(90%);
    }*/

.inwindow.max {
    border: none;
    box-shadow: none;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
}

.inwindow-top {
    width: 100%;
    height: 35px;
    border-bottom: 2px solid #DDDDDD;
    flex: 0 0 35px;
    background: #FFFFFF;
    display: flex;
    flex-flow: row;
    cursor: move;
    touch-action: none;
    box-sizing: border-box;
}

.inwindow-toolbar {
    flex: 0 0 35px;
    height: 35px;
    background: #FFF;
    border-top: 1px solid #DDD;
    display: flex;
    align-items: center;
    flex-flow: row-reverse;
    padding: 3px 20px 3px 0;
    box-sizing: border-box;
}

    .inwindow-toolbar * {
        margin-left: 10px;
        vertical-align: middle;
    }

    .inwindow-toolbar button {
        height: 100%;
    }

.inwindow-title {
    width: 100%;
    min-width: 0px;
    height: 35px;
    flex: 1 1 auto;
    text-align: center;
    font-size: 18px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    flex-direction: column;
    justify-content: center;
    white-space: nowrap;
    -webkit-touch-callout: none; /* iOS Safari */
    -webkit-user-select: none; /* Safari */
    -khtml-user-select: none; /* Konqueror HTML */
    -moz-user-select: none; /* Firefox */
    -ms-user-select: none; /* Internet Explorer/Edge */
    user-select: none; /* Non-prefixed version, currently
                          supported by Chrome and Opera */
    pointer-events: none;
}

.inwindow-button {
    width: 35px;
    height: 35px;
    flex: 0 0 35px;
    display: table-cell;
    text-align: center;
    vertical-align: middle;
    border-left: 1px solid #DDDDDD;
    cursor: default;
}

.inwindow-button.close:hover {
    background-color: #ff4040 !important;
}

.inwindow-button.min:hover, .inwindow-button.max:hover {
    background-color: #D9D9D9 !important;
}

.inwindow-button.close {
    background: url(../resources/images/close.png) no-repeat 50% 50%;
    background-size: 75%;
}

.inwindow-button.max {
    background: url(../resources/images/fullscreen.png) no-repeat 50% 50%;
    background-size: 75%;
}

    .inwindow.max .inwindow-button.max {
        background-image: url(../resources/images/windowed.png);
    }

.inwindow-button.min {
    background: url(../resources/images/windowed.png) no-repeat 50% 50%;
    background-size: 75%;
}

.inwindow-wrap {
    width: 100%;
    height: 100%;
    display: flex;
    position: relative;
    overflow: hidden;
}

.inwindow.full .inwindow-wrap {
    height: calc(100% - 32px);
}

.inwindow:not(.ontop) .inwindow-wrap {
    pointer-events: none;
}

.inwindow-content {
    flex: 1 0 0;
    background: white;
    overflow: hidden;
    background-origin: content-box;
    /*font-size: 150%;*/
    height: 100%;
    /*padding: 10px;*/
    position: relative;
}

.inwindow-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    box-sizing: border-box;
}

.inwindow-content iframe {
    padding: 0;
    border: 0;
    width: 100%;
    min-height: 100%;
    display:block;
}

.inwindow-image-wrap {
    position: absolute;
    background-color: white;
}

.inwindow-image-wrap img, .inwindow-image-wrap canvas {
    position: absolute;
    width: 100%;
    height: 100%;
}

.inwindow-loading {
    width: 100%;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    background-color: white;
    background-image: url(../resources/images/loading.gif);
    background-repeat: no-repeat;
    background-position: 50%;
    z-index: 9999;
}

.inwindow-ord {
    flex: 0 0 64px;
    height: 100%;
    background: rgba(0,0,0,0);
    filter: opacity(0.1);
}

    .inwindow-ord.inwindow-page-down {
        background: url("../resources/images/pg_down.png") 50% no-repeat;
        background-size: 100%;
    }

    .inwindow-ord.inwindow-page-up {
        background: url("../resources/images/pg_up.png") 50% no-repeat;
        background-size: 100%;
    }

    .inwindow-ord.inwindow-disabled {
        background: none;
    }

.inwindow-ord:hover {
    /*background:rgba(0,0,0,0.4);*/
    filter: opacity(0.6);
}

.inwindow-canvas {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
}

.inwindow-resizer {
    position: absolute;
    touch-action: none;
}

.inwindow-resizer-l {
    width: 8px;
    left: -4px;
    top: 4px;
    bottom: 4px;
    cursor: ew-resize;
}

.inwindow-resizer-r {
    width: 8px;
    right: -4px;
    top: 4px;
    bottom: 16px;
    cursor: ew-resize;
}

.inwindow-resizer-t {
    height: 8px;
    left: 4px;
    right: 4px;
    top: -4px;
    cursor: ns-resize;
}

.inwindow-resizer-b {
    height: 8px;
    left: 4px;
    right: 16px;
    bottom: -4px;
    cursor: ns-resize;
}

.inwindow-resizer-tl {
    width: 8px;
    height: 8px;
    left: -4px;
    top: -4px;
    cursor: nwse-resize;
}

.inwindow-resizer-tr {
    width: 8px;
    height: 8px;
    right: -4px;
    top: -4px;
    cursor: nesw-resize;
}

.inwindow-resizer-bl {
    width: 8px;
    height: 8px;
    left: -4px;
    bottom: -4px;
    cursor: nesw-resize;
}

.inwindow-resizer-br {
    width: 20px;
    height: 20px;
    right: -4px;
    bottom: -4px;
    cursor: nwse-resize;
    background-image: url("../resources/images/resizer.png");
    background-size: 16px 16px;
    background-repeat: no-repeat;
    background-position: right 4px bottom 4px;
    filter: brightness(0.6) sepia(1) hue-rotate(30deg) saturate(5);
}


.inwindow:not(.max) .maximized-only {
    display: none;
}

/**
    MCWV styles
*/


.canvas-freehand {
    position: absolute;
    top: 0px;
    left: 0px;
    margin: 0;
    padding: 0;
    /*transform: scale(2);*/
    z-index: 999;
}

.drawn_svg {
    pointer-events: none;
    position: absolute;
    z-index: 1000;
    fill: none;
}
