body {
    font-family: sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header {
    text-align: center;
    margin-bottom: 20px;
}

.header h2 {
    font-size: 1.5em;
}

.header h3 {
    font-size: 1.2em;
    font-weight: bold;
}

.apparatus-container {
    display: flex;
    justify-content: center;
    align-items: stretch;
    height: 200px;
    margin-bottom: 10px;
}

.apparatus-item {
    margin: 0 10px;
    height: 100%;
}

.motor-img {
    width: 450px;
    height: 200px;
    object-fit: cover;
    border: 1px solid #ccc;
}

.osc-img {
    width: 300px;
    height: 200px;
    object-fit: cover;
    border: 1px solid #ccc;
}

.switch-container {
    cursor: pointer;
}

.switch-box {
    width: 100px;
    height: 200px;
    background-color: #9999ff;
    border: 2px solid black;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    transition: background-color 0.2s;
}

.switch-text {
    font-weight: bold;
    text-align: center;
    margin-top: 10px;
    flex-grow: 1;
    font-size: 0.9em;
}

.switch-graphic {
    width: 80px;
    height: 80px;
    margin-bottom: 10px;
    position: relative;
}

/* Base shape: a vertical bar on the right */
.switch-graphic::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 0;
    bottom: 0;
    width: 15px;
    background-color: black;
}

/* 3 horizontal poles */
.pole {
    position: absolute;
    left: 10px;
    right: 25px;
    height: 15px;
    background-color: black;
}

.pole:nth-child(1) { top: 10px; }
.pole:nth-child(2) { top: 35px; }
.pole:nth-child(3) { top: 60px; }

/* The gap that opens/closes */
.gap {
    position: absolute;
    left: 40%;
    width: 20%;
    height: 100%;
    background-color: #9999ff; /* match switch bg */
    transition: width 0.1s, left 0.1s;
}

/* closed state */
.switch-box.closed .gap {
    width: 0;
    left: 50%;
}


.slider-container {
    width: 600px;
    margin: 0 auto 30px auto;
    position: relative;
    border: 1px solid #999;
    padding: 10px 10px 20px 10px;
    background: #f5f5f5;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
    margin-bottom: 5px;
    padding: 0 5px;
}

.slider {
    width: 100%;
    margin: 0;
    cursor: pointer;
}

.graphs-container {
    width: 900px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.graph-row {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 20px;
}

.bottom-row {
    justify-content: center;
}

.graph-wrapper {
    display: flex;
    width: 48%;
    height: 250px;
}

.y-label {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    text-align: center;
    font-size: 0.9em;
    font-weight: bold;
    color: olive;
    margin-right: 5px;
}

.canvas-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

canvas {
    border-left: 1px solid black;
    border-bottom: 1px solid black;
    width: 100% !important;
    height: calc(100% - 20px) !important;
}

.x-label {
    text-align: center;
    font-size: 0.9em;
    font-weight: bold;
    color: olive;
    margin-top: 5px;
}
