:root {
    --bg: #F6F5F3;
    --surface: #ffffff;
    --border: #CFCBC3;
    --field-bg: #ffffff;
    --field-border: #7C786F;
    --primary: #C2540A;
    --primary-light: #FF7A1A;
    --primary-dark: #8A3A00;
    --primary-tint: #FFF0E3;
    --on-primary: #ffffff;
    --header-bg: #111111;
    --btn-bg: #FF7A1A;
    --btn-ink: #111111;
    --accent-bg: #FF7A1A;
    --accent-ink: #111111;
    --highlight: #FF7A1A;
    --text: #111111;
    --text-secondary: #45423D;
    --shadow-soft: 0 1px 3px rgba(17, 17, 17, 0.1), 0 1px 2px rgba(17, 17, 17, 0.08);
    --status-up: #B3261E;
    --status-down: #1B6B3A;
    --status-muted: #8A8A8A;
    --lockup-subtitle: #D9D6D0;
    --font-display: 'Bricolage Grotesque', 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    --page-pad: 20px;
    --content-max: 640px;
}

html { font-size: 106%; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

svg[viewBox] path, svg[viewBox] line, svg[viewBox] circle, svg[viewBox] rect {
    stroke-linecap: square;
    stroke-linejoin: miter;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    margin: 0;
    padding: calc(var(--page-pad) + env(safe-area-inset-top)) calc(var(--page-pad) + env(safe-area-inset-right)) 0 calc(var(--page-pad) + env(safe-area-inset-left));
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
}

.app-container {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    position: relative;
    display: flex; flex-direction: column;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    background: var(--header-bg);
    border-bottom: 3px solid var(--accent-bg);
    border-radius: 12px;
    padding: 14px 16px;
}

#offline-banner {
    margin: 0 0 12px;
    padding: 10px 14px;
    border-radius: 4px;
    background: var(--status-up);
    color: white;
    font-size: 0.82rem;
    font-weight: 600;
}

#update-banner {
    margin: 0 0 12px;
    padding: 10px 14px;
    border-radius: 4px;
    background: var(--status-down);
    color: white;
    font-size: 0.82rem;
    font-weight: 600;
}
#update-banner:not([hidden]) {
    display: flex;
    align-items: center;
    gap: 10px;
}
#update-banner > span { flex: 1; }
#update-banner a { color: white; }
#update-close {
    flex-shrink: 0;
    min-width: 32px;
    min-height: 32px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: white;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
}

#alerts-toggle-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    cursor: pointer;
}
#alerts-note { margin: 8px 0 0; font-size: 0.78rem; color: var(--text-secondary); }
#alerts-options { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; font-size: 0.85rem; }
#alerts-options label { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
#alerts-rises-wrap { justify-content: flex-start; cursor: pointer; }
#alerts-threshold { min-height: 40px; padding: 0 8px; font: inherit; }

.home-link-wrap { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
#app-logomark svg { width: 46px; height: 46px; border-radius: 11px; flex-shrink: 0; }
#app-logomark { display: flex; }

.home-link-wrap strong {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 800;
    display: block;
    letter-spacing: -0.01em;
    color: white;
}
.home-link-wrap strong .plus {
    color: var(--highlight); font-size: 1.15em; font-weight: 500;
    display: inline-block; transform: rotate(-8deg) translateY(-2px);
}
.home-link-wrap #app-subtitle {
    display: block;
    font-size: 0.72rem;
    color: var(--lockup-subtitle);
}

.header-actions { display: flex; gap: 8px; }
.header-actions .btn-icon {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.35);
    color: white;
}

.btn-icon {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text);
}
.btn-icon svg { width: 18px; height: 18px; stroke-width: 2.1; }

.count-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--primary);
    color: var(--on-primary);
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 3px;
    padding: 1px 5px;
    min-width: 16px;
    text-align: center;
}

#national-stats {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 12px;
    overflow: hidden;
}
#national-stats-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    color: var(--text);
}
#national-stats-toggle svg { width: 16px; height: 16px; flex-shrink: 0; transition: transform 0.15s ease; }
#national-stats-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

.national-stats__figures { display: flex; gap: 20px; }
.national-stats__figures span { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
.national-stats__figures small { font-size: 0.68rem; color: var(--text-secondary); }
.national-stats__figures strong { font-family: var(--font-display); font-size: 1rem; }

#national-stats-detail { padding: 4px 14px 14px; border-top: 1px solid var(--border); }
#national-stats-note { font-size: 0.76rem; color: var(--text-secondary); margin: 8px 0 0; }

#search-form {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    position: relative;
}
#search-suggestions {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 1150;
    list-style: none;
    margin: 0;
    padding: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}
#search-suggestions li button {
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border: none;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    font-family: inherit;
    font-size: 0.87rem;
    color: var(--text);
    cursor: pointer;
}
#search-suggestions li:last-child button { border-bottom: none; }
#search-suggestions li button:hover { background: var(--primary-tint); }
#search-suggestions li button small { display: block; color: var(--text-secondary); font-size: 0.76rem; margin-top: 2px; }
#search-input {
    flex: 1;
    padding: 10px 12px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-family: inherit;
    font-size: 0.92rem;
    color: var(--text);
}
#search-form > button {
    flex-shrink: 0;
}

#back-to-nearby {
    display: block;
    background: none;
    border: none;
    color: var(--primary);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0 0 12px;
    cursor: pointer;
    margin-top: -4px;
}

#geo-toggle[aria-pressed="true"] { background: rgba(255, 255, 255, 0.3); }

#filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
#filters-bar select {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    box-sizing: border-box;
    padding: 8px 10px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--bg);
    font-family: inherit;
    font-size: 0.84rem;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#view-toggle {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1250;
    margin: 0;
    border: none;
    border-radius: 0;
    background: var(--surface);
    padding: 0 0 env(safe-area-inset-bottom);
}
#view-toggle button {
    flex: 1;
    min-height: 68px;
    padding: 8px 2px;
    border: none;
    border-radius: 0;
    background: var(--surface);
    font-family: inherit;
    font-weight: 800;
    font-size: 0.78rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    cursor: pointer;
    color: var(--text-secondary);
}
#view-toggle button + button { border-left: 1px solid var(--border); }
#view-toggle button[aria-selected="true"] {
    background: var(--accent-bg);
    color: var(--accent-ink);
}

#geo-ask { text-align: center; }
#geo-ask-logomark { display: flex; justify-content: center; margin-bottom: 12px; }
#geo-ask-logomark svg { width: 56px; height: 56px; border-radius: 14px; }
#geo-ask h3 { margin: 0 0 10px; color: var(--text); font-family: var(--font-display); }
#geo-ask p { margin: 0 0 16px; font-size: 0.86rem; color: var(--text-secondary); }
#geo-ask-actions { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
#geo-ask-actions .pill { background: var(--accent-bg); color: var(--accent-ink); border-color: var(--accent-bg); padding: 11px; }
#geo-skip {
    background: none; border: none; color: var(--text-secondary);
    font-family: inherit; font-size: 0.82rem; text-decoration: underline; cursor: pointer; padding: 4px;
}

#geo-fallback {
    font-size: 0.82rem;
    color: var(--text-secondary);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 12px;
}
#geo-retry {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    font-family: inherit;
    padding: 0;
}

#stations-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.station-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 12px 14px;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}
.station-card__main { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.station-card__main strong { font-family: var(--font-display); font-size: 0.95rem; }
.station-card__address { font-size: 0.78rem; color: var(--text-secondary); }
.station-card__distance { font-size: 0.76rem; color: var(--primary-dark); font-weight: 600; }
.station-card__prices { display: flex; flex-direction: column; gap: 3px; font-size: 0.8rem; text-align: right; white-space: nowrap; }

.badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 3px;
    background: #111111;
    color: #FFFFFF;
}
.badge--24h { background: var(--accent-bg); color: var(--accent-ink); }

#stations-empty { color: var(--text-secondary); text-align: center; padding: 24px; font-size: 0.9rem; }
#stations-geocoded-note {
    background: var(--primary-tint);
    color: var(--primary-dark);
    border-radius: 4px;
    padding: 10px 12px;
    font-size: 0.82rem;
    margin-bottom: 10px;
}

#stations-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px 0 6px;
}
#stations-pagination .pill:disabled { opacity: 0.4; cursor: default; }
#pagination-status { color: var(--text-secondary); font-size: 0.85rem; white-space: nowrap; }

#map-controls { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.pill {
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text);
    text-decoration: none;
    display: inline-block;
}
.pill[aria-pressed="true"] { background: var(--accent-bg); color: var(--accent-ink); border-color: var(--accent-bg); }

#map-wrap { position: relative; }
#map { height: 60vh; height: 60dvh; min-height: 360px; border-radius: 4px; border: 1px solid var(--border); }
#map-note { margin: 8px 0 0; font-size: 0.78rem; color: var(--text-secondary); }

#map-legend {
    position: absolute;
    left: 10px;
    bottom: 10px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.7rem;
    color: var(--text-secondary);
    box-shadow: var(--shadow-soft);
}
#map-legend-gradient {
    width: 60px;
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(to right, hsl(120, 70%, 42%), hsl(60, 70%, 42%), hsl(0, 70%, 42%));
}

.marker-cluster-small, .marker-cluster-medium, .marker-cluster-large {
    background: rgba(255, 122, 26, 0.25);
}
.marker-cluster-small div, .marker-cluster-medium div, .marker-cluster-large div {
    background: var(--primary);
    color: var(--on-primary);
    font-weight: 700;
}

dialog {
    border: none;
    border-radius: 6px;
    box-shadow: 0 12px 40px rgba(34, 29, 18, 0.25);
    padding: 20px;
    max-width: 420px;
    width: calc(100% - 40px);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
}
dialog::backdrop { background: rgba(34, 29, 18, 0.5); }

#station-modal h3 { font-family: var(--font-display); margin: 10px 0 4px; font-size: 1.2rem; color: var(--text); }
#modal-municipio, #modal-horario { color: var(--text-secondary); font-size: 0.85rem; margin: 2px 0; }

#modal-fuels {
    list-style: none;
    padding: 0;
    margin: 14px 0;
    border-top: 1px solid var(--border);
}
#modal-fuels li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

#modal-zone-comparison {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

#modal-top-actions { display: flex; justify-content: space-between; margin-bottom: 10px; }
#modal-favorite-toggle[aria-pressed="true"] { color: var(--status-up); border-color: var(--status-up); }
#modal-favorite-toggle[aria-pressed="true"] svg { fill: var(--status-up); }

#modal-actions { display: flex; gap: 8px; margin-top: 14px; }
#modal-actions .pill { flex: 1; text-align: center; }
#modal-directions { background: var(--accent-bg); color: var(--accent-ink); border-color: var(--accent-bg); }

#compare-table table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
#compare-table th, #compare-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: left; }
#compare-table th:first-child, #compare-table td:first-child { color: var(--text-secondary); font-weight: 500; }
#compare-table th small { display: block; font-weight: 500; color: var(--text-secondary); font-size: 0.7rem; }

#favorites-list { list-style: none; margin: 0; padding: 0; }
#favorites-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
#favorites-list li:last-child { border-bottom: none; }
#favorites-list button.favorites-item-open {
    flex: 1;
    text-align: left;
    background: none;
    border: none;
    font-family: inherit;
    color: var(--text);
    cursor: pointer;
    padding: 0;
}
#favorites-list strong { display: block; font-size: 0.9rem; }
#favorites-list small { color: var(--text-secondary); font-size: 0.78rem; }
#favorites-list .favorites-item-remove {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.78rem;
    text-decoration: underline;
}

#toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    background: var(--text);
    color: var(--bg);
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    z-index: 2000;
    transition: opacity 0.2s ease;
}

.leaflet-popup-content .popup-view-btn {
    margin-top: 6px;
    padding: 4px 10px;
    border: 1px solid var(--primary);
    background: var(--primary);
    color: var(--on-primary);
    border-radius: 3px;
    font-size: 0.75rem;
    cursor: pointer;
}

.stats-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    box-shadow: var(--shadow-soft);
    padding: 14px;
    margin-bottom: 12px;
}
#stats-province-chart-wrap { position: relative; width: 100%; height: 420px; }

.stats-block h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    margin: 0 0 10px;
}
.stats-controls { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.stats-controls select {
    flex: 1;
    min-width: 140px;
    padding: 8px 10px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--bg);
    font-family: inherit;
    font-size: 0.84rem;
    color: var(--text);
}
#stats-group-toggle { display: flex; gap: 6px; }
#stats-group-toggle .pill[aria-pressed="true"] { background: var(--accent-bg); color: var(--accent-ink); border-color: var(--accent-bg); }

.stats-date-range { display: flex; gap: 14px; flex-wrap: wrap; }
.stats-date-range label {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 0.76rem;
    color: var(--text-secondary);
}
.stats-date-range input[type="date"] {
    padding: 7px 8px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--bg);
    font-family: inherit;
    font-size: 0.82rem;
    color: var(--text);
}
#stats-range-note, #stats-distribution-note {
    font-size: 0.76rem;
    color: var(--text-secondary);
    margin: 8px 0 0;
}
#stats-national-variation, #stats-station-variation {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin: 0 0 10px;
}
#stats-national-variation strong, #stats-station-variation strong { color: var(--text); }

#stats-station-search-wrap { position: relative; }
#stats-station-search {
    width: 100%;
    padding: 10px 12px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--bg);
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text);
    box-sizing: border-box;
}
#stats-station-results {
    list-style: none;
    margin: 4px 0 0;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
}
#stats-station-results:empty { border: none; }
#stats-station-results li button {
    width: 100%;
    text-align: left;
    padding: 9px 12px;
    border: none;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--text);
    cursor: pointer;
}
#stats-station-results li:last-child button { border-bottom: none; }
#stats-station-results li button:hover { background: var(--primary-tint); }
#stats-station-results li button small { display: block; color: var(--text-secondary); font-size: 0.76rem; margin-top: 2px; }

#stats-station-detail { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
#stats-station-name { font-weight: 700; margin: 0 0 2px; }

#view-list, #view-map, #view-stats, #view-about { margin-bottom: 24px; }
.about-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.about-links .pill { flex: 1 1 140px; text-align: center; padding: 14px 12px; font-size: 0.95rem; text-decoration: none; }

#get-app {
    margin: 0 0 16px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--primary-tint);
}
#get-app h3 { margin: 0 0 6px; font-size: 1rem; }
#get-app p { margin: 0 0 10px; font-size: 0.85rem; color: var(--text-secondary); }
#get-app-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
#get-app-ios-help { margin: 0; }

@media (max-width: 680px) {
    body { padding-top: 0; }
    header {
        position: sticky;
        top: 0;
        z-index: 1200;
        margin-left: calc(-1 * var(--page-pad));
        margin-right: calc(-1 * var(--page-pad));
        padding: calc(14px + env(safe-area-inset-top)) var(--page-pad) 14px;
        border-radius: 0;
        box-shadow: 0 2px 10px rgba(34, 29, 18, 0.18);
    }
}

#legal-panel p { font-size: 0.85rem; line-height: 1.5; margin: 0 0 12px; color: var(--text); }
#legal-panel h3 { margin: 4px 0 14px; }
#legal-panel strong { color: var(--text); }

@media (min-width: 768px) {
    :root { --content-max: 760px; --page-pad: 32px; }

    header { padding: 16px 20px; }
    #app-logomark svg { width: 50px; height: 50px; }
    .home-link-wrap strong { font-size: 1.15rem; }

    #filters-bar select { flex: 1 1 160px; }

    #stations-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .station-card { flex-direction: column; align-items: flex-start; gap: 8px; }
    .station-card__prices { flex-direction: row; flex-wrap: wrap; text-align: left; gap: 4px 12px; align-items: center; }

    #map { min-height: 440px; }

    .stats-controls { flex-wrap: nowrap; }
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0F0F0F;
        --surface: #1E1E1E;
        --border: #444444;
        --field-bg: #2A2A2A;
        --field-border: #7C7970;
        --text: #F4F2EE;
        --text-secondary: #D0CCC4;
        --primary: #FF7A1A;
        --primary-dark: #FFB37A;
        --primary-tint: #2E1D0F;
        --on-primary: #111111;
        --header-bg: #000000;
        --btn-bg: #FF7A1A;
        --btn-ink: #111111;
        --accent-bg: #FF7A1A;
        --accent-ink: #111111;
        --highlight: #FF7A1A;
        --lockup-subtitle: #B5B0A6;
    }
}

#view-toggle button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
#view-toggle button svg { width: 28px; height: 28px; flex-shrink: 0; }

html[data-view="about"] #national-stats,
html[data-view="about"] #search-form,
html[data-view="about"] #back-to-nearby,
html[data-view="about"] #filters-bar,
html[data-view="about"] #geo-fallback,
html[data-view="garage"] #national-stats,
html[data-view="garage"] #search-form,
html[data-view="garage"] #back-to-nearby,
html[data-view="garage"] #filters-bar,
html[data-view="garage"] #geo-fallback,
html[data-view="route"] #national-stats,
html[data-view="route"] #search-form,
html[data-view="route"] #back-to-nearby,
html[data-view="route"] #geo-fallback { display: none !important; }
html[data-view="route"] #filter-radius,
html[data-view="route"] #filter-sort { display: none; }

.pill--primary { background: var(--accent-bg); color: var(--accent-ink); border-color: var(--accent-bg); }
.pill--danger { color: var(--status-up); border-color: var(--status-up); }

#view-garage { margin-bottom: 24px; }
.garage-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-soft);
}
.garage-card h3 { margin: 0 0 10px; font-family: var(--font-display); font-size: 1.05rem; }
.garage-card p { font-size: 0.88rem; line-height: 1.45; }
.garage-note { margin: 8px 0 0; font-size: 0.8rem !important; color: var(--text-secondary); }
#garage-vehicles { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 4px; }
#garage-vehicles .pill { flex-shrink: 0; }
#garage-vehicles .pill[aria-selected="true"] { background: var(--accent-bg); color: var(--accent-ink); border-color: var(--accent-bg); }
.garage-vehicle-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.garage-vehicle-head strong { display: block; font-family: var(--font-display); font-size: 1.25rem; }
.garage-vehicle-head small { color: var(--text-secondary); font-size: 0.8rem; }
#garage-tank-bar { height: 14px; border-radius: 999px; background: var(--primary-tint); border: 1px solid var(--border); overflow: hidden; }
#garage-tank-fill { display: block; height: 100%; width: 0; background: var(--status-down); transition: width 0.4s ease; }
#garage-tank-fill[data-level="mid"] { background: var(--accent-bg); }
#garage-tank-fill[data-level="low"] { background: var(--status-up); }
#garage-tank-text { margin: 8px 0 14px; font-size: 0.85rem; color: var(--text-secondary); }
.garage-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.garage-tiles > div { background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 10px; }
.garage-tiles small { display: block; font-size: 0.72rem; color: var(--text-secondary); }
.garage-tiles strong { display: block; font-size: 1.05rem; margin: 2px 0; }
.garage-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.garage-check { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; margin: 10px 0; }
#garage-refuels { list-style: none; margin: 0; padding: 0; }
#garage-refuels li + li { border-top: 1px solid var(--border); }
.garage-refuel-item { display: block; width: 100%; text-align: left; background: none; border: none; padding: 10px 0; font-family: inherit; color: var(--text); cursor: pointer; }
.garage-refuel-item strong { display: block; font-size: 0.9rem; }
.garage-refuel-item small { display: block; font-size: 0.78rem; color: var(--text-secondary); margin-top: 2px; }

#vehicle-form label, #refuel-form label, #odometer-form label { display: block; font-size: 0.82rem; font-weight: 600; margin: 10px 0 0; color: var(--text); }
#vehicle-form input, #vehicle-form select, #refuel-form input, #odometer-form input {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.95rem;
    background: var(--bg);
    color: var(--text);
}
#vehicle-form .garage-check input, #refuel-form .garage-check input { width: auto; margin: 0; }
#vehicle-form h3, #refuel-form h3, #odometer-form h3 { margin: 0 0 6px; font-family: var(--font-display); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-error { margin: 10px 0 0; color: var(--status-up); font-size: 0.82rem; font-weight: 600; }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.dialog-actions .pill--danger { margin-right: auto; }

body { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
#toast { bottom: calc(100px + env(safe-area-inset-bottom)); }

#view-route { margin-bottom: 24px; }
#route-form { position: relative; }
.route-field { position: relative; margin-bottom: 6px; }
.route-field label { display: block; font-size: 0.8rem; font-weight: 600; margin-bottom: 4px; }
.route-input { display: flex; gap: 8px; }
.route-input input {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--bg);
    font-family: inherit;
    font-size: 0.92rem;
    color: var(--text);
}
.route-label-row { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 8px; }
.route-label-row label { margin-bottom: 4px; }
#route-swap { width: 32px; height: 32px; margin-bottom: 4px; }
.route-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 30;
    list-style: none;
    margin: 4px 0 0;
    padding: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}
.route-suggestions li button {
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border: none;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    font-family: inherit;
    font-size: 0.87rem;
    color: var(--text);
    cursor: pointer;
}
.route-suggestions li:last-child button { border-bottom: none; }
.route-suggestions li button small { display: block; color: var(--text-secondary); font-size: 0.76rem; margin-top: 2px; }
.route-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.route-options label { font-size: 0.8rem; font-weight: 600; }
.route-options select {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: inherit;
    background: var(--bg);
    color: var(--text);
}
#route-submit { width: 100%; padding: 11px; font-size: 0.9rem; }
#route-progress { height: 6px; border-radius: 999px; background: var(--primary-tint); overflow: hidden; margin-top: 8px; }
#route-progress-bar { display: block; height: 100%; width: 0; background: var(--primary); transition: width 0.2s ease; }
#route-map-wrap { margin-bottom: 12px; }
#route-map { height: 50vh; height: 50dvh; min-height: 320px; border-radius: 8px; border: 1px solid var(--border); }
#route-tank-row { margin-bottom: 10px; }
#route-tank-row label { font-size: 0.85rem; }
#route-tank { width: 100%; accent-color: var(--primary); }
#route-refuel-advice { font-size: 0.9rem; line-height: 1.45; margin: 0 0 10px; }
#route-stations { list-style: none; margin: 0; padding: 0; }
.route-station { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; }
.route-station + .route-station { border-top: 1px solid var(--border); }
.route-station__main { flex: 1; min-width: 0; cursor: pointer; }
.route-station__main strong { display: block; font-size: 0.9rem; }
.route-station__main small { display: block; font-size: 0.76rem; color: var(--text-secondary); margin-top: 2px; }
.route-station__side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.route-station__price { font-weight: 800; font-size: 0.95rem; }
.route-station--cheapest .route-station__main strong::after {
    content: 'la más barata';
    margin-left: 6px;
    font-size: 0.66rem;
    font-weight: 700;
    color: white;
    background: var(--status-down);
    padding: 2px 6px;
    border-radius: 999px;
    vertical-align: middle;
}

#trip-dialog { max-width: 560px; max-height: 92vh; max-height: 92dvh; overflow-y: auto; }
#trip-dialog h3 { position: sticky; top: -20px; z-index: 2; margin: -20px -20px 2px; padding: 20px 72px 6px 20px; font-family: var(--font-display); background: var(--surface); }
#trip-dialog h4 { margin: 16px 0 6px; font-size: 0.9rem; }
#trip-dialog-close { position: sticky; top: -6px; z-index: 3; float: right; margin: -6px -6px 0 8px; background: var(--surface); }
#trip-map { height: 240px; border-radius: 6px; border: 1px solid var(--border); margin: 10px 0 6px; }
#trip-legend { display: flex; align-items: center; gap: 6px; font-size: 0.72rem; color: var(--text-secondary); margin-bottom: 12px; }
#trip-legend-gradient { width: 80px; height: 8px; border-radius: 999px; background: linear-gradient(90deg, hsl(220, 75%, 45%), hsl(110, 75%, 45%), hsl(0, 75%, 45%)); }
#trip-list { list-style: none; margin: 12px 0 0; padding: 0; }
#trip-list li + li { border-top: 1px solid var(--border); }
.history-open { width: 100%; margin-top: 12px; padding: 12px 14px; font-weight: 700; text-align: center; }
#history-dialog { max-width: 560px; max-height: 92vh; max-height: 92dvh; overflow-y: auto; overflow-x: hidden; box-sizing: border-box; }
#history-dialog h3 { margin: 0 48px 12px 0; font-family: var(--font-display); }
#history-close { position: absolute; top: 14px; right: 14px; }
.history-range { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin: 4px 0 10px; }
.history-range label { min-width: 0; display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); }
.history-range input { width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; min-height: 44px; padding: 0 10px; font: inherit; font-size: 0.95rem; }
.history-presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.history-presets .pill { min-width: 0; padding: 8px 4px; font-size: 0.8rem; text-align: center; justify-content: center; }
@media (max-width: 340px) { .history-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
#history-list { list-style: none; margin: 8px 0 0; padding: 0; }
#history-list li + li { border-top: 1px solid var(--border); }
#history-more { width: 100%; margin-top: 12px; padding: 12px 14px; font-weight: 700; text-align: center; }
#history-more:disabled { opacity: 0.6; }
#offline-maps-list { list-style: none; margin: 12px 0 0; padding: 0; }
#offline-maps-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; font-size: 0.85rem; }
#offline-maps-list li + li { border-top: 1px solid var(--border); }
#offline-maps-list .pill { flex-shrink: 0; min-width: 96px; text-align: center; }
#trip-live .garage-tiles { margin-bottom: 10px; }
#trip-live strong { font-variant-numeric: tabular-nums; }

html.is-driving { overflow: hidden; }
#trip-drive {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: flex;
    flex-direction: column;
    padding: calc(16px + env(safe-area-inset-top)) 20px calc(16px + env(safe-area-inset-bottom));
    background: #000;
    color: #fff;
    font-family: var(--font-display);
}
#trip-drive-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#trip-drive-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 800;
    font-style: italic;
    letter-spacing: 0.12em;
    color: var(--primary-light);
}
#trip-drive-dot, #trip-rec-dot {
    width: 14px;
    height: 14px;
    background: #E5322D;
    animation: trip-blink 1.1s steps(2, start) infinite;
}
#trip-drive-min {
    padding: 10px 16px;
    border: 3px solid #fff;
    background: #000;
    color: #fff;
    font: inherit;
    font-size: 1.1rem;
    font-weight: 800;
    font-style: italic;
    text-transform: uppercase;
    cursor: pointer;
}
#trip-drive-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 0; }
#trip-drive-speed {
    font-size: min(46vw, 32vh);
    font-weight: 800;
    font-style: italic;
    line-height: 0.85;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}
#trip-drive-unit { font-size: 1.8rem; font-weight: 800; font-style: italic; letter-spacing: 0.2em; text-transform: uppercase; color: var(--primary-light); }
#trip-drive-bar {
    width: 100%;
    height: 26px;
    margin-top: 28px;
    border: 3px solid #fff;
    transform: skewX(-18deg);
}
#trip-drive-bar-fill {
    display: block;
    height: 100%;
    width: 0;
    background: repeating-linear-gradient(90deg, var(--primary-light) 0 14px, #000 14px 18px);
    transition: width 0.4s linear;
}
#trip-drive[data-level="warn"] #trip-drive-speed { color: var(--primary-light); }
#trip-drive[data-level="over"] #trip-drive-speed { color: #E5322D; }
#trip-drive[data-level="over"] #trip-drive-bar-fill { background: repeating-linear-gradient(90deg, #E5322D 0 14px, #000 14px 18px); }
#trip-drive-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 3px solid #fff; }
#trip-drive-stats > div { padding: 12px 10px 8px; }
#trip-drive-stats > div + div { border-left: 3px solid #fff; }
#trip-drive-stats small { display: block; font-size: 0.95rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: #9a9a9a; }
#trip-drive-stats strong { font-size: 2.6rem; font-weight: 800; font-style: italic; line-height: 1; font-variant-numeric: tabular-nums; }
#trip-drive-stats em { margin-left: 4px; font-size: 1.1rem; font-weight: 700; font-style: italic; color: var(--primary-light); }
#trip-drive-hint { margin: 10px 0; text-align: center; font-family: var(--font-body); font-size: 0.85rem; color: #9a9a9a; }
#trip-drive-stop {
    width: 100%;
    min-height: 84px;
    border: 3px solid #fff;
    background: #E5322D;
    color: #fff;
    font: inherit;
    font-size: 2.2rem;
    font-weight: 800;
    font-style: italic;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
}
#trip-drive-stop:active { background: #fff; color: #E5322D; }
#trip-drive-actions { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 10px; }
#trip-drive-actions #trip-drive-stop { font-size: 1.6rem; }
#trip-drive-pause {
    min-height: 84px;
    border: 3px solid #fff;
    background: var(--primary-light);
    color: #111;
    font: inherit;
    font-size: 1.6rem;
    font-weight: 800;
    font-style: italic;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
}
#trip-drive-pause:active { background: #fff; color: #111; }
#trip-drive[data-paused="true"] #trip-drive-dot { background: var(--primary-light); animation: none; }
#trip-drive[data-paused="true"] #trip-drive-speed { color: #555; }
#trip-rec-chip {
    position: fixed;
    left: 12px;
    bottom: calc(68px + env(safe-area-inset-bottom) + 12px);
    z-index: 1300;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border: 3px solid var(--primary-light);
    background: #000;
    color: var(--primary-light);
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 800;
    font-style: italic;
    letter-spacing: 0.1em;
    cursor: pointer;
}
@keyframes trip-blink { to { visibility: hidden; } }
@media (prefers-reduced-motion: reduce) {
    #trip-drive-dot, #trip-rec-dot { animation: none; }
    #trip-drive-bar-fill { transition: none; }
}

#view-toggle { border-top: 1px solid var(--border); box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06); }
#view-toggle button {
    min-height: 66px;
    gap: 2px;
    background: transparent;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}
#view-toggle button + button { border-left: 0; }
#view-toggle button svg { width: 26px; height: 26px; padding: 0; }
#view-toggle button[aria-selected="true"] { background: var(--accent-bg); color: var(--accent-ink); font-weight: 800; }

#route-form-card h3 { margin-bottom: 12px; font-size: 1.4rem; }
.route-field label { font-size: 0.8rem; font-weight: 600; }
.route-input input { min-height: 52px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); font-size: 1rem; }
.route-input .pill { border-radius: 12px; font-weight: 700; }
#route-settings { margin: 8px 0 12px; }
#route-settings summary { padding: 10px 0; font-size: 0.9rem; font-weight: 600; cursor: pointer; }
#route-submit { min-height: 56px; border: 0; border-radius: 14px; background: var(--btn-bg); color: var(--btn-ink); font-size: 1.05rem; font-weight: 700; }
#route-map { height: 62vh; height: 62dvh; min-height: 380px; border: 1px solid var(--border); border-radius: 16px; }
#route-navigate { min-height: 52px; border-radius: 14px; font-weight: 700; }
.route-station { padding: 14px 0; }
.route-station__main strong { font-size: 1.02rem; }
.route-station__price { font-size: 1.25rem; font-weight: 800; }

#garage-main { display: flex; flex-direction: column; }
#garage-main > #garage-vehicles { order: -3; }
#garage-main > #garage-trips-card { order: -2; }
#garage-main > #garage-vehicle-card { order: -1; }
#trip-start { width: 100%; min-height: 84px; border: 0; border-radius: 16px; background: var(--accent-bg); color: var(--accent-ink); font-size: 1.6rem; font-weight: 800; letter-spacing: 0.01em; }
#trip-stop, #trip-pause { flex: 1 1 0; min-height: 56px; border-radius: 14px; font-weight: 700; }
#trip-pause { background: var(--accent-bg); border-color: var(--accent-bg); color: var(--accent-ink); }
#garage-vehicle-card .garage-tiles strong { font-size: 1.6rem; }
#garage-vehicle-name { font-size: 1.3rem; font-weight: 800; }
#garage-refuel, #garage-odometer { min-height: 48px; border-radius: 12px; font-weight: 700; }

#trip-summary { max-width: 560px; }
#trip-summary h3 { margin: 0 0 12px; font-size: 1.6rem; }
#trip-summary h4 { margin: 16px 0 8px; font-size: 1rem; }
#trip-summary-tiles strong { font-size: 1.5rem; }
#trip-summary-cars { display: flex; flex-direction: column; gap: 8px; }
#trip-summary-cars .pill { padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; font-size: 1rem; font-weight: 600; text-align: left; }
#trip-summary-cars .pill[aria-pressed="true"] { background: var(--accent-bg); border-color: var(--accent-bg); color: var(--accent-ink); font-weight: 700; }

#view-list, #view-map, #view-stats, #view-about { margin-bottom: 24px; }
.about-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.about-links .pill { flex: 1 1 140px; padding: 14px 12px; border-radius: 12px; font-size: 0.95rem; font-weight: 600; text-align: center; text-decoration: none; }
#get-app-actions .pill { padding: 12px 16px; border-radius: 12px; font-weight: 600; }

#trip-drive-speed, #trip-drive-stats strong, #trip-drive-stop, #trip-drive-pause { font-stretch: 75%; }

.station-card { flex-wrap: wrap; }
.station-card.is-selected { border-color: var(--accent-bg); background: var(--primary-tint); box-shadow: 0 0 0 2px var(--accent-bg); }
.station-card__open { display: none; flex: 1 1 100%; margin-top: 6px; padding: 10px; border-radius: 12px; font-weight: 700; text-align: center; }
.station-card.is-selected .station-card__open { display: block; }
#map-show-all { border-color: var(--accent-bg); background: var(--accent-bg); color: var(--accent-ink); font-weight: 700; }
html:not(.desktop) #view-map { order: 1; margin-bottom: 12px; }
html:not(.desktop) #view-list { order: 2; }
html:not(.desktop) #map { height: 40vh; height: 40dvh; min-height: 260px; border-radius: 16px; }

#garage-savings.is-saving { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--primary-tint); color: var(--text); font-size: 1rem !important; font-weight: 700; }

html:not(.desktop) *, html:not(.desktop) *::before, html:not(.desktop) *::after { border-radius: 0 !important; }
.garage-segment { display: flex; flex-wrap: wrap; gap: 0; margin-bottom: 12px; }
.garage-segment .pill { flex: 1 1 0; padding: 12px 8px; border: 1px solid var(--text); font-weight: 700; text-align: center; }
.garage-segment .pill + .pill { border-left: 0; }
.garage-segment .pill[aria-pressed="true"] { background: var(--accent-bg); border-color: var(--text); color: var(--accent-ink); }
#garage-compare-list { list-style: none; margin: 12px 0 0; padding: 0; }
#garage-compare-list li { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; }
#garage-compare-list li + li { border-top: 1px solid var(--border); }
#garage-compare-list small { color: var(--text-secondary); font-size: 0.82rem; }
#refuel-picker { margin: 8px 0; }
#refuel-station-clear { margin-top: 6px; }

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="button"]):not([type="submit"]),
select,
textarea {
    background-color: var(--field-bg) !important;
    border: 1px solid var(--field-border) !important;
    color: var(--text) !important;
}
.pill { border-color: var(--field-border); }

a { color: var(--primary); }

.marker-cluster, .marker-cluster div, .leaflet-marker-icon.marker-cluster { border-radius: 50% !important; }

.tab-short { display: none; }
@media (max-width: 599px) {
    .tab-long { display: none; }
    .tab-short { display: inline; }
    #view-toggle button { font-size: 0.68rem; }
}

#search-input { min-height: 52px; }
#search-form > button { align-self: stretch; width: 52px; height: auto; }

#view-map.is-map-hidden #map-wrap, #view-map.is-map-hidden #map-note { display: none !important; }

.map-shield { position: absolute; inset: 0; z-index: 1100; display: flex; align-items: flex-end; justify-content: center; padding: 12px; border: 0; background: rgba(0, 0, 0, 0.04); cursor: pointer; }
.map-shield span { padding: 10px 16px; background: var(--surface); color: var(--text); border: 1px solid var(--field-border); font-size: 0.9rem; font-weight: 700; }
.map-guard-wrap { position: relative; width: 100%; }

#stations-progress { height: 4px; margin: 0 0 8px; background: var(--border); overflow: hidden; }
#stations-progress span { display: block; width: 35%; height: 100%; background: var(--accent-bg); animation: stations-slide 1s linear infinite; }
@keyframes stations-slide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
#stations-status { margin: 0 0 12px; padding: 4px 0; font-size: 0.95rem; font-weight: 600; color: var(--text); }
#stations-status:empty { display: none; }
#stations-progress[hidden] { display: block; visibility: hidden; }
@media (max-width: 599px) { html:not(.desktop) #stations-status { min-height: 68px; box-sizing: border-box; } html:not(.desktop) #stations-status:empty { display: block; } }
#stations-status.is-flash { animation: status-flash 1s ease-out; }
@keyframes status-flash { from { background: var(--primary-tint); } to { background: transparent; } }
#stations-list.is-loading { opacity: 0.45; pointer-events: none; transition: opacity 0.15s; }
html[data-view="garage"] #stations-status, html[data-view="garage"] #stations-progress,
html[data-view="route"] #stations-status, html[data-view="route"] #stations-progress,
html[data-view="about"] #stations-status, html[data-view="about"] #stations-progress { display: none !important; }
@media (prefers-reduced-motion: reduce) {
    #stations-progress span, #stations-status.is-flash { animation: none; }
}

#stations-status.is-loading::before { content: ''; display: inline-block; width: 14px; height: 14px; margin-right: 8px; border: 3px solid var(--border); border-top-color: var(--accent-bg); border-radius: 50% !important; animation: gp-spin 0.8s linear infinite; vertical-align: -2px; }
@keyframes gp-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { #stations-status.is-loading::before { animation: none; } }

#stations-search-btn { display: block; width: 100%; min-height: 54px; margin: 0 0 12px; border: 0; background: var(--btn-bg); color: var(--btn-ink); font-family: var(--font-display); font-size: 1.05rem; font-weight: 800; letter-spacing: 0.01em; cursor: pointer; }
#stations-search-btn:disabled { opacity: 0.7; cursor: progress; }
html[data-view="garage"] #stations-search-btn,
html[data-view="route"] #stations-search-btn,
html[data-view="about"] #stations-search-btn,
html[data-view="stats"] #stations-search-btn { display: none !important; }

#national-stats-toggle { text-align: left; }
.national-stats__figures span { text-align: left; }
.metric-unit { font-size: 0.62em; font-weight: 700; color: var(--text-secondary); white-space: nowrap; }
.garage-tiles strong,
#garage-vehicle-card .garage-tiles strong,
#route-result .garage-tiles strong,
#trip-summary-tiles strong { font-size: clamp(1.1rem, 5.2vw, 1.5rem); line-height: 1.15; overflow-wrap: anywhere; }
.garage-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.garage-tiles > div { min-width: 0; }
.garage-tiles .metric-unit { display: inline; }

.splash { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; background: var(--bg); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.3s ease, visibility 0s linear 0.3s; }
.splash__word { display: flex; align-items: center; font-family: var(--font-display); font-size: clamp(2rem, 10vw, 3.4rem); font-weight: 800; letter-spacing: -0.02em; color: var(--text); }
.splash__plus { position: relative; display: inline-block; width: 0.72em; height: 0.72em; margin-left: 0.14em; font-size: 1.15em; color: transparent; overflow: hidden; }
.splash__plus::before, .splash__plus::after { content: ''; position: absolute; background: var(--highlight); left: 50%; top: 50%; transform: translate(-50%, -50%); }
.splash__plus::before { width: 100%; height: 0.16em; }
.splash__plus::after { width: 0.16em; height: 100%; }
.is-loading .splash { opacity: 1; visibility: visible; pointer-events: auto; transition: none; }
.is-loading .splash__plus { animation: splash-plus-spin 0.8s ease-in-out infinite; }
@keyframes splash-plus-spin {
    0% { transform: rotate(0deg) scale(1); }
    60% { transform: rotate(360deg) scale(1.15); }
    100% { transform: rotate(360deg) scale(1); }
}
@media (prefers-reduced-motion: reduce) { .is-loading .splash { display: none; } }

.station-card__prices { flex: 1 1 100%; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; text-align: left; }

.station-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; align-items: start; }
.station-card__main { min-width: 0; }
.station-card__prices { display: flex; flex-flow: row wrap; gap: 4px 16px; text-align: left; white-space: normal; }
.station-card__prices span { white-space: nowrap; }
.station-card__open { grid-column: 1 / -1; }

.view-loading { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 12px 14px; border: 1px solid var(--accent-bg); background: var(--primary-tint); color: var(--text); font-weight: 700; }
.view-loading::before { content: ''; flex: none; width: 16px; height: 16px; border: 3px solid var(--border); border-top-color: var(--accent-bg); border-radius: 50% !important; animation: gp-spin 0.8s linear infinite; }
@media (prefers-reduced-motion: reduce) { .view-loading::before { animation: none; } }

.pill--danger { background: #C62828; border-color: #C62828; color: #ffffff; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: stretch; }
.dialog-actions .pill { flex: 1 1 calc(50% - 4px); min-height: 48px; margin: 0; padding: 12px 14px; text-align: center; font-weight: 700; }
.dialog-actions .pill--primary { flex-basis: 100%; order: -1; }

.garage-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.garage-actions .pill { width: 100%; min-height: 48px; padding: 12px 14px; text-align: center; font-weight: 700; }

.is-loading .splash { animation: splash-safety 0s linear 10s forwards; }
@keyframes splash-safety { to { opacity: 0; visibility: hidden; pointer-events: none; } }

.view-loading--float { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 10001; margin: 0; background: #111111; color: #FFFFFF; border-color: #FF7A1A; }

.refuel-step h4 { margin: 8px 0 10px; font-family: var(--font-display); font-size: 1.15rem; }
.refuel-step[hidden] { display: none; }
.refuel-inline { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.refuel-inline .pill { flex: 1 1 140px; }
.refuel-review { list-style: none; margin: 0 0 8px; padding: 0; }
.refuel-review li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.refuel-review strong { text-align: right; }
.refuel-done { text-align: center; padding: 16px 0; }
#refuel-form.is-edit .refuel-confirm { display: none; }
#refuel-progress { margin: 0 0 4px; font-weight: 700; }
#recap-image, #recap-pdf { flex: 1 1 0; }

.splash__plus { width: 0.5em; height: 0.5em; margin-left: 0.05em; font-size: 1em; align-self: flex-start; margin-top: 0.14em; }
.splash__plus::before { height: 0.13em; }
.splash__plus::after { width: 0.13em; }

#refuel-station-results { max-height: 38vh; overflow-y: auto; margin: 0 0 8px; }
.refuel-done { display: flex; flex-direction: column; justify-content: space-between; gap: 24px; min-height: 42vh; text-align: center; }
.refuel-done .pill { width: 100%; min-height: 52px; }
#recap-share { grid-column: 1 / -1; }

#refuel-station-results { position: static; border: 0; box-shadow: none; background: transparent; margin: 0 0 8px; }
#refuel-station-results li button { border: 1px solid var(--border); margin-bottom: 6px; }

.garage-check[hidden] { display: none; }
.trip-bt-cars { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.trip-bt-cars[hidden] { display: none; }
.trip-bt-cars li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 4px; font-size: 0.85rem; }
.trip-bt-add { display: flex; align-items: flex-end; gap: 8px; margin-top: 8px; }
.trip-bt-add label { flex: 1; min-width: 0; }
.trip-bt-add select { width: 100%; }
.refuel-ask { font-size: 1.1rem; font-weight: 700; color: var(--text); margin: 4px 0 12px; }

#garage-tank-fill { background: #FFB020; }
#garage-tank-fill[data-level="mid"] { background: #FF7A1A; }
#garage-tank-fill[data-level="low"] { background: #D93025; }

.offline-only { display: none; }
html.is-offline .offline-only { display: block; }
.offline-block { margin: 0 0 12px; padding: 12px 14px; border: 1px solid #FFB020; background: var(--primary-tint); color: var(--text); font-weight: 700; }
html.is-offline #view-stats > *:not(.offline-block) { opacity: 0.4; pointer-events: none; }
#offline-banner { position: fixed; left: 12px; right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 60; margin: 0; padding: 10px 14px; background: #FFB020; color: #111111; font-size: 0.85rem; font-weight: 700; border: 1px solid #111111; }
#offline-banner[hidden] { display: none; }
.desktop #offline-banner { left: calc(248px + (100% - 248px) / 2); right: auto; width: min(560px, 60vw); transform: translateX(-50%); bottom: 24px; }

/* Guía de uso en la pestaña Info */
.guide-card details { border-top: 1px solid var(--border); padding: 12px 0; }
.guide-card details:last-of-type { border-bottom: 1px solid var(--border); }
.guide-card summary { cursor: pointer; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.guide-card summary::-webkit-details-marker { display: none; }
.guide-card summary::after { content: '+'; color: var(--primary); font-weight: 800; }
.guide-card details[open] summary::after { content: '−'; }
.guide-card details p { margin: 10px 0 0; color: var(--text-secondary); font-size: 0.95rem; }

/* Permisos y privacidad en la pestaña Info */
.permissions-card ul { list-style: none; margin: 12px 0 0; padding: 0; }
.permissions-card li { padding: 14px 0; border-top: 1px solid var(--border); }
.permission-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.permission-state { font-weight: 800; font-size: 0.85rem; padding: 2px 8px; background: var(--text); color: var(--bg); }
.permissions-card li p { margin: 6px 0 10px; color: var(--text-secondary); font-size: 0.92rem; }
.permission-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.permission-actions .pill { flex: 1 1 140px; text-align: center; }

.permission-state--on { background: #1B8A3A; color: #FFFFFF; }
.permission-state--off { background: #C62828; color: #FFFFFF; }

/* Sugerencias y errores en la pestaña Info */
.feedback-kinds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 12px; }
.feedback-kind { padding: 14px 6px; text-align: center; border: 1px solid var(--field-border); background: var(--surface); color: var(--text); font: inherit; font-weight: 700; font-size: 0.9rem; cursor: pointer; }
.feedback-kind[aria-pressed="true"] { background: var(--accent-bg); border-color: var(--accent-bg); color: var(--accent-ink); }
.feedback-field { position: relative; }
.feedback-field textarea { display: block; width: 100%; min-height: 140px; padding: 12px 12px 30px; font: inherit; font-size: 1rem; line-height: 1.45; resize: vertical; box-sizing: border-box; }
.feedback-field textarea:focus { outline: 2px solid var(--accent-bg); outline-offset: 0; }
.feedback-count { position: absolute; right: 12px; bottom: 8px; font-size: 0.78rem; color: var(--text-secondary); pointer-events: none; }
.feedback-tech-row { display: flex; align-items: flex-start; gap: 10px; margin: 12px 0; font-size: 0.95rem; font-weight: 600; cursor: pointer; }
.feedback-tech-row input { margin-top: 3px; flex-shrink: 0; }
.feedback-tech-row small { display: block; margin-top: 2px; font-weight: 400; font-size: 0.82rem; color: var(--text-secondary); }
.feedback-actions { display: flex; flex-direction: column; gap: 8px; }
.feedback-actions .pill { width: 100%; min-height: 50px; text-align: center; font-weight: 700; }
.feedback-note { margin: 12px 0 0; padding: 10px 12px; border-left: 4px solid var(--accent-bg); background: var(--field-bg); font-size: 0.88rem; font-weight: 600; }


.guide-card summary { align-items: center; padding: 4px 0; }
.guide-card summary::after { font-size: 2rem; font-weight: 900; line-height: 1; flex-shrink: 0; -webkit-text-stroke: 2px currentColor; }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.province-links { list-style: none; margin: 0; padding: 0; columns: 2 150px; column-gap: 16px; }
.province-links li { padding: 5px 0; break-inside: avoid; }

.national-date { margin: 0; padding: 0 14px 10px; font-size: 0.82rem; color: var(--text-secondary); }
.national-date.is-stale { color: var(--status-up); font-weight: 700; }

/* Ordenador: menú lateral, tabla de resultados con mapa y ficha al lado, paneles por sección.
   La clase .desktop la pone el <head> en la web a partir de 1024 px; la app nativa nunca la tiene. */
:root { --row-line: #E7E4DE; --row-hover: #FBFAF8; --sidebar-w: 248px; --topbar-h: 114px; }
@media (prefers-color-scheme: dark) { :root { --row-line: #333333; --row-hover: #252525; } }

.desktop-only, .tab-desktop, .field-label, .btn-label, .sidebar-note, .station-card__actions { display: none; }
#search-panel, .filter-field, .garage-col { display: contents; }
#national-line, .price--empty { display: none; }

html.desktop { font-size: 100%; }
.desktop body { display: flex; flex-direction: column; min-height: 100vh; padding: 0; }
.desktop .app-container { flex: 1 0 auto; min-height: 100vh; box-sizing: border-box; }
.desktop .desktop-only { display: revert; }
.desktop .tab-desktop { display: inline; }
.desktop .tab-short, .desktop .tab-mobile, .desktop #view-list-btn .tab-long { display: none; }

.desktop .app-container {
    width: auto;
    max-width: none;
    margin: 0 0 0 var(--sidebar-w);
    padding: 24px 32px 32px;
    display: grid;
    grid-template-columns: minmax(0, 11fr) minmax(0, 9fr);
    grid-auto-flow: row dense;
    column-gap: 20px;
    align-items: start;
    align-content: start;
}
.desktop .app-container > * { grid-column: 1 / -1; }

.desktop header {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1200;
    width: var(--sidebar-w);
    box-sizing: border-box;
    margin: 0;
    padding: 0 0 24px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 4px;
    overflow-y: auto;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: #111111;
}
/* El logo y la banda de precios forman una sola barra superior con la misma altura. El menú empieza justo debajo, sin hueco: el margen negativo cancela el espacio entre elementos del menú. */
.desktop .home-link-wrap { order: 0; flex: none; box-sizing: border-box; height: var(--topbar-h); gap: 12px; margin: 0 0 -4px; padding: 0 16px; }
.desktop #app-logomark svg { width: 40px; height: 40px; border-radius: 10px; }
.desktop .home-link-wrap strong { font-size: 20px; }
.desktop .home-link-wrap #app-subtitle { display: none; }

.desktop #view-toggle { display: contents; }
.desktop #view-toggle button,
.desktop .header-actions .btn-icon {
    order: 1;
    flex: none;
    position: static;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: auto;
    height: auto;
    min-height: 44px;
    padding: 0 28px;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    color: #D9D6D0;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    text-align: left;
    cursor: pointer;
}
.desktop #view-toggle button svg,
.desktop .header-actions .btn-icon svg { width: 20px; height: 20px; padding: 0; flex-shrink: 0; }
.desktop #view-toggle button:hover,
.desktop .header-actions .btn-icon:hover { background: #262626; color: #ffffff; }
.desktop #view-toggle button[aria-selected="true"] { background: #FF7A1A; color: #111111; font-weight: 600; }
.desktop #view-toggle button:focus-visible,
.desktop .header-actions .btn-icon:focus-visible { outline: 2px solid #ffffff; outline-offset: -2px; border-radius: 0; }
.desktop #view-toggle #view-about-btn { order: 4; margin-top: auto; }
.desktop .header-actions { order: 2; display: flex; flex-direction: column; gap: 4px; margin-top: 24px; padding-top: 20px; border-top: 1px solid #2E2E2E; }
.desktop #geo-toggle { display: none; }
.desktop .btn-label { display: inline; }
.desktop .header-actions .count-badge { position: static; margin-left: auto; min-width: 22px; padding: 2px 7px; border-radius: 999px; background: #2E2E2E; color: #ffffff; font-size: 12px; font-weight: 600; }
.desktop .sidebar-note { display: block; order: 5; margin: 8px 28px 0; font-size: 13px; line-height: 1.5; color: #B5B1AA; }
.desktop .sidebar-note a { color: #FF9A4D; }

/* La barra superior (logo y precios medios) se ve en todas las pestañas del ordenador. */
html.desktop[data-view] #national-stats { display: block !important; }
.desktop #national-stats { margin: -24px -32px 20px; padding: 0; border: 0; background: none; box-shadow: none; overflow: visible; }
.desktop #national-stats-toggle,
.desktop #national-date,
.desktop #national-stats-detail { display: none; }
.desktop #national-line:not([hidden]) { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 0; margin: 0; padding: 16px 32px; box-sizing: border-box; min-height: var(--topbar-h); border-radius: 0; background: #111111; color: #B5B1AA; }
.national-line__day,
.national-kpi { display: flex; flex-direction: column; gap: 4px; }
.national-line__day { padding-right: 28px; }
.national-kpi { padding: 0 28px; border-left: 1px solid #2E2E2E; }
.national-line__day small,
.national-kpi small { font-size: 13px; color: #B5B1AA; }
.national-line__day strong { font-family: var(--font-display); font-size: 22px; font-weight: 800; color: #FF7A1A; }
.national-line__day.is-stale strong { color: #FF8A80; }
.national-kpi strong { font-family: var(--font-display); font-size: 30px; font-weight: 800; line-height: 1.1; color: #ffffff; }
.national-line__delta { font-size: 14px; font-weight: 600; color: #B5B1AA; }
.national-line__delta.is-down { color: #6FCF8F; }
.national-line__delta.is-up { color: #FF8A80; }
.national-line__stats { display: inline-flex; align-items: center; gap: 10px; height: 44px; margin-left: auto; padding: 0 18px; border: 0; border-radius: 6px; background: #FF7A1A; color: #111111; font-family: var(--font-body); font-size: 15px; font-weight: 700; cursor: pointer; }
.national-line__stats svg { width: 20px; height: 20px; }
.national-line__stats:hover { background: #FF9A4D; }
.link-button { padding: 0; border: 0; background: none; color: var(--primary); font-family: var(--font-body); font-size: 14px; font-weight: 600; cursor: pointer; }
.link-button:hover { color: var(--primary-dark); text-decoration: underline; }

.desktop #search-panel { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin: 0 0 20px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.desktop #search-form { flex: 1 1 160px; flex-direction: column; gap: 6px; margin: 0; }
.desktop #filters-bar { display: contents; }
.desktop .field-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.desktop .filter-field { display: flex; flex-direction: column; gap: 6px; flex: 0 1 170px; min-width: 0; }
.desktop .filter-field:nth-child(2) { flex-basis: 110px; }
.desktop .filter-field:nth-child(3) { flex-basis: 140px; }
.desktop #search-input,
.desktop #filters-bar select { flex: none; width: 100%; height: 44px; min-height: 44px; box-sizing: border-box; padding: 0 12px; border-radius: 6px; font-size: 15px; }
.desktop #stations-search-btn,
.desktop #search-nearby { width: auto; height: 44px; min-height: 44px; margin: 0; padding: 0 18px; border-radius: 6px; font-family: var(--font-body); font-size: 15px; font-weight: 600; letter-spacing: 0; cursor: pointer; }
.desktop #search-nearby { display: inline-block; border: 1px solid var(--field-border); background: var(--surface); color: var(--text); }
.desktop #back-to-nearby { order: 10; flex-basis: 100%; margin: 0; padding: 0; font-size: 14px; text-align: left; }
.desktop #stations-progress { position: fixed; top: 0; left: var(--sidebar-w); right: 0; z-index: 1300; margin: 0; }

.desktop #view-list > #stations-status:empty { display: block; }
.desktop #view-list > #stations-status { min-height: 52px; box-sizing: border-box; margin: 0; padding: 14px 16px; border-bottom: 1px solid var(--border); font-family: var(--font-display); font-size: 18px; font-weight: 800; line-height: 1.3; }
.desktop #geo-fallback { margin: 0 0 12px; }
.desktop #view-list { grid-column: 1; min-width: 0; margin: 0 0 24px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.desktop #stations-geocoded-note { margin: 12px 16px; }
.desktop #stations-head { display: grid; grid-template-columns: minmax(0, 1fr) 92px 92px 84px; gap: 12px; padding: 10px 16px; background: var(--bg); font-size: 12px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; }
.desktop #stations-head span:nth-child(2),
.desktop #stations-head span:nth-child(3) { text-align: right; }
.desktop #stations-list { display: block; }
.desktop .station-card { display: grid; grid-template-columns: minmax(0, 1fr) 92px 92px 84px; gap: 12px; align-items: center; padding: 12px 16px; border: 0; border-bottom: 1px solid var(--row-line); border-radius: 0; box-shadow: none; background: none; }
.desktop .station-card > *,
.desktop .station-card__prices .price { grid-row: 1; }
.desktop .station-card:hover { background: var(--row-hover); }
.desktop .station-card.is-selected { border-color: var(--row-line); background: var(--primary-tint); box-shadow: inset 4px 0 0 var(--accent-bg); }
.desktop .station-card__main { grid-column: 1; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 2px 8px; min-width: 0; }
.desktop .station-card__main strong { font-family: var(--font-body); font-size: 15px; font-weight: 700; }
.desktop .station-card__address { flex-basis: 100%; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.desktop .station-card__distance { font-size: 13px; }
.desktop .station-card .badge--24h { padding: 1px 6px; border-radius: 4px; background: var(--primary-tint); color: var(--primary-dark); font-size: 11px; }
.desktop .station-card__prices { display: contents; }
.desktop .station-card__prices .price { display: none; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.desktop .station-card__prices .price.is-primary { display: block; grid-column: 2; font-size: 16px; font-weight: 700; }
.desktop .station-card__prices .price.is-secondary { display: block; grid-column: 3; font-size: 15px; color: var(--text-secondary); }
.desktop .price__label { display: none; }
.desktop .station-card__open { display: none !important; }
.desktop .station-card__actions { display: flex; grid-column: 4; justify-content: flex-end; gap: 6px; }
.row-action { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text-secondary); cursor: pointer; }
.row-action svg { width: 18px; height: 18px; }
.row-action:hover { color: var(--text); border-color: var(--field-border); }
.row-action[aria-pressed="true"] { border-color: var(--accent-bg); background: var(--primary-tint); color: var(--primary-dark); }
.desktop #stations-empty { padding: 24px 16px; }
.desktop #stations-pagination { justify-content: space-between; padding: 12px 16px; }
.desktop #pagination-status { order: -1; margin-right: auto; font-size: 14px; }
.desktop #stations-pagination .pill,
.desktop #map-controls .pill { height: 36px; padding: 0 12px; border: 1px solid var(--field-border); border-radius: 6px; background: var(--surface); font-size: 14px; }
.desktop #map-show-all { border-color: var(--accent-bg); background: var(--accent-bg); color: var(--accent-ink); }

.desktop #view-map { grid-column: 2; align-self: stretch; position: relative; display: flex; flex-direction: column; gap: 16px; min-width: 0; margin: 0 0 24px; }
.desktop #map-controls { position: absolute; top: 12px; right: 12px; z-index: 1001; margin: 0; }
.desktop #map-toggle,
.desktop #locate-me { display: none; }
.desktop #map-wrap { flex: 1 1 auto; position: relative; min-height: 380px; }
.desktop #map { position: absolute; inset: 0; height: auto; min-height: 0; border: 1px solid var(--border); border-radius: 8px; }
.desktop #map-wrap > .map-guard-wrap { position: absolute; inset: 0; }
.desktop #map-legend { z-index: 1000; }
.desktop #view-map > #station-modal[open] { flex: none; }
.desktop #map-note { margin: 0; font-size: 13px; }

.desktop #view-map > #station-modal[open] { position: relative; inset: auto; display: flex; flex-direction: column; gap: 12px; box-sizing: border-box; width: auto; max-width: none; max-height: none; margin: 0; padding: 20px; border: 1px solid var(--border); border-radius: 8px; box-shadow: none; background: var(--surface); color: var(--text); }
.desktop #station-modal #modal-top-actions { position: absolute; top: 16px; right: 16px; display: flex; gap: 6px; margin: 0; }
.desktop #station-modal #modal-top-actions .btn-icon { width: 36px; height: 36px; border-radius: 6px; }
.desktop #station-modal #modal-rotulo { align-self: flex-start; margin: 0; padding: 0 130px 0 0; background: none; color: var(--text); font-family: var(--font-display); font-size: 22px; font-weight: 800; }
.desktop #station-modal h3 { margin: 0; font-family: var(--font-body); font-size: 14px; font-weight: 400; color: var(--text-secondary); }
.desktop #modal-municipio,
.desktop #modal-horario { margin: 0; font-size: 14px; }
.desktop #modal-fuels { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin: 4px 0; border: 0; }
.desktop #modal-fuels li { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border: 0; border-radius: 6px; background: var(--bg); }
.desktop #modal-fuels li span:first-child { font-size: 12px; color: var(--text-secondary); }
.desktop #modal-fuels li span:last-child { font-family: var(--font-display); font-size: 20px; font-weight: 800; }
.desktop #modal-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.desktop #modal-actions .pill { flex: 0 0 auto; display: inline-flex; align-items: center; white-space: nowrap; width: auto; height: 44px; margin: 0; padding: 0 18px; border-radius: 6px; font-size: 15px; font-weight: 600; }
.desktop #modal-actions .pill--primary { border-color: var(--accent-bg); background: var(--accent-bg); color: var(--accent-ink); }
.desktop #modal-actions #modal-refuel { display: none; }

.desktop .pill { border-radius: 6px; }
.desktop .garage-card,
.desktop .stats-block { margin: 0; padding: 20px; border-radius: 8px; box-shadow: none; }
.desktop .garage-card h3,
.desktop .stats-block h3 { font-family: var(--font-body); font-size: 17px; font-weight: 700; }

html.desktop[data-view="route"] #national-stats,
html.desktop[data-view="garage"] #national-stats,
html.desktop[data-view="stats"] #national-stats,
html.desktop[data-view="about"] #national-stats,
html.desktop[data-view="garage"] #search-panel,
html.desktop[data-view="stats"] #search-panel,
html.desktop[data-view="about"] #search-panel,
html.desktop[data-view="route"] #search-form,
html.desktop[data-view="route"] #search-nearby,
html.desktop[data-view="route"] #stations-search-btn,
html.desktop[data-view="route"] .filter-field:nth-child(2),
html.desktop[data-view="route"] .filter-field:nth-child(3),
html.desktop:not([data-view="list"]) #stations-status,
html.desktop:not([data-view="list"]) #stations-progress { display: none; }

.desktop #view-route:not([hidden]) { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 20px; align-items: start; }
.desktop #view-route:not([hidden]):has(#route-result:not([hidden])) { grid-template-columns: minmax(0, 320px) minmax(0, 340px) minmax(0, 1fr); }
.desktop #view-route > * { grid-column: 1; margin: 0; }
.desktop #view-route > .offline-block { grid-column: 1 / -1; }
.desktop #view-route > #route-map-wrap { grid-column: -2 / -1; grid-row: 1 / span 3; }
.desktop #route-map { height: calc(100vh - 230px - var(--topbar-h) - 20px); min-height: 520px; border-radius: 8px; }
.desktop #view-route:has(#route-result:not([hidden])) > #route-map-wrap { align-self: stretch; height: 0; min-height: 100%; display: flex; flex-direction: column; gap: 8px; }
.desktop #view-route:has(#route-result:not([hidden])) #route-map-wrap > .map-guard-wrap { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.desktop #view-route:has(#route-result:not([hidden])) #route-map { flex: 1 1 auto; height: auto; min-height: 0; }
.desktop #route-map-wrap .garage-note { margin: 0; }
.desktop #route-form-card h3 { font-family: var(--font-display); font-size: 24px; font-weight: 800; }
.desktop #route-result:not([hidden]) { display: contents; }
.desktop #route-result[hidden] { display: none; }
.desktop #route-result > .garage-card { grid-column: 1; margin: 0; }
.desktop #route-result > .garage-card:last-child { grid-column: 2; grid-row: 1 / span 3; align-self: stretch; height: 0; min-height: 100%; box-sizing: border-box; display: flex; flex-direction: column; overflow: hidden; }
.desktop #route-result > .garage-card:last-child h3 { flex: none; }
.desktop #route-stations { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin: 0 -20px; padding: 0 20px; overscroll-behavior: contain; }
.desktop .route-input input,
.desktop #route-submit,
.desktop #route-navigate { border-radius: 6px; }

.desktop #garage-main:not([hidden]) { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.desktop #garage-main > #garage-vehicles,
.desktop #garage-main > #garage-vehicle-card { grid-column: 1 / -1; }
.desktop .garage-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.desktop .garage-col--main > .garage-card:has(#garage-refuels) { order: -1; }
.desktop #garage-vehicle-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: start; }
.desktop #garage-vehicle-card > .garage-vehicle-head { grid-column: 1; grid-row: 1; }
.desktop #garage-vehicle-card > .garage-actions { grid-column: 2; grid-row: 1; }
.desktop #garage-vehicle-card > #garage-tank,
.desktop #garage-vehicle-card > .garage-tiles { grid-column: 1 / -1; }
.desktop #garage-vehicle-card .garage-tiles { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin: 0; }
.desktop #garage-vehicle-card .garage-tiles > div { padding: 16px 20px; border-radius: 8px; background: var(--surface); }
.desktop #garage-vehicle-card .garage-tiles strong { font-family: var(--font-display); font-size: 28px; font-weight: 800; }
.desktop .garage-vehicle-head strong { font-size: 28px; }
.desktop #garage-vehicle-card .garage-actions .pill,
.desktop #garage-edit { height: 44px; min-height: 44px; padding: 0 18px; border-radius: 6px; font-size: 15px; }
.desktop #garage-empty { max-width: 760px; }
.desktop #garage-odometer,
.desktop #garage-trips-card .garage-actions,
.desktop #trip-live,
.desktop #trip-note,
.desktop #trip-auto-wrap,
.desktop #trip-bt-wrap,
.desktop #trip-permissions,
.desktop #trip-rec-chip,
.desktop #trip-drive,
.desktop #offline-maps-card,
.desktop #recap-share,
.desktop #get-app-ios,
.desktop #get-app-ios-help,
.desktop #alerts-toggle-wrap,
.desktop #alerts-options,
.desktop #alerts-note,
.desktop .permissions-card { display: none !important; }

.desktop #view-stats:not([hidden]) { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; align-items: start; }
.desktop #view-stats > * { grid-column: 1 / -1; margin: 0; }
.desktop #view-stats > #stats-province-block,
.desktop #view-stats > #stats-distribution-block { grid-column: span 2; }
.desktop #stats-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 0; border: 0; background: none; }
.desktop #stats-filters > h3 { display: none; }
.desktop .stats-title { margin: 0 auto 0 0; font-family: var(--font-display); font-size: 28px; font-weight: 800; }
.desktop .stats-controls { flex-wrap: nowrap; align-items: center; margin: 0; }
.desktop .stats-controls select,
.desktop .stats-date-range input { height: 44px; box-sizing: border-box; padding: 0 12px; border-radius: 6px; font-size: 15px; }
.desktop #stats-group-toggle .pill { height: 44px; padding: 0 16px; border-radius: 6px; font-size: 15px; }
.desktop #stats-group-toggle .pill[aria-pressed="true"] { border-color: #111111; background: #111111; color: #ffffff; }
.desktop .stats-date-range { display: flex; gap: 12px; margin: 0; }
.desktop .stats-date-range label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.desktop #stats-range-note { flex-basis: 100%; margin: 0; font-size: 13px; }
.desktop #stats-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.stats-kpi { display: flex; flex-direction: column; gap: 4px; padding: 20px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.stats-kpi small { font-size: 13px; color: var(--text-secondary); }
.stats-kpi strong { font-family: var(--font-display); font-size: 28px; font-weight: 800; }
.stats-kpi .is-down { color: var(--status-down); }
.stats-kpi .is-up { color: var(--status-up); }
.desktop #stats-province-ranks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
#stats-province-ranks h4 { margin: 0 0 8px; font-size: 15px; font-weight: 700; }
#stats-province-ranks ol { margin: 0; padding: 0; list-style: none; }
#stats-province-ranks li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; padding: 10px 0; border-top: 1px solid var(--row-line); font-size: 14px; }
#stats-province-ranks li span:first-child { color: var(--text-secondary); }
#stats-province-ranks li strong { font-variant-numeric: tabular-nums; }
.desktop #stats-province-all { margin-top: 12px; }
.desktop #stats-province-block:not(.is-expanded) #stats-province-chart-wrap { display: none; }
.desktop #stats-province-block.is-expanded #stats-province-chart-wrap { margin-top: 16px; }

.desktop #view-about:not([hidden]) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.desktop #view-about > * { margin: 0; }
.desktop #view-about > .mobile-features-card,
.desktop #view-about > #get-app { grid-column: 1 / -1; }
.desktop #view-about > .mobile-features-card { order: -1; }
.mobile-features { margin: 12px 0 0; padding-left: 20px; }
.mobile-features li { margin: 0 0 8px; font-size: 15px; line-height: 1.5; }
.desktop .about-links .pill { flex: 0 1 auto; padding: 12px 18px; border-radius: 6px; }

.store-blocks { display: flex; flex-wrap: wrap; gap: 16px; margin: 16px 0; }
.store-block { flex: 1 1 300px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 20px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); }
.store-block h4 { margin: 0; font-size: 17px; }
.store-block p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text-secondary); }
.store-block .pill { padding: 12px 18px; font-size: 15px; font-weight: 700; text-decoration: none; }

.desktop .site-footer { display: flex; flex-direction: column; gap: 32px; margin: 0 0 0 var(--sidebar-w); padding: 40px 32px 24px; border-top: 3px solid #FF7A1A; background: #111111; color: #D9D6D0; }
.site-footer__cols { display: flex; flex-wrap: wrap; gap: 32px 56px; }
.site-footer__brand { flex: 2 1 280px; display: flex; flex-direction: column; gap: 12px; }
.site-footer__name { font-family: var(--font-display); font-size: 22px; font-weight: 800; color: #ffffff; }
.site-footer__name span { color: #FF7A1A; }
.site-footer__brand p { max-width: 420px; margin: 0; font-size: 14px; line-height: 1.6; color: #B5B1AA; }
.site-footer nav { flex: 1 1 160px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.site-footer h2 { margin: 0 0 4px; font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: #8F8B84; }
.site-footer nav a,
.site-footer nav button { padding: 0; border: 0; background: none; color: #D9D6D0; font-family: var(--font-body); font-size: 14px; text-align: left; text-decoration: none; cursor: pointer; }
.site-footer nav a:hover,
.site-footer nav button:hover { color: #ffffff; text-decoration: underline; }
.site-footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 20px; border-top: 1px solid #2E2E2E; font-size: 13px; color: #8F8B84; }

.favorites-item-prices { display: none; }
.desktop #favorites-panel,
.desktop #history-dialog,
.desktop #compare-panel { position: fixed; inset: 0 0 0 auto; width: 440px; max-width: 100vw; height: 100vh; max-height: 100vh; box-sizing: border-box; margin: 0; padding: 24px; overflow-y: auto; border: 0; border-left: 3px solid #FF7A1A; border-radius: 0; box-shadow: -12px 0 40px rgba(17, 17, 17, 0.25); }
.desktop #compare-panel { width: 600px; }
.desktop #favorites-panel[open],
.desktop #history-dialog[open],
.desktop #compare-panel[open] { animation: drawer-in 0.2s ease-out; }
.desktop #favorites-panel::backdrop,
.desktop #history-dialog::backdrop,
.desktop #compare-panel::backdrop { background: rgba(17, 17, 17, 0.45); }
.desktop #history-dialog { width: 520px; }
@keyframes drawer-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .desktop #favorites-panel[open], .desktop #history-dialog[open], .desktop #compare-panel[open] { animation: none; } }
.desktop #favorites-panel h3,
.desktop #compare-panel h3 { margin: 0 56px 4px 0; font-family: var(--font-display); font-size: 24px; font-weight: 800; }
.desktop #favorites-close,
.desktop #compare-close { position: absolute; top: 20px; right: 20px; width: 40px; height: 40px; border-radius: 6px; }
.drawer-subtitle { margin: 0 0 12px; font-size: 13px; color: var(--text-secondary); }
.desktop #favorites-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 16px 0; }
.desktop #favorites-list .favorites-item-open { grid-column: 1; }
.desktop #favorites-list .favorites-item-remove { grid-column: 2; grid-row: 1; align-self: start; border-radius: 6px; }
.desktop .favorites-item-prices { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.desktop .favorites-item-prices:empty { display: none; }
.favorites-item-prices span { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 6px; background: var(--bg); }
.favorites-item-prices small { font-size: 12px; color: var(--text-secondary); }
.favorites-item-prices strong { font-family: var(--font-display); font-size: 18px; font-weight: 800; }
.drawer-note { margin: 16px -24px -24px; padding: 16px 24px; border-top: 1px solid var(--row-line); background: var(--bg); font-size: 13px; line-height: 1.5; color: var(--text-secondary); }
.desktop #compare-table table { font-size: 14px; }
.desktop #compare-table th,
.desktop #compare-table td { padding: 12px; }
.desktop #compare-table td.is-best { background: var(--primary-tint); color: var(--primary-dark); font-weight: 800; }

.pill.is-busy { opacity: 0.85; cursor: progress; }
.pill.is-busy::before { content: ''; display: inline-block; width: 14px; height: 14px; margin-right: 8px; border: 3px solid currentColor; border-top-color: transparent; border-radius: 50% !important; animation: gp-spin 0.8s linear infinite; vertical-align: -2px; }
.pill:disabled { cursor: progress; }
@media (prefers-reduced-motion: reduce) { .pill.is-busy::before { animation: none; } }
