.lfo-destination-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    height: 82%;
    margin-top: 2px;
    position: relative;
    top: 30px;
  }
  /* Vertical destination range slider */
.lfo-destination-range {
    -webkit-appearance: none;
    appearance: none;
    width: 20px; /* Make the slider wider than standard */
    height: 100%;
    background: transparent;
    writing-mode: vertical-lr;
    direction: rtl; /* Bottom to top orientation */
    margin-left: 5px;
    margin-right: 15px;
  }
  
  /* Custom track styling */
  .lfo-destination-range::-webkit-slider-runnable-track {
    width: 10px; /* Keep the width */
    height: 100%; /* Use full height without the calculation */
    background: #35100B;
    border-radius: 8px;
  }
  
  /* Ticks container positioned to the right of the slider */
  .lfo-destination-ticks {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 65%;
    margin-left: -11px;
    margin-bottom: 56px;
    pointer-events: none; /* Don't block interaction */
  }
  
  /* Individual tick with label container */
  .tick-with-label {
    display: flex;
    align-items: center;
    height: calc(100% / 9);
  }
  
  /* Tick mark styling */
  .tick {
    width: 5px;
    height: 1.9px;
    background-color: #35100B;
  }
  
  /* Label styling */
  .tick-label {
    margin-left: 5px;
    font-size: 10px;
    white-space: nowrap;
    font-family: "Nunito", sans-serif;
    font-size: 10px;
    font-variant-caps: all-small-caps;
    font-weight: 750;
    margin-bottom: 1.6px;
    color: #35100B;
  }
  .lfo-destination-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    background: #35100B;
    width: 24px; /* Make it wider than the track */
    height: 26px; /* Make it taller */
    cursor: pointer;
    border-radius: 5px; /* Rectangular shape with rounded corners */
    
    /* Center it on the track */
    margin-left: -6.8px; 
    
    /* Add a subtle shadow for depth */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    
    /* Optional: Add a small indicator line */
    background-image: linear-gradient(to right, #f2eed3 30%, transparent 30%, transparent 70%, #f2eed3 70%);
    background-size: 100% 2px;
    background-repeat: no-repeat;
    background-position: center;
  }
  
  /* Firefox version */
  .lfo-destination-range::-moz-range-thumb {
    appearance: none;
    background: #f2eed3;
    border: 2px solid #35100B;
    width: 24px;
    height: 26px;
    cursor: pointer;
    border-radius: 5px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    background-image: linear-gradient(to right, #35100B 30%, transparent 30%, transparent 70%, #35100B 70%);
    background-size: 100% 2px;
    background-repeat: no-repeat;
    background-position: center;
  }
  .slider-label {
    font-family: "Nunito", sans-serif;
    font-size: 10px;
    font-variant-caps: all-small-caps;
    font-weight: 750;
    color: #35100B;
    text-align: center;
    width: 100%;
    position: absolute;
    right: 5px;
    top: 148px;
  }
  
  /* Position the slider containers correctly to make room for labels */
  .slider-tick-container {
    position: relative;
  
  }
  .destination-label {
    font-family: "Nunito", sans-serif;
    font-size: 10px;
    font-variant-caps: all-small-caps;
    font-weight: 750;
    color: #35100B;
    text-align: center;
    width: 100%;
    position: absolute;
    bottom: -17px;
    margin-left: -4px;
    right: 16px;
  
  }
  /* Select button styling - make it square and match panel color */
.select-button-container {
    display: flex;
    flex-direction: column;
    align-items: center;
  margin-top: 26px;
  margin-bottom: 18px;
  }
  
  .select-button {
    position: relative;
    width: 41px; /* Match the knob width for consistency */
    height: 41px; /* Perfect square */
    background-color: #6B8F53; /* Match the synth panel color */
    border: 2.5px solid #35100B;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    margin-top: -3px;
    margin-bottom: 0px; /* Add space for label below */
    transition: background-color 0.2s, box-shadow 0.2s;
    margin-right: -10px;
    right: 5px;
  }
  
  .select-button:hover {
    background-color: #729759; /* Slightly darker on hover */
  }
  
  .select-button.active {
    background-color: #7da263;
    box-shadow: 0 0 8px #9ec681; /* Glow effect */
    transform: scale(0.98); /* Slight pressed effect */
  }
  
  /* Add icon styling */
  .select-button .icon {
    position: absolute;
    width: 18px;
    height: 18px;
    opacity: 0.8;
    pointer-events: none;
  }
  
  /* Icon color changes with button state */
  .select-button .icon {
    filter: invert(8%) sepia(12%) saturate(6770%) hue-rotate(338deg) brightness(97%) contrast(99%);
  }
  
  .select-button.active .icon {
    filter: invert(94%) sepia(8%) saturate(289%) hue-rotate(347deg) brightness(105%) contrast(92%);
  }
  
  /* Remove the LED */
  .select-button .select-led {
    display: none;
  }
  
  /* Add label under select button */
  .select-button-container label {
    font-family: "Nunito", sans-serif;
    font-size: 10px;
    font-variant-caps: all-small-caps;
    font-weight: 750;
    color: #35100B;
    text-align: center;
  }
  #mod-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    z-index: 2;
  }
  
  .mod-grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(to right, rgba(242, 238, 211, 0.1) 1px, transparent 1px),
                      linear-gradient(to bottom, rgba(242, 238, 211, 0.1) 1px, transparent 1px);
    background-size: 10px 10px;
    z-index: 1;
  }
  .modulation-module {
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid #35100B;
    background-color: #f2eed3;
    border-radius: 10px;
    padding: 10px;
    min-width: 145px;
    max-width: 145px;
    padding-top: 15px;
    overflow: hidden;
    box-sizing: border-box;
  }
  .mod-mode-selector {
    display: flex;
    flex-direction: column;
    background-color: #E5AB5F;
    border: 2px solid #35100B;
    border-radius: 5px;
    overflow: visible; /* Changed from 'overflow: hidden' to allow glow to extend out */
    width: 45px;
    position: relative; /* Add this to establish stacking context */
    z-index: 1; /* Ensure it sits above other elements */
  }
  
  
  /* Default button styling */
  .mode-option {
    padding: 6px;
    text-align: center;
    font-family: "Nunito", sans-serif;
    font-size: 10px;
    font-variant-caps: all-small-caps;
    font-weight: 750;
    color: #35100B;
    cursor: pointer;
    border-bottom: 1px solid #35100B;
    background-color: #f2eed3;
    transition: background-color 0.2s, box-shadow 0.2s, transform 0.1s;
  }
  
  /* Remove border from last item */
  .mode-option:last-child {
    border-bottom: none;
  }
  
  /* Individual color styling for each button */
  .mode-option[data-mode="env"] {
    background-color: #E5AB5F;
  }
  
  .mode-option[data-mode="lfo"] {
    background-color: #CF814D;
  }
  
  .mode-option[data-mode="trig"] {
    background-color: #BA5446;
  }
  
  /* Hover states */
  .mode-option[data-mode="env"]:hover {
    background-color: #e7b068;
  }
  
  .mode-option[data-mode="lfo"]:hover {
    background-color: #d69061;
  }
  
  .mode-option[data-mode="trig"]:hover {
    background-color: #b85f53;
  }
  
  /* Enhanced glow effects for active buttons */
  .mode-option[data-mode="env"].active {
    background-color: #E5AB5F; /* Yellow */
    color: #f2eed3;
    box-shadow: 0 0 8px 1px #E5AB5F, 0 0 20px 5px rgba(229, 171, 95, 0.5); /* Multiple shadows for stronger effect */
    transform: scale(0.98); /* Slight pressed effect */
    position: relative;
    z-index: 2; /* Higher than container */
  }
  
  .mode-option[data-mode="lfo"].active {
    background-color: #dc8953; /* Orange */
    color: #f2eed3;
    box-shadow: 0 0 8px 1px #dc8953, 0 0 20px 5px rgba(220, 137, 83, 0.5); /* Multiple shadows */
    transform: scale(0.98);
    position: relative;
    z-index: 2;
  }
  
  .mode-option[data-mode="trig"].active {
    background-color: #d55d4d; /* Red */
    color: #f2eed3;
    box-shadow: 0 0 8px 1px #d55d4d, 0 0 25px 6px rgba(213, 93, 77, 0.6); /* Strongest glow */
    transform: scale(0.98);
    position: relative;
    z-index: 2;
  }
  
  /* Ensure hover states don't have overflow issues */
  .mode-option:hover {
    overflow: visible;
  }
  /* Canvas container - now at the top of the module */
  .mod-canvas-container {
    position: relative;
    width: 120px;
    height: 100px;
    background-color: #35100B;
    border: 2px solid #35100B;
    border-radius: 5px;
    margin-bottom: 13px;
    margin-top: 10px;
    overflow: hidden;
  }
  
  /* Two-column layout container below the canvas */
  .mod-columns-container {
    display: flex;
    width: 92%;
    justify-content: space-between;
    margin-top: 5px;
    height: 191px;
  }
  
  /* Left column styling */
  .mod-left-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 65%;
    border: 1px solid #35100B;
    border-radius: 10px;
    padding-right: 5px;
      padding-left: 5px;
      margin-right: 5px;
      margin-left: -5px;
      right: 2px;
  }
  
  /* Right column styling */
  .mod-right-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 45%;
  }
  
  /* Adjust spacing between items in left column */
  .mod-left-column .mod-selector-container,
  .mod-left-column .knob-container {
    margin-bottom: 0px;
  }
  
  /* Ensure mode selector is centered */
  .mod-mode-selector {
    margin: 0 auto;
    margin-top: 10px;
  }
  
  /* Make destination container fit properly */
  .mod-destination-container {
    height: 170px;
  }
  /* Three-way mode selector styling */
  .mod-selector-container {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
    width: 100%;
  }
  
  .mod-mode-selector {
    display: flex;
    flex-direction: column;
    background-color: #E5AB5F;
    border: 2px solid #35100B;
    border-radius: 5px;
    overflow: hidden;
    width: 45px;
  }
  
  .mode-option {
    padding: 6px;
    text-align: center;
    font-family: "Nunito", sans-serif;
    font-size: 10px;
    font-variant-caps: all-small-caps;
    font-weight: 750;
    color: #35100B;
    cursor: pointer;
    border-bottom: 1px solid #35100B;
    background-color: #f2eed3;
  }
  
  .mode-option:last-child {
    border-bottom: none;
  }
  
  .mode-option.active {
    background-color: #35100B;
    color: #f2eed3;
  }
  
  /* Controls container */
  .mod-controls-container {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 10px;
  }
  
  /* Knob styling (using existing knob styles) */
  .modulation-module .knob {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background-color: #CF814D;
    position: relative;
    cursor: grab;
    box-sizing: border-box;
    border: 0.5px solid #35100B;
    box-shadow: 0 0 0 4.2px #CF814D, 0 0 0 6px #35100B;
    transform-origin: center center;
  }
  
  .modulation-module .knob::after {
    content: '';
    position: absolute;
    border-radius: 1px;
    top: 50%;
    left: 50%;
    width: 23.6px;
    height: 3px;
    background-color: #f2eed3;
    transform-origin: left center;
    transform: translate(-0px, -50%) rotate(270deg);
  }
  
  /* Destination slider styling */
  .mod-destination-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    height: 240px; /* Match LFO height */
    width: 81.95px; /* Match LFO width */
    margin-top: 10px;
    position: relative;
  }
  
  /* Vertical destination range slider */
  .mod-destination-range {
    -webkit-appearance: none;
    appearance: none;
    width: 20px; /* Make the slider wider than standard */
    height: 100%;
    background: transparent;
    writing-mode: vertical-lr;
    direction: rtl; /* Bottom to top orientation */
    margin: 15px;
  }
  
  /* Custom track styling */
  .mod-destination-range::-webkit-slider-runnable-track {
    width: 10px;
    height: 100%;
    background: #35100B;
    border-radius: 8px;
  }
  
  /* Custom thumb styling */
  .mod-destination-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    background: #35100B;
    width: 24px; /* Make it wider than the track */
    height: 26px; /* Make it taller */
    cursor: pointer;
    border-radius: 5px; /* Rectangular shape with rounded corners */
    
    /* Center it on the track */
    margin-left: -6.8px; 
    
    /* Add a subtle shadow for depth */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    
    /* Optional: Add a small indicator line */
    background-image: linear-gradient(to right, #f2eed3 30%, transparent 30%, transparent 70%, #f2eed3 70%);
    background-size: 100% 2px;
    background-repeat: no-repeat;
    background-position: center;
  }
  
  /* Ticks container positioned to the right of the slider */
  .mod-destination-ticks {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100.3%;
    margin-left: -11px;
    pointer-events: none; /* Don't block interaction */
  }
  
  /* Individual tick with label container */
  .mod-destination-tick {
    display: flex;
    align-items: center;
    height: calc(100% / 9);
  }
  
  /* Tick mark styling */
  .mod-destination-tick .tick {
    width: 5px;
    height: 1.9px;
    background-color: #35100B;
  }
  
  /* Label styling */
  .mod-destination-tick .tick-label {
    margin-left: 5px;
    font-size: 10px;
    white-space: nowrap;
    font-family: "Nunito", sans-serif;
    font-size: 10px;
    font-variant-caps: all-small-caps;
    font-weight: 750;
    margin-bottom: 1.6px;
    color: #35100B;
  }
  
  /* Destination label */
  .mod-destination-label {
    font-family: "Nunito", sans-serif;
    font-size: 10px;
    font-variant-caps: all-small-caps;
    font-weight: 750;
    color: #35100B;
    text-align: center;
    width: 100%;
    position: absolute;
    bottom: -21px;
    margin-left: -4px;
  }
  /* New class for the modulation module select button */
  .mod-select-button-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* No right margin here, unlike the original */
    margin-bottom: 5px;
    margin-top: 12px;
  }
  
  /* Ensure the button itself is centered */
  .mod-select-button-container .select-button {
    position: relative;
    width: 41px;
    height: 41px;
    background-color: #BA5446; /* Match the modulation module color */
    border: 2.5px solid #35100B;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    margin-top: -2px;
    margin-bottom: 0px;
    transition: background-color 0.2s, box-shadow 0.2s;
  }
  
  .mod-select-button-container .select-button:hover {
    background-color: #b85f53; /* Slightly darker on hover */
  }
  
  .mod-select-button-container .select-button.active {
    background-color: #d15f50;
    box-shadow: 0 0 15px rgba(218, 92, 75, 0.7); /* Glow effect */
    transform: scale(0.98); /* Slight pressed effect */
  }
  .mod-select-button-container label {
    font-family: "Nunito", sans-serif;
    font-size: 10px;
    font-variant-caps: all-small-caps;
    font-weight: 750;
    color: #35100B;
    text-align: center;
    margin-top: 3px;
    display: block;
    width: 100%;
  }
  /* Styling for macro knob columns */
.macro-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  
  /* Styling for bottom row of macros */
  .bottom-macro-row {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    width: 100%;
    justify-content: space-around;
  }
  
  /* Adjust mod-bottom-controls to support the new layout */
  .mod-bottom-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    width: 96%;
    margin-top: 7px;
  
  }
  
  /* Ensure all knobs have the proper indicator line */
  .knob::after {
    content: '';
    position: absolute;
    border-radius: 1px;
    top: 50%;
    left: 50%;
    width: 23.6px;
    height: 3px;
    background-color: #f2eed3;
    transform-origin: left center;
    transform: translate(-0px, -50%) rotate(270deg);
  }
  /* Styling for the button container */
  .matrix-buttons-container {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin: 10px auto 5px auto;
    margin-top: 15px;
      margin-bottom: 0px;
  }
  
  /* Styling for the individual buttons */
  .matrix-button {
    width: 21px;
    height: 21px;
    background-color: #f2eed3;
    border: 2.5px solid #35100B;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s;
  }
  
  .matrix-button:hover {
    background-color: #e8e3c4;
  }
  
  .matrix-button.active {
    background-color: #BA5446;
    box-shadow: 0 0 8px rgba(186, 84, 70, 0.5);
  }
  /* Base colors for the six buttons */
  .matrix-button:nth-child(1),
  .matrix-button:nth-child(2) {
    background-color: #6B8F53; /* Green color */
  }
  
  .matrix-button:nth-child(3) {
    background-color: #4E658B; /* Blue color */
  }
  
  .matrix-button:nth-child(4) {
    background-color: #E5AB5F; /* Yellow color */
  }
  
  .matrix-button:nth-child(5) {
    background-color: #BA5446; /* Red color */
  }
  
  .matrix-button:nth-child(6) {
    background-color: #CF814D; /* Orange color */
  }
  
  /* Hover states - slightly brighter versions of each color */
  .matrix-button:nth-child(1):hover,
  .matrix-button:nth-child(2):hover {
    background-color: #7da263; /* Brighter green */
  }
  
  .matrix-button:nth-child(3):hover {
    background-color: #5a739a; /* Brighter blue */
  }
  
  .matrix-button:nth-child(4):hover {
    background-color: #e7b068; /* Brighter yellow */
  }
  
  .matrix-button:nth-child(5):hover {
    background-color: #c65f53; /* Brighter red */
  }
  
  .matrix-button:nth-child(6):hover {
    background-color: #d69061; /* Brighter orange */
  }
  
  /* Active state with glow effect */
  .matrix-button:nth-child(1).active,
  .matrix-button:nth-child(2).active {
    background-color: #7da263; /* Same as hover green */
    box-shadow: 0 0 8px rgba(107, 143, 83, 0.8); /* Green glow */
  }
  
  .matrix-button:nth-child(3).active {
    background-color: #5a739a; /* Same as hover blue */
    box-shadow: 0 0 8px rgba(78, 101, 139, 0.8); /* Blue glow */
  }
  
  .matrix-button:nth-child(4).active {
    background-color: #e7b068; /* Same as hover yellow */
    box-shadow: 0 0 8px rgba(229, 171, 95, 0.8); /* Yellow glow */
  }
  
  .matrix-button:nth-child(5).active {
    background-color: #c65f53; /* Same as hover red */
    box-shadow: 0 0 8px rgba(186, 84, 70, 0.8); /* Red glow */
  }
  
  .matrix-button:nth-child(6).active {
    background-color: #d69061; /* Same as hover orange */
    box-shadow: 0 0 8px rgba(207, 129, 77, 0.8); /* Orange glow */
  }
  /* Add this CSS to style the text in the matrix buttons */
  .matrix-button {
    width: 21px;
    height: 21px;
    background-color: #f2eed3;
    border: 2.5px solid #35100B;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;           /* Add flex display to center text */
    justify-content: center; /* Center horizontally */
    align-items: center;     /* Center vertically */
    font-family: "Nunito", sans-serif;
    font-size: 8px;          /* Small font size for the small buttons */
    font-weight: 700;        /* Bold text for better visibility */
    color: #35100B;          /* Dark text color by default */
  }
  
  /* Make text white when button is active */
  .matrix-button.active {
    background-color: #BA5446;
    box-shadow: 0 0 8px rgba(186, 84, 70, 0.5);
    color: #f2eed3;          /* Light text color when active */
  }