:root {
  --panel-bg: #ffffff;
  --accent: #0d6efd;
  --border: #dee2e6;
  --text-muted: #6c757d;
}

.toolbar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #ffffff;
  padding: 0; 
  border-radius: 12px;
  border: 1px solid #dee2e6;
  max-width: 950px;
  margin: 0 auto;
  overflow: hidden;
}

.control-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 10px !important;
  border: none !important;
}

/* Desktop: alternating white/gray background */
.control-section:nth-child(even) {
  background-color: #f8f9fa;
}

/* Tablets (2 columns): 2x2 checkerboard pattern */
@media (max-width: 992px) {
  .toolbar-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .control-section:nth-child(2),
  .control-section:nth-child(3) {
    background-color: #f8f9fa;
  }
  .control-section:nth-child(1),
  .control-section:nth-child(4) {
    background-color: #ffffff;
  }
}

/* Mobile (1 column): alternating top-to-bottom */
@media (max-width: 576px) {
  .toolbar-grid {
    grid-template-columns: 1fr;
  }
  .control-section:nth-child(odd) {
    background-color: #ffffff;
  }
  .control-section:nth-child(even) {
    background-color: #f8f9fa;
  }
}

/* Sections */
.control-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0.5rem;
}

.section-title {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  letter-spacing: 0.08em;
}

/* Buttons and Inputs */
.ctrl-item {
  height: 32px !important;
  font-size: 0.85rem !important;
  border-radius: 6px !important;
}

select.form-select.ctrl-item {
  padding-top: 0;
  padding-bottom: 0;
  cursor: pointer;
  background-position: right 0.5rem center; /* Позиція стандартної стрілки */
  background-size: 12px 10px;
}

.select-std-width {
  width: 135px;
}

.select-wrapper {
  position: relative;
  width: 140px; 
}

.select-wrapper select {
  appearance: none; 
  -webkit-appearance: none;
  padding-left: 8px !important;
  padding-right: 28px !important; 
  text-align: center;
  width: 100%;
  cursor: pointer;
}

.select-wrapper::after {
  content: "\F282"; 
  font-family: "bootstrap-icons";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  color: var(--text-muted);
  pointer-events: none;
}

/* Remove browser arrows (spinners) for Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Remove browser arrows for Firefox */
input[type=number] {
    -moz-appearance: textfield;
}

#fretboard {
    display: inline-block;
    height: 30vh; /* The fretboard will always occupy 30% of the window height */
    width: auto;
    max-width: none;
}

.fretboard-wrap {
    min-height: 55vh; /* Reserve space */
    overflow-x: auto;
    text-align: center;
}