* {
    box-sizing: border-box;
}

:root {
    --bg: #f4f7fb;
    --card: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --accent: #d91f26;
    --accent-dark: #a31217;
    --border: #dbe3ee;
    --shadow: 0 10px 30px rgba(22, 34, 51, 0.08);
}

html, body {
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
}

img {
    max-width: 100%;
    display: block;
}

button {
    font: inherit;
}

.page {
    width: min(1400px, calc(100% - 24px));
    margin: 0 auto;
    padding: 18px 0 32px;
}

.hero {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #fff;
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.eyebrow {
    margin: 0 0 8px;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.8;
}

.hero h1 {
    margin: 0 0 10px;
    font-size: clamp(28px, 4vw, 42px);
}

.lead {
    margin: 0;
    max-width: 760px;
    color: rgba(255,255,255,0.84);
}

.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.map-card,
.sidebar-card,
.alert {
    background: var(--card);
    border-radius: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.alert {
    padding: 14px 16px;
    margin-bottom: 16px;
}

.alert-error {
    border-color: #fecaca;
    background: #fff1f2;
    color: #991b1b;
}

.card-header {
    padding: 20px 20px 0;
}

.card-header h2 {
    margin: 0 0 6px;
    font-size: 22px;
}

.card-header p {
    margin: 0;
    color: var(--muted);
}

.map-wrapper {
    position: relative;
    margin: 20px;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: #fff;
}

.map-image {
    width: 100%;
    height: auto;
}

.station-marker {
    position: absolute;
    transform: translate(-50%, -100%);
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
    z-index: 2;
}

.station-marker::before {
    content: "";
    display: block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    position: relative;
    z-index: 2;
}

.pulse {
    position: absolute;
    left: 50%;
    top: 9px;
    width: 18px;
    height: 18px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: rgba(217, 31, 38, 0.28);
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(2.3); opacity: 0; }
}

.station-popup {
    position: absolute;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%) scale(0.92);
    transform-origin: bottom center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    min-width: 230px;
    max-width: min(300px, 76vw);
}

.station-popup-inner {
    display: block;
    background: rgba(255,255,255,0.98);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.18);
    padding: 12px;
    text-align: left;
}

.station-popup-inner::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -8px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    transform: translateX(-50%) rotate(45deg);
}

.station-marker:hover,
.station-marker:focus-visible,
.station-marker:active {
    z-index: 10;
}

.station-marker:hover .station-popup,
.station-marker:focus-visible .station-popup,
.station-marker:active .station-popup {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1);
}

.station-header-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.station-logo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--border);
    flex: 0 0 auto;
}

.station-logo-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    background: #eef2ff;
    color: #1d4ed8;
}

.station-title-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.station-title-block strong {
    font-size: 15px;
}

.station-title-block small,
.updated-at,
.no-data {
    color: var(--muted);
    font-size: 12px;
}

.fuel-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fuel-row,
.mini-fuel-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.fuel-row strong,
.mini-fuel-row strong {
    color: var(--accent-dark);
}

.updated-at {
    display: block;
    margin-top: 10px;
}

.sidebar-card {
    padding-bottom: 12px;
}

.station-list {
    padding: 16px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.station-list-item {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px;
    background: #fbfdff;
}

.station-list-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.station-list-top h3 {
    margin: 0 0 4px;
    font-size: 17px;
}

.station-list-top p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.brand-badge {
    white-space: nowrap;
    background: #eef2ff;
    color: #3730a3;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: bold;
}

.mini-fuels {
    display: grid;
    gap: 6px;
}

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

@media (max-width: 700px) {
    .page {
        width: min(100% - 12px, 1400px);
        padding-top: 8px;
    }

    .hero,
    .card-header,
    .station-list,
    .map-wrapper {
        border-radius: 16px;
    }

    .hero {
        padding: 18px;
    }

    .card-header {
        padding: 16px 16px 0;
    }

    .map-wrapper {
        margin: 16px;
    }

    .station-popup {
        min-width: 210px;
        max-width: min(260px, 82vw);
    }

    .station-marker::before,
    .pulse {
        width: 16px;
        height: 16px;
    }
}
