/* Harta.md — UI modernă */
:root {
    --hm-green: #16a34a;
    --hm-green-dark: #15803d;
    --hm-green-soft: #dcfce7;
    --hm-red: #dc2626;
    --hm-red-dark: #b91c1c;
    --hm-red-soft: #fef2f2;
    --hm-ink: #0f172a;
    --hm-muted: #64748b;
    --hm-line: rgba(15, 23, 42, 0.08);
    --hm-glass: rgba(255, 255, 255, 0.82);
    --hm-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
    --hm-shadow-sm: 0 4px 14px rgba(15, 23, 42, 0.08);
    --hm-radius: 16px;
    --hm-pill: 999px;
    --hm-font: 'Inter', 'Open Sans', system-ui, -apple-system, sans-serif;
    --app-vh: 100vh;
}

@supports (height: 100dvh) {
    :root {
        --app-vh: 100dvh;
    }
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    overflow-x: hidden;
    overflow-x: clip;
    overflow-y: auto;
    font-family: var(--hm-font);
    color: var(--hm-ink);
    background: #f4f7f4;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.skip-link {
    position: absolute;
    left: 12px;
    top: -56px;
    z-index: 2000;
    padding: 8px 14px;
    border-radius: 10px;
    background: var(--hm-ink);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.skip-link:focus {
    top: 12px;
}

.map-stage {
    position: relative;
    width: 100%;
    height: calc(var(--app-vh, 100vh) - var(--site-header-h, 68px));
    min-height: 200px;
    max-height: calc(var(--app-vh, 100vh) - var(--site-header-h, 68px));
    overflow: hidden;
    background: #e8eef3;
    --hm-ctrl-size: 42px;
    --hm-zoom-gap: 8px;
    --hm-ctrl-stack-gap: 12px;
    --hm-zoom-bottom: max(24px, env(safe-area-inset-bottom, 0px));
}

.map-stage.is-satellite {
    background: #1c2128;
}

.map-stage:fullscreen,
.map-stage:-webkit-full-screen,
.map-stage:-ms-fullscreen {
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    max-height: none;
    min-height: 0;
}

.map-stage.is-fullscreen {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2400;
    box-sizing: border-box;
    width: auto;
    height: auto;
    max-height: none;
    min-height: 0;
    padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}

html.is-map-fullscreen,
body.is-map-fullscreen {
    overflow: hidden;
    height: 100%;
    height: 100vh;
    height: 100dvh;
    width: 100%;
    overscroll-behavior: none;
}

body.is-map-fullscreen {
    position: fixed;
    left: 0;
    right: 0;
}

body.is-map-fullscreen .site-header,
body.is-map-fullscreen .site-content,
body.is-map-fullscreen .site-footer,
body.is-map-fullscreen .skip-link {
    display: none !important;
}

.ol-full-screen button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    font-size: 0;
}

.ol-full-screen button .ol-full-screen-enter,
.ol-full-screen button .ol-full-screen-leave {
    line-height: 0;
}

.ol-full-screen button .ol-full-screen-leave {
    display: none;
}

.ol-full-screen button.ol-full-screen-true .ol-full-screen-enter {
    display: none;
}

.ol-full-screen button.ol-full-screen-true .ol-full-screen-leave {
    display: block;
}

.ol-full-screen button.ol-full-screen-true {
    background: var(--hm-green);
    color: #fff;
    box-shadow: 0 8px 18px rgba(22, 163, 74, 0.28);
}

.ol-full-screen button svg {
    display: block;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke: currentColor;
}

.vector-basemap {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.vector-basemap .maplibregl-map,
.vector-basemap .maplibregl-canvas,
.vector-basemap .maplibregl-canvas-container {
    width: 100%;
    height: 100%;
}

.map-stage.is-satellite .vector-basemap {
    /* opacity+visibility: iOS Safari can keep a blank WebGL layer on top with visibility alone */
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

#map .ol-viewport,
#map .ol-unselectable,
#map canvas,
#map .ol-layer {
    background: transparent !important;
}

@media (min-height: 700px) {
    .map-stage {
        min-height: min(520px, calc(var(--app-vh, 100vh) - var(--site-header-h, 68px)));
    }
}

#map {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    background: transparent;
}

/* Header */
.map-header {
    position: absolute;
    top: max(10px, env(safe-area-inset-top, 0px));
    right: max(12px, env(safe-area-inset-right, 0px));
    left: auto;
    z-index: 1000;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-height: 0;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.map-header h1,
.site-logo {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
    line-height: 1;
}

.logo-word {
    display: inline-flex;
    align-items: baseline;
    font-family: var(--hm-font);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.055em;
    color: var(--hm-ink);
    line-height: 1;
    white-space: nowrap;
}

.logo-tld {
    color: var(--hm-green);
    letter-spacing: -0.06em;
}

.brand-mark {
    display: inline-flex;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: linear-gradient(180deg, #22c55e 0%, #15803d 100%);
    box-shadow: 0 6px 14px rgba(22, 163, 74, 0.35);
}

.brand-mark svg {
    display: block;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Toggle Hartă / Satelit */
#menu {
    position: static;
    top: auto;
    right: auto;
    z-index: auto;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    gap: 2px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--hm-line);
    border-radius: var(--hm-pill);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

#menu input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

#menu label {
    margin: 0;
    padding: 8px 14px;
    border-radius: var(--hm-pill);
    font-family: var(--hm-font);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #475569;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

#menu label:hover {
    background: transparent;
    color: var(--hm-ink);
}

#menu input[type="radio"]:checked + label {
    background: var(--hm-green);
    color: #fff;
    box-shadow: 0 6px 14px rgba(22, 163, 74, 0.32);
}

#menu input[type="radio"]:focus-visible + label {
    outline: 2px solid var(--hm-green);
    outline-offset: 2px;
}

/* Search + A/B routing */
#search-container {
    position: absolute;
    top: 12px;
    left: max(12px, env(safe-area-inset-left, 0px));
    right: auto;
    z-index: 999;
    display: flex;
    align-items: flex-start;
    gap: 0;
    width: min(528px, calc(100% - 160px));
    max-width: calc(100% - 24px);
    min-width: 0;
}

.search-dock {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}

/* Shared hide-tab (route = side, results = bottom). Change both together. */
.chrome-tab {
    position: relative;
    z-index: 3;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0;
    border: 1px solid var(--hm-line);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px) saturate(1.45);
    -webkit-backdrop-filter: blur(20px) saturate(1.45);
    color: var(--hm-red);
    box-shadow: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.chrome-tab::before {
    content: "";
    position: absolute;
}

.chrome-tab svg {
    position: relative;
    display: block;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: transform 0.22s ease;
}

.chrome-tab-text {
    position: relative;
    font-family: var(--hm-font);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    line-height: 1;
    white-space: nowrap;
}

.chrome-tab:hover {
    background: var(--hm-red-soft);
    color: var(--hm-red-dark);
}

.chrome-tab:active {
    color: var(--hm-red);
}

.chrome-tab:focus-visible {
    outline: 2px solid var(--hm-red);
    outline-offset: 2px;
}

.chrome-tab--side {
    flex: 0 0 28px;
    align-self: center;
    flex-direction: column;
    width: 28px;
    min-width: 28px;
    height: auto;
    min-height: 72px;
    margin: 0 0 0 -8px;
    padding: 14px 0 12px;
    border-left: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 0 14px 14px 0;
}

.chrome-tab--side::before {
    inset: -8px -12px -8px 0;
}

.chrome-tab--side .chrome-tab-text {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

#search-container.is-route .chrome-tab--side,
#search-container.is-collapsed .chrome-tab--side {
    display: inline-flex;
}

#search-container:not(.is-route):not(.is-collapsed) .chrome-tab--side {
    display: none !important;
}

#search-container:not(.is-collapsed) .chrome-tab--side .chrome-tab-show,
#search-container.is-collapsed .chrome-tab--side .chrome-tab-hide {
    display: none !important;
}

.chrome-tab--bottom {
    flex: 0 0 28px;
    flex-direction: row;
    width: auto;
    min-width: 72px;
    height: 28px;
    min-height: 28px;
    margin: -8px 0 0;
    padding: 0 14px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 0 0 14px 14px;
}

.chrome-tab--bottom::before {
    inset: 0 -10px -12px -10px;
}

/* Left chevron → up. Pair with --side (no rotate = left). */
.chrome-tab--bottom svg {
    transform: rotate(90deg);
}

.search-results-shell:not(.is-collapsed) .chrome-tab-show,
.search-results-shell.is-collapsed .chrome-tab-hide {
    display: none !important;
}

.search-results-shell {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    z-index: 6;
    display: none;
    flex-direction: column;
    align-items: center;
    min-width: 0;
}

.search-results-shell.is-open {
    display: flex;
}

.search-results-shell.is-open .chrome-tab--bottom {
    display: inline-flex;
}

.search-results-shell.is-above {
    flex-direction: column-reverse;
}

.search-results-shell.is-above .chrome-tab--bottom {
    margin: 0 0 -8px;
    border-top: 1px solid var(--hm-line);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px 14px 0 0;
}

.search-results-shell.is-above:not(.is-collapsed) .chrome-tab--bottom svg {
    transform: rotate(-90deg);
}

.search-results-shell.is-collapsed .chrome-tab--bottom {
    margin: 0;
    border: 1px solid var(--hm-line);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
}

.search-results-shell.is-collapsed:not(.is-above) .chrome-tab--bottom svg {
    transform: rotate(-90deg);
}

.search-results-shell.is-collapsed.is-above .chrome-tab--bottom svg {
    transform: rotate(90deg);
}

.search-results-shell.is-collapsed #search-results {
    display: none !important;
}

.search-results-shell.is-open:not(.is-collapsed) #search-results {
    padding-bottom: 12px;
}

#search-container.is-collapsed {
    width: auto;
    max-width: none;
    right: auto;
}

#search-container.is-collapsed .search-dock {
    position: absolute;
    width: min(480px, 72vw);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translateX(calc(-100% - 16px));
}

#search-container.is-collapsed .chrome-tab--side {
    margin: 0;
    border-left: 1px solid var(--hm-line);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
}

#search-container.is-collapsed .chrome-tab--side svg {
    transform: rotate(180deg);
}

#search-container.is-collapsed .search-results-shell {
    display: none !important;
}

.route-panel {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(20px) saturate(1.45);
    -webkit-backdrop-filter: blur(20px) saturate(1.45);
    border: 1px solid var(--hm-line);
    border-radius: 20px;
    box-shadow: var(--hm-shadow);
    overflow: hidden;
    max-height: calc(var(--app-vh, 100vh) - var(--site-header-h, 68px) - 24px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.search-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 8px;
}

.search-box {
    position: relative;
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    height: 48px;
    padding: 4px 4px 4px 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--hm-pill);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.search-box:hover {
    background: #f1f5f9;
}

.search-box:focus-within {
    background: #fff;
    border-color: rgba(22, 163, 74, 0.35);
    box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.14);
}

.search-icon {
    flex-shrink: 0;
    display: flex;
    color: #94a3b8;
    pointer-events: none;
}

.search-box:focus-within .search-icon {
    color: var(--hm-green);
}

.search-box .route-input {
    height: 100%;
    width: 100%;
    min-width: 0;
    padding: 0 8px;
}

.search-submit {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 40px;
    min-width: 40px;
    padding: 0 14px;
    border: 0;
    border-radius: var(--hm-pill);
    background: linear-gradient(180deg, #22c55e 0%, #15803d 100%);
    color: #fff;
    font-family: var(--hm-font);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.02em;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(22, 163, 74, 0.32);
    transition: transform 0.15s ease, box-shadow 0.18s ease, filter 0.18s ease;
    -webkit-tap-highlight-color: transparent;
}

.search-submit:hover {
    filter: brightness(1.05);
    box-shadow: 0 8px 18px rgba(22, 163, 74, 0.4);
}

.search-submit:active {
    transform: scale(0.96);
}

.search-submit:focus-visible {
    outline: 2px solid var(--hm-green);
    outline-offset: 2px;
}

.search-submit svg {
    display: none;
    flex-shrink: 0;
}

.search-submit-label,
.route-toggle-label {
    white-space: nowrap;
}

.route-toggle {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    min-width: 48px;
    padding: 0 16px;
    border: 1px solid #e2e8f0;
    border-radius: var(--hm-pill);
    background: #f8fafc;
    color: var(--hm-green-dark);
    font-family: var(--hm-font);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.02em;
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.15s ease, border-color 0.18s ease;
    -webkit-tap-highlight-color: transparent;
}

.route-toggle:hover {
    background: #e2e8f0;
}

.route-toggle:active {
    transform: scale(0.97);
}

.route-toggle:focus-visible {
    outline: 2px solid var(--hm-green);
    outline-offset: 2px;
}

.route-toggle svg {
    display: block;
    flex-shrink: 0;
}

.route-toggle-icon {
    width: 20px;
    height: 20px;
}

.route-toggle.is-on {
    background: linear-gradient(180deg, #22c55e 0%, #15803d 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 8px 18px rgba(22, 163, 74, 0.38);
}

.route-toggle.is-on:hover {
    filter: brightness(1.05);
    background: linear-gradient(180deg, #22c55e 0%, #15803d 100%);
}

#route-fields[hidden] {
    display: none !important;
}

.route-fields-bar,
.route-trip-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.route-fields-bar {
    justify-content: flex-end;
    padding: 8px 10px 0;
}

.route-trip-bar {
    margin: 0 0 2px;
}

.route-trip-bar .route-start {
    margin-right: auto;
}

.route-start {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 88px;
    max-width: 100%;
    min-height: 48px;
    margin: 0;
    padding: 8px 22px;
    border: 2px solid #cc0000;
    border-radius: 999px;
    background: #ff0000;
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 3px 10px rgba(220, 0, 0, 0.38);
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.15s ease;
}

.route-start:hover {
    background: #e60000;
    border-color: #b30000;
    box-shadow: 0 5px 14px rgba(220, 0, 0, 0.45);
}

.route-start:active {
    transform: scale(0.97);
}

.route-start:focus-visible {
    outline: 2px solid #ff0000;
    outline-offset: 2px;
}

.route-start.is-on {
    background: #fef2f2;
    border-color: #dc2626;
    color: #b91c1c;
    box-shadow: 0 3px 10px rgba(220, 38, 38, 0.12);
}

.route-start.is-on:hover {
    background: #fee2e2;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.12);
}

.route-close {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
    min-height: 44px;
    margin: 0;
    padding: 4px 12px 4px 6px;
    border: 2px solid #0f172a;
    border-radius: 999px;
    background: #f8fafc;
    color: #475569;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.15s ease;
}

.route-close-x {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fff;
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.route-close-label {
    min-width: 0;
    overflow-wrap: anywhere;
}

.route-close:hover {
    background: #fef2f2;
    border-color: #0f172a;
    color: #b91c1c;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.1);
}

.route-close:hover .route-close-x {
    background: #dc2626;
    color: #fff;
}

.route-close:active {
    transform: scale(0.97);
}

.route-close:focus-visible {
    outline: 2px solid var(--hm-green);
    outline-offset: 2px;
}

.route-points {
    position: relative;
}

.route-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid #f1f5f9;
}

.route-points .route-row {
    border-bottom: none;
}

.route-points .route-row[data-point="a"] {
    padding-bottom: 18px;
}

.route-points .route-row[data-point="b"] {
    padding-top: 18px;
    border-top: 1px solid #e2e8f0;
}

.route-row:last-of-type {
    border-bottom: none;
}

.route-swap {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 2;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    margin: 0;
    padding: 0;
    transform: translate(-50%, -50%);
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    background: #fff;
    color: var(--hm-green-dark);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.15s ease, border-color 0.18s ease;
    -webkit-tap-highlight-color: transparent;
}

.route-swap:hover {
    background: var(--hm-green-soft);
    border-color: rgba(22, 163, 74, 0.28);
    color: var(--hm-green);
    box-shadow: 0 6px 16px rgba(22, 163, 74, 0.18);
}

.route-swap:active {
    transform: translate(-50%, -50%) scale(0.94);
}

.route-swap:focus-visible {
    outline: 2px solid var(--hm-green);
    outline-offset: 2px;
}

.route-swap svg {
    display: block;
    width: 20px;
    height: 20px;
}

.route-row-slot {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
}

.route-clear {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #0f172a;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.route-clear svg {
    display: block;
}

.route-clear:hover,
.route-clear:focus-visible {
    color: #dc2626;
    background: transparent;
}

.route-clear:active {
    color: #b91c1c;
}

.route-clear:focus-visible {
    outline: 2px solid #dc2626;
    outline-offset: 2px;
}

.route-clear[hidden] {
    display: none !important;
}

.route-row.is-active .route-input {
    background: #f0fdf4;
}

.route-badge {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 800;
    color: #fff;
}

.route-badge.a {
    background: #dc2626;
}

.route-badge.b {
    background: #16a34a;
}

.route-input {
    flex: 1;
    min-width: 0;
    padding: 10px 8px;
    border: 0;
    outline: none;
    font-size: 16px;
    font-family: var(--hm-font);
    color: var(--hm-ink);
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    border-radius: 0;
}

.route-input::placeholder {
    color: #94a3b8;
}

.icon-btn {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 12px;
    background: #f1f5f9;
    color: var(--hm-ink);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover,
.icon-btn.is-on {
    background: var(--hm-green-soft);
    color: var(--hm-green-dark);
}

#btn-gps {
    color: #dc2626;
}

#btn-gps:hover,
#btn-gps.is-on {
    background: #fee2e2;
    color: #b91c1c;
}

.icon-btn.is-loading {
    opacity: 0.6;
}

.icon-btn:focus-visible,
.locate-btn:focus-visible,
#language-selector .lang-link:focus-visible,
.search-result-item:focus-visible,
.site-content a:focus-visible,
.site-footer a:focus-visible {
    outline: 3px solid var(--hm-green);
    outline-offset: 2px;
}

#search-results {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    width: 100%;
    display: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-height: min(420px, calc(var(--app-vh, 100vh) - var(--site-header-h, 68px) - 150px));
    background: #fff;
    border: 1px solid var(--hm-line);
    border-radius: var(--hm-radius);
    box-shadow: var(--hm-shadow);
    z-index: 1;
}

#search-results.show {
    display: block;
}

#search-results:empty {
    display: none !important;
}

.search-result-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    font-family: var(--hm-font);
    transition: background-color 0.15s ease;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover,
.search-result-item.active {
    background-color: var(--hm-green-soft);
}

.search-result-street {
    margin-bottom: 3px;
    font-weight: 600;
    font-size: 14px;
    color: var(--hm-ink);
    min-width: 0;
    overflow-wrap: anywhere;
}

.search-result-address {
    color: var(--hm-muted);
    font-size: 12px;
    line-height: 1.4;
    min-width: 0;
    overflow-wrap: anywhere;
}

.search-result-kind {
    display: inline-block;
    margin-left: 6px;
    font-weight: 600;
    font-size: 11px;
    line-height: 1.2;
    color: var(--hm-muted);
    overflow-wrap: anywhere;
}

.search-result-number {
    color: var(--hm-green-dark);
    font-weight: 600;
}

.search-loading,
.search-no-results {
    padding: 16px;
    text-align: center;
    color: var(--hm-muted);
}

.search-loading {
    font-style: italic;
}

/* Language */
#language-selector {
    position: static;
    display: inline-flex;
    gap: 2px;
    padding: 4px;
    background: #f1f5f9;
    border: 1px solid var(--hm-line);
    border-radius: var(--hm-pill);
    box-shadow: none;
    font-family: var(--hm-font);
    font-size: 12px;
}

#language-selector span {
    display: none;
}

#language-selector .lang-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    padding: 7px 12px;
    border: 0;
    border-radius: var(--hm-pill);
    text-align: center;
    text-decoration: none;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #475569;
    background: transparent;
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

#language-selector .lang-link:hover {
    background-color: transparent;
    color: var(--hm-ink);
}

#language-selector .lang-link.active,
#language-selector .lang-link[aria-current="page"] {
    color: #111;
    background-color: var(--hm-green);
    box-shadow: 0 6px 14px rgba(22, 163, 74, 0.32);
}

/* Popup */
.ol-popup {
    position: relative;
    left: auto;
    bottom: auto;
    min-width: 180px;
    max-width: min(320px, calc(100vw - 24px));
    width: auto;
    padding: 16px 18px 14px;
    background: #fff;
    border: 1px solid var(--hm-line);
    border-radius: 18px;
    box-shadow: var(--hm-shadow);
}

.ol-popup:after,
.ol-popup:before {
    content: " ";
    position: absolute;
    top: 100%;
    height: 0;
    width: 0;
    pointer-events: none;
    border: solid transparent;
}

.ol-popup:after {
    left: 50%;
    margin-left: -10px;
    border-width: 10px;
    border-top-color: #fff;
}

.ol-popup:before {
    left: 50%;
    margin-left: -11px;
    border-width: 11px;
    border-top-color: rgba(15, 23, 42, 0.08);
}

.ol-popup-closer {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    text-decoration: none;
    font-size: 20px;
    font-weight: 500;
    line-height: 1;
    color: var(--hm-muted);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.ol-popup-closer:hover {
    background: #f1f5f9;
    color: var(--hm-ink);
}

.ol-popup-content {
    padding-right: 18px;
    text-align: left;
    font-family: var(--hm-font);
}

.ol-popup-content h3 {
    margin: 0 0 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 15px;
    font-weight: 700;
    color: var(--hm-ink);
}

.ol-popup-content p {
    margin: 6px 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--hm-muted);
}

.ol-popup-content strong {
    color: var(--hm-ink);
}

.ol-popup-content .popup-kind {
    display: inline-block;
    margin: 0 0 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #ecfdf3;
    color: #15803d;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.popup-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.popup-btn,
.popup-btn-b {
    flex: 1;
    border: 0;
    border-radius: 999px;
    padding: 8px 10px;
    font-family: var(--hm-font);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    color: #fff;
    background: #dc2626;
}

.popup-btn-b {
    background: #16a34a;
}

.route-trip {
    margin-top: 8px;
    padding: 12px 12px 14px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px) saturate(1.45);
    -webkit-backdrop-filter: blur(20px) saturate(1.45);
    border: 1px solid var(--hm-line);
    border-radius: 20px;
    box-shadow: var(--hm-shadow);
    min-width: 0;
    touch-action: pan-y;
}

.route-trip[hidden] {
    display: none !important;
}

.route-trip-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    align-items: center;
    column-gap: 6px;
    min-width: 0;
}

.route-trip-stops {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
}

.route-trip-row {
    display: flex;
    align-items: center;
    gap: 2px;
    min-width: 0;
}

.route-trip-row:first-of-type {
    padding-bottom: 18px;
}

.route-trip-row:last-of-type {
    padding-top: 18px;
    border-top: 1px solid #e2e8f0;
}

.route-trip-stop {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    width: auto;
    min-width: 0;
    min-height: 44px;
    padding: 4px 6px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.route-trip-stop:hover {
    background: #f8fafc;
}

.route-trip-stop:focus-visible {
    outline: 2px solid var(--hm-green);
    outline-offset: 2px;
}

.route-trip-addr {
    min-width: 0;
    font-size: 14px;
    font-weight: 650;
    color: var(--hm-ink);
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.route-trip-locate {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    justify-self: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border: 1px solid var(--hm-line);
    border-radius: 12px;
    background: #fff;
    color: #dc2626;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.route-trip-locate svg {
    display: block;
    width: 22px;
    height: 22px;
}

.route-trip-locate.is-on {
    background: #dc2626;
    color: #fff;
    border-color: transparent;
}

.route-trip-locate.is-follow {
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.22);
}

.route-trip-locate.is-loading {
    opacity: 0.65;
}

.route-trip-locate:focus-visible {
    outline: 2px solid var(--hm-green);
    outline-offset: 2px;
}

#search-container.is-route ~ .locate-btn {
    display: inline-flex !important;
}

@media (max-width: 699.98px) {
    /* Hide while picking A/B; show again after route starts (panel collapsed / nav). */
    #search-container.is-route:not(.is-collapsed) ~ .locate-btn {
        display: none !important;
    }

    #search-container.is-route.is-collapsed ~ .locate-btn {
        display: inline-flex !important;
    }
}

.route-play {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    min-width: 56px;
    min-height: 56px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #ff0000;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(220, 0, 0, 0.38);
    transition: transform 0.15s ease, box-shadow 0.18s ease, filter 0.18s ease;
    -webkit-tap-highlight-color: transparent;
}

.route-play:hover {
    filter: brightness(1.08);
    box-shadow: 0 8px 22px rgba(220, 0, 0, 0.45);
}

.route-play:active {
    transform: scale(0.94);
}

.route-play:focus-visible {
    outline: 2px solid #ff0000;
    outline-offset: 3px;
}

.route-play .route-play-icon {
    margin-left: 3px;
}

.route-play .route-stop-icon {
    display: none;
}

.route-play.is-on {
    box-shadow: 0 0 0 4px rgba(255, 0, 0, 0.22), 0 8px 22px rgba(220, 0, 0, 0.4);
}

.route-play.is-on .route-play-icon {
    display: none;
}

.route-play.is-on .route-stop-icon {
    display: block;
}

.route-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 2px 0;
    font-size: 13px;
    font-weight: 650;
    color: var(--hm-ink);
    background: transparent;
}

.route-info[hidden] {
    display: none !important;
}

.route-info.is-walk .route-summary {
    color: #0f766e;
}

.route-info.is-transit .route-summary,
.route-info.is-transit .route-legs {
    color: #2563eb;
}

.route-summary,
.route-legs {
    margin: 0;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.route-summary {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #1e3a8a;
}

.route-info:not(.is-transit):not(.is-walk) .route-summary {
    color: var(--hm-green-dark);
}

.route-legs {
    font-size: 13px;
    font-weight: 600;
    color: #2563eb;
}

.route-summary[hidden],
.route-legs[hidden] {
    display: none !important;
}

.hm-choice-row,
.route-modes {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
    min-width: 0;
}

.route-mode {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 44px;
    padding: 8px 6px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    background: #fff;
    color: #334155;
    font-family: var(--hm-font);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.2;
    letter-spacing: -0.02em;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    hyphens: auto;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.route-mode:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.route-mode.is-on {
    border-color: transparent;
    color: #fff;
    background: #16a34a;
    box-shadow: 0 4px 10px rgba(22, 163, 74, 0.28);
}

.route-info.is-walk .route-mode.is-on {
    background: #0f766e;
    box-shadow: 0 4px 10px rgba(15, 118, 110, 0.28);
}

.route-info.is-transit .route-mode.is-on {
    background: #2563eb;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.28);
}

.locate-btn {
    position: absolute;
    left: max(16px, env(safe-area-inset-left, 0px));
    bottom: max(52px, calc(env(safe-area-inset-bottom, 0px) + 36px));
    z-index: 1000;
    width: 46px;
    height: 46px;
    border: 1px solid var(--hm-line);
    border-radius: 14px;
    background: var(--hm-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--hm-shadow-sm);
    color: #dc2626;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.locate-btn svg {
    display: block;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.locate-btn.is-on {
    background: #dc2626;
    color: #fff;
    border-color: transparent;
}

.locate-btn.is-follow {
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.22), 0 8px 18px rgba(220, 38, 38, 0.28);
}

.locate-btn.is-loading {
    opacity: 0.65;
}

.geo-status {
    position: absolute;
    left: max(16px, env(safe-area-inset-left, 0px));
    bottom: max(108px, calc(env(safe-area-inset-bottom, 0px) + 92px));
    z-index: 1001;
    max-width: min(280px, calc(100% - 88px));
    padding: 10px 12px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--hm-line);
    box-shadow: var(--hm-shadow-sm);
    color: #b91c1c;
    font-family: var(--hm-font);
    font-size: 13px;
    font-weight: 650;
    line-height: 1.4;
}

.geo-status[hidden] {
    display: none !important;
}

.gps-marker {
    position: relative;
    width: 52px;
    height: 52px;
    pointer-events: none;
}

.gps-marker-pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.28);
    animation: gps-pulse 1.8s ease-out infinite;
}

.gps-marker-dot {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border-radius: 50%;
    background: #2563eb;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.28);
}

.gps-marker-heading {
    position: absolute;
    left: 50%;
    top: 6px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 11px solid #1d4ed8;
    transform-origin: 50% 20px;
}

@keyframes gps-pulse {
    0% { transform: scale(0.4); opacity: 0.65; }
    100% { transform: scale(1.2); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .gps-marker-pulse {
        animation: none;
        opacity: 0.35;
    }

    .route-traveler-pulse {
        animation: none;
        opacity: 0.35;
    }
}

.route-traveler {
    position: relative;
    width: 52px;
    height: 52px;
    pointer-events: none;
}

.route-traveler-pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(22, 163, 74, 0.3);
    animation: gps-pulse 1.8s ease-out infinite;
}

.route-traveler-dot {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border-radius: 50%;
    background: #16a34a;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.3);
}

.route-traveler-heading {
    position: absolute;
    left: 50%;
    top: 4px;
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 12px solid #15803d;
    transform-origin: 50% 22px;
}

/* OpenLayers controls */
.ol-control {
    background: transparent;
    border-radius: 14px;
}

.ol-zoom {
    top: auto;
    left: auto;
    right: max(16px, env(safe-area-inset-right, 0px));
    bottom: var(--hm-zoom-bottom);
}

/* Sit clear of + / − (two buttons + gap), including 44px touch targets on phones. */
.ol-north-up {
    top: auto;
    right: max(16px, env(safe-area-inset-right, 0px));
    bottom: calc(
        var(--hm-zoom-bottom)
        + (2 * var(--hm-ctrl-size))
        + var(--hm-zoom-gap)
        + var(--hm-ctrl-stack-gap)
    );
}

.ol-full-screen {
    top: auto;
    right: max(16px, env(safe-area-inset-right, 0px));
    bottom: calc(
        var(--hm-zoom-bottom)
        + (3 * var(--hm-ctrl-size))
        + var(--hm-zoom-gap)
        + (2 * var(--hm-ctrl-stack-gap))
    );
}

.ol-rotate {
    display: none !important;
}

.ol-north-up button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    font-size: 0;
}

.ol-north-up .north-up-dial {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    line-height: 1;
    will-change: transform;
}

.ol-north-up .north-up-arrow {
    display: block;
    width: 13px;
    height: 11px;
    color: #e11d48;
    flex-shrink: 0;
}

.ol-north-up .north-up-n {
    display: block;
    font-family: var(--hm-font);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1;
    color: var(--hm-ink);
}

.ol-north-up button:focus-visible .north-up-n {
    color: #fff;
}

.ol-north-up button:focus-visible .north-up-arrow {
    color: #fff;
}

.ol-north-up button.is-north .north-up-arrow {
    color: #e11d48;
}

.ol-north-up button.is-north:focus-visible .north-up-arrow {
    color: #fff;
}

.ol-control button {
    width: 42px;
    height: 42px;
    margin: 0;
    border: 1px solid var(--hm-line);
    border-radius: 14px;
    background: var(--hm-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--hm-shadow-sm);
    color: var(--hm-ink);
    font-size: 18px;
    font-weight: 600;
    line-height: 42px;
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.ol-zoom .ol-zoom-in,
.ol-zoom .ol-zoom-out {
    border-radius: 14px;
}

.ol-zoom .ol-zoom-in {
    margin-bottom: 8px;
}

.ol-control button:focus-visible {
    outline: none;
    background: var(--hm-green);
    color: #fff;
    box-shadow: 0 8px 18px rgba(22, 163, 74, 0.28);
}

.ol-control button:focus {
    outline: none;
}

/* Avoid sticky green :hover after tap on phones. */
@media (hover: hover) and (pointer: fine) {
    .ol-control button:hover {
        outline: none;
        background: var(--hm-green);
        color: #fff;
        box-shadow: 0 8px 18px rgba(22, 163, 74, 0.28);
    }

    .ol-north-up button:hover .north-up-n {
        color: #fff;
    }

    .ol-north-up button:hover .north-up-arrow {
        color: #fff;
    }

    .ol-north-up button.is-north:hover .north-up-arrow {
        color: #fff;
    }
}

.ol-scale-line {
    left: 12px;
    bottom: 16px;
    background: var(--hm-glass);
    backdrop-filter: blur(12px);
    border-radius: 8px;
}

.ol-scale-line-inner {
    border-color: var(--hm-ink);
    color: var(--hm-ink);
    font-family: var(--hm-font);
}

.ol-attribution {
    left: auto;
    right: max(64px, calc(env(safe-area-inset-right, 0px) + 54px));
    bottom: max(8px, env(safe-area-inset-bottom, 0px));
    max-width: min(240px, calc(100% - 160px));
    font-family: var(--hm-font);
    font-size: 11px;
    background: transparent !important;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.9);
}

.ol-attribution button {
    display: none;
}

/* Content below the map — visible to users, Google, and AI crawlers */
.site-content {
    max-width: 980px;
    margin: 0 auto;
    padding: 48px max(20px, env(safe-area-inset-right, 0px)) 32px max(20px, env(safe-area-inset-left, 0px));
    color: #334155;
    line-height: 1.7;
}

.site-content h1 {
    margin: 0 0 12px;
    font-size: clamp(1.4rem, 4vw, 1.875rem);
    letter-spacing: -0.03em;
    color: var(--hm-ink);
    overflow-wrap: break-word;
}

.site-content h2 {
    margin: 28px 0 12px;
    font-size: 22px;
    letter-spacing: -0.03em;
    color: var(--hm-ink);
}

.site-content h3 {
    margin: 28px 0 10px;
    font-size: 18px;
    letter-spacing: -0.02em;
    color: var(--hm-ink);
}

.site-content p,
.site-content li {
    margin: 0 0 12px;
    font-size: 16px;
}

.site-content ul {
    margin: 0 0 16px;
    padding-left: 18px;
}

.site-content .feature-cards,
.site-content .place-chips {
    padding-left: 0;
}

.site-content a {
    color: var(--hm-green-dark);
    font-weight: 600;
    text-decoration: none;
}

.site-content a:hover {
    text-decoration: underline;
}

.faq-list {
    display: grid;
    gap: 10px;
    margin: 16px 0 8px;
}

.faq-list details {
    padding: 12px 16px;
    border: 1px solid var(--hm-line);
    border-radius: 14px;
    background: #f8fafc;
}

.faq-list summary {
    display: flex;
    align-items: center;
    min-height: 44px;
    cursor: pointer;
    font-weight: 700;
    color: var(--hm-ink);
    overflow-wrap: anywhere;
}

.faq-list details p {
    margin: 10px 0 0;
}

.site-content .feature-cards {
    margin-top: 8px;
}

.image-gallery {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin: 20px 0;
}

.image-gallery img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 12px;
}

@media (min-width: 576px) {
    .map-header {
        top: 12px;
        right: 16px;
        padding: 0;
        min-height: 0;
    }

    .logo-word {
        font-size: 24px;
    }

    #menu label {
        padding: 8px 16px;
        font-size: 13px;
    }

    #search-container {
        top: 12px;
        left: 16px;
        right: auto;
        width: 440px;
        max-width: calc(100% - 32px);
    }

    #language-selector {
        font-size: 13px;
    }

    .ol-popup {
        min-width: 220px;
        max-width: 320px;
        padding: 18px 20px 16px;
    }

    .image-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .image-gallery img {
        height: 250px;
    }
}

@media (min-width: 768px) {
    #search-container {
        width: 480px;
    }
}

@media (min-width: 992px) {
    .image-gallery {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 699.98px) {
    .map-header {
        top: auto;
        left: max(10px, env(safe-area-inset-left, 0px));
        right: auto;
        bottom: max(16px, env(safe-area-inset-bottom, 0px));
        padding: 0;
        min-height: 0;
        gap: 8px;
    }

    .brand-mark {
        width: 28px;
        height: 28px;
        border-radius: 8px;
    }

    .logo-word {
        font-size: 20px;
    }

    #menu {
        padding: 3px;
        max-width: calc(100vw - 88px);
    }

    #menu label {
        padding: 7px 11px;
        font-size: 12px;
    }

    #search-container {
        top: max(10px, calc(env(safe-area-inset-top, 0px) + 8px));
        left: max(8px, env(safe-area-inset-left, 0px));
        right: max(8px, env(safe-area-inset-right, 0px));
        width: auto;
        max-width: none;
    }

    .search-toolbar {
        grid-template-columns: minmax(0, 1fr) 46px;
        gap: 6px;
        padding: 6px;
    }

    .search-box {
        height: 46px;
        padding: 3px 3px 3px 8px;
    }

    .search-icon {
        display: none;
    }

    .search-box .route-input {
        padding-left: 12px;
    }

    .search-submit {
        width: 40px;
        min-width: 40px;
        padding: 0;
        height: 40px;
    }

    .search-submit svg {
        display: block;
    }

    .search-submit-label {
        display: none;
    }

    .route-toggle {
        width: 46px;
        min-width: 46px;
        height: 46px;
        padding: 0;
        gap: 0;
    }

    .route-toggle-label {
        display: none;
    }

    .locate-btn {
        left: max(10px, env(safe-area-inset-left, 0px));
        /* Sit above Hartă/Satelit switch */
        bottom: max(68px, calc(env(safe-area-inset-bottom, 0px) + 52px));
        width: 44px;
        height: 44px;
    }

    .geo-status {
        left: max(10px, env(safe-area-inset-left, 0px));
        bottom: max(120px, calc(env(safe-area-inset-bottom, 0px) + 104px));
        max-width: calc(100% - 88px);
    }

    /* Under zoom −, bottom-right (zoom/fullscreen sit above via --hm-zoom-bottom). */
    .ol-scale-line {
        left: auto;
        right: max(10px, env(safe-area-inset-right, 0px));
        bottom: max(10px, env(safe-area-inset-bottom, 0px));
    }

    .ol-popup-content {
        font-size: 13px;
    }

    .ol-popup-content h3 {
        font-size: 14px;
    }

    .ol-control button {
        width: 38px;
        height: 38px;
        line-height: 38px;
        font-size: 16px;
    }

    .ol-full-screen button {
        line-height: 1;
    }

    .ol-full-screen button svg {
        width: 22px;
        height: 22px;
    }

    .header-actions {
        gap: 6px;
    }

    .map-stage {
        --hm-ctrl-size: 38px;
        --hm-scale-clearance: 30px;
        --hm-zoom-bottom: calc(
            max(10px, env(safe-area-inset-bottom, 0px))
            + var(--hm-scale-clearance)
        );
    }

    .ol-zoom {
        right: max(10px, env(safe-area-inset-right, 0px));
    }

    .ol-north-up {
        right: max(10px, env(safe-area-inset-right, 0px));
    }

    .ol-full-screen {
        right: max(10px, env(safe-area-inset-right, 0px));
    }

    .ol-north-up .north-up-arrow {
        width: 14px;
        height: 12px;
    }

    .ol-north-up .north-up-n {
        font-size: 12px;
    }

    .ol-attribution {
        right: max(62px, calc(env(safe-area-inset-right, 0px) + 52px));
        bottom: max(6px, env(safe-area-inset-bottom, 0px));
        max-width: calc(100% - 150px);
        font-size: 10px;
    }

    .site-content {
        padding: 28px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px));
    }

    .site-content h2 {
        font-size: 1.25rem;
    }

    #language-selector .lang-link {
        min-width: 34px;
        padding: 6px 9px;
    }

    .route-modes {
        grid-template-columns: 1fr 1fr;
    }

    .route-mode[data-mode="transit"] {
        grid-column: 1 / -1;
    }

    .route-trip {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1001;
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 10px 12px max(14px, env(safe-area-inset-bottom, 0px));
        border-radius: 22px 22px 0 0;
        border-left: 0;
        border-right: 0;
        border-bottom: 0;
        box-shadow: 0 -10px 32px rgba(15, 23, 42, 0.16);
    }

    .route-trip::before {
        content: "";
        display: block;
        width: 36px;
        height: 4px;
        margin: 0 auto 10px;
        border-radius: 999px;
        background: #d1d5db;
        /* Larger grab zone for swipe to hide/show. */
        box-shadow: 0 0 0 14px transparent;
    }

    .map-stage.has-trip .map-header {
        bottom: calc(var(--route-trip-h, 240px) + 40px);
    }

    .map-stage.has-trip .locate-btn {
        bottom: calc(var(--route-trip-h, 240px) + 88px);
    }

    .map-stage.has-trip {
        --hm-zoom-bottom: calc(
            var(--route-trip-h, 240px)
            + 12px
            + var(--hm-scale-clearance, 30px)
        );
    }

    .map-stage.has-trip .ol-scale-line {
        left: auto;
        right: max(10px, env(safe-area-inset-right, 0px));
        bottom: calc(var(--route-trip-h, 240px) + 12px);
    }

    .map-stage.has-trip .geo-status {
        bottom: calc(var(--route-trip-h, 240px) + 140px);
    }

    /* Hide-tab on the route sheet (not a side stub that covers map controls). */
    #search-container.is-route:not(.is-collapsed) .chrome-tab--side {
        display: none !important;
    }

    /* Ascunde glued to the trip sheet — never floats free above it. */
    .map-stage.has-trip #search-container.is-route:not(.is-collapsed) .route-trip > .chrome-tab--side {
        position: absolute;
        left: 50%;
        right: auto;
        top: auto;
        bottom: 100%;
        z-index: 2;
        display: inline-flex !important;
        flex: 0 0 28px;
        flex-direction: row;
        align-self: auto;
        width: auto;
        min-width: 88px;
        height: 28px;
        min-height: 28px;
        margin: 0;
        padding: 0 14px;
        border: 1px solid var(--hm-line);
        border-bottom: 0;
        border-radius: 14px 14px 0 0;
        transform: translateX(-50%);
        box-shadow: 0 -6px 18px rgba(15, 23, 42, 0.1);
    }

    .map-stage.has-trip #search-container.is-route:not(.is-collapsed) .route-trip > .chrome-tab--side::before {
        inset: -12px -14px 0 -14px;
    }

    .map-stage.has-trip #search-container.is-route:not(.is-collapsed) .route-trip > .chrome-tab--side .chrome-tab-text {
        writing-mode: horizontal-tb;
        transform: none;
    }

    .map-stage.has-trip #search-container.is-route:not(.is-collapsed) .route-trip > .chrome-tab--side svg {
        transform: rotate(-90deg);
    }

    .map-stage.has-trip #search-container.is-route.is-collapsed .chrome-tab--side {
        position: fixed;
        left: 50%;
        right: auto;
        top: auto;
        z-index: 1002;
        display: inline-flex !important;
        flex: 0 0 28px;
        flex-direction: row;
        align-self: auto;
        width: auto;
        min-width: 88px;
        height: 28px;
        min-height: 28px;
        margin: 0;
        padding: 0 14px;
        border: 1px solid var(--hm-line);
        border-radius: 14px;
        transform: translateX(-50%);
        bottom: max(16px, env(safe-area-inset-bottom, 0px));
        box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
    }

    /* Fullscreen route: Arată glued to bottom center of the screen. */
    .map-stage.is-fullscreen.has-trip #search-container.is-route.is-collapsed .chrome-tab--side,
    .map-stage.is-fullscreen:has(#search-container.is-route.is-collapsed) .chrome-tab--side {
        position: fixed;
        left: 50%;
        right: auto;
        top: auto;
        bottom: 0;
        z-index: 1003;
        margin: 0;
        transform: translateX(-50%);
        height: calc(28px + env(safe-area-inset-bottom, 0px));
        min-height: calc(28px + env(safe-area-inset-bottom, 0px));
        padding: 0 16px env(safe-area-inset-bottom, 0px);
        border: 1px solid var(--hm-line);
        border-bottom: 0;
        border-radius: 14px 14px 0 0;
        box-shadow: 0 -6px 18px rgba(15, 23, 42, 0.12);
    }

    .map-stage.has-trip #search-container.is-route.is-collapsed .chrome-tab--side svg {
        transform: rotate(90deg);
    }

    .map-stage.has-trip #search-container.is-route.is-collapsed .chrome-tab--side .chrome-tab-text {
        writing-mode: horizontal-tb;
        transform: none;
    }

    .map-stage.has-trip:has(#search-container.is-collapsed) .map-header {
        bottom: max(16px, env(safe-area-inset-bottom, 0px));
    }

    /* Hartă / Satelit same pill size as Arată when the route sheet is hidden. */
    .map-stage.has-trip:has(#search-container.is-collapsed) .map-header #menu {
        height: 28px;
        min-height: 28px;
        max-height: 28px;
        padding: 2px;
        gap: 2px;
        border-radius: 14px;
        box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
    }

    .map-stage.has-trip:has(#search-container.is-collapsed) .map-header #menu label {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 24px;
        height: 24px;
        padding: 0 12px;
        font-size: 10px;
        font-weight: 700;
        letter-spacing: 0.14em;
        text-transform: uppercase;
        line-height: 1;
        border-radius: 12px;
    }

    /* Route + fullscreen + sheet hidden: Hartă/Satelit top-left (free the bottom). */
    .map-stage.is-fullscreen:has(#search-container.is-route.is-collapsed) .map-header {
        top: max(10px, calc(env(safe-area-inset-top, 0px) + 8px));
        bottom: auto;
        left: max(10px, env(safe-area-inset-left, 0px));
        right: auto;
    }

    .map-stage.has-trip:has(#search-container.is-collapsed) .locate-btn {
        bottom: max(68px, calc(env(safe-area-inset-bottom, 0px) + 52px));
    }

    /* Route + fullscreen + sheet hidden: Locația mea top-right. */
    .map-stage.is-fullscreen:has(#search-container.is-route.is-collapsed) .locate-btn,
    .map-stage.is-fullscreen.has-trip:has(#search-container.is-collapsed) .locate-btn {
        top: max(10px, calc(env(safe-area-inset-top, 0px) + 8px));
        bottom: auto;
        left: auto;
        right: max(10px, env(safe-area-inset-right, 0px));
    }

    .map-stage.has-trip:has(#search-container.is-collapsed) {
        --hm-zoom-bottom: calc(
            max(10px, env(safe-area-inset-bottom, 0px))
            + var(--hm-scale-clearance, 30px)
        );
    }

    .map-stage.has-trip:has(#search-container.is-collapsed) .ol-scale-line {
        left: auto;
        right: max(10px, env(safe-area-inset-right, 0px));
        bottom: max(10px, env(safe-area-inset-bottom, 0px));
    }

    .map-stage.has-trip:has(#search-container.is-collapsed) .geo-status {
        bottom: max(120px, calc(env(safe-area-inset-bottom, 0px) + 104px));
    }
}

@media (max-width: 400px) {
    .map-header {
        gap: 6px;
    }

    .logo-word {
        font-size: 18px;
    }

    #menu label {
        padding: 6px 7px;
        font-size: 11px;
    }

    #language-selector {
        padding: 3px;
    }

    #language-selector .lang-link {
        min-width: 30px;
        padding: 5px 7px;
    }

    .search-toolbar {
        grid-template-columns: minmax(0, 1fr) 46px;
    }

    .route-toggle-label {
        display: none;
    }

    .route-toggle {
        width: 46px;
        min-width: 46px;
        padding: 0;
    }
}

@media (max-height: 500px) and (orientation: landscape) {
    .map-stage {
        min-height: 180px;
    }

    #search-container {
        top: max(8px, env(safe-area-inset-top, 0px));
        left: max(8px, env(safe-area-inset-left, 0px));
        right: auto;
        width: min(400px, calc(100vw - 176px));
        max-width: calc(100% - 168px);
    }

    .route-panel {
        max-height: calc(var(--app-vh, 100vh) - 20px);
    }

    .map-header {
        top: auto;
        left: max(8px, env(safe-area-inset-left, 0px));
        right: auto;
        bottom: max(12px, env(safe-area-inset-bottom, 0px));
    }

    .locate-btn {
        bottom: max(56px, calc(env(safe-area-inset-bottom, 0px) + 44px));
    }

    #search-results {
        max-height: min(220px, calc(var(--app-vh, 100vh) - 120px));
    }

    .route-modes {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .route-mode[data-mode="transit"] {
        grid-column: auto;
    }

    .route-mode {
        min-height: 40px;
        padding: 6px 4px;
        font-size: 11px;
    }

    .site-content {
        padding: 28px 16px 20px;
    }
}

@media (pointer: coarse) {
    .chrome-tab--bottom::before {
        inset: 0 -14px -16px -14px;
    }

    .chrome-tab--side::before {
        inset: -10px -16px -10px 0;
    }

    .locate-btn,
    .route-trip-locate,
    .icon-btn,
    .route-swap,
    .route-start,
    .route-play,
    .route-clear,
    .route-close,
    .route-trip-stop,
    .search-submit,
    .route-toggle,
    .route-mode,
    .ol-control button {
        min-width: 44px;
        min-height: 44px;
    }

    .route-start {
        min-width: 96px;
        min-height: 48px;
        font-size: 16px;
    }

    .route-swap {
        width: 44px;
        height: 44px;
    }

    .route-points .route-row[data-point="a"] {
        padding-bottom: 24px;
    }

    .route-points .route-row[data-point="b"] {
        padding-top: 24px;
    }

    .route-trip-row:first-of-type {
        padding-bottom: 22px;
    }

    .route-trip-row:last-of-type {
        padding-top: 22px;
    }

    .route-row-slot {
        width: 44px;
        height: 44px;
    }

    .map-stage {
        --hm-ctrl-size: 44px;
    }

    .ol-control button {
        width: 44px;
        height: 44px;
        line-height: 44px;
    }

    .ol-full-screen button {
        line-height: 1;
    }

    .ol-full-screen button svg {
        width: 22px;
        height: 22px;
    }

    .ol-north-up button {
        line-height: 1;
    }

    button,
    .search-result-item,
    #menu label,
    .lang-link {
        touch-action: manipulation;
    }
}

@media (min-width: 1400px) {
    #search-container {
        width: 568px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition: none !important;
    }
}
