body {
    margin: 0;
    padding: 20px;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
    height: 100vh;
    box-sizing: border-box;
    overflow: hidden;
    background-color: #f9f9f9;
    color: #333;
}

#topBar {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 5px 20px;
    background: #2bc903;
    border-radius: 8px;
    margin-bottom: 15px;
}

#topBar h2 {
    margin: 0;
    flex-grow: 1;
    font-size: 1.0rem;
    color: #2c3e50;
    text-align: center;
}

#topBar a.navlink {
    padding: 6px 15px;
    background-color: #2980b9;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

#topBar a.navlink:hover {
    background-color: #1f6391;
}

#controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
    flex-shrink: 0;
}

/* First band: all inputs / sliders (wraps within itself) */
#fieldRow {
    display: flex;
    flex-wrap: wrap;
    gap: 20px 30px;
    align-items: flex-start;
}

/* Second band: buttons, always on their own row */
#buttonRow {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

/* all buttons the same size */
#buttonRow button {
    width: 170px;
    text-align: center;
}

/* seed sits above the table with the lake variables */
#seedRow {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #34495e;
    font-size: 0.9rem;
}

#seed {
    min-width: 0;
    width: 120px;
}

/* stacked pair: survey days on top, repeat toggle below */
.colstack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: flex-end;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.field label {
    font-weight: 600;
    color: #34495e;
    font-size: 0.9rem;
    white-space: nowrap;
}

select,
input[type="number"] {
    padding: 6px 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
    font-size: 1rem;
    min-width: 180px;
}

select:focus,
input:focus {
    outline: none;
    border-color: #2980b9;
    box-shadow: 0 0 5px #2980b9;
}

.slider {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 270px;
}

.slabel {
    font-size: 0.9rem;
    font-weight: 600;
    color: #34495e;
    white-space: nowrap;
}

/* bar + value on one line, value at the end */
.sline {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* editable value box at the end of the bar; overrides the wide default */
input[type="number"].valinput {
    width: 66px;
    min-width: 0;
    padding: 4px 6px;
    font-size: 0.95rem;
    color: #2980b9;
    font-weight: 600;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.unit {
    font-size: 0.85rem;
    font-weight: 600;
    color: #34495e;
}

input[type="range"] {
    width: 170px;
}

.checkfield {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #34495e;
}

/* gear multi-select checkboxes */
.gearbox {
    display: grid;
    grid-template-columns: repeat(2, auto);
    gap: 3px 18px;
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background: #fff;
    max-height: 96px;
    overflow: auto;
}

.gearbox label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    color: #34495e;
    white-space: nowrap;
}

/* separate grouping for the stand-alone "Shoreline sample" gear */
.gearbox-special {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
    padding: 5px 10px;
    border-color: #e67e22;
    background: #fff8f1;
}

.gearbox-special label {
    font-weight: 600;
    color: #a15b12;
}

.gearnote {
    font-size: 0.78rem;
    color: #a15b12;
    white-space: nowrap;
}

button {
    padding: 10px 22px;
    border: none;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, opacity 0.3s ease;
}

#generateBtn {
    background-color: #2980b9;
}

#generateBtn:hover:enabled {
    background-color: #1f6391;
}

#reseedBtn {
    background-color: #8e44ad;
}

#reseedBtn:hover:enabled {
    background-color: #6c3483;
}

#exportCsvBtn {
    background-color: #27ae60;
}

#exportCsvBtn:hover:enabled {
    background-color: #1e874b;
}

#clearBtn {
    background-color: #e67e22;
}

#clearBtn:hover:enabled {
    background-color: #ca6a15;
}

#resetBtn {
    background-color: #7f8c8d;
    margin-left: auto;
    /* pushed to the far right of the button row */
}

#resetBtn:hover:enabled {
    background-color: #616a6b;
}

#printBtn {
    background-color: #16a085;
}

#printBtn:hover:enabled {
    background-color: #11806a;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#middle {
    flex-grow: 1;
    display: flex;
    gap: 15px;
    min-height: 0;
}

#viewDiv {
    flex: 3;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-sizing: border-box;
    background-color: white;
}

#rightPanel {
    flex: 0 0 340px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
}

#lakeInfo {
    flex-shrink: 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px 15px;
    background: white;
    font-size: 14px;
    color: #444;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.1);
}

#lakeInfo strong {
    color: #2c3e50;
}

#lakeInfo .sep {
    color: #ccc;
    margin: 0 8px;
}

#tablePreview {
    flex: 1;
    overflow: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    background: white;
    font-size: 14px;
    color: #444;
    box-sizing: border-box;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.1);
}

table,
th,
td {
    border: 1px solid #ccc;
    border-collapse: collapse;
    padding: 4px 8px;
    text-align: center;
}

th {
    background-color: #f0f3f7;
    position: sticky;
    top: 0;
    z-index: 1;
    font-weight: 600;
    color: #2c3e50;
}

tbody tr:hover {
    background-color: #f9fbfd;
}

#status {
    font-size: 0.9rem;
    color: #555;
    margin: 4px 0 10px 0;
    min-height: 1.1em;
}

/* On-map depth-contour toggle (sits under the Sketch tools, top-left) */
.map-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    font-size: 0.85rem;
    font-weight: 600;
    color: #34495e;
    white-space: nowrap;
    cursor: pointer;
}

.map-toggle input {
    min-width: 0;
    margin: 0;
    cursor: pointer;
}

.map-toggle label {
    cursor: pointer;
}

#lengthSelect {
    width: 180px;
    min-width: 0;
}