    :root {
        --gap-size: 0.1vw; /* You can adjust this value as needed */
        --background-color: #f0f0f0;
        --text-color: #222;
    }
    * {
        box-sizing: border-box;
    }
    body {
        user-select: none; /* Disable text selection */
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        min-height: 100vh;
        margin: 0;
        background-color: var(--background-color);
        color: var(--text-color);
        font-family: "t26-carbon", monospace;
        transition: background-color 0.3s, color 0.3s;
        font-size: 16px;
        text-transform: uppercase;
    }
    .page-layout {
        display: grid;
        grid-template-columns: 3fr 1fr; /* Adjusted to allow the right column to scale relative to the left */
        grid-template-rows: auto; /* Define rows for desktop */
        width: 100%;
        max-width: 1400px;
        margin: 0 auto;
        padding: 2vw;
        gap: 2em; /* Changed from 2vw to 2em for consistent spacing */
        align-items: start;
    }
    .left-column, .right-column {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        flex-grow: 1; /* Allow columns to grow proportionally */
    }
    .right-column {
        width: 100%;
        height: auto;
        overflow-y: visible; /* Change overflow to visible to prevent unwanted scrollbars */
    }
    .grid-container, .right-column .grid {
        width: 100%;
        aspect-ratio: 1 / 1; /* Maintain square aspect ratio */
        max-height: 100%; /* Ensure it doesn't exceed the container height */
    }
    .grid {
        display: grid;
        grid-template-columns: repeat(8, 1fr);
        grid-template-rows: repeat(8, 1fr); /* Ensure rows have the same height as columns */
        gap: var(--gap-size);
        width: 100%;
        height: 100%; /* Let the grid fill its container */
    }
    .tile, .tile.active {
        width: 100%;
        height: 100%;
        padding: 0; /* Remove padding to ensure tiles fill the cells */
        cursor: pointer;
        display: flex;
        justify-content: center;
        align-items: center;
        transition: all 0.3s ease;
        border: none;
        background-color: transparent;
    }
    .tile:not(.active):hover {
        background-color: rgba(255, 255, 255, 0.1);
        border: 1px solid #888;
        cursor: pointer;
    }
    .selector {
        width: 100%;
        aspect-ratio: 1 / 1; /* Maintain a square shape */
        cursor: pointer;
        transition: all 0.3s ease;
        background-color: transparent;
        border: 1px solid #888;
        border-radius: 0%; /* Initialize with no border-radius */
    }
    .selector.active {
        background-color: #ddd;
        border-radius: 20%; /* Adjust percentage as needed for desired curvature */
    }
    button {
        width: 100%;
        padding: 0.5em 1em;
        margin: 0.3vw 0;
        border-radius: 2.5vw 2.5vw 2.5vw 2.5vw;
        border: 1px solid currentColor;
        background-color: rgba(255, 255, 255, 0.1);
        color: inherit;
        cursor: pointer;
        transition: all 0.3s ease;
        font-family: "t26-carbon", monospace;
        font-size: 1em;
    }
    button:hover {
        color: #888;
    }
    .controls {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        margin-top: 0.5vw; /* Reduced from 1vw to 0.5vw */
    }
    .button-row {
        display: flex;
        gap: 0.5em;
        margin-bottom: 1em;
    }
    .slider-container {
        display: flex;
        align-items: center;
        margin-bottom: 0.5vw; /* Reduced from 1vw to 0.5vw */
        width: 100%;
    }
    /* For the three main sliders: exposure, saturation, and hue */
    .slider-container label[for="exposureSlider"],
    .slider-container label[for="saturationSlider"],
    .slider-container label[for="hueSlider"],
    .slider-container label[for="varianceSlider"] {
        /* Use a fixed width relative to the container */
        flex: 0 0 120px;
        text-align: right;
        margin-right: 0.5em;
    }
    .slider-container input[type="range"]#exposureSlider,
    .slider-container input[type="range"]#saturationSlider,
    .slider-container input[type="range"]#hueSlider,
    .slider-container input[type="range"]#varianceSlider {
        /* Allow the input to grow and fill remaining space */
        flex: 1;
        width: 100%;
    }
    input[type="range"] {
        -webkit-appearance: none; /* Override default appearance */
        width: 100%;
        background: #ccc; /* Light grey background */
        margin-top: 0; /* Adjust spacing as needed */
        border-radius: 0.5vw 0.5vw 0.5vw 0.5vw; /* Top right, bottom right, bottom left */
    }
    input[type="range"]::-webkit-slider-thumb {
        -webkit-appearance: none;
        width: 15px;
        height: 15px;
        background: #888; /* Darker grey thumb */
        cursor: pointer;
        border-radius: 50% 50% 50% 50%; /* Remove top-left radius */
    }
    input[type="range"]::-moz-range-thumb {
        width: 15px;
        height: 15px;
        background: #888;
        cursor: pointer;
        border-radius: 50% 50% 50% 50%; /* Remove top-left radius */
        border: none;
    }
    input[type="range"]:focus {
        outline: none;
    }
    .info-palette-row {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        width: 100%;
        margin-top: 1vw; /* Increase margin-top to add vertical padding */
        margin-bottom: 0.5vw; /* Adjust spacing to reduce vertical gap */
    }
    .info-panel {
        flex: 1;
        margin-right: 1vw;
    }
    .palette-grid {
        flex: 1;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(3, 1fr);
        gap: var(--gap-size);
        width: 100%;
        aspect-ratio: 1 / 1;
        max-width: 300px; /* Optional: Set a max width for better scaling */
    }
    .palette-tile {
        width: 100%;
        height: 100%;
        background-color: transparent;
        border: 1px solid #ccc;
        cursor: pointer;
        transition: all 0.3s ease;
        border-radius: 2.5vw 2.5vw 2.5vw 2.5vw; /* Apply radius to all corners except the upper left */
    }
    .palette-tile:hover {
        border-color: #888;
    }
    .palette-tile.active {
        border: none;
    }
    @media (max-width: 768px) {
        .page-layout {
            grid-template-columns: 1fr;
            grid-template-rows: auto auto; /* Define two rows */
            gap: 1.5em; /* Adjust gap for smaller screens */
        }
        .left-column {
            grid-row: 1; /* Tile grid first */
        }
        .right-column {
            grid-row: 2; /* Info panel and palette grid below */
        }
        /* Further adjustments for smaller screens */
        .selector.active {
            border-radius: 15%; /* Adjust percentage as needed */
        }
        
        button {
            border-radius: 1.5%; /* Adjust button border-radius for smaller screens */
        }
    }
    body.dark-mode {
        background-color: #000;
        color: #f0f0f0;
    }
    body.dark-mode .color-picker-content {
        background-color: #000; /* Set background color to black in dark mode */
    }
    .color-picker-modal {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: transparent; /* Set background to transparent */
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 1000;
    }
    .color-picker-content {
        background-color: var(--background-color); /* Use CSS variable for background */
        padding: 1em;
        border-radius: 0.5em;
        text-align: center;
    }
    .color-picker-content h3 {
        margin-top: 0;
    }
    .color-picker-buttons {
        margin-top: 1em;
    }
    .color-picker-buttons button {
        margin: 0 0.5em;
    }
    details summary {
        padding-top: 0.5em;
        padding-bottom: 0.5em;
    }
    /* Help Button Style */
    #helpButton {
        width: 100%;
        padding: 0.5em 1em;
        margin: 0.3vw 0;
        border-radius: 2.5vw 2.5vw 2.5vw 2.5vw;
        border: 1px solid currentColor;
        background-color: rgba(255, 255, 255, 0.1);
        color: inherit;
        cursor: pointer;
        transition: all 0.3s ease;
        font-family: "t26-carbon", monospace;
        font-size: 1em;
        text-transform: uppercase;
    }
    #helpButton:hover {
        color: #888;
    }

    /* Modal Styling */
    .modal {
        display: none; /* Hidden by default */
        position: fixed; /* Stay in place */
        z-index: 1000; /* Sit on top */
        left: 0;
        top: 0;
        width: 100%; /* Full width */
        height: 100%; /* Full height */
        overflow: auto; /* Enable scroll if needed */
        background-color: rgba(0, 0, 0, 0.7); /* Black with opacity */
    }
    .modal-content {
        background-color: var(--background-color);
        margin: 10% auto; /* 10% from the top and centered */
        padding: 2em;
        border-radius: 0.5em;
        width: 80%;
        max-width: 600px;
        color: var(--text-color);
        text-align: left;
    }
    .modal-content h2 {
        margin-top: 0;
        text-align: center;
    }
    .modal-content ul {
        list-style-type: none;
        padding: 0;
    }
    .modal-content li {
        margin-bottom: 1em;
    }
    .modal-content strong {
        display: block;
        margin-bottom: 0.5em;
    }
    .modal-content p {
        margin-bottom: 1.5em;
    }
    /* Close Button Style */
    #closeHelpButton {
        width: 100%;
        padding: 0.5em 1em;
        margin-top: 1em;
        border-radius: 0.3vw 2.5vw 2.5vw 2.5vw;
        border: 1px solid currentColor;
        background-color: rgba(255, 255, 255, 0.1);
        color: inherit;
        cursor: pointer;
        transition: all 0.3s ease;
        font-family: "t26-carbon", monospace;
        font-size: 1em;
        text-transform: uppercase;
    }
    #closeHelpButton:hover {
        color: #888;
    }
    #radiusSliderContainer {
    display: none; /* or visibility: hidden; */
}
    /* Toggle Switch Styles */
.switch {
    position: relative;
    display: inline-block;
    width: 3em;
    height: 1.5em;
    margin-left: 0.5em;
}

/* Hide the checkbox itself */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* Slider track (off state) */
.switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0;
    background-color: #000;        /* Black track when OFF */
    border: 1px solid #fff;       /* White outline */
    transition: .4s;
    /*border-radius: 1.5em;          Rounded switch track */
    border-radius: 1.5em 1.5em 1.5em 1.5em;
}

/* Knob (the circle) */
.switch .slider:before {
    content: "";
    position: absolute;
    height: 1.3em;
    width: 1.3em;
    left: 0.05em;
    bottom: 0.02em;
    background-color: #fff;       /* White knob when OFF */
    transition: .4s;
    /*border-radius: 50%;*/
    border-radius: 50% 50% 50% 50%;
}

/* Slider track (on state) */
.switch input:checked + .slider {
    background-color: #fff;       /* White track when ON */
}

/* Knob (on state) */
.switch input:checked + .slider:before {
    transform: translateX(1.5em); /* Slide knob to the right */
    background-color: #000;       /* Black knob when ON */
}

    .tile.selected {
    outline: 2px solid #00f; /* or any highlight color */
}

#hueSlider {
    background: linear-gradient(to right, red, yellow, lime, cyan, blue, magenta, red);
    -webkit-appearance: none;
    width: 100%;
}
#hueSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 15px;
    width: 15px;
    /*border-radius: 50%;*/
    border-radius: 0% 50% 50% 50%;
    background-color: var(--thumb-color, hsl(180, 100%, 50%));
    cursor: pointer;
    margin-top: -5px;
}
#hueSlider::-moz-range-thumb {
    height: 15px;
    width: 15px;
    border-radius: 50%;
    background-color: var(--thumb-color, hsl(180, 100%, 50%));
    cursor: pointer;
}
.tile canvas {
    width: 100%;
    height: 100%;
    display: block; /* eliminate any unexpected inline spacing */
}