body {
    font-family: sans-serif;
    margin: 20px;
    background: #f9f9f9;
    overflow: hidden;
    /* Prevent body scrolling */
    height: calc(100vh - 40px);
}

#chart {
    position: relative;
    height: 100%;
    max-height: calc(100vh - 40px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    touch-action: none;
    /* Prevent browser handling of gestures */
    -webkit-user-select: none;
    user-select: none;
    overflow: hidden;
    /* Prevent chart overflow */
}

/* Allow touch events to pass through SVG elements to the chart container */
#plot {
    overflow: hidden;
}

#plot svg {
    max-width: 100%;
    max-height: 100%;
}

/* Disable pointer events on rect, path, line elements that make up the bars/lines */
#plot svg rect,
#plot svg path,
#plot svg line {
    pointer-events: none;
}

@media (max-width: 600px) {
    body {
        margin: 10px;
        height: calc(100vh - 20px);
    }

    #chart {
        flex-direction: column;
        align-items: stretch;
        padding: 10px;
        max-height: calc(100vh - 20px);
    }

    #plot {
        flex: 1;
        min-height: 0;
        /* Allow flex shrinking */


        pointer-events: none;
        touch-action: none;
    }

    #plot svg {
        pointer-events: none;
        touch-action: none;
    }
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: #09f;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}
