/* ─────────────────────────────────────────
   SHARED VARIABLES & RESET
───────────────────────────────────────── */

:root {
    --accent-color: #d95f02;
}

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

body, html {
    margin: 0;
    padding: 0;
    font-family: 'IBM Plex Mono', monospace;
    color: black;
    height: 100vh;
    overflow: hidden;
}

/* ─────────────────────────────────────────
   LAYOUT
───────────────────────────────────────── */

#container {
    display: flex;
    height: 100vh;
}

#map {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 80%;
}

#sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 20%;
    height: 100vh;
    overflow-y: auto;
    background: white;
    padding: 2em;
    display: flex;
    flex-direction: column;
}

/* ─────────────────────────────────────────
   SIDEBAR HEADER
───────────────────────────────────────── */

#sidebar-header {
    padding: 0 0 20px 0;
    background: transparent;
    color: black;
}

.title-box {
    position: relative;
    margin-bottom: 12px;
}

.title-box::before,
.title-box::after {
    content: '';
    position: absolute;
    top: -3px;
    height: 3px;
    width: 40px;
    background: black;
    z-index: 1;
}
.title-box::before { left: 0; }
.title-box::after  { right: 0; }

#sidebar-header h1 {
    font-size: 20px;
    font-weight: 700;
    text-transform: uppercase;
    border: 1px solid black;
    border-bottom: none;
    padding: 8px 12px;
}

.title-box-btm {
    height: 3px;
    display: flex;
    justify-content: space-between;
}
.title-box-btm::before {
    content: '';
    width: 20%;
    background: black;
}
.title-box-btm::after {
    content: '';
    width: 40%;
    background: black;
}

#sidebar-header p {
    font-size: 13px;
    opacity: 0.75;
    margin-top: 6px;
}

/* ─────────────────────────────────────────
   SIDEBAR CONTENT
───────────────────────────────────────── */

#sidebar-content {
    padding: 0;
    flex: 1;
}

.detail-label {
    font-weight: 600;
    color: black;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

/* ─────────────────────────────────────────
   LEGEND
───────────────────────────────────────── */

#legend {
    padding: 20px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.legend-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    margin-bottom: 8px;
}

.legend-answer {
    font-weight: 600;
    font-size: 12px;
}

.legend-sub {
    font-size: 10px;
    color: black;
    margin-top: 1px;
}

.legend-toggle {
    cursor: pointer;
    user-select: none;
    transition: opacity 0.15s;
}

.legend-toggle:not(.active) {
    opacity: 0.35;
}

.legend-toggle:hover {
    opacity: 0.75;
}

.legend-toggle.active:hover {
    opacity: 0.8;
}

#legend-hint {
    font-weight: 400;
    font-size: 10px;
    color: black;
    text-transform: none;
    letter-spacing: 0;
}

/* ─────────────────────────────────────────
   STATS
───────────────────────────────────────── */

#stats {
    padding: 20px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

#stats-district {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed rgba(0, 0, 0, 0.15);
}

.stats-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    margin-bottom: 4px;
    line-height: 1.4;
}

.stats-label {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.4px;
    margin-bottom: 2px;
}

.stats-key {
    color: #666;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1;
}

.stats-val {
    font-weight: 600;
}

.stats-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 52px 48px 52px;
    column-gap: 6px;
    row-gap: 5px;
    align-items: start;
    margin-top: 4px;
}

.sg-head {
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    text-decoration: underline;
    color: black;
    text-align: right;
    width: 100%;
}

.sg-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.sg-val {
    font-weight: 600;
    font-size: 11px;
    text-align: right;
    line-height: 1.5;
    width: 100%;
}

.sg-pct {
    font-weight: 400;
    color: black;
    font-size: 10px;
}

/* ─────────────────────────────────────────
   DISTRICT FILTER
───────────────────────────────────────── */

#district-filter {
    padding: 20px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    font-size: 13px;
}

#district-filter-label {
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    color: #000;
}

.district-check {
    display: block;
    margin-bottom: 4px;
    cursor: pointer;
}

/* ─────────────────────────────────────────
   PARCEL INFO PANEL
───────────────────────────────────────── */

#parcel-info {
    padding: 20px 0;
}

#parcel-details {
    margin-top: 4px;
}

.parcel-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 5px;
    font-size: 12px;
    line-height: 1.4;
}

.parcel-row--highlight {
    margin-top: 6px;
    font-size: 13px;
    font-weight: 700;
}

.parcel-key {
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #666;
    flex-shrink: 0;
    font-size: 11px;
}

.parcel-val {
    text-align: right;
    word-break: break-word;
}

.parcel-divider {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    margin: 6px 0;
}

/* ─────────────────────────────────────────
   MOBILE
───────────────────────────────────────── */

@media (max-width: 768px) {
    body, html {
        overflow: auto;
    }

    #container {
        flex-direction: column;
        height: auto;
    }

    #map {
        position: relative;
        width: 100%;
        height: 50vh;
        order: 2;
    }

    #sidebar {
        position: relative;
        width: 100%;
        height: auto;
        overflow-y: visible;
        order: 1;
    }
}
