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

:root {
    color-scheme: light dark;
    --bg: #f6f8fb;
    --panel-bg: #fbfcff;
    --panel-border: #cccccc;
    --muted-border: #eeeeee;
    --text: #111111;
    --subtle-text: #333333;
    --muted-text: #666666;
    --link: #1a73e8;
    --hover-bg: #f0f0f0;
    --card-bg: #fafafa;
    --selected-bg: #ffe2b8;
    --selected-border: #f39c12;
    --control-bg: #fbfcff;
    --control-border: #d6d6d6;
    --spinner: #111111;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #121417;
        --panel-bg: #181c21;
        --panel-border: #2f3742;
        --muted-border: #2a313a;
        --text: #e9edf2;
        --subtle-text: #c6cfda;
        --muted-text: #9da9b7;
        --link: #82b4ff;
        --hover-bg: #242b33;
        --card-bg: #1d232a;
        --selected-bg: #413521;
        --selected-border: #f0b24f;
        --control-bg: #13181d;
        --control-border: #394350;
        --spinner: #e9edf2;
    }
}

body {
    font-family: Arial, sans-serif;
    height: 100vh;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
}

#map {
    width: 100%;
    height: calc(100% - 64px);
}

#info {
    position: fixed;
    top: 64px;
    right: 0;
    width: min(420px, 38vw);
    height: calc(100% - 64px);
    padding: 0;
    border-left: 1px solid var(--panel-border);
    background: var(--panel-bg);
    z-index: 1200;
    display: flex;
    flex-direction: column;
}

body.desktop-layout.info-open #map {
    width: calc(100% - min(420px, 38vw));
}

body.info-closed #info {
    display: none;
}

#info #location-sorter {
    padding-top: 10px;
    padding-left: 10px;
    padding-right: 10px;
    flex: 0 0 auto;
}

#info #location-sorter p {
    font-size: 14px;
    color: var(--subtle-text);
    margin-bottom: 10px;
}

#info #location-sorter select {
    padding: 5px;
    font-size: 20px;
    width: 100%;
    line-height: 64px;
    height: 64px;
    background: var(--control-bg);
    color: var(--text);
    border: 1px solid var(--control-border);
    border-radius: 8px;
}

#info #location-list {
    flex: 1 1 auto;
    min-height: 0;
    margin-top: 0;
    overflow-y: auto;
}

#info #location-list .location-list-placeholder {
    padding: 20px;
    text-align: center;
    color: var(--muted-text);
}

#info #location-list .location-list-placeholder p {
    font-size: 16px;
}

#info #location-list tr th {
    text-align: left;
    display: none;
}

#info #location-list .distance .title {
    display: none;
}

#info #location-list hr {
    border: none;
    border-top: 1px solid var(--muted-border);
    margin: 10px 0;
    text-align: left;
}

#info #location-list table {
    width: 100%;
}

#info #location-list .prices-title {
    display: none;
}

#info #location-list table tr td.price-value {
    text-align: right;
}

#info #location-list table tr td, #info #location-list table tr th {
    padding-right: 8px;
}

#info #location-list .location-list-item:not(:last-child) {
    margin-bottom: 10px;
}

#info #location-list .location-list-item:hover {
    background-color: var(--hover-bg);
}

#info #location-list .location-list-item.is-selected {
    background-color: var(--selected-bg);
    border-color: var(--selected-border);
    box-shadow: inset 0 0 0 1px var(--selected-border);
}

#info #location-list .location-list-item {
    border: 1px solid var(--muted-border);
    border-radius: 5px;
    margin: 10px;
    background-color: var(--card-bg);
    cursor: pointer;
    transition: background-color 0.2s ease;
    padding: 4px;
}

#info #location-list .location-list-item h3 {
    margin-bottom: 5px;
    color: var(--link);
    font-size: 16px;
}

.info-window {
    padding: 10px;
    max-width: 200px;
    background: var(--panel-bg);
    color: var(--text);
}

.info-window h3 {
    margin: 0 5px 8px 0;
    color: var(--link);
    font-size: 16px;
    padding-right: 44px;
}

.info-window p {
    margin: 4px 0;
    font-size: 14px;
    color: var(--subtle-text);
}

.info-window .description {
    color: var(--muted-text);
    font-size: 13px;
    margin-top: 8px;
}

.info-window table {
    margin-top: 8px;
}

.info-window table tr th {
    text-align: left;
}

.info-window table tr td {
    padding-top: 3px;
}

.info-window table tr td, .info-window table tr th {
    padding-right: 5px;
}

.gm-style-iw-chr {
    height: 0px;
    background: transparent !important;
}

.gm-style .gm-style-iw-c {
    background: var(--panel-bg) !important;
    color: var(--text) !important;
    border: 1px solid var(--panel-border);
    padding-inline-end: 0 !important;
}

.gm-style .gm-style-iw {
    background: var(--panel-bg) !important;
    color: var(--text) !important;
}

.gm-style .gm-style-iw-d {
    background: var(--panel-bg) !important;
    color: var(--text) !important;
    overflow: auto !important;
    scrollbar-color: var(--control-border) var(--panel-bg);
    scrollbar-width: thin;
}

.gm-style .gm-style-iw-d > div {
    background: var(--panel-bg) !important;
}

.gm-style .gm-style-iw-d::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.gm-style .gm-style-iw-d::-webkit-scrollbar-track {
    background: var(--panel-bg);
}

.gm-style .gm-style-iw-d::-webkit-scrollbar-thumb {
    background: var(--control-border);
    border-radius: 8px;
    border: 2px solid var(--panel-bg);
}

.gm-style .gm-style-iw-tc {
    background: transparent !important;
}

.gm-style .gm-style-iw-t::after {
    background: var(--panel-bg) !important;
}

.gm-style .gm-style-iw-c,
.gm-style .gm-style-iw-d,
.gm-style .gm-style-iw,
.gm-style .gm-style-iw-t::after {
    box-shadow: none !important;
}

.top-nav {
    height: 64px;
    display: flex;
    align-items: stretch;
}

.top-nav #location-input {
    height: 64px;
    flex: 1 1 auto;
    min-width: 0;
    display: block;
    background: var(--control-bg);
    color: var(--text);
    border: 1px solid var(--control-border);
    border-right: 0;
    padding: 20px;
    font-size: 20px;
    line-height: 64px;
}

.top-nav #menu-toggle {
    height: 64px;
    width: 64px;
    flex: 0 0 64px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--control-bg);
    color: var(--text);
    border: 1px solid var(--control-border);
    line-height: 1;
    padding: 0;
}

.top-nav #location-input::placeholder {
    color: var(--muted-text);
}

.top-nav #menu-toggle .menu-icon {
    width: 45px;
    height: 45px;
}

.top-nav #menu-toggle .menu-icon path {
    stroke: currentColor;
    fill: currentColor;
}

.top-nav #menu-toggle .menu-icon-close {
    display: none;
}

.top-nav #menu-toggle.is-open .menu-icon-open {
    display: none;
}

.top-nav #menu-toggle.is-open .menu-icon-close {
    display: inline-block;
}

@media (max-width: 900px) {
    #map {
        width: 100%;
    }

    #info {
        left: 0;
        right: 0;
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--panel-border);
    }

    body.mobile-layout.info-open {
        overflow: hidden;
    }

    body.mobile-layout.info-open #info {
        display: block;
    }
}
