* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/****************************************/
/* BASE FORM STYLING                    */
/****************************************/
.stacked-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 850px;
    font-size: 15px;
    margin: 40px auto;
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 8px;
    position: relative;
    background-color: #f6f0ed;
    /* Increas to account for taller inline rows */
    padding-bottom: 70px;
}

fieldset {
    border: 1px solid #bbb;
    border-radius: 6px;
    padding: 15px;
}

legend {
    font-size: 14px;
    font-weight: bold;
    padding: 0 5px;
}

.submit-container {
    position: absolute;
    bottom: 16px;
    left: 20px;
}

.submit-btn {
    padding: 10px 20px;
    background-color: #0066cc;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 15px;
}

.submit-btn:hover {
    background-color: #0052a3;
}

/****************************************/
/* COMMON ELEMENTS THROUGHOUT           */
/****************************************/

/* Set size of text fields in forms */
#scaleroot,
#chordroot,
#melodynote {
    width: 50px;
    margin-right: 1.5em;
    padding-left: 2px;
}

/* Set size of select menus in forms */
.select-item {
    width: 180px;
}

/* Set size of tuning select menus in forms */
.tuning-select select {
    width: 300px;
}

/* make select menu font a bit larger */
select {
    font-size: 15px;
    padding: 1px 2px;
}

input[type="text"] {
    font-size: 15px;
    padding: 1px 2px;
}

.help {
    margin-bottom: .75em;
    font-style: italic;
    font-size: .9em;
    color: #666;
}

.error {
    color: #a32;
    font-size: .9em;
    padding-top: 5px;
}

.inline-error {
    color: #a32;
    font-size: .9em;
    margin-left: 1em;
}

/****************************************/
/* SLANT BAR CHECKBOX STYLING           */
/****************************************/
.slant-panel {
    display: flex;
    /* Lays out the children in a horizontal row */
    flex-direction: row;
    /* Spaces the 5 items evenly across the width */
    justify-content: space-between;
    /* Centers the items vertically */
    align-items: center;
    /* Allows wrapping on smaller screens */
    flex-wrap: wrap;
    /* Fallback spacing between items */
    gap: 10px;
}

.checkbox-item {
    /* Keeps the input and label perfectly aligned */
    display: inline-flex;
    align-items: center;
    /* Prevents the label text from wrapping away from the box */
    white-space: nowrap;
}

/* Optional: Add a little space between the specific checkbox and its text */
.checkbox-item input[type="checkbox"] {
    margin-right: 6px;
}

/****************************************/
/* CHORD SELECT INPUT FIELD STYLING     */
/****************************************/
.chord-select-panel {
    width: 100%;
    padding-bottom: 0;
    box-sizing: border-box;
}

.compact-grid {
    /* 5 main inputs, 1 narrow spacer column, 1 separate input */
    grid-template-columns: repeat(5, .5fr) 0.5fr .75fr;
    /* Expanded to fit the new layout while keeping inputs small */
    max-width: 80%;
    display: grid;
    gap: 12px;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    text-align: left;
    margin-bottom: 1px;
}

.input-group input {
    width: 90%;
    box-sizing: border-box;
}

/* Optional styling to visually highlight the distinct field */
.distinct-field #chordroot {
    width: 90px;
}

/****************************************/
/* DISPLAY OPTIONS RADIO BUTTON STYLING */
/****************************************/
.display-select-panel {
    width: 100%;
    margin: 0 auto;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* 4 equal columns */
    gap: 0px;
    padding-bottom: 1em;
}

.column {
    display: flex;
    flex-direction: column;
    /* Left-justified content */
    align-items: flex-start;
}

.column-title {
    margin-bottom: 4px;
    margin-top: 0;
}

.radio-group {
    display: flex;
    flex-direction: column;
    /* Spacing between radio buttons */
    gap: 0;
    text-align: left;
}

.radio-group label {
    /* Keeps label text from breaking awkwardly */
    white-space: nowrap;
}