/* ───────── RESET & BASE ───────── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #f5f7fa;
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: pan-x pan-y;
    -webkit-tap-highlight-color: transparent;
}

html.search-ui-active,
html.search-ui-active body {
    overflow: hidden;
    overscroll-behavior: none;
    height: 100%;
    position: fixed;
    width: 100%;
}

:root {
    --screen-radius: 2.25rem;
    --card-radius: var(--screen-radius);
    --tg-safe-top: env(safe-area-inset-top, 0px);
    --tg-safe-bottom: env(safe-area-inset-bottom, 0px);
    --dock-inset-x: 12px;
    --dock-inset-bottom: max(10px, var(--tg-safe-bottom));
    --dock-height: 72px;
    --dock-gap: 8px;
    --dock-total-height: calc(var(--dock-height) + var(--dock-inset-bottom) + var(--dock-gap));

    --card-bg: rgba(255, 255, 255, 0.94);
    --card-border: rgba(255, 255, 255, 0.65);
    --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.14);
    --card-blur: blur(18px);

    --search-motion-duration: 0.34s;
    --search-motion-ease: cubic-bezier(0.32, 0.72, 0, 1);
    --keyboard-offset: 0px;
    --search-results-max-height: min(50vh, calc(100dvh - var(--dock-total-height) - var(--search-bar-height) - 24px));

    /* Inset from card edge to inner rounded component */
    --inset-dock-pill-x: 20px;
    --inset-dock-pill-y: 12px;
    --inset-dock-actions-x: 4px;
    --inset-search-panel: 8px;
    --inset-search-panel-left: 18px;
    --search-bar-height: 40px;
    --inset-search-form: 10px;
    --inset-filter-panel: 16px;
    --inset-filter-header-top: 8px;
    --inset-sheet-x: 20px;
    --inset-sheet-y: 8px;
    --inset-sheet-handle-top: 12px;
    --inset-comment-form: 12px;
    --map-nav-compass-size: 48px;
    --map-nav-zoom-btn-height: 44px;
    --map-nav-gap: 8px;
    --map-nav-stack-height: calc(var(--map-nav-compass-size) * 2 + var(--map-nav-gap) * 2 + var(--map-nav-zoom-btn-height) * 2);
    --map-controls-bottom: calc(var(--dock-total-height) + 8px);

    /* inner radius = card radius − inset from edge */
    --radius-dock-btn: max(0px, calc(var(--card-radius) - var(--inset-dock-pill-x) - var(--inset-dock-actions-x)));
    --radius-search-panel: max(0px, calc(var(--card-radius) - var(--inset-search-panel)));
    --radius-search-form-inner: max(0px, calc(var(--radius-search-panel) - var(--inset-search-form)));
    --radius-filter-panel: max(0px, calc(var(--card-radius) - var(--inset-filter-panel)));
    --radius-filter-handle: max(0px, calc(var(--card-radius) - var(--inset-filter-header-top)));
    --radius-filter-close: max(0px, calc(var(--card-radius) - var(--inset-filter-panel)));
    --radius-sheet: max(0px, calc(var(--card-radius) - var(--inset-sheet-x)));
    --radius-sheet-handle: max(0px, calc(var(--card-radius) - var(--inset-sheet-handle-top)));
    --radius-sheet-form: max(0px, calc(var(--radius-sheet) - var(--inset-comment-form)));
    --radius-comment-card: var(--radius-sheet);
}

/* ───────── MAP ───────── */
#map,
#map.maplibregl-map {
    height: 100%;
    width: 100%;
    z-index: 0;
    position: absolute;
    top: 0;
    left: 0;
    font-family: inherit;
}

.maplibregl-ctrl-attrib {
    font-size: 10px;
    background: rgba(255, 255, 255, 0.8) !important;
    margin: 0 !important;
    order: 1;
}

.maplibregl-ctrl-attrib a {
    color: #334155;
}

.maplibregl-ctrl-bottom-left {
    bottom: var(--map-controls-bottom) !important;
}

.maplibregl-ctrl-bottom-right {
    bottom: var(--map-controls-bottom) !important;
    right: var(--dock-inset-x) !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.maplibregl-ctrl-bottom-right .maplibregl-ctrl,
.maplibregl-ctrl-bottom-right .map-nav-control {
    margin: 0;
    float: none;
}

/* Compact attribution: fixed icon slot, text expands left without moving nav buttons */
.maplibregl-ctrl-bottom-right > .maplibregl-ctrl-attrib.maplibregl-compact {
    position: relative;
    width: 24px;
    height: 24px;
    min-height: 24px;
    padding: 0 !important;
    box-sizing: border-box;
    overflow: visible;
    flex-shrink: 0;
    border-radius: 12px;
}

.maplibregl-ctrl-bottom-right > .maplibregl-ctrl-attrib.maplibregl-compact::after {
    display: none;
}

.maplibregl-ctrl-bottom-right > .maplibregl-ctrl-attrib.maplibregl-compact.maplibregl-compact-show,
.maplibregl-ctrl-bottom-right > .maplibregl-ctrl-attrib.maplibregl-compact[open] {
    width: 24px !important;
    height: 24px !important;
    min-height: 24px !important;
    padding: 0 !important;
}

.maplibregl-ctrl-bottom-right > .maplibregl-ctrl-attrib.maplibregl-compact summary.maplibregl-ctrl-attrib-button {
    position: absolute;
    top: 0;
    right: 0;
    left: auto;
    width: 24px;
    height: 24px;
    display: block !important;
    margin: 0;
}

.maplibregl-ctrl-bottom-right > .maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner {
    position: absolute;
    top: 50%;
    right: calc(100% + 6px);
    left: auto;
    transform: translateY(-50%);
    display: none !important;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.8) !important;
    padding: 2px 8px;
    border-radius: 12px;
    margin: 0;
}

.maplibregl-ctrl-bottom-right > .maplibregl-ctrl-attrib.maplibregl-compact.maplibregl-compact-show .maplibregl-ctrl-attrib-inner,
.maplibregl-ctrl-bottom-right > .maplibregl-ctrl-attrib.maplibregl-compact[open] .maplibregl-ctrl-attrib-inner {
    display: block !important;
}

.map-nav-control {
    display: flex;
    flex-direction: column;
    gap: 8px;
    order: 0;
    pointer-events: auto;
}

.map-nav-btn {
    width: 48px;
    height: 48px;
    margin: 0;
    padding: 0;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    backdrop-filter: var(--card-blur);
    -webkit-backdrop-filter: var(--card-blur);
    color: #334155;
    font-size: 1.15rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: manipulation;
    box-shadow: var(--card-shadow);
    transition: transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.map-nav-btn:focus {
    outline: none;
}

.map-nav-btn:focus-visible {
    outline: 2px solid #2d6a4f;
    outline-offset: 2px;
}

.map-nav-btn:active {
    transform: scale(0.94);
}

/* Beat MapLibre .maplibregl-ctrl button:hover tint on frosted nav buttons */
.map-nav-control.maplibregl-ctrl button:not(:disabled):hover,
.map-nav-control.maplibregl-ctrl button:not(:disabled):focus {
    background-color: var(--card-bg);
    filter: none;
}

.map-nav-control.maplibregl-ctrl .map-nav-zoom .map-nav-btn:not(:disabled):hover,
.map-nav-control.maplibregl-ctrl .map-nav-zoom .map-nav-btn:not(:disabled):focus {
    background-color: transparent;
    filter: none;
}

.map-compass-btn {
    border-radius: min(50%, var(--card-radius));
    line-height: 0;
}

.map-compass-btn .compass-dial {
    display: block;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    transition: transform 0.15s ease-out;
    transform-origin: 50% 50%;
}

.map-compass-btn .compass-dial svg {
    display: block;
    width: 32px;
    height: 32px;
}

.map-nav-zoom {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--card-border);
    border-radius: var(--card-radius);
    background: var(--card-bg);
    backdrop-filter: var(--card-blur);
    -webkit-backdrop-filter: var(--card-blur);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.map-nav-zoom .map-nav-btn {
    width: 48px;
    height: 44px;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}

.map-nav-zoom .map-zoom-in {
    border-bottom: 1px solid rgba(203, 213, 225, 0.65);
}

/* ───────── BOTTOM DOCK ───────── */
.bottom-dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1500;
    pointer-events: none;
    padding: 0 var(--dock-inset-x) var(--dock-inset-bottom);
    transition: transform var(--search-motion-duration) var(--search-motion-ease), opacity 0.25s ease;
}

.bottom-dock.is-hidden {
    transform: translateY(110%);
    opacity: 0;
}

.bottom-dock.keyboard-adjusted:not(.is-hidden) {
    transition: opacity 0.25s ease;
}

.bottom-dock-pill {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: var(--dock-height);
    padding: var(--inset-dock-pill-y) var(--inset-dock-pill-x);
    background: var(--card-bg);
    backdrop-filter: var(--card-blur);
    -webkit-backdrop-filter: var(--card-blur);
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
    border-radius: var(--card-radius);
}

.dock-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0 var(--inset-dock-actions-x);
}

.dock-btn {
    height: 52px;
    min-width: 64px;
    padding: 0 22px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: #334155;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: manipulation;
    transition: background 0.15s, color 0.15s, transform 0.15s;
}

.dock-btn.active,
.dock-btn.applied {
    min-width: 72px;
    padding: 0 26px;
    background: #2d6a4f;
    color: #ffffff;
}

.dock-btn.applied:not(.active) {
    background: #dcfce7;
    color: #166534;
}

.dock-btn:active {
    transform: scale(0.94);
}

/* ───────── DOCK STACK & PANELS ───────── */
.dock-stack {
    position: fixed;
    left: var(--dock-inset-x);
    right: var(--dock-inset-x);
    bottom: calc(var(--dock-inset-bottom) + var(--dock-height) + var(--dock-gap));
    z-index: 1600;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    transition: transform var(--search-motion-duration) var(--search-motion-ease);
}

.dock-stack.keyboard-adjusted {
    transition: none;
}

.dock-stack.active {
    pointer-events: auto;
}

.dock-panel {
    background: var(--card-bg);
    backdrop-filter: var(--card-blur);
    -webkit-backdrop-filter: var(--card-blur);
    border-radius: var(--card-radius);
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
    max-height: min(50vh, 360px);
    display: flex;
    flex-direction: column;
    transform: translateY(110%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.25s ease, visibility 0.38s;
    pointer-events: none;
}

.dock-stack.active .dock-panel.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.search-panel {
    max-height: none;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: transform var(--search-motion-duration) var(--search-motion-ease),
        opacity 0.28s ease,
        visibility var(--search-motion-duration);
}

.search-panel .search-panel-body {
    padding: var(--inset-search-panel) var(--inset-search-panel) var(--inset-search-panel) var(--inset-search-panel-left);
    overflow: visible;
    display: flex;
    align-items: center;
    width: 100%;
}

.profile-panel {
    max-height: none;
}

.profile-panel .dock-panel-body {
    overflow: visible;
}

.dock-panel-handle {
    width: 44px;
    height: 5px;
    border-radius: var(--radius-filter-handle);
    background: #cbd5e1;
    margin: var(--inset-filter-header-top) auto 0;
    flex-shrink: 0;
}

.dock-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px var(--inset-filter-panel) 4px;
    flex-shrink: 0;
}

.dock-panel-header h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}

.dock-panel-close {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: min(50%, var(--radius-filter-close));
    background: #f1f5f9;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dock-panel-body {
    overflow-y: auto;
    padding: 8px var(--inset-filter-panel) var(--inset-filter-panel);
    -webkit-overflow-scrolling: touch;
}

/* ───────── SEARCH RESULTS ───────── */
#searchStack.active {
    justify-content: flex-end;
}

#searchStack.active.has-search-results {
    flex-direction: column;
}

#searchStack.active.has-search-results .search-results-stack {
    flex: 0 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

#searchStack.active.has-search-results .search-results-scroll {
    flex: 0 1 auto;
    height: auto;
    max-height: var(--search-results-max-height);
}

#searchStack.active.has-search-results .search-panel {
    flex-shrink: 0;
}

.search-results-stack {
    pointer-events: none;
    background: transparent;
    overflow: hidden;
    opacity: 0;
    transform: translateY(12px);
    max-height: 0;
    transition:
        opacity 0.28s var(--search-motion-ease),
        transform var(--search-motion-duration) var(--search-motion-ease),
        max-height var(--search-motion-duration) var(--search-motion-ease);
}

.search-results-stack.is-open {
    pointer-events: auto;
    opacity: 1;
    transform: translateY(0);
    max-height: var(--search-results-max-height);
}

.search-results-stack.is-hidden {
    display: none;
}

.search-results-scroll {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    max-height: var(--search-results-max-height);
    transition: max-height var(--search-motion-duration) var(--search-motion-ease);
}

html.keyboard-open .search-results-scroll {
    transition: none;
}

.search-results-scroll::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.search-result-card {
    background: var(--card-bg);
    backdrop-filter: var(--card-blur);
    -webkit-backdrop-filter: var(--card-blur);
    border: 1px solid var(--card-border);
    border-radius: var(--card-radius);
    flex-shrink: 0;
}

.search-results-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 16px;
    font-size: 0.85rem;
    color: #64748b;
    animation: searchResultEnter 0.32s var(--search-motion-ease) backwards;
}

.search-results-loading.is-hidden {
    display: none;
}

.search-loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top-color: #2d6a4f;
    border-radius: 50%;
    animation: searchSpin 0.7s linear infinite;
}

@keyframes searchSpin {
    to { transform: rotate(360deg); }
}

.search-results-empty {
    padding: 14px 16px;
    text-align: center;
    font-size: 0.82rem;
    color: #94a3b8;
    animation: searchResultEnter 0.32s var(--search-motion-ease) backwards;
}

button.search-result-card {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    margin: 0;
    text-align: left;
    padding: 12px 14px;
    font: inherit;
    color: inherit;
    cursor: pointer;
    touch-action: manipulation;
    appearance: none;
    -webkit-appearance: none;
    transition: transform 0.15s ease, opacity 0.15s ease;
    animation: searchResultEnter 0.32s var(--search-motion-ease) backwards;
}

@keyframes searchResultEnter {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

button.search-result-card:active {
    transform: scale(0.985);
}

.search-result-kind {
    flex-shrink: 0;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 2px 6px;
    border-radius: 999px;
    margin-top: 1px;
}

.search-result-kind.place {
    color: #1d4ed8;
    background: #dbeafe;
}

.search-result-kind.station {
    color: #2d6a4f;
    background: #dcfce7;
}

.search-result-text {
    flex: 1;
    min-width: 0;
    font-size: 0.82rem;
    line-height: 1.35;
    color: #334155;
}

/* ───────── SEARCH FORM ───────── */
.search-form {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-height: var(--search-bar-height);
    background: transparent;
    border: none;
    padding: 0 56px 0 4px;
}

.search-input {
    width: 100%;
    min-width: 0;
    height: var(--search-bar-height);
    border: none;
    background: transparent;
    font: inherit;
    font-size: 0.88rem;
    line-height: var(--search-bar-height);
    color: #0f172a;
    outline: none;
    text-align: left;
    padding: 0 0 0 4px;
    appearance: none;
}

.search-input::-webkit-search-cancel-button,
.search-input::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
    display: none;
}

.search-input::placeholder {
    color: #94a3b8;
    text-align: left;
}

.search-form .search-submit.dock-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: var(--search-bar-height);
    min-width: 48px;
    padding: 0 16px;
    font-size: 1.1rem;
}

.search-form .search-submit.dock-btn:active {
    transform: translateY(-50%) scale(0.94);
}

/* ───────── FILTERS ───────── */
.filter-section {
    margin-bottom: 14px;
}

.filter-section-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 8px;
}

.filter-fuel-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-fuel-pill {
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #ffffff;
    color: #334155;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 8px 14px;
    cursor: pointer;
    touch-action: manipulation;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.filter-fuel-pill.selected {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
}

.filter-fuel-pill:active {
    transform: scale(0.97);
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-field span {
    font-size: 0.68rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.filter-field select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    padding: 10px 48px 10px 16px;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' stroke='%2364748b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 18px center;
    background-size: 12px;
    cursor: pointer;
    touch-action: manipulation;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.filter-field select:focus {
    outline: none;
    border-color: #86efac;
    background-color: #f8fafc;
}

.filter-field select:active {
    transform: scale(0.99);
}

.filter-panel .dock-panel-header {
    padding-top: calc(var(--inset-filter-panel) + 12px);
}

.filter-actions {
    margin-top: 6px;
}

.filter-clear-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    border: none;
    border-radius: var(--radius-filter-panel);
    background: #f1f5f9;
    color: #64748b;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 12px 16px;
    cursor: pointer;
    touch-action: manipulation;
    transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
}

.filter-clear-btn:not(:disabled):active {
    background: #e2e8f0;
    color: #475569;
    transform: scale(0.99);
}

.filter-clear-btn:disabled {
    opacity: 0.42;
    cursor: default;
}

.profile-input {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    padding: 10px 16px;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
    background-color: #ffffff;
    outline: none;
    touch-action: manipulation;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.profile-input:focus {
    border-color: #86efac;
    background-color: #f8fafc;
}

.profile-field-hint {
    margin: 6px 0 0;
    font-size: 0.72rem;
    line-height: 1.35;
    color: #64748b;
}

.profile-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.profile-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    border: 1px solid #86efac;
    border-radius: var(--radius-filter-panel);
    background: #dcfce7;
    color: #166534;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 12px 16px;
    text-decoration: none;
    touch-action: manipulation;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.profile-link-btn-secondary {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #334155;
}

.profile-link-btn:active {
    transform: scale(0.99);
}

.profile-form-error {
    margin: 10px 0 0;
    font-size: 0.75rem;
    color: #b91c1c;
}

.profile-form-error.is-hidden {
    display: none;
}

#favoritesStack.active {
    flex-direction: column;
    justify-content: flex-end;
}

#favoritesStack.active .search-results-stack.is-open {
    flex: 0 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

#favoritesStack.active .search-results-scroll {
    flex: 0 1 auto;
    height: auto;
    max-height: var(--search-results-max-height);
}

.sheet-favorite-action {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

.sheet-favorite-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sheet-form);
    background: #ffffff;
    color: #334155;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 12px 16px;
    cursor: pointer;
    touch-action: manipulation;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.sheet-favorite-btn.is-active {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}

.sheet-favorite-btn:active {
    transform: scale(0.99);
}

.sheet-favorite-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.map-status {
    margin: 12px 0 0;
    padding: 6px 12px;
    font-size: 0.75rem;
    color: #475569;
    background: #f1f5f9;
    border-radius: 999px;
    text-align: center;
}

.map-status.is-hidden {
    display: none;
}

/* ───────── BOTTOM SHEET ───────── */
.bottom-sheet-overlay {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    padding: 0 var(--dock-inset-x) var(--dock-inset-bottom);
    pointer-events: none;
    visibility: hidden;
    transition: visibility 0.3s ease;
}

.bottom-sheet-overlay.active {
    visibility: visible;
    pointer-events: auto;
}

.bottom-sheet-backdrop {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: 0;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
    z-index: 1999;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.bottom-sheet-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.bottom-sheet {
    position: relative;
    background: var(--card-bg);
    backdrop-filter: var(--card-blur);
    -webkit-backdrop-filter: var(--card-blur);
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
    border-radius: var(--card-radius);
    padding: var(--inset-sheet-y) var(--inset-sheet-x) 20px;
    max-height: min(75vh, calc(100dvh - var(--dock-inset-bottom) - 24px));
    transform: translateY(calc(100% + 20px));
    transition: transform 0.45s cubic-bezier(0.32, 0.72, 0, 1);
    will-change: transform;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    pointer-events: auto;
    z-index: 2001;
}

.bottom-sheet-overlay.active .bottom-sheet {
    transform: translateY(0);
}

.sheet-handle {
    display: flex;
    justify-content: center;
    padding: 4px 0 12px 0;
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.sheet-handle:active {
    cursor: grabbing;
}

.sheet-handle .bar {
    width: 44px;
    height: 5px;
    border-radius: var(--radius-sheet-handle);
    background: #cbd5e1;
    transition: background 0.2s;
}

.sheet-handle .bar:active {
    background: #94a3b8;
}

.sheet-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.sheet-header .title-group {
    flex: 1;
    min-width: 0;
}

.sheet-header .title-group h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
    margin: 0;
    letter-spacing: -0.4px;
}

.sheet-header .title-group .subtitle {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sheet-header .title-group .subtitle.is-hidden {
    display: none;
}

.sheet-close-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: min(50%, var(--radius-sheet));
    border: none;
    background: #f1f5f9;
    color: #334155;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    touch-action: manipulation;
}

.sheet-close-btn:active {
    transform: scale(0.90);
    background: #e2e8f0;
}

.sheet-body {
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
}

.sheet-empty-hidden:empty,
.sheet-empty-hidden.is-hidden {
    display: none;
}

.sheet-body .detail-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.sheet-body .detail-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    color: #1e293b;
    min-height: 24px;
}

.sheet-body .detail-row > i {
    width: 18px;
    text-align: center;
    color: #2d6a4f;
    flex-shrink: 0;
}

.sheet-body .detail-row .value {
    font-weight: 500;
    line-height: 1.35;
    word-break: break-word;
}

.sheet-body .detail-row .value a {
    color: #2d6a4f;
    text-decoration: none;
}

.sheet-body .fuel-section {
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
}

.fuel-section-header {
    margin-bottom: 8px;
}

.fuel-section-header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
}

.fuel-section-hint {
    margin: 2px 0 0;
    font-size: 0.72rem;
    color: #64748b;
}

.sheet-body .fuel-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.sheet-body .fuel-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    border: 1px solid transparent;
}

.fuel-pill-available {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
}

.fuel-pill-unavailable {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
    text-decoration: line-through;
}

.fuel-pill-unknown {
    background: #f1f5f9;
    color: #64748b;
    border-color: #cbd5e1;
}

.comments-section {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

.comments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.comments-header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
}

.comments-header span {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 999px;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 240px;
    overflow-y: auto;
}

.comment-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-comment-card);
    padding: 10px 12px;
}

.comment-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.comment-author {
    font-size: 0.82rem;
    font-weight: 700;
    color: #0f172a;
}

.comment-time {
    font-size: 0.72rem;
    color: #94a3b8;
    white-space: nowrap;
}

.comment-fuels {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
}

.comment-fuel-tag {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
}

.comment-fuel-tag.unavailable {
    background: #fee2e2;
    color: #991b1b;
    text-decoration: line-through;
}

.comment-fuel-tag.available::before {
    content: '✓ ';
}

.comment-text {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.4;
    color: #334155;
}

.comments-empty {
    margin: 0;
    font-size: 0.82rem;
    color: #94a3b8;
    text-align: center;
    padding: 12px 0;
}

.comments-empty.is-hidden {
    display: none;
}

.comment-form {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sheet);
    padding: var(--inset-comment-form);
    margin-bottom: 12px;
}

.comment-form.is-hidden {
    display: none;
}

.comment-form-title {
    margin: 0 0 4px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #0f172a;
}

.comment-form-hint {
    margin: 0 0 10px;
    font-size: 0.72rem;
    line-height: 1.35;
    color: #64748b;
}

.comment-form-fuels {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.comment-form-fuels-empty {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.4;
    color: #64748b;
    padding: 8px 10px;
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    border-radius: var(--radius-sheet-form);
}

.comment-fuel-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 8px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sheet-form);
}

.comment-fuel-label {
    flex: 1;
    min-width: 0;
    font-size: 0.78rem;
    font-weight: 700;
    color: #0f172a;
}

.comment-fuel-options {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.comment-fuel-option {
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.15s;
    touch-action: manipulation;
    white-space: nowrap;
}

.comment-fuel-option.yes.selected {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
}

.comment-fuel-option.no.selected {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}

.comment-fuel-option.unknown.selected {
    background: #e2e8f0;
    border-color: #94a3b8;
    color: #475569;
}

.comment-form-text {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sheet-form);
    padding: 8px 10px;
    font: inherit;
    font-size: 0.82rem;
    line-height: 1.4;
    color: #334155;
    resize: vertical;
    min-height: 64px;
    margin-bottom: 8px;
}

.comment-form-text:focus {
    outline: none;
    border-color: #2d6a4f;
    box-shadow: 0 0 0 2px rgba(45, 106, 79, 0.15);
}

.comment-form-submit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    border-radius: 999px;
    background: #2d6a4f;
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 8px 14px;
    cursor: pointer;
    touch-action: manipulation;
}

.comment-form-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.comment-form-submit:active:not(:disabled) {
    transform: scale(0.97);
}

.comment-form-error {
    margin: 8px 0 0;
    font-size: 0.75rem;
    color: #b91c1c;
}

.comment-form-error.is-hidden {
    display: none;
}

.comment-votes {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.comment-vote-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    cursor: pointer;
    touch-action: manipulation;
    transition: all 0.15s;
}

.comment-vote-btn.active-like {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
}

.comment-vote-btn.active-dislike {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}

.comment-vote-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.comment-vote-btn:active:not(:disabled) {
    transform: scale(0.96);
}

.comment-votes-readonly {
    display: flex;
    gap: 10px;
    font-size: 0.75rem;
    color: #64748b;
}

.comment-votes-readonly span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ───────── MARKERS ───────── */
.custom-marker {
    cursor: pointer;
}

.custom-marker-icon {
    position: relative;
    background: #2d6a4f;
    border: 3px solid white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.20);
    transition: transform 0.12s ease-out, opacity 0.14s ease-out;
}

.custom-marker.is-entering .custom-marker-icon,
.custom-marker.is-exiting .custom-marker-icon {
    transform: scale(0.72);
    opacity: 0;
}

.custom-marker.is-entering,
.custom-marker.is-exiting {
    transition: opacity 0.14s ease-out;
}

.custom-marker.is-count-up .custom-marker-icon {
    animation: markerCountPulse 0.18s ease-out;
}

@keyframes markerCountPulse {
    0% { transform: scale(1); }
    45% { transform: scale(1.12); }
    100% { transform: scale(1); }
}

.marker-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ffffff;
    color: #334155;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

@media (hover: none) {
    .map-nav-control.maplibregl-ctrl button:not(:disabled):hover,
    .map-nav-control.maplibregl-ctrl button:not(:disabled):focus {
        background-color: var(--card-bg);
        filter: none;
    }

    .map-nav-control.maplibregl-ctrl .map-nav-zoom .map-nav-btn:not(:disabled):hover,
    .map-nav-control.maplibregl-ctrl .map-nav-zoom .map-nav-btn:not(:disabled):focus {
        background-color: transparent;
        filter: none;
    }
}

/* ───────── TOUCH / HOVER FIXES ───────── */
@media (hover: hover) and (pointer: fine) {
    .custom-marker-icon:hover {
        transform: scale(1.08);
    }

    .sheet-body .detail-row .value a:hover {
        text-decoration: underline;
    }

    .map-nav-control.maplibregl-ctrl button:not(:disabled):hover {
        filter: brightness(0.98);
    }

    .map-nav-control.maplibregl-ctrl .map-nav-zoom .map-nav-btn:not(:disabled):hover {
        filter: brightness(0.98);
    }
}

/* ───────── RESPONSIVE ───────── */
@media (max-width: 480px) {
    .dock-btn {
        height: 48px;
        min-width: 56px;
        padding: 0 18px;
        font-size: 1.1rem;
    }

    .dock-btn.active,
    .dock-btn.applied {
        min-width: 64px;
        padding: 0 22px;
    }
    .bottom-sheet {
        padding: 8px 16px 16px;
    }
    .sheet-header .title-group h2 {
        font-size: 1.15rem;
    }
    .comment-fuel-row {
        flex-direction: column;
        align-items: stretch;
    }
    .comment-fuel-options {
        justify-content: space-between;
    }
    .comment-fuel-option {
        flex: 1;
        text-align: center;
    }
}

.bottom-sheet::-webkit-scrollbar {
    width: 4px;
}
.bottom-sheet::-webkit-scrollbar-track {
    background: transparent;
}
.bottom-sheet::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
