/* Choropleth Threshold Lab - styles (based on the map template) */
* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: white;
    color: #222;
}

main { background: aliceblue; border: 1px solid silver; }

h2 {
    text-align: center;
    font-size: 19px;
    font-weight: normal;
    margin: 0;
    padding: 7px 8px 2px 8px;
}
.subtitle { text-align: center; font-size: 13px; color: #7f1d1d; padding-bottom: 5px; }

#map {
    width: 100%;
    height: 420px;
    border-top: 1px solid silver;
    border-bottom: 1px solid silver;
    background: #dde7ee;
}

/* ---------- hover info panel ---------- */
.info {
    padding: 7px 10px;
    font-size: 14px;
    line-height: 1.4;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.25);
    border-radius: 6px;
    min-width: 170px;
}
.info h4 { margin: 0 0 3px 0; font-size: 15px; }
.info .swatch { display: inline-block; width: 13px; height: 13px; border-radius: 2px; vertical-align: -2px; margin-right: 4px; border: 1px solid #555; }

/* ---------- legend with class counts ---------- */
#legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 12px;
    padding: 6px 8px;
    background: white;
    border-bottom: 1px solid silver;
    font-size: 14px;
}
.lg { display: inline-flex; align-items: center; gap: 5px; }
.lg i { display: inline-block; width: 20px; height: 14px; border: 1px solid #555; border-radius: 2px; }
.lg .n { color: #444; font-size: 13px; }

/* ---------- controls ---------- */
.controls { background: white; padding: 4px 8px 8px 8px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 4px; }
select, button { font-size: 14px; padding: 3px 6px; }
label { font-size: 14px; }
.sliders {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 20px;
    margin-top: 4px;
}
.slider-row { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.slider-row span.name { width: 118px; flex: 0 0 118px; }
.slider-row input[type=range] { flex: 1 1 auto; min-width: 0; }
.judge {
    margin-top: 6px;
    padding: 5px 8px;
    background: aliceblue;
    border: 1px solid silver;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.4;
}
#feedback { margin-top: 3px; min-height: 58px; }
.ok { color: #14532d; font-weight: bold; }
.no { color: #b91c1c; font-weight: bold; }

/* medium widths: the legend and feedback wrap, so the map gives up a little height */
@media (max-width: 719px) {
    #map { height: 380px; }
}

/* narrow screens: shorter map, sliders stacked in one column */
@media (max-width: 599px) {
    #map { height: 240px; }
    h2 { font-size: 16px; padding-top: 4px; }
    .subtitle { padding-bottom: 3px; }
    #legend { font-size: 13px; gap: 2px 10px; padding: 4px 6px; }
    .slider-row span.name { width: 100px; flex: 0 0 100px; }
    .judge { font-size: 13px; }
    .sliders { grid-template-columns: 1fr; }
    .info { font-size: 13px; min-width: 140px; }
}
