html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    height: 100vh;
}

#main-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

#canvas-section {
    flex: 0 0 30vh;
    max-height: 30vh;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

#right-section {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

#status-section {
    flex: 0 0 auto;
    padding: 0 1em;
    background: #eee;
    display: flex;
    flex-direction: column;
    gap: 0.3em;
    font-size: 2em;
}

#log-section {
    flex: 1 1 0;
    overflow-y: auto;
    background: #ddd;
    padding: 1em;
}

#canvas {
    display: block;
    margin: 0;
    padding: 0;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    box-sizing: border-box;
}

#missingList {
    color: #f00;
    overflow-x: auto;
    white-space: nowrap;
    max-width: 100%;
}

.controls-row-1 {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.controls-row-next {
    display: flex;
    align-items: center;
    gap: 0.2em;
}

.camera-group {
    display: flex;
    align-items: center;
    gap: 0.3em;
}

@media (orientation: landscape) {
    #main-layout {
        flex-direction: row;
    }

    #canvas-section {
        flex: 0 0 40vw;
        min-width: 40vw;
        max-width: 40vw;
        min-height: 100vh;
        max-height: 100vh;
    }

    #right-section {
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    #status-section {
        flex: 0 0 20%;
        min-width: 0;
        min-height: 0;
        flex-direction: column;
        gap: 0.3em;
    }

    #log-section {
        flex: 1 1 0;
        min-width: 0;
        min-height: 0;
        overflow-y: auto;
    }
}
