:root {
    color-scheme: light;
    font-family: Arial, Helvetica, sans-serif;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: #f9f9ff;
}

.exp-viewer {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    width: 100%;
    height: 100%;
    min-height: 260px;
}

.exp-toolbar {
    position: relative;
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-height: 46px;
    padding: 5px 7px;
    box-sizing: border-box;
    border-bottom: 1px solid #777;
    background: rgba(28, 28, 28, .96);
    color: #ddd;
}

.exp-toolbar button {
    min-width: 40px;
    min-height: 34px;
    padding: 4px 10px;
    border: 1px solid #777;
    border-radius: 4px;
    background: #444;
    color: #fff;
    font: inherit;
    cursor: pointer;
}

.exp-toolbar button:hover,
.exp-toolbar button:focus {
    border-color: #ccc;
    background: #555;
}

.exp-toolbar output {
    min-width: 48px;
    font-size: 12px;
    text-align: center;
}

.exp-toolbar span {
    flex: 1 1 280px;
    color: #bbb;
    font-size: 11px;
}

.exp-viewport {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: #f9f9ff;
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.exp-viewport:focus {
    outline: 2px solid #555;
    outline-offset: -2px;
}

.exp-viewport.is-dragging {
    cursor: grabbing;
}

.exp-stage {
    position: absolute;
    left: 0;
    top: 0;
    transform-origin: 0 0;
    will-change: transform;
}

.exp-stage img {
    display: block;
    border: 0;
    background: #f9f9ff;
    pointer-events: auto;
    -webkit-user-drag: none;
}

.exp-popup {
    position: absolute;
    z-index: 30;
    max-width: calc(100% - 16px);
    max-height: calc(100% - 16px);
    padding-top: 30px;
    overflow: hidden;
    box-sizing: border-box;
    border: 1px solid #555;
    border-radius: 5px;
    background: #fff;
    box-shadow: 3px 3px 12px rgba(0, 0, 0, .5);
}

.exp-popup[hidden] {
    display: none;
}

.exp-popup button {
    position: absolute;
    right: 3px;
    top: 2px;
    width: 28px;
    height: 26px;
    padding: 0;
    border: 1px solid #777;
    border-radius: 3px;
    background: #eee;
    color: #222;
    font-size: 20px;
    line-height: 22px;
    cursor: pointer;
}

.exp-popup iframe {
    display: block;
    max-width: 100%;
    max-height: calc(100% - 30px);
    border: 0;
    background: #fff;
}

@media (max-width: 600px) {
    .exp-toolbar {
        min-height: 84px;
    }

    .exp-toolbar button {
        min-width: 46px;
        min-height: 40px;
    }

    .exp-toolbar span {
        flex-basis: 100%;
    }
}
