:root {
    --hm-bg: #101010;
    --hm-panel: rgba(20, 20, 20, .96);
    --hm-panel-solid: #181818;
    --hm-text: #f7f7f7;
    --hm-muted: #bdbdbd;
    --hm-line: rgba(255,255,255,.13);
    --hm-accent: #e53935;
    --hm-shadow: 0 14px 40px rgba(0,0,0,.35);
    --hm-radius: 22px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    background: var(--hm-bg);
    color: var(--hm-text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    overflow: hidden;
}
button, input { font: inherit; }
button { cursor: pointer; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

#hm-map {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    z-index: 1;
    background: #202020;
}

.hm-brand {
    position: fixed;
    z-index: 500;
    top: calc(12px + var(--safe-top));
    right: 14px;
    left: auto;
    bottom: auto;
    max-width: min(58vw, 360px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(16,16,16,.82);
    backdrop-filter: blur(10px);
    border: 1px solid var(--hm-line);
    box-shadow: var(--hm-shadow);
    font-weight: 750;
    letter-spacing: .02em;
    pointer-events: none;
    color: var(--hm-text);
    text-decoration: none;
}
.hm-brand.is-link {
    pointer-events: auto;
    cursor: pointer;
}
.hm-brand.is-link:hover {
    background: rgba(28,28,28,.92);
    transform: translateY(-1px);
}
.hm-brand[data-position="top-right"] {
    top: calc(12px + var(--safe-top));
    right: 14px;
    left: auto;
    bottom: auto;
}
.hm-brand[data-position="top-left"] {
    top: calc(82px + var(--safe-top));
    left: 12px;
    right: auto;
    bottom: auto;
}
.hm-brand[data-position="bottom-left"] {
    top: auto;
    left: 12px;
    right: auto;
    bottom: calc(24px + var(--safe-bottom));
}
.hm-brand[data-position="bottom-right"] {
    top: auto;
    right: 14px;
    left: auto;
    bottom: calc(144px + var(--safe-bottom));
}
.hm-brand[hidden] { display: none; }

.hm-top-suggest {
    position: fixed;
    z-index: 650;
    top: calc(8px + var(--safe-top));
    left: 50%;
    transform: translateX(-50%);
    border: 1px solid var(--hm-line);
    border-radius: 999px;
    padding: 10px 17px;
    background: #1a1917;
    color: var(--hm-text);
    box-shadow: var(--hm-shadow);
    font-weight: 850;
    letter-spacing: .01em;
    white-space: nowrap;
    backdrop-filter: blur(12px);
}
.hm-top-suggest:active { transform: translateX(-50%) scale(.97); }
.hm-top-suggest[hidden] { display: none; }


.hm-powered-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    height: 24px;
    min-height: 24px;
    max-height: 24px;
    padding: 0 8px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    color: #cccccc;
    font-size: 12px;
    font-weight: 600;
    line-height: 24px;
    letter-spacing: .02em;
    overflow: hidden;
    white-space: nowrap;
    pointer-events: auto;
}

.hm-powered-footer a {
    color: #cccccc;
    text-decoration: none;
    display: inline-block;
    max-width: 100%;
    height: 24px;
    line-height: 24px;
    padding: 0;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: auto;
}

.hm-powered-footer a:hover,
.hm-powered-footer a:focus {
    text-decoration: underline;
}

.hm-actions {
    position: fixed;
    right: 14px;
    bottom: 46px;
    display: grid;
    gap: 10px;
    z-index: 600;
}

.hm-fab,
.hm-icon-button,
.hm-sheet-close {
    border: 1px solid var(--hm-line);
    color: var(--hm-text);
    background: rgba(18,18,18,.9);
    backdrop-filter: blur(12px);
    box-shadow: var(--hm-shadow);
}

.hm-fab {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    font-size: 1.45rem;
    font-weight: 750;
}
a.hm-fab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}
.hm-info-fab {
    font-size: 1.5rem;
}
.hm-fab:active { transform: scale(.96); }
.hm-fab.is-active {
    background: var(--hm-accent);
    border-color: transparent;
    color: #fff;
}

/* Satellit/kartväxlaren ska matcha övriga mörka GUI-knappar, inte accent/rött. */
#hm-satellite-toggle.hm-fab.is-active {
    background: #1a1917;
    border-color: var(--hm-line);
    color: var(--hm-text);
}


.hm-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 800;
    max-height: min(82dvh, 620px);
    overflow: auto;
    padding: 10px 16px calc(18px + var(--safe-bottom));
    border-radius: var(--hm-radius) var(--hm-radius) 0 0;
    background: var(--hm-panel);
    border-top: 1px solid var(--hm-line);
    box-shadow: var(--hm-shadow);
}

.hm-panel[hidden],
.hm-sheet[hidden],
.hm-toast[hidden] { display: none; }

.hm-panel-handle,
.hm-sheet-handle {
    width: 46px;
    height: 5px;
    border-radius: 999px;
    background: rgba(255,255,255,.24);
    margin: 2px auto 14px;
}

.hm-panel-head,
.hm-layer-tools,
.hm-sheet-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.hm-panel-head strong { display: block; font-size: 1.2rem; }
.hm-panel-head span { display: block; color: var(--hm-muted); font-size: .92rem; margin-top: 2px; }

.hm-icon-button,
.hm-sheet-close {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    font-size: 1.4rem;
    line-height: 1;
}

.hm-search {
    display: grid;
    gap: 7px;
    margin: 16px 0 12px;
    color: var(--hm-muted);
    font-size: .9rem;
}
.hm-search input {
    width: 100%;
    border: 1px solid var(--hm-line);
    border-radius: 16px;
    padding: 13px 14px;
    background: rgba(255,255,255,.08);
    color: var(--hm-text);
    outline: none;
}
.hm-search input:focus { border-color: rgba(229,57,53,.8); }

.hm-layer-tools { margin: 10px 0; }
.hm-layer-tools button,
.hm-place-link {
    border: 1px solid var(--hm-line);
    border-radius: 999px;
    padding: 9px 12px;
    background: rgba(255,255,255,.08);
    color: var(--hm-text);
    text-decoration: none;
}

.hm-layer-list {
    display: grid;
    gap: 9px;
    margin-top: 12px;
}
.hm-layer-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--hm-line);
    border-radius: 18px;
    background: rgba(255,255,255,.06);
}
.hm-layer-icon {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border-radius: 14px;
    background: var(--layer-color, var(--hm-accent));
}
.hm-layer-name { font-weight: 720; }
.hm-layer-desc { color: var(--hm-muted); font-size: .88rem; margin-top: 2px; }
.hm-layer-item input {
    width: 22px;
    height: 22px;
    accent-color: var(--layer-color, var(--hm-accent));
}

.hm-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 750;
    max-height: min(76dvh, 660px);
    overflow: auto;
    padding: 10px 16px calc(18px + var(--safe-bottom));
    border-radius: var(--hm-radius) var(--hm-radius) 0 0;
    background: var(--hm-panel);
    border-top: 1px solid var(--hm-line);
    box-shadow: var(--hm-shadow);
}
.hm-sheet-close {
    position: absolute;
    top: 12px;
    right: 14px;
}
.hm-place-image {
    width: 100%;
    max-height: 230px;
    object-fit: cover;
    border-radius: 18px;
    margin-bottom: 14px;
    background: rgba(255,255,255,.08);
}
.hm-place-title {
    margin: 0 46px 6px 0;
    font-size: 1.32rem;
    line-height: 1.15;
}
.hm-place-address,
.hm-place-desc {
    color: var(--hm-muted);
    line-height: 1.45;
}
.hm-place-address { margin: 0 0 10px; }
.hm-place-desc { margin: 12px 0; white-space: pre-wrap; }
.hm-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 10px 0;
}
.hm-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 6px 9px;
    background: rgba(255,255,255,.08);
    border: 1px solid var(--hm-line);
    font-size: .88rem;
}

.hm-chip.hm-chip-link {
    color: inherit;
    font: inherit;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}
.hm-chip.hm-chip-link:hover,
.hm-chip.hm-chip-link:focus-visible {
    background: rgba(255,255,255,.16);
    border-color: rgba(255,255,255,.38);
    outline: none;
}
.hm-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}
.hm-place-link.primary {
    background: var(--hm-accent);
    border-color: transparent;
    color: white;
}

.hm-marker {
    width: 34px;
    height: 34px;
    border-radius: 50% 50% 50% 10px;
    transform: rotate(-45deg);
    background: var(--marker-color, #e53935);
    border: 2px solid #fff;
    box-shadow: 0 6px 14px rgba(0,0,0,.35);
    display: grid;
    place-items: center;
    position: relative;
    transition: box-shadow .18s ease, border-color .18s ease, filter .18s ease;
}
.hm-marker.is-selected {
    border-color: #39ff14;
    box-shadow:
        0 0 0 5px rgba(57,255,20,.24),
        0 0 18px rgba(57,255,20,.88),
        0 0 38px rgba(57,255,20,.55),
        0 8px 18px rgba(0,0,0,.45);
    filter: saturate(1.25) brightness(1.08);
    animation: hm-marker-selected-glow 1.35s ease-in-out infinite alternate;
}
@keyframes hm-marker-selected-glow {
    from {
        box-shadow:
            0 0 0 4px rgba(57,255,20,.18),
            0 0 14px rgba(57,255,20,.72),
            0 0 28px rgba(57,255,20,.42),
            0 8px 18px rgba(0,0,0,.45);
    }
    to {
        box-shadow:
            0 0 0 7px rgba(57,255,20,.30),
            0 0 24px rgba(57,255,20,.95),
            0 0 48px rgba(57,255,20,.65),
            0 8px 18px rgba(0,0,0,.45);
    }
}
.hm-marker span {
    transform: rotate(45deg);
    font-size: 17px;
    line-height: 1;
}

.hm-toast {
    position: fixed;
    left: 50%;
    bottom: calc(128px + var(--safe-bottom));
    transform: translateX(-50%);
    z-index: 900;
    max-width: min(92vw, 420px);
    padding: 11px 14px;
    border-radius: 999px;
    background: rgba(18,18,18,.94);
    color: var(--hm-text);
    border: 1px solid var(--hm-line);
    box-shadow: var(--hm-shadow);
    text-align: center;
}

.leaflet-bottom { bottom: 26px; }
.leaflet-control-attribution { font-size: 10px; }
.leaflet-control-zoom { border: 0 !important; box-shadow: var(--hm-shadow) !important; }
.leaflet-control-zoom a { background: rgba(18,18,18,.9) !important; color: #fff !important; border-color: var(--hm-line) !important; }


@media (max-width: 759px) {
    .hm-top-suggest {
        top: calc(6px + var(--safe-top));
        max-width: min(82vw, 280px);
        padding: 9px 15px;
        font-size: .95rem;
    }
    .hm-powered-footer {
        height: 22px;
        min-height: 22px;
        max-height: 22px;
        padding: 0 6px;
        font-size: 11px;
        line-height: 22px;
    }
    .hm-powered-footer a {
        height: 22px;
        line-height: 22px;
    }
    .hm-actions { bottom: 42px; }
    .leaflet-bottom { bottom: 24px; }
}

@media (min-width: 760px) {
    .hm-panel {
        left: auto;
        right: 18px;
        bottom: 88px;
        width: min(380px, calc(100vw - 36px));
        border-radius: var(--hm-radius);
        border: 1px solid var(--hm-line);
        max-height: calc(100dvh - 120px);
    }
    .hm-panel-handle { display: none; }
    .hm-sheet {
        left: auto;
        right: 18px;
        bottom: 48px;
        width: min(430px, calc(100vw - 36px));
        border-radius: var(--hm-radius);
        border: 1px solid var(--hm-line);
        max-height: calc(100dvh - 36px);
    }
    .hm-actions { bottom: 58px; }
}


/* v3 additions */
.hm-menu-actions {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}
.hm-wide-action {
    display: block;
    width: 100%;
    border: 1px solid var(--hm-line);
    border-radius: 16px;
    background: rgba(255,255,255,.08);
    color: var(--hm-text);
    text-align: center;
    text-decoration: none;
    padding: 12px 14px;
    font-weight: 750;
}
.hm-wide-action.secondary {
    background: rgba(255,255,255,.04);
    color: var(--hm-muted);
}
.hm-wide-action:hover,
.hm-wide-action:focus {
    background: rgba(229,57,53,.18);
}
.hm-search select,
.hm-modal select,
.hm-modal input,
.hm-modal textarea {
    width: 100%;
    border: 1px solid var(--hm-line);
    border-radius: 16px;
    background: rgba(0,0,0,.28);
    color: var(--hm-text);
    padding: 12px 13px;
    outline: none;
}
.hm-modal textarea { resize: vertical; }
.hm-modal input[type="file"] {
    padding: 10px 12px;
    cursor: pointer;
}
.hm-field-help {
    display: block;
    color: var(--hm-muted);
    font-size: .82rem;
    line-height: 1.35;
}
.hm-image-choice {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--hm-line);
    border-radius: 18px;
    background: rgba(255,255,255,.035);
}
.hm-image-choice label {
    margin: 0;
}
.hm-image-choice-title {
    font-weight: 700;
    color: var(--hm-text);
}
.hm-image-choice-grid {
    display: grid;
    gap: 10px;
}
.hm-upload-option {
    padding: 12px;
    border: 1px solid var(--hm-line);
    border-radius: 16px;
    background: rgba(255,255,255,.035);
}
.hm-upload-option-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: var(--hm-text);
}
.hm-upload-option-note {
    display: block;
    color: var(--hm-muted);
    font-size: .83rem;
    line-height: 1.35;
}
.hm-camera-icon {
    display: inline-grid;
    place-items: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    font-size: 1rem;
}
.hm-field-help-strong {
    color: var(--hm-text);
    font-weight: 700;
}
.hm-image-orientation-warning {
    display: block;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(255, 196, 0, .35);
    background: rgba(255, 196, 0, .10);
    color: #ffe7a3;
    font-size: .84rem;
    line-height: 1.35;
}
.hm-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: end center;
    background: rgba(0,0,0,.55);
    padding: 16px;
}
.hm-modal[hidden] { display: none; }
.hm-modal-card {
    width: min(620px, 100%);
    max-height: min(88dvh, 760px);
    overflow: auto;
    border: 1px solid var(--hm-line);
    border-radius: 24px;
    background: var(--hm-panel-solid);
    box-shadow: var(--hm-shadow);
    padding: 16px;
    display: grid;
    gap: 12px;
}
.hm-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.hm-modal-head h2 { margin: 0; }
.hm-modal label {
    display: grid;
    gap: 6px;
    color: var(--hm-muted);
    font-size: .92rem;
}
.hm-modal-actions,
.hm-form-grid {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.hm-form-grid > * { flex: 1 1 180px; }
.hm-muted { color: var(--hm-muted); }
.hm-info-box {
    border: 1px solid var(--hm-line);
    background: rgba(255,255,255,.055);
    border-radius: 16px;
    padding: 11px 12px;
    margin: 10px 0;
}
.hm-info-box strong,
.hm-info-box span { display: block; }
.hm-info-box strong { margin-bottom: 5px; }

.hm-report-current,
.hm-report-fieldset,
.hm-report-proposals {
    border: 1px solid var(--hm-line);
    border-radius: 18px;
    background: rgba(255,255,255,.035);
    padding: 11px 12px;
}
.hm-report-current-head,
.hm-report-fieldset legend,
.hm-report-proposals summary {
    color: var(--hm-text);
    font-weight: 800;
}
.hm-report-current-list {
    display: grid;
    gap: 8px;
    margin: 9px 0;
}
.hm-report-current-row {
    display: grid;
    gap: 3px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.hm-report-current-row:last-child { border-bottom: 0; padding-bottom: 0; }
.hm-report-current-row strong {
    color: var(--hm-text);
    font-size: .88rem;
}
.hm-report-current-row span {
    color: var(--hm-muted);
    font-size: .86rem;
    line-height: 1.35;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.hm-report-current-row span.is-empty { opacity: .7; font-style: italic; }
.hm-report-fieldset { margin: 0; }
.hm-report-fieldset legend { padding: 0 6px; }
.hm-report-check-grid {
    display: grid;
    gap: 7px;
    margin-top: 8px;
}
.hm-report-check-grid label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--hm-muted);
    font-size: .9rem;
}
.hm-report-check-grid input[type="checkbox"] {
    width: auto;
    min-width: 1rem;
}
.hm-report-proposals summary {
    cursor: pointer;
    list-style-position: inside;
}
.hm-report-proposals label { margin-top: 10px; }
.hm-direct-url {
    color: var(--hm-muted);
    font-size: .82rem;
    overflow-wrap: anywhere;
    margin: 12px 0 0;
}
.hm-direct-url a { color: var(--hm-muted); }
.hm-place-link.subtle {
    background: rgba(255,255,255,.04);
    color: var(--hm-muted);
}
.hm-hover-tooltip.leaflet-tooltip {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    white-space: normal;
    max-width: min(320px, calc(100vw - 28px));
}
.hm-hover-tooltip:before { display: none; }
.hm-hover-card {
    width: min(280px, calc(100vw - 42px));
    max-width: 100%;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 16px;
    background: rgba(16,16,16,.94);
    color: #f7f7f7;
    box-shadow: 0 14px 38px rgba(0,0,0,.38);
    padding: 11px 12px;
    backdrop-filter: blur(10px);
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.hm-hover-card strong,
.hm-hover-card span,
.hm-hover-card em,
.hm-hover-card p {
    display: block;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.hm-hover-card span { color: #cfcfcf; font-size: .86rem; margin-top: 3px; }
.hm-hover-card p { margin: 7px 0 0; font-size: .88rem; line-height: 1.35; }
.hm-hover-card em { color: #ffb4b4; font-size: .78rem; margin-top: 7px; font-style: normal; }
@media (min-width: 820px) {
    .hm-panel {
        left: auto;
        right: 16px;
        bottom: 46px;
        top: 16px;
        width: min(390px, calc(100vw - 32px));
        max-height: none;
        border-radius: var(--hm-radius);
        border: 1px solid var(--hm-line);
    }
    .hm-sheet {
        left: auto;
        right: 16px;
        bottom: 46px;
        width: min(430px, calc(100vw - 32px));
        border-radius: var(--hm-radius);
        border: 1px solid var(--hm-line);
    }
    .hm-modal { place-items: center; }
}
@media (max-width: 560px) {
    .hm-modal { padding: 0; align-items: end; }
    .hm-modal-card { border-radius: 24px 24px 0 0; max-height: 88dvh; }
    .hm-form-grid { display: grid; }
}
.hm-embed .hm-actions { display: none; }
.hm-embed .hm-powered-footer { height: 20px; font-size: 11px; line-height: 20px; }
.hm-embed .hm-powered-footer a { height: 20px; line-height: 20px; }
.hm-embed .hm-sheet { max-height: min(72dvh, 520px); }

.hm-start-loader {
    position: fixed;
    inset: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    padding: 24px;
    color: #fff;
    text-align: center;
    font-weight: 700;
    background: radial-gradient(circle at center, rgba(229,57,53,.18), transparent 35%), #202020;
}
.hm-start-loader.is-error {
    color: #ffdede;
}


/* Center picker for "Tipsa om plats" */
.hm-suggest-position {
    border: 1px dashed rgba(255,255,255,.22);
    border-radius: 14px;
    padding: 10px 12px;
    color: var(--hm-muted);
    background: rgba(255,255,255,.05);
    font-size: .9rem;
    line-height: 1.35;
}
.hm-suggest-position.is-set {
    border-color: rgba(229,57,53,.55);
    color: var(--hm-text);
    background: rgba(229,57,53,.12);
}
.hm-picker {
    position: fixed;
    inset: 0;
    z-index: 1100;
    pointer-events: none;
}
.hm-picker[hidden] { display: none; }
.hm-picker-cross {
    position: fixed;
    left: 50%;
    top: 50%;
    width: 52px;
    height: 52px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 3px solid var(--hm-accent);
    box-shadow: 0 0 0 4px rgba(255,255,255,.92), 0 10px 30px rgba(0,0,0,.35);
    background: rgba(255,255,255,.12);
}
.hm-picker-cross::before,
.hm-picker-cross::after {
    content: "";
    position: absolute;
    background: var(--hm-accent);
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 999px;
}
.hm-picker-cross::before { width: 30px; height: 3px; }
.hm-picker-cross::after { width: 3px; height: 30px; }
.hm-picker-card {
    pointer-events: auto;
    position: fixed;
    left: 50%;
    bottom: calc(54px + var(--safe-bottom));
    transform: translateX(-50%);
    width: min(94vw, 520px);
    padding: 14px;
    border-radius: 20px;
    background: rgba(18,18,18,.96);
    border: 1px solid var(--hm-line);
    box-shadow: var(--hm-shadow);
    display: grid;
    gap: 8px;
}
.hm-picker-card strong { font-size: 1.05rem; }
.hm-picker-card span {
    color: var(--hm-muted);
    line-height: 1.35;
}
.hm-picker-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}
.hm-picker-actions .hm-place-link { flex: 1 1 160px; justify-content: center; }
body.hm-picker-active .hm-actions,
body.hm-picker-active .hm-panel,
body.hm-picker-active .hm-sheet,
body.hm-picker-active .hm-top-suggest { display: none !important; }

@media (max-width: 759px) {
    .hm-picker-cross { width: 46px; height: 46px; }
    .hm-picker-card {
        bottom: calc(32px + var(--safe-bottom));
        width: calc(100vw - 18px);
    }
}


button:disabled {
    opacity: .65;
    cursor: wait;
}


/* Platsgrupper / arrangemangsfilter */
.hm-group-section {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--hm-line);
}
.hm-section-title {
    display: grid;
    gap: 3px;
    margin-bottom: 10px;
}
.hm-section-title strong { font-size: 1rem; }
.hm-section-title span { color: var(--hm-muted); font-size: .88rem; line-height: 1.35; }
.hm-group-item .hm-layer-icon {
    background: linear-gradient(135deg, rgba(229,57,53,.95), rgba(251,140,0,.92));
}
.hm-group-count {
    display: inline-block;
    color: var(--hm-muted);
    font-size: .82rem;
    margin-top: 3px;
}

/* Rutter/rundor på publika kartan */
.hm-route-line {
    filter: drop-shadow(0 2px 5px rgba(0,0,0,.35));
    cursor: pointer;
}
.hm-route-hover strong {
    display: block;
}

.hm-optional {
    color: var(--hm-muted);
    font-size: 0.85em;
    font-weight: 500;
}

/* Snabbval för kartvyer/kategorier på index */
.hm-view-quick-toggle {
    position: fixed;
    z-index: 660;
    top: calc(58px + var(--safe-top));
    right: 12px;
    border: 1px solid rgba(255,255,255,.24);
    border-radius: 18px;
    padding: 8px 12px 9px;
    background: rgba(26,25,23,.94);
    color: var(--hm-text);
    box-shadow: 0 10px 28px rgba(0,0,0,.34);
    font-weight: 850;
    letter-spacing: .01em;
    backdrop-filter: blur(12px);
    display: grid;
    gap: 2px;
    text-align: left;
    line-height: 1.12;
    max-width: min(280px, calc(100vw - 24px));
    cursor: pointer;
}
.hm-view-quick-toggle::after {
    content: "▾";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--hm-muted);
    font-size: .95rem;
}
.hm-view-quick-toggle:hover,
.hm-view-quick-toggle:focus-visible {
    border-color: rgba(255,255,255,.42);
    background: rgba(36,34,31,.96);
}
.hm-view-quick-toggle:active { transform: scale(.97); }
.hm-view-quick-toggle[hidden] { display: none; }
.hm-view-quick-toggle .hm-quick-main,
.hm-view-quick-toggle .hm-quick-sub {
    display: block;
    padding-right: 18px;
}
.hm-view-quick-toggle .hm-quick-main {
    font-size: .95rem;
    white-space: nowrap;
}
.hm-view-quick-toggle .hm-quick-sub {
    color: var(--hm-muted);
    font-size: .73rem;
    font-weight: 700;
    white-space: nowrap;
}
.hm-view-quick-toggle.is-nudging {
    animation: hm-menu-nudge 2.8s ease-in-out 2;
}
@keyframes hm-menu-nudge {
    0%, 100% { box-shadow: 0 10px 28px rgba(0,0,0,.34); border-color: rgba(255,255,255,.24); }
    35% { box-shadow: 0 10px 28px rgba(0,0,0,.34), 0 0 0 5px rgba(229,57,53,.24); border-color: rgba(255,255,255,.52); }
    70% { box-shadow: 0 10px 28px rgba(0,0,0,.34), 0 0 0 2px rgba(229,57,53,.12); border-color: rgba(255,255,255,.34); }
}
@media (prefers-reduced-motion: reduce) {
    .hm-view-quick-toggle.is-nudging { animation: none; }
}

.hm-view-quick-panel {
    position: fixed;
    z-index: 790;
    top: calc(112px + var(--safe-top));
    right: 12px;
    width: min(370px, calc(100vw - 24px));
    max-height: min(72dvh, 580px);
    overflow: auto;
    border: 1px solid var(--hm-line);
    border-radius: 22px;
    background: var(--hm-panel);
    box-shadow: var(--hm-shadow);
    padding: 13px;
    backdrop-filter: blur(14px);
}
.hm-view-quick-panel[hidden] { display: none; }
.hm-view-quick-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.hm-view-quick-head strong { display: block; font-size: 1.08rem; }
.hm-view-quick-head span { display: block; color: var(--hm-muted); font-size: .88rem; margin-top: 2px; }

.hm-view-quick-search {
    display: grid;
    gap: 6px;
    margin: 0 0 12px;
    padding: 10px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 16px;
    background: rgba(255,255,255,.06);
}
.hm-view-quick-search span {
    font-size: .84rem;
    color: var(--hm-muted);
    font-weight: 800;
}
.hm-view-quick-search small {
    color: var(--hm-muted);
    font-size: .76rem;
    line-height: 1.25;
}
.hm-view-quick-search-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.hm-view-quick-search-row input {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--hm-line);
    border-radius: 13px;
    background: #111;
    color: var(--hm-text);
    padding: 10px 11px;
    font: inherit;
    outline: none;
}
.hm-view-quick-search-row input:focus {
    border-color: rgba(229,57,53,.85);
    box-shadow: 0 0 0 3px rgba(229,57,53,.16);
}
.hm-view-quick-search-row button {
    border: 1px solid var(--hm-line);
    border-radius: 12px;
    background: rgba(255,255,255,.08);
    color: var(--hm-text);
    padding: 9px 10px;
    font-weight: 800;
    cursor: pointer;
}
.hm-view-quick-search-row button[hidden] { display: none; }
.hm-view-quick-search-row button:hover,
.hm-view-quick-search-row button:focus-visible {
    background: rgba(255,255,255,.14);
}

.hm-view-quick-list {
    display: grid;
    gap: 13px;
}
.hm-view-quick-section {
    display: grid;
    gap: 7px;
}
.hm-view-quick-section h3 {
    margin: 0 0 2px;
    color: var(--hm-muted);
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.hm-view-quick-item {
    width: 100%;
    border: 1px solid var(--hm-line);
    border-radius: 16px;
    background: rgba(255,255,255,.07);
    color: var(--hm-text);
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 10px;
    padding: 10px 11px;
    text-align: left;
}
.hm-view-quick-item:hover,
.hm-view-quick-item:focus {
    background: rgba(255,255,255,.12);
}
.hm-view-quick-item.is-active {
    background: #1a1917;
    border-color: rgba(255,255,255,.32);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.hm-view-quick-icon {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border-radius: 13px;
    background: rgba(255,255,255,.10);
    font-size: 1.05rem;
}
.hm-view-quick-item strong,
.hm-view-quick-item small {
    display: block;
    min-width: 0;
}
.hm-view-quick-item strong {
    font-size: .96rem;
    line-height: 1.18;
}
.hm-view-quick-item small {
    color: var(--hm-muted);
    font-size: .8rem;
    line-height: 1.25;
    margin-top: 3px;
    overflow-wrap: anywhere;
}

body.hm-picker-active .hm-view-quick-toggle,
body.hm-picker-active .hm-view-quick-panel { display: none !important; }

@media (max-width: 759px) {
    .hm-view-quick-toggle {
        top: calc(54px + var(--safe-top));
        right: 8px;
        padding: 7px 10px 8px;
        border-radius: 16px;
        max-width: min(210px, calc(100vw - 118px));
    }
    .hm-view-quick-toggle .hm-quick-main { font-size: .86rem; }
    .hm-view-quick-toggle .hm-quick-sub { font-size: .66rem; }
    .hm-view-quick-panel {
        top: calc(102px + var(--safe-top));
        right: 8px;
        left: 8px;
        width: auto;
        max-height: min(70dvh, calc(100dvh - 130px));
        padding: 12px;
    }
}


.hm-upload-option-single {
    cursor: pointer;
}
.hm-upload-option-single input[type="file"] {
    margin-top: 8px;
}

/* v5: Kortvy / lokalt skyltfönster för platser */
.hm-showcase-toggle {
    position: fixed;
    z-index: 660;
    top: calc(58px + var(--safe-top));
    left: 12px;
    border: 1px solid var(--hm-line);
    border-radius: 999px;
    padding: 10px 14px;
    background: #1a1917;
    color: var(--hm-text);
    box-shadow: var(--hm-shadow);
    font-weight: 850;
    letter-spacing: .01em;
    white-space: nowrap;
    backdrop-filter: blur(12px);
}
.hm-showcase-toggle:hover,
.hm-showcase-toggle:focus,
.hm-showcase-toggle[aria-expanded="true"] {
    background: rgba(229,57,53,.22);
    border-color: rgba(255,255,255,.28);
}
.hm-showcase-toggle:active { transform: scale(.97); }
.hm-showcase-toggle[hidden] { display: none; }

.hm-showcase-panel {
    position: fixed;
    z-index: 850;
    left: 12px;
    top: calc(108px + var(--safe-top));
    bottom: calc(32px + var(--safe-bottom));
    width: min(690px, calc(100vw - 24px));
    overflow: auto;
    padding: 14px;
    border: 1px solid var(--hm-line);
    border-radius: 24px;
    background: rgba(18,18,18,.96);
    box-shadow: var(--hm-shadow);
    backdrop-filter: blur(16px);
}
.hm-showcase-panel[hidden] { display: none; }
.hm-showcase-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}
.hm-showcase-head strong {
    display: block;
    font-size: 1.35rem;
    line-height: 1.1;
}
.hm-showcase-head span {
    display: block;
    color: var(--hm-muted);
    font-size: .92rem;
    line-height: 1.35;
    margin-top: 4px;
}
.hm-showcase-tools {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    align-items: end;
    gap: 10px;
    margin: 4px 0 12px;
    padding: 10px;
    border: 1px solid var(--hm-line);
    border-radius: 18px;
    background: rgba(255,255,255,.045);
    color: var(--hm-muted);
    font-size: .9rem;
}
.hm-showcase-search {
    display: grid;
    gap: 5px;
}
.hm-showcase-search span {
    font-size: .78rem;
    font-weight: 800;
    color: var(--hm-muted);
}
.hm-showcase-search input {
    width: 100%;
    min-height: 38px;
    border: 1px solid var(--hm-line);
    border-radius: 999px;
    background: rgba(0,0,0,.26);
    color: var(--hm-text);
    padding: 9px 13px;
    outline: none;
}
.hm-showcase-search input:focus {
    border-color: rgba(255,255,255,.34);
    background: rgba(0,0,0,.38);
}
.hm-showcase-tool-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}
.hm-showcase-tool-button {
    border: 1px solid var(--hm-line);
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    color: var(--hm-text);
    padding: 8px 11px;
    font-weight: 750;
}
.hm-showcase-tool-button:hover,
.hm-showcase-tool-button:focus {
    background: rgba(229,57,53,.20);
}
.hm-showcase-tool-button[hidden] { display: none; }
.hm-showcase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
    gap: 13px;
}
.hm-place-card {
    display: grid;
    overflow: hidden;
    border: 1px solid var(--hm-line);
    border-radius: 20px;
    background: rgba(255,255,255,.065);
    box-shadow: 0 10px 26px rgba(0,0,0,.22);
}
.hm-place-card:hover,
.hm-place-card:focus-within {
    border-color: rgba(255,255,255,.28);
    background: rgba(255,255,255,.085);
}
.hm-place-card-main {
    display: grid;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    text-decoration: none;
}
.hm-place-card-image {
    position: relative;
    width: 100%;
    height: 145px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(229,57,53,.24), rgba(255,255,255,.06));
}
.hm-place-card-image::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 4px;
    background: var(--card-accent, var(--hm-accent));
}
.hm-place-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .18s ease-out;
}
.hm-place-card:hover .hm-place-card-image img,
.hm-place-card:focus-within .hm-place-card-image img {
    transform: scale(1.03);
}
.hm-place-card-placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    font-size: 3rem;
    background: radial-gradient(circle at 50% 35%, rgba(255,255,255,.18), rgba(255,255,255,.04));
}
.hm-place-card-body {
    display: grid;
    gap: 7px;
    padding: 13px;
}
.hm-place-card-category {
    justify-self: start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(0,0,0,.28);
    border: 1px solid rgba(255,255,255,.12);
    color: #f4f4f4;
    font-size: .78rem;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.hm-place-card h3 {
    margin: 0;
    font-size: 1.12rem;
    line-height: 1.16;
}
.hm-place-card p {
    margin: 0;
    color: var(--hm-muted);
    line-height: 1.4;
    font-size: .92rem;
}
.hm-place-card small {
    display: block;
    color: #d8d8d8;
    font-size: .82rem;
    line-height: 1.3;
}
.hm-place-card-address::before { content: "📍 "; }
.hm-place-card-open::before { content: "⏱ "; }

.hm-place-card-page-hint {
    color: #f2f2f2 !important;
    font-weight: 850;
}
.hm-place-card-page-hint::before { content: "↗ "; }
.hm-place-card-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 13px 10px;
}
.hm-place-card-chips button {
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 999px;
    background: rgba(255,255,255,.065);
    color: var(--hm-muted);
    padding: 5px 8px;
    font-size: .76rem;
    font-weight: 750;
    cursor: pointer;
}
.hm-place-card-chips button:hover,
.hm-place-card-chips button:focus-visible {
    border-color: rgba(255,255,255,.34);
    color: var(--hm-text);
    background: rgba(255,255,255,.11);
}
.hm-place-card-chips button span {
    margin-right: 4px;
}
.hm-place-card-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 0 13px 13px;
}
.hm-place-card-actions button {
    border: 1px solid var(--hm-line);
    border-radius: 12px;
    background: rgba(255,255,255,.08);
    color: var(--hm-text);
    padding: 9px 10px;
    font-size: .9rem;
    font-weight: 800;
}
.hm-place-card-actions button {
    background: #1c1b19;
    border-color: rgba(255,255,255,.16);
    color: #fff;
}
.hm-place-card-actions button:hover,
.hm-place-card-actions button:focus {
    filter: brightness(1.12);
}
.hm-showcase-empty {
    grid-column: 1 / -1;
    display: grid;
    gap: 6px;
    padding: 18px;
    border: 1px dashed rgba(255,255,255,.22);
    border-radius: 18px;
    background: rgba(255,255,255,.045);
}
.hm-showcase-empty strong { font-size: 1.05rem; }
.hm-showcase-empty span { color: var(--hm-muted); line-height: 1.35; }

body.hm-picker-active .hm-showcase-toggle,
body.hm-picker-active .hm-showcase-panel { display: none !important; }

@media (min-width: 1000px) {
    .hm-showcase-panel {
        left: 24px;
        right: 24px;
        width: auto;
        max-width: none;
    }
    .hm-showcase-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 16px;
    }
}

@media (max-width: 759px) {
    .hm-showcase-toggle {
        top: calc(54px + var(--safe-top));
        left: 8px;
        padding: 8px 10px;
        font-size: .9rem;
        max-width: 42vw;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .hm-showcase-panel {
        left: 8px;
        right: 8px;
        width: auto;
        top: calc(98px + var(--safe-top));
        bottom: calc(28px + var(--safe-bottom));
        padding: 12px;
        border-radius: 22px;
    }
    .hm-showcase-head strong { font-size: 1.18rem; }
    .hm-showcase-tools {
        align-items: stretch;
        grid-template-columns: 1fr;
    }
    .hm-showcase-tool-row {
        justify-content: space-between;
    }
    .hm-showcase-grid {
        grid-template-columns: 1fr;
    }
    .hm-place-card-image { height: 150px; }
    .hm-place-card-actions { grid-template-columns: 1fr; }
}

/* v5.5 swish: fast stötta-knapp på index, lågt lager och nära vänster nederkant på mobil */
.hm-swish-support-button {
    position: fixed;
    left: 8px;
    bottom: calc(26px + var(--safe-bottom));
    z-index: 520;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: min(76vw, 260px);
    min-height: 44px;
    padding: 10px 15px;
    border: 1px solid var(--hm-line);
    border-radius: 999px;
    background: #1c1b19;
    color: var(--hm-text);
    box-shadow: var(--hm-shadow);
    font-weight: 850;
    letter-spacing: .01em;
    white-space: nowrap;
    backdrop-filter: blur(12px);
}
.hm-swish-support-button:hover,
.hm-swish-support-button:focus-visible {
    filter: brightness(1.12);
}
.hm-swish-support-button:active {
    transform: scale(.97);
}
.hm-swish-support-modal[hidden] {
    display: none;
}
.hm-swish-support-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: grid;
    place-items: end start;
    padding: 14px 14px calc(86px + var(--safe-bottom));
    pointer-events: none;
}
.hm-swish-support-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.28);
    pointer-events: auto;
}
.hm-swish-support-card {
    position: relative;
    width: min(360px, calc(100vw - 28px));
    border: 1px solid var(--hm-line);
    border-radius: 22px;
    background: rgba(24,24,24,.97);
    color: var(--hm-text);
    box-shadow: var(--hm-shadow);
    padding: 18px;
    pointer-events: auto;
    backdrop-filter: blur(14px);
}
.hm-swish-support-close {
    position: absolute;
    top: 9px;
    right: 9px;
    width: 34px;
    height: 34px;
    border: 1px solid var(--hm-line);
    border-radius: 50%;
    background: rgba(255,255,255,.07);
    color: var(--hm-text);
    font-size: 1.25rem;
    line-height: 1;
}
.hm-swish-support-card h2 {
    margin: 0 34px 8px 0;
    font-size: 1.25rem;
    letter-spacing: -.015em;
}
.hm-swish-support-card p {
    margin: 0 0 12px;
    color: var(--hm-muted);
    line-height: 1.45;
}
.hm-swish-support-number {
    display: block;
    margin: 12px 0;
    padding: 12px 14px;
    border: 1px solid var(--hm-line);
    border-radius: 16px;
    background: rgba(255,255,255,.06);
    color: #fff;
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: .06em;
    text-align: center;
}
.hm-swish-support-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
}
.hm-swish-support-actions a,
.hm-swish-support-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 1px solid var(--hm-line);
    border-radius: 14px;
    background: #1c1b19;
    color: var(--hm-text);
    text-decoration: none;
    font-weight: 850;
    text-align: center;
}
.hm-swish-support-actions button {
    background: rgba(255,255,255,.08);
}
.hm-swish-support-note {
    margin: 12px 0 0 !important;
    font-size: .86rem;
}
@media (max-width: 759px) {
    .hm-swish-support-button {
        left: 4px;
        bottom: calc(23px + var(--safe-bottom));
        min-height: 38px;
        max-width: min(72vw, 236px);
        padding: 8px 10px;
        font-size: .86rem;
    }
    .hm-swish-support-modal {
        align-items: end;
        justify-items: stretch;
        padding: 12px 10px calc(66px + var(--safe-bottom));
    }
    .hm-swish-support-card {
        width: 100%;
    }
}
@media (max-width: 420px) {
    .hm-swish-support-actions {
        grid-template-columns: 1fr;
    }
}

/* v7.1: egna ikonbilder/emojis för grupper och platser */
.hm-marker img.hm-marker-icon-img {
    width: 22px;
    height: 22px;
    object-fit: cover;
    border-radius: 50%;
    transform: rotate(45deg);
    display: block;
    background: rgba(255,255,255,.14);
}
.hm-inline-icon-img,
.hm-hover-icon,
.hm-layer-icon-img {
    width: 1.25em;
    height: 1.25em;
    object-fit: cover;
    border-radius: 50%;
    display: inline-block;
    vertical-align: -0.22em;
    flex: 0 0 auto;
}
.hm-layer-icon img.hm-layer-icon-img {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    vertical-align: middle;
}
.hm-hover-icon {
    width: 1.15em;
    height: 1.15em;
}
.hm-place-card-placeholder img.hm-place-card-icon-img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 22px;
    box-shadow: 0 8px 18px rgba(0,0,0,.22);
}
.hm-place-card-category img,
.hm-chip img {
    margin-right: 2px;
}

.hm-route-image {
    max-height: 210px;
}
