:root {
    --app-bg: #f3f5f8;
    --app-surface: #ffffff;
    --app-surface-2: #f8fafc;
    --app-border: #d9dee6;
    --app-text: #111827;
    --app-muted: #5b6472;
    --app-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
    --app-radius: 8px;
    --app-radius-sm: 4px;
}

html[data-bs-theme="dark"] {
    --app-bg: #0f1318;
    --app-surface: #171c22;
    --app-surface-2: #1d242c;
    --app-border: #2d3742;
    --app-text: #eef2f7;
    --app-muted: #a4afbd;
    --app-shadow: 0 18px 38px rgba(0, 0, 0, 0.25);
}

body {
    background: var(--app-bg);
    color: var(--app-text);
}

.letter-space { letter-spacing: .08em; }
.navbar, .hero-section, footer { background: var(--app-bg); }
.app-navbar { backdrop-filter: blur(8px); }
.hero-panel,
.search-card,
.summary-card,
.station-card,
.warning-card,
.empty-state,
.loading-state,
.error-state,
.ad-slot {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    box-shadow: var(--app-shadow);
}
.hero-panel,
.search-card,
.summary-card,
.station-card,
.warning-card,
.empty-state,
.loading-state,
.error-state,
.ad-slot,
.btn-sharp,
.control-sharp,
.chip,
.status-badge,
.price-pill,
.logo-wrap,
.source-pill,
.ad-mock-badge {
    border-radius: var(--app-radius) !important;
}

.hero-panel, .search-card { min-height: 100%; }
.summary-card,
.station-card,
.warning-card,
.empty-state,
.loading-state,
.error-state,
.ad-slot { padding: 1rem; }
.summary-label {
    color: var(--app-muted);
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: .4rem;
}
.summary-value { font-size: 1.8rem; font-weight: 700; }
.average-card .summary-value { font-size: 2rem; }
.chip {
    display: inline-flex;
    align-items: center;
    padding: .5rem .75rem;
    border: 1px solid var(--app-border);
    background: var(--app-surface-2);
    color: var(--app-muted);
    font-size: .9rem;
}
.status-badge,
.source-pill,
.ad-mock-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: .35rem .7rem;
    border: 1px solid var(--app-border);
    background: var(--app-surface-2);
    color: var(--app-muted);
    font-size: .82rem;
    white-space: nowrap;
}
.fuel-check-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .4rem .9rem;
    padding: .75rem;
    border: 1px solid var(--app-border);
    background: var(--app-surface-2);
}
.form-control,
.form-select {
    background-color: var(--app-surface);
    border-color: var(--app-border);
    color: var(--app-text);
}
.form-control:focus,
.form-select:focus {
    background-color: var(--app-surface);
    color: var(--app-text);
    border-color: #7aa7ff;
    box-shadow: 0 0 0 .18rem rgba(59, 130, 246, 0.12);
}
.btn-primary {
    background: #1f6feb;
    border-color: #1f6feb;
}
.btn-primary:hover,
.btn-primary:focus { background: #185fc8; border-color: #185fc8; }
.btn-outline-secondary {
    border-color: var(--app-border);
    color: var(--app-text);
}
.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
    background: var(--app-surface-2);
    color: var(--app-text);
    border-color: var(--app-border);
}
.results-toolbar code {
    color: inherit;
    background: var(--app-surface-2);
    padding: .18rem .38rem;
    border: 1px solid var(--app-border);
    border-radius: 4px;
}
.station-card { height: 100%; }
.station-head {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: start;
    margin-bottom: 1rem;
}
.logo-wrap {
    width: 58px;
    height: 58px;
    border: 1px solid var(--app-border);
    background: var(--app-surface-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}
.logo-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: .45rem;
}
.logo-fallback {
    font-weight: 700;
    font-size: 1rem;
    color: var(--app-muted);
}
.station-title {
    margin: 0 0 .25rem;
    font-size: 1.15rem;
    font-weight: 700;
}
.station-subtitle,
.station-address,
.station-meta,
.price-updated,
.ad-placeholder-copy {
    color: var(--app-muted);
}
.station-address {
    margin: 0;
    font-size: .94rem;
    line-height: 1.45;
}
.price-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
    gap: .75rem;
    margin-bottom: 1rem;
}
.price-pill {
    border: 1px solid var(--app-border);
    background: var(--app-surface-2);
    padding: .75rem;
}
.price-label {
    color: var(--app-muted);
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.price-value {
    font-size: 1.35rem;
    font-weight: 700;
    margin: .15rem 0;
}
.station-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    padding-top: 1rem;
    border-top: 1px solid var(--app-border);
}
.warning-card {
    border-left: 4px solid #f59e0b;
    margin-bottom: 1rem;
}
.empty-state,
.loading-state,
.error-state {
    text-align: center;
    padding: 2rem 1rem;
}
.error-state { border-left: 4px solid #dc3545; }
.loading-state { border-left: 4px solid #1f6feb; }
.ad-slot {
    background-image: linear-gradient(135deg, rgba(31, 111, 235, 0.03), transparent 55%);
}
.ad-slot-label {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--app-muted);
    margin-bottom: .6rem;
}
.ad-placeholder-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: .2rem;
}
.hero-ad-slot .ad-slot-body {
    min-height: 90px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.inline-ad-slot .ad-slot-body {
    min-height: 100px;
}

@media (max-width: 767.98px) {
    .station-head {
        grid-template-columns: auto 1fr;
    }
    .station-distance {
        grid-column: 1 / -1;
        justify-self: start;
    }
}


.sharp-modal .modal-content,
.sharp-modal .modal-header,
.sharp-modal .modal-footer,
.disclaimer-box {
    border-radius: var(--app-radius) !important;
}

.disclaimer-box {
    max-height: 360px;
    overflow-y: auto;
    padding: 1rem;
    border: 1px solid var(--app-border);
    background: var(--app-surface-2);
}

.disclaimer-box p,
.disclaimer-box li {
    font-size: .96rem;
    line-height: 1.55;
}

.disclaimer-box ul {
    padding-left: 1.2rem;
    margin-bottom: 0;
}


.news-card .station-title {
    font-size: 1.2rem;
    line-height: 1.35;
}

.news-card .station-address {
    font-size: .96rem;
}

.ad-slot-label {
    color: var(--app-muted);
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: .5rem;
}

.ad-placeholder-title {
    font-weight: 700;
    margin-bottom: .2rem;
}

.bd-placeholder-img {
    font-size: 1.125rem;
    text-anchor: middle;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

@media (min-width: 768px) {
    .bd-placeholder-img-lg {
        font-size: 3.5rem;
    }
}

.b-example-divider {
    width: 100%;
    height: 3rem;
    background-color: #0000001a;
    border: solid rgba(0, 0, 0, 0.15);
    border-width: 1px 0;
    box-shadow: inset 0 0.5em 1.5em #0000001a, inset 0 0.125em 0.5em #00000026;
}

.b-example-vr {
    flex-shrink: 0;
    width: 1.5rem;
    height: 100vh;
}

.bi {
    vertical-align: -0.125em;
    fill: currentColor;
}

.nav-scroller {
    position: relative;
    z-index: 2;
    height: 2.75rem;
    overflow-y: hidden;
}

    .nav-scroller .nav {
        display: flex;
        flex-wrap: nowrap;
        padding-bottom: 1rem;
        margin-top: -1px;
        overflow-x: auto;
        text-align: center;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

.btn-bd-primary {
    --bd-violet-bg: #712cf9;
    --bd-violet-rgb: 112.520718, 44.062154, 249.437846;
    --bs-btn-font-weight: 600;
    --bs-btn-color: var(--bs-white);
    --bs-btn-bg: var(--bd-violet-bg);
    --bs-btn-border-color: var(--bd-violet-bg);
    --bs-btn-hover-color: var(--bs-white);
    --bs-btn-hover-bg: #6528e0;
    --bs-btn-hover-border-color: #6528e0;
    --bs-btn-focus-shadow-rgb: var(--bd-violet-rgb);
    --bs-btn-active-color: var(--bs-btn-hover-color);
    --bs-btn-active-bg: #5a23c8;
    --bs-btn-active-border-color: #5a23c8;
}

.bd-mode-toggle {
    z-index: 1500;
}

    .bd-mode-toggle .bi {
        width: 1em;
        height: 1em;
    }

    .bd-mode-toggle .dropdown-menu .active .bi {
        display: block !important;
    }