* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

#map {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
}

.map-info {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 1;
    background: rgba(255, 255, 255, 0.92);
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    font-size: 13px;
    color: #333;
    pointer-events: none;
}

/* Маркер-пончик кластера */
.cluster-donut {
    cursor: pointer;
}

.cluster-donut svg {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.cluster-donut text {
    fill: #333;
    font-weight: 600;
}

/* Всплывающее окно с информацией о заправке */
.station-popup .maplibregl-popup-content {
    padding: 14px 16px;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
    max-width: min(280px, 90vw);
    max-height: 60vh;
    overflow-y: auto;
}

.station-popup h3 {
    margin: 0 0 8px;
    font-size: 16px;
    color: #1a1a1a;
}

.station-popup .brand {
    display: inline-block;
    background: #e8f0fe;
    color: #1a56db;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
    margin-bottom: 8px;
}

.station-popup dl {
    margin: 0;
    font-size: 13px;
    color: #444;
}

.station-popup dt {
    font-weight: 600;
    margin-top: 6px;
    color: #666;
}

.station-popup dd {
    margin: 2px 0 0;
}

.station-popup .fuel-avail {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 4px;
}

.station-popup .fuel-avail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.station-popup .fuel-grade {
    font-size: 12px;
    color: #333;
}

.station-popup .avail {
    font-size: 11px;
    font-weight: 600;
    padding: 1px 8px;
    border-radius: 10px;
}

.station-popup .avail-yes {
    background: #e6f4ea;
    color: #137333;
}

.station-popup .avail-no {
    background: #fce8e6;
    color: #c5221f;
}

.station-popup .avail-unknown {
    background: #f1f3f4;
    color: #5f6368;
}

/* Фотографии заправки */
.station-popup .station-photos {
    margin: 8px 0 4px;
}

.station-popup .station-photo-main img {
    display: block;
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 8px;
}

.station-popup .photo-upload-btn {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 12px;
    background: #1a56db;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
}

.station-popup .photo-upload-btn input {
    display: none;
}

.station-popup .photo-upload-status {
    font-size: 11px;
    color: #666;
    margin-top: 4px;
    min-height: 14px;
}

.station-popup a {
    color: #1a56db;
    text-decoration: none;
    word-break: break-all;
}

.station-popup a:hover {
    text-decoration: underline;
}

/* Адаптация под мобильные устройства */
@media (max-width: 600px) {
    .map-info {
        font-size: 12px;
        padding: 6px 10px;
        max-width: 60vw;
    }

    /* Более крупные, удобные для касания элементы управления. */
    .maplibregl-ctrl button {
        width: 32px;
        height: 32px;
    }
}
