body {
    font-family: serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}
header {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 1rem;
    font-size: 2rem;
    display: flex;
    position: relative;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
}
#gpts {
    position: absolute;
    left: 1rem;
}
#gpts img {
    width: 40px;
}
#external-link {
    width: 1rem;
    height: 1rem;
    margin-bottom: -0.2rem;
    margin-left: 0.3rem;
    margin-right: 0.3rem;
}
.container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
}
.map-container {
    display: flex;
    flex: 1;
    height: 50%;
    overflow: hidden;
    width: 100%;
}
.sidebar {
    width: 20%;
    background-color: #f4f4f4;
    border-right: 1px solid #ddd;
    overflow-y: auto;
    height: 100%;
    padding: 1rem;
    box-sizing: border-box;
    transition: transform 0.3s ease;
}
.sidebar h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    margin-top: 0;
}
.compare-table-container {
    flex: 1;
    overflow: auto;
    display: flex;
    flex-direction: column;
}
.compare-table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    margin: 0.5rem auto;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    table-layout: auto;
    font-size: 0.875rem;
    flex: 1;
}
#th-item {
    width: 10%;
}
#th-base, #th-target {
    width: 45%;
}
.compare-table th, .compare-table td {
    border: 1px solid #ddd;
    padding: 0.3rem 0.75rem;
    text-align: left;
}
.compare-table th {
    background-color: #f4f4f4;
    font-weight: bold;
}
.compare-table tr:nth-child(even) {
    background-color: #f9f9f9;
}
.estate-item {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    border: 1px solid #ddd;
    background-color: white;
    cursor: pointer;
}
.estate-item:hover {
    background-color: #eaeaea;
}
.estate-item.selected {
    background-color: #d0e8ff;
}
#map {
    flex: 1;
    height: calc(100% - 20px);
    margin: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-height: 300px;
    box-sizing: border-box;
}
.estate-info {
    display: flex;
    justify-content: center;
    padding-bottom: 2.5rem;
}
footer {
    background-color: #333;
    width: 100%;
    color: white;
    text-align: center;
    padding: 0.75rem;
    font-size: 0.875rem;
    bottom: 0;
    align-items: center;
    justify-content: center;
    position: fixed;
    box-sizing: border-box;
}
footer a {
    margin-left: 0.2rem;
    color: white;
    text-decoration: none;
}
footer a:hover {
    text-decoration: underline;
}
hr {
    border: 0.5px solid #ddd;
    margin: 0.1rem;
}
.tooltip {
    padding: 10px;
    background-color: #fff;
    box-shadow: 2px 2px 2px 2px #adadad;
}
.tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    padding-bottom: 5px;
}
.tooltip-header a:nth-child(1) {
    color: #7776b3;
    text-decoration: none;
    font-weight: 800;
    margin-left: 1rem;
}
#tooltip-header-0 div {
    margin-bottom: 0.1rem;
}
.tooltip-header span:nth-child(2) {
    margin-left: 0.3rem;
    margin-right: 0.3rem;
}
.tooltip-body {
    margin-top: 10px;
}
.tooltip-body table {
    width: 100%;
    border-collapse: collapse;
    border: none;
}
.tooltip-body th, .tooltip-body td {
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    padding: 8px;
    text-align: left;
    font-weight: normal;
}
.tooltip-body th {
    background-color: #f9f9f9;
}
.tooltip-body th:first-child {
    border-left: none;
    font-size: 0.85rem;
    font-weight: bold;
}
.tooltip-body td:last-child {
    border-right: none;
    font-size: 0.925rem;
}
#serviceTitle {
    align-items: center;
    display: inline-flex;
    transform: translateX(3rem);
}
#mainTitle {
    margin-right: 1rem;
}
#subTitle {
    font-size: 0.8rem;
    align-self: flex-end;
    padding-bottom: 0.3rem;
}
#subTitleSpan {
    font-size: 0.9rem;
}
@media screen and (max-width: 768px), screen and (orientation: landscape) and (max-height: 500px) {
    body {
        overflow: auto;
        width: 100%;
    }
    .container {
        flex: none;
        height: auto;
        overflow: visible;
        width: 100%;
    }
    .sidebar {
        width: 100%;
        height: auto;
        border-right: none;
    }
    .map-container {
        flex-direction: column;
        height: auto;
        width: 100%;
    }
    #map {
        height: 300px;
        width: 100%;
        margin: 0;
    }
    .estate-info {
        padding-bottom: 0;
    }
    .compare-table-container {
        overflow-x: auto;
        overflow-y: auto;
    }
    .compare-table {
        font-size: 0.75rem;
        width: 100%;
        min-width: 600px;
        table-layout: auto;
    }
    footer {
        position: relative;
    }
    #tooltip {
        td {
            text-overflow: ellipsis;
            max-width: 5rem;
            overflow: hidden;
            white-space: nowrap;
            padding: 0.1rem 0.5rem;
        }
        th {
            max-width: 2rem;
            overflow: hidden;
            white-space: nowrap;
            padding: 2px;
        }
        .tooltip-header a {
            text-overflow: ellipsis;
            max-width: 5rem;
            overflow: hidden;
            white-space: nowrap;
            margin-left: 0.3rem;
        }
    }
    .sidebar.hidden {
        display: none;
    }
}