html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: Arial, sans-serif;
}

#app-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    width: 100vw;
    height: 100vh;
    background: #fff;
}

#map {
    width: 100%;
    height: 100%;
    min-width: 0;
}

#listing-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    background: #fff;
    border-left: 1px solid #b8b8b8;
    box-shadow: -2px 0 8px rgba(0,0,0,.10);
    overflow: hidden;
}

#listing-panel-header {
    padding: 6px 10px 5px;
    border-bottom: 1px solid #d2d2d2;
    background: #f4f4f4;
}

#listing-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

#listing-panel-title {
    font-size: 16px;
    font-weight: 700;
}

#subdivision-filter {
    max-width: 170px;
    height: 25px;
    padding: 2px 24px 2px 7px;
    border: 1px solid #aaa;
    border-radius: 4px;
    background: #fff;
    color: #333;
    font: inherit;
    font-size: 12px;
}

#listing-instructions {
    margin: 3px 0 0;
    color: #666;
    font-size: 12.5px;
    line-height: 1.2;
}

#listing-panel-content {
    flex: 1;
    min-height: 0;
    overflow: auto;
    background: #fff;
}

#listing-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 11px;
}

#listing-table th,
#listing-table td {
    padding: 4px 5px;
    border-bottom: 1px solid #e2e2e2;
    text-align: left;
    vertical-align: middle;
    line-height: 1.15;
}

#listing-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #efefef;
    font-size: 11.5px;
}

#listing-table th:nth-child(1),
#listing-table td:nth-child(1) {
    width: 22px;
    text-align: center;
}

#listing-table th:nth-child(2),
#listing-table td:nth-child(2) {
    width: 72px;
}

#listing-table th:nth-child(4),
#listing-table td:nth-child(4) {
    width: 76px;
    text-align: right;
}

#listing-table td:nth-child(3) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#listing-table tbody tr {
    cursor: pointer;
}

#listing-table tbody tr:hover {
    background: #f8f3df;
}


#listing-table tbody tr.is-map-hover {
    background: #f4e9b8;
    box-shadow: inset 4px 0 0 #9d7d00;
}

#listing-table tbody tr.is-selected {
    background: #e4d79b;
    box-shadow: inset 4px 0 0 #5f4a00;
    outline: 1px solid #7f6a2c;
    outline-offset: -1px;
}

.status-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    vertical-align: middle;
}

.status-dot.active {
    background: #d9b52f;
    border: 1px solid #9d7d00;
}

.status-dot.pending {
    background: #aba67a;
    border: 1px solid #77724e;
}

.view-listing-link {
    display: inline-block;
    padding: 3px 6px;
    border: 1px solid #8a6b00;
    border-radius: 3px;
    background: #fffdf4;
    color: #5f4a00;
    text-decoration: none;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.view-listing-link:hover {
    background: #f1e8bd;
}

@media (max-width: 760px) {
    html, body {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100%;
        overflow: hidden;
        overscroll-behavior: none;
    }

    #app-shell {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: 48vh minmax(0, 1fr);
        width: 100%;
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
    }

    #map {
        width: 100%;
        height: 100%;
        min-height: 0;
    }

    #listing-panel {
        width: 100%;
        height: 100%;
        min-height: 0;
        max-height: none;
        border-left: 0;
        border-top: 1px solid #b8b8b8;
        box-shadow: 0 -2px 8px rgba(0,0,0,.08);
        overflow: hidden;
    }

    #listing-panel-content {
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior-y: contain;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
    }

    #subdivision-filter {
        max-width: 158px;
        font-size: 11.5px;
    }

    #listing-table {
        font-size: 12px;
    }

    #listing-table th,
    #listing-table td {
        padding: 5px 4px;
    }

    #listing-table th:nth-child(2),
    #listing-table td:nth-child(2) {
        width: 68px;
    }

    #listing-table th:nth-child(4),
    #listing-table td:nth-child(4) {
        width: 72px;
    }
}
