* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f3f5f7;
    color: #28323b;
    font-family: Arial, sans-serif;
    font-size: 14px;
}

.header {
    background: #205b81;
    color: white;
    padding: 17px 24px;
}

.header-inner {
    max-width: 1500px;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.header h1 {
    font-size: 23px;
    margin: 0 0 4px;
}

.header p {
    margin: 0;
    color: #d8e5ed;
}

.header-right {
    text-align: right;
    display: grid;
    gap: 5px;
    font-size: 13px;
}

.layout {
    max-width: 1500px;
    margin: 20px auto;
    padding: 0 16px;
    display: grid;
    grid-template-columns: 350px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.sidebar, .panel, .main-content {
    background: white;
    border: 1px solid #d8dee4;
    border-radius: 6px;
}

.sidebar {
    padding: 18px;
}

h2 {
    font-size: 18px;
    margin: 0 0 16px;
}

h3 {
    font-size: 15px;
    margin: 0;
}

label {
    font-size: 13px;
    font-weight: bold;
    display: block;
    margin: 12px 0 6px;
}

input, select {
    width: 100%;
    padding: 10px;
    font-family: inherit;
    font-size: 14px;
    color: #28323b;
    background: white;
    border: 1px solid #bfc9d2;
    border-radius: 4px;
}

input:focus, select:focus, button:focus-visible {
    outline: 2px solid #71a8d0;
    outline-offset: 1px;
}

.two-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

button {
    border: 0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    padding: 10px 12px;
}

.primary-button {
    background: #205b81;
    color: white;
}

.secondary-button, .city-button {
    background: #e8eef3;
    color: #264b64;
    border: 1px solid #d2dde5;
}

.secondary-button.active {
    background: #205b81;
    color: white;
}

.buttons-row {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.buttons-row button {
    flex: 1;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #e3e7eb;
    margin-top: 17px;
    padding-top: 16px;
}

#resultCount, .small-text, .message, .map-note {
    color: #6a747d;
    font-size: 12px;
}

.message {
    line-height: 1.6;
}

.station-list {
    max-height: 530px;
    overflow-y: auto;
    margin-top: 8px;
}

.station-item {
    border: 1px solid #e0e5e8;
    padding: 12px;
    margin-bottom: 9px;
    border-radius: 4px;
}

.station-item strong {
    display: block;
    margin-bottom: 6px;
}

.station-item p {
    margin: 5px 0;
    font-size: 12px;
    color: #59646d;
    line-height: 1.5;
}

.station-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.station-actions button {
    background: #e8eef3;
    color: #245a7a;
    padding: 6px 10px;
}

.main-content {
    padding: 14px;
    min-width: 0;
}

.map-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-weight: bold;
}

.cities {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.city-button {
    padding: 7px 9px;
}

#map {
    height: 560px;
    width: 100%;
    border: 1px solid #cbd4da;
}

.map-note {
    margin: 9px 1px 16px;
}

.bottom-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.panel {
    padding: 16px;
    min-width: 0;
}

.panel p {
    line-height: 1.6;
}

.panel h2 {
    margin-bottom: 9px;
}

.panel label {
    margin-top: 8px;
}

.panel a, footer a {
    color: #205b81;
}

.panel button {
    margin-top: 12px;
}

.panel .calculation {
    font-weight: bold;
    color: #205b81;
}

.detail-line {
    margin: 7px 0;
    font-size: 13px;
    overflow-wrap: anywhere;
}

footer {
    max-width: 1500px;
    margin: 0 auto;
    padding: 8px 20px 30px;
    color: #69727b;
    font-size: 12px;
}

@media (max-width: 900px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .station-list {
        max-height: 260px;
    }

    #map {
        height: 460px;
    }
}

@media (max-width: 570px) {
    .header-inner, .map-top {
        align-items: flex-start;
        flex-direction: column;
    }

    .header-right {
        text-align: left;
    }

    .bottom-sections {
        grid-template-columns: 1fr;
    }

    #map {
        height: 390px;
    }
}
