﻿@font-face {
    font-family: 'League Spartan';
    src: url('/fonts/LeagueSpartan-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'League Spartan';
    src: url('/fonts/LeagueSpartan-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
}

:root {
    --sidebar-w: 260px;
    --bg: #f6f7f9;
    --card: #ffffff;
    --text: #1b1f24;
    --accent: #ef4444;
    --radius: 16px;
    --shadow: 0 8px 24px rgba(0,0,0,.08);
    --accent-amber: #f59e0b;
    --accent-amber-bg: rgba(245,158,11,.16);
    --trupps-panel-w: 240px;
    --trupps-panel-w-collapsed: 44px;
}

html, body, #app {
    height: 100%;
    margin: 0;
}

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

.btn-primary {
    color: #fff;
    background-color: #F22401;
    border-color: #F22401;
    font-weight: bold;
}

    .btn-primary:hover {
        color: #fff;
        background-color: #F25D26;
        border-color: #F25D26;
        font-weight: bold;
    }

.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--card);
    border-right: 1px solid #eef0f3;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

    .sidebar .brand {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 8px 10px;
    }

        .sidebar .brand img {
            height: 28px;
            object-fit: contain;
        }

.content {
    position: relative;
    padding: 20px;
    overflow: auto;
    min-width: 0;
}

/* Blazored Modal Fixes */
.blazored-modal-container {
    position: fixed !important;
    inset: 0 !important;
    z-index: 1050 !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.blazored-modal-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 1040 !important;
}

.blazored-modal {
    position: relative;
    z-index: 1060 !important;
    margin: 0 auto;
    max-width: min(700px, calc(100vw - 2rem));
}

.home-map {
    position: relative;
    height: calc(100vh - 60px);
    width: 100%;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background: transparent;
    overflow: hidden;
}

.map-canvas {
    position: absolute;
    inset: 0;
    z-index: 1;
}

    .map-canvas > * {
        display: block;
        width: 100%;
        height: 100%;
    }

.home-map .card,
.home-map .ol-map,
.home-map .ol-viewport {
    width: 100% !important;
    height: 100% !important;
    border-radius: var(--radius);
}

.map-ui-layer {
    position: absolute;
    inset: 0;
    z-index: 2000;
    pointer-events: none;
}

.map-panel,
.map-switches-box,
.north-btn {
    pointer-events: auto;
}

/* Sidebar modern */
.ud-sidebar {
    width: 260px;
    min-width: 260px;
    background: var(--card);
    border-right: 1px solid #eef0f3;
    height: 100%;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ud-brand {
    padding: 4px 0 8px 0;
}

    .ud-brand img {
        display: block;
        width: 100%;
        height: auto;
        max-height: 90px;
        object-fit: contain;
    }

.ud-title {
    font-weight: 700;
}

.ud-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
}

    .ud-nav a {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 12px;
        border-radius: 12px;
        text-decoration: none;
        color: var(--text);
        transition: background .15s ease, color .15s ease;
    }

        .ud-nav a:hover {
            background: #f1f5f9;
        }

        .ud-nav a.active {
            background: var(--accent-amber-bg);
            color: var(--text);
            font-weight: 700;
            position: relative;
        }

            .ud-nav a.active::before {
                content: "";
                position: absolute;
                left: 6px;
                top: 8px;
                bottom: 8px;
                width: 3px;
                border-radius: 6px;
                background: var(--accent-amber);
            }

            .ud-nav a.active i {
                color: var(--accent-amber);
            }

.ud-group {
    font-size: .8rem;
    color: #6b7280;
    margin: 10px 8px 2px;
}

/* Switches */
.map-switches {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 2100;
}

.map-switches-box {
    display: inline-block;
    background: rgba(255,255,255,.92);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    padding: 8px 12px;
    user-select: none;
}

    .map-switches-box .form-check {
        margin: 0 !important;
        width: auto !important;
        display: flex;
        align-items: center;
        gap: 8px;
    }

/* Panel */
.map-panel {
    position: absolute;
    top: 16px;
    right: 20px;
    z-index: 2200;
    width: var(--trupps-panel-w);
    min-width: var(--trupps-panel-w);
    max-width: 300px;
    max-height: 60vh;
    overflow: hidden;
    background: rgba(255,255,255,.92);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    display: flex;
    flex-direction: column;
    transition: width 220ms ease, height 220ms ease, box-shadow 180ms ease;
}

.map-panel__inner {
    display: flex;
    flex-direction: column;
    max-height: 60vh;
    opacity: 1;
    transition: opacity 160ms ease;
}

.map-panel__header {
    display: flex;
    justify-content: left;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid #eef0f3;
}

.map-panel__title {
    font-weight: 700;
    font-size: .95rem;
    text-align: left;
}

.map-panel__ctrl {
    margin-top: 4px;
}

    .map-panel__ctrl .form-check {
        margin: 0;
    }

.map-panel__list {
    list-style: none;
    margin: 0;
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: auto;
}

.map-panel__item {
    display: grid;
    grid-template-columns: 14px 1fr;
    gap: 8px;
    padding: 6px;
    border-radius: 8px;
}

    .map-panel__item:hover {
        background: #f7f9fb;
    }

.item-body {
    min-width: 0;
}

.item-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.item-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.item-sub {
    font-size: .8rem;
    color: #6b7280;
    line-height: 1.1;
}

.santrupp-battery {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 6px 2px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

    .santrupp-battery i {
        font-size: 0.9rem;
    }

.map-panel__empty {
    color: #9ca3af;
    padding: 8px 6px;
    font-size: .85rem;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 6px;
}

.dot--active {
    background: #10b981;
}

.dot--inactive {
    background: #9ca3af;
}

.panel-toggle {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
    display: grid;
    place-items: center;
    cursor: pointer;
    z-index: 2300;
}

.map-panel.collapsed {
    width: var(--trupps-panel-w-collapsed);
    min-width: var(--trupps-panel-w-collapsed);
    height: 44px;
    max-height: 44px;
    background: transparent;
    box-shadow: none;
    overflow: visible;
    padding: 0;
}

    .map-panel.collapsed .map-panel__inner {
        display: none;
        opacity: 0;
    }

.north-btn {
    position: absolute;
    bottom: 16px;
    left: 16px;
    z-index: 2300;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
    cursor: pointer;
    display: grid;
    place-items: center;
}

/* Rest */
#map-editor .controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 12px;
}

#map-editor fieldset {
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 10px 14px;
    background-color: #fafafa;
}

#map-editor legend {
    font-weight: 600;
    margin-bottom: 4px;
}

#map-editor label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 4px 0;
}

#map-editor button {
    margin: 2px 4px 2px 0;
    padding: 4px 10px;
    border: 1px solid #aaa;
    border-radius: 6px;
    background-color: #f4f4f4;
    cursor: pointer;
}

    #map-editor button:hover {
        background-color: #e0e0e0;
    }

#map {
    height: 70vh;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.login-page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #f5f7fb 0%, #e9eef8 100%);
    padding: 2rem;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid #e8ecf4;
}

.login-logo {
    width: 110px;
    height: 110px;
    display: block;
    margin: 0 auto 1rem auto;
    object-fit: contain;
}

.blazored-modal-container {
    position: fixed !important;
    inset: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 2000 !important;
}

.blazored-modal-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 1999 !important;
}

.blazored-modal {
    z-index: 2001 !important;
    margin: auto !important;
}

.sidebar-feedback {
    position: relative;
    margin-top: 100%;
}

.feedback-fab {
    width: 100%;
    border-radius: 12px;
    padding: 12px 18px;
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
}

.poi-form-column {
    width: 240px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

    .poi-form-column .form-control,
    .poi-form-column .symbol-select-wrapper {
        width: 100%;
    }

.collapse-card {
    border: 1px solid #e6eaf0;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.06);
    overflow: visible;
    margin-bottom: 1rem;
}

.collapse-card-header {
    width: 100%;
    border: 1px solid #ffffff;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
    padding: 1rem 1.1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

    .collapse-card-header:hover {
        background: linear-gradient(180deg, #ffffff 0%, #f6f8fb 100%);
    }

.collapse-card-header-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.collapse-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #101828;
    letter-spacing: -0.01em;
}

.collapse-card-subtitle {
    font-size: 0.82rem;
    color: #667085;
}

.collapse-card-chevron {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #f2f4f7;
    color: #667085;
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.collapse-card-header:hover .collapse-card-chevron {
    background: #eef2ff;
    color: #4f46e5;
}

.collapse-card-chevron.open {
    transform: rotate(180deg);
}

.collapse-card-body {
    padding: 1rem 1.1rem 1.1rem;
    border-top: 1px solid #f0f2f5;
    background: #ffffff;
}

.modern-label {
    font-size: 0.84rem;
    font-weight: 600;
    color: #344054;
    margin-bottom: 0.45rem;
}

.modern-input {
    min-height: 44px;
    border-radius: 12px;
    border: 1px solid #d0d5dd;
    background: #ffffff;
    box-shadow: inset 0 1px 2px rgba(16, 24, 40, 0.03);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

    .modern-input:hover {
        border-color: #b8c1cc;
    }

    .modern-input:focus {
        border-color: #7c8cff;
        box-shadow: 0 0 0 4px rgba(124, 140, 255, 0.12);
    }

.modern-textarea {
    min-height: 110px;
    resize: vertical;
    padding-top: 0.75rem;
}

.section-block {
    display: block;
}

.section-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

.section-divider {
    height: 1px;
    background: #eef2f7;
    margin: 1rem 0;
}

.info-box {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #f9fafb;
    color: #475467;
    padding: 0.75rem 0.9rem;
    font-size: 0.9rem;
    margin-bottom: 0.85rem;
}

.coordinate-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.coordinate-pill {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #ffffff;
    padding: 0.65rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

    .coordinate-pill span {
        color: #667085;
        font-size: 0.8rem;
        font-weight: 600;
    }

    .coordinate-pill strong {
        color: #111827;
        font-size: 0.86rem;
        font-weight: 700;
    }

.modern-check-list {
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #ffffff;
    padding: 0.35rem;
}

.modern-check-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 38px;
    padding: 0.45rem 0.55rem;
    border-radius: 10px;
    cursor: pointer;
    color: #344054;
    font-size: 0.9rem;
    transition: background 0.15s ease;
}

    .modern-check-item:hover {
        background: #f8fafc;
    }

    .modern-check-item input {
        margin: 0;
    }

.poi-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.poi-symbol-cell {
    min-width: 0;
}

    .poi-symbol-cell .symbol-select-wrapper {
        width: 100%;
    }

.selected-key-line {
    color: #667085;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

    .selected-key-line strong {
        color: #111827;
    }

.modern-table-wrapper {
    border: 1px solid #e5e7eb;
    border-radius: 0px;
    overflow: hidden;
    margin-top: 0.75rem;
}

.modern-table thead th {
    background: #f9fafb;
    color: #667085;
    font-size: 0.78rem;
    font-weight: 700;
    border-bottom: 1px solid #e5e7eb;
}

.modern-table tbody td {
    color: #344054;
    font-size: 0.86rem;
    border-color: #f0f2f5;
}

.icon-danger-button {
    width: 28px;
    height: 28px;
    border: 1px solid #fecaca;
    border-radius: 999px;
    background: #ffffff;
    color: #dc2626;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

    .icon-danger-button:hover {
        background: #fef2f2;
        border-color: #fca5a5;
        color: #b91c1c;
    }

.small-hint {
    color: #667085;
    font-size: 0.82rem;
    margin-bottom: 0.75rem;
}

.warning-hint {
    color: #b45309;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 12px;
    padding: 0.65rem 0.8rem;
}

.modern-list-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.modern-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #ffffff;
    padding: 0.65rem 0.75rem;
}

.modern-file-name {
    min-width: 0;
    max-width: 230px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: #344054;
    font-size: 0.88rem;
    font-weight: 500;
}

.modern-list-actions {
    display: flex;
    gap: 0.45rem;
    flex: 0 0 auto;
}

.modern-secondary-button,
.modern-danger-button {
    border-radius: 10px;
    padding: 0.4rem 0.65rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.modern-secondary-button {
    border: 1px solid #c7d2fe;
    background: #ffffff;
    color: #4f46e5;
}

    .modern-secondary-button:hover {
        background: #eef2ff;
        border-color: #a5b4fc;
    }

.modern-danger-button {
    border: 1px solid #fecaca;
    background: #ffffff;
    color: #dc2626;
}

    .modern-danger-button:hover {
        background: #fef2f2;
        border-color: #fca5a5;
    }

@media (max-width: 768px) {
    .poi-input-row {
        grid-template-columns: 1fr;
    }

    .coordinate-grid {
        grid-template-columns: 1fr;
    }

    .modern-list-item {
        align-items: stretch;
        flex-direction: column;
    }

    .modern-list-actions {
        justify-content: flex-end;
    }
}

/* =========================================================
   Home Map Responsive Optimierung
   Desktop bleibt weitgehend unverändert
   ========================================================= */

.home-map {
    min-height: 520px;
    touch-action: manipulation;
}

.event-info-card {
    top: 16px;
    left: 16px;
    right: auto;
    z-index: 2100;
}

.layer-switch-card {
    top: 110px;
    left: 16px;
    right: auto;
    z-index: 2100;
}

.map-switches-box {
    max-width: min(320px, calc(100vw - 32px));
}

.north-btn {
    font-size: 1.25rem;
}

.panel-toggle,
.north-btn,
.map-switches-box .form-check-input,
.map-panel__item {
    touch-action: manipulation;
}

.poi-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.poi-list-item {
    display: grid;
    grid-template-columns: 42px 1fr auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.85rem;
    background: #ffffff;
}

    .poi-list-item:hover {
        background: #f8fafc;
        border-color: #dbe3ef;
    }

.poi-list-symbol {
    display: flex;
    align-items: center;
    justify-content: center;
}

.poi-symbol-preview {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.96);
}

    .poi-symbol-preview.with-ring {
        border: 3px solid var(--symbol-color);
    }

.poi-symbol-img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    display: block;
}

.poi-symbol-text {
    font-size: 22px;
    line-height: 1;
    color: var(--symbol-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.poi-list-content {
    min-width: 0;
}

.poi-list-name {
    font-weight: 600;
    color: #111827;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.poi-list-subtitle {
    font-size: 0.78rem;
    color: #6b7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.poi-delete-button {
    width: 34px;
    height: 34px;
    border: 1px solid #fecaca;
    border-radius: 999px;
    background: #fff5f5;
    color: #dc2626;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
}

    .poi-delete-button:hover {
        background: #fee2e2;
        border-color: #fca5a5;
        color: #991b1b;
    }

    .poi-delete-button i {
        font-size: 0.85rem;
        line-height: 1;
    }

/* Größere Touch-Ziele für Tablets und Handys */
@media (pointer: coarse) {
    .panel-toggle {
        width: 38px;
        height: 38px;
        border-radius: 12px;
    }

    .north-btn {
        width: 48px;
        height: 48px;
    }

    .map-panel__item {
        min-height: 46px;
        align-items: center;
    }

    .map-switches-box {
        padding: 10px 14px;
    }

        .map-switches-box .form-check-input {
            width: 2.5em;
            height: 1.35em;
        }
}

/* =========================================================
   Tablets allgemein
   ========================================================= */
@media (max-width: 1024px) {
    :root {
        --trupps-panel-w: 220px;
        --trupps-panel-w-collapsed: 46px;
    }

    .content {
        padding: 12px;
    }

    .home-map {
        height: calc(100dvh - 24px);
        min-height: 520px;
        border-radius: 14px;
    }

    .map-panel {
        top: 14px;
        right: 14px;
        max-height: calc(100dvh - 120px);
    }

    .map-panel__inner {
        max-height: calc(100dvh - 120px);
    }

    .map-panel__title {
        font-size: 0.9rem;
    }

    .item-title {
        font-size: 0.86rem;
    }

    .item-sub {
        font-size: 0.76rem;
    }

    .event-info-card {
        top: 14px;
        left: 14px;
    }

    .layer-switch-card {
        top: 106px;
        left: 14px;
    }

    .north-btn {
        bottom: 14px;
        left: 14px;
    }
}

/* =========================================================
   Tablets im Querformat
   Beispiel: iPad quer, Android Tablets quer
   ========================================================= */
@media (min-width: 769px) and (max-width: 1180px) and (orientation: landscape) {
    .content {
        padding: 10px;
    }

    .home-map {
        height: calc(100dvh - 20px);
        min-height: 430px;
    }

    .event-info-card {
        top: 12px;
        left: 12px;
    }

    .layer-switch-card {
        top: 100px;
        left: 12px;
    }

    .map-panel {
        top: 12px;
        right: 12px;
        width: 210px;
        min-width: 210px;
        max-width: 230px;
        max-height: calc(100dvh - 84px);
    }

    .map-panel__inner {
        max-height: calc(100dvh - 84px);
    }

    .map-panel__header {
        padding: 8px 10px;
    }

    .map-panel__list {
        padding: 5px 7px;
        gap: 4px;
    }

    .map-panel__item {
        padding: 5px;
    }

    .panel-toggle {
        top: 6px;
        right: 6px;
    }

    .north-btn {
        bottom: 12px;
        left: 12px;
    }
}

/* =========================================================
   Tablets im Hochformat
   Panel bleibt rechts, aber kompakter
   ========================================================= */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: portrait) {
    .home-map {
        height: calc(100dvh - 24px);
    }

    .map-panel {
        width: 215px;
        min-width: 215px;
        max-height: 52dvh;
    }

    .map-panel__inner {
        max-height: 52dvh;
    }

    .event-info-card .map-switches-box {
        max-width: 300px;
    }
}

/* =========================================================
   Handy / kleine Screens
   Map-App Layout mit Bottom-Sheet
   ========================================================= */
@media (max-width: 768px) {
    html,
    body,
    #app {
        min-height: 100%;
        overflow: hidden;
    }

    .app-shell {
        display: block;
        min-height: 100dvh;
    }

    .sidebar,
    .ud-sidebar {
        display: none;
    }

    .content {
        padding: 0;
        overflow: hidden;
        width: 100%;
        min-height: 100dvh;
    }

    .home-map {
        height: 100dvh;
        min-height: 100dvh;
        width: 100%;
        border-radius: 0;
        box-shadow: none;
    }

        .home-map .card,
        .home-map .ol-map,
        .home-map .ol-viewport {
            border-radius: 0;
        }

    .event-info-card {
        top: max(10px, env(safe-area-inset-top));
        left: 10px;
        right: 10px;
        width: auto;
    }

        .event-info-card .map-switches-box {
            width: 100%;
            max-width: none;
            padding: 10px 12px;
            font-size: 0.88rem;
        }

        .event-info-card .small {
            font-size: 0.75rem;
            line-height: 1.2;
        }

    .layer-switch-card {
        top: calc(max(10px, env(safe-area-inset-top)) + 82px);
        left: 10px;
        right: auto;
    }

        .layer-switch-card .map-switches-box {
            padding: 8px 10px;
            font-size: 0.86rem;
        }

    .map-switches-box {
        border-radius: 14px;
        box-shadow: 0 8px 24px rgba(0,0,0,.18);
        background: rgba(255,255,255,.95);
        backdrop-filter: blur(8px);
    }

    .map-panel {
        top: auto;
        right: 10px;
        left: 10px;
        bottom: max(10px, env(safe-area-inset-bottom));
        width: auto;
        min-width: 0;
        max-width: none;
        max-height: 38dvh;
        border-radius: 18px;
        background: rgba(255,255,255,.96);
        backdrop-filter: blur(10px);
    }

    .map-panel__inner {
        max-height: 38dvh;
    }

    .map-panel__header {
        padding: 12px 14px 10px;
    }

    .map-panel__title {
        font-size: 0.95rem;
    }

    .map-panel__list {
        padding: 6px 10px 10px;
        gap: 5px;
    }

    .map-panel__item {
        grid-template-columns: 16px 1fr;
        padding: 8px;
    }

    .item-title {
        font-size: 0.9rem;
    }

    .item-sub {
        font-size: 0.78rem;
    }

    .panel-toggle {
        top: 10px;
        right: 10px;
        width: 38px;
        height: 38px;
        border-radius: 12px;
    }

    .map-panel.collapsed {
        left: auto;
        right: 10px;
        bottom: max(10px, env(safe-area-inset-bottom));
        width: 48px;
        min-width: 48px;
        height: 48px;
        max-height: 48px;
        border-radius: 14px;
        background: transparent;
        box-shadow: none;
    }

        .map-panel.collapsed .panel-toggle {
            top: 0;
            right: 0;
        }

    .north-btn {
        left: 10px;
        bottom: calc(max(10px, env(safe-area-inset-bottom)) + 42dvh);
        width: 48px;
        height: 48px;
    }
}

/* Sehr kleine Handys */
@media (max-width: 420px) {
    .event-info-card .map-switches-box {
        font-size: 0.82rem;
    }

    .layer-switch-card {
        top: calc(max(10px, env(safe-area-inset-top)) + 78px);
    }

    .map-panel {
        max-height: 42dvh;
    }

    .map-panel__inner {
        max-height: 42dvh;
    }

    .north-btn {
        bottom: calc(max(10px, env(safe-area-inset-bottom)) + 46dvh);
    }
}

/* Handy Querformat / sehr niedrige Screens */
@media (max-height: 520px) and (orientation: landscape) {
    .event-info-card {
        top: 8px;
        left: 8px;
        right: auto;
        max-width: 300px;
    }

        .event-info-card .map-switches-box {
            font-size: 0.78rem;
            padding: 7px 9px;
        }

    .layer-switch-card {
        top: 8px;
        left: 320px;
    }

        .layer-switch-card .map-switches-box {
            padding: 7px 9px;
            font-size: 0.78rem;
        }

    .map-panel {
        top: 8px;
        right: 8px;
        left: auto;
        bottom: auto;
        width: 210px;
        min-width: 210px;
        max-height: calc(100dvh - 16px);
        border-radius: 14px;
    }

    .map-panel__inner {
        max-height: calc(100dvh - 16px);
    }

    .map-panel__header {
        padding: 8px 10px;
    }

    .map-panel__list {
        padding: 5px 7px;
    }

    .map-panel__item {
        padding: 5px;
        min-height: 38px;
    }

    .north-btn {
        bottom: 8px;
        left: 8px;
        width: 42px;
        height: 42px;
    }
}

/* =========================================================
   UnitDesk SanTrupp Marker Pixel-Clustering
   Marker_Symbol für Einzeltrupps
   Marker_Clean für Cluster
   ========================================================= */

.ud-santrupp-marker {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translateY(-8px);
    cursor: pointer;
    user-select: none;
    pointer-events: auto;
    font-family: "League Spartan", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    z-index: 9999;
}

.ud-santrupp-marker__icon-wrap {
    position: relative;
    width: 38px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 4px 9px rgba(0, 0, 0, 0.34));
    transition: transform 140ms ease, filter 140ms ease;
}

.ud-santrupp-marker--cluster .ud-santrupp-marker__icon-wrap {
    width: 46px;
    height: 58px;
}

.ud-santrupp-marker:hover .ud-santrupp-marker__icon-wrap {
    transform: scale(1.08);
    filter: drop-shadow(0 7px 15px rgba(0, 0, 0, 0.42));
}

.ud-santrupp-marker__icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.ud-santrupp-marker__count {
    position: absolute;
    top: 13px;
    left: 50%;
    transform: translateX(-50%);
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f22401;
    background: transparent;
    font-size: 15px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.02em;
    text-align: center;
}

.ud-santrupp-marker__caption {
    margin-top: -2px;
    padding: 4px 8px 3px;
    border-radius: 8px;
    background: rgba(17, 24, 39, 0.82);
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.1;
    white-space: nowrap;
    box-shadow: 0 3px 9px rgba(0, 0, 0, 0.24);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.ud-santrupp-marker--single .ud-santrupp-marker__caption {
    background: rgba(242, 36, 1, 0.92);
}

.ud-santrupp-marker--cluster .ud-santrupp-marker__caption {
    background: rgba(17, 24, 39, 0.88);
}

.ud-santrupp-marker.is-inactive {
    opacity: 0.72;
    filter: grayscale(0.25);
}

/* =========================================================
   UnitDesk SanTrupp Tooltip / Hover-Menü
   ========================================================= */

.ud-santrupp-tooltip {
    min-width: 170px;
    max-width: 300px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    color: #111827;
    font-family: "League Spartan", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 13px;
    line-height: 1.25;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.28);
    pointer-events: none;
    z-index: 99999;
    border: 1px solid rgba(242, 36, 1, 0.22);
    backdrop-filter: blur(10px);
}

    .ud-santrupp-tooltip::before {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: 14px;
        border-left: 4px solid #f22401;
        pointer-events: none;
    }

    .ud-santrupp-tooltip::after {
        content: "";
        position: absolute;
        left: 50%;
        bottom: -8px;
        transform: translateX(-50%);
        border-width: 8px 8px 0 8px;
        border-style: solid;
        border-color: rgba(255, 255, 255, 0.96) transparent transparent transparent;
        filter: drop-shadow(0 3px 2px rgba(15, 23, 42, 0.12));
    }

.ud-santrupp-tooltip__title {
    font-size: 15px;
    font-weight: 900;
    margin-bottom: 4px;
    color: #f22401;
    letter-spacing: -0.01em;
}

.ud-santrupp-tooltip__location {
    margin-bottom: 7px;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.15;
}

.ud-santrupp-tooltip__list {
    display: grid;
    gap: 4px;
}

/* Mobile etwas kompakter */

@media (max-width: 768px) {
    .ud-santrupp-marker__icon-wrap {
        width: 34px;
        height: 44px;
    }

    .ud-santrupp-marker--cluster .ud-santrupp-marker__icon-wrap {
        width: 42px;
        height: 54px;
    }

    .ud-santrupp-marker__count {
        top: 12px;
        min-width: 20px;
        height: 20px;
        font-size: 14px;
    }

    .ud-santrupp-marker__caption {
        font-size: 10px;
        padding: 3px 7px 2px;
    }

    .ud-santrupp-tooltip {
        max-width: 240px;
        font-size: 12px;
    }

    .ud-santrupp-tooltip__title {
        font-size: 14px;
    }
}

.ud-santrupp-tooltip__item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 6px 7px;
    border-radius: 9px;
    background: rgba(242, 36, 1, 0.07);
}

.ud-santrupp-tooltip__name {
    min-width: 0;
    color: #111827;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ud-santrupp-tooltip__battery {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    padding: 3px 7px 2px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}

    .ud-santrupp-tooltip__battery.battery-good,
    .santrupp-battery.battery-good {
        color: #047857;
        background: rgba(16, 185, 129, 0.14);
    }

    .ud-santrupp-tooltip__battery.battery-medium,
    .santrupp-battery.battery-medium {
        color: #b45309;
        background: rgba(245, 158, 11, 0.18);
    }

    .ud-santrupp-tooltip__battery.battery-low,
    .santrupp-battery.battery-low {
        color: #b91c1c;
        background: rgba(239, 68, 68, 0.16);
    }

    .ud-santrupp-tooltip__battery.battery-unknown,
    .santrupp-battery.battery-unknown {
        color: #64748b;
        background: rgba(100, 116, 139, 0.13);
    }

.ud-santrupp-marker__icon-wrap {
    position: relative !important;
    width: 46px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible !important;
}

.ud-santrupp-marker--single .ud-santrupp-marker__icon-wrap {
    width: 38px;
    height: 48px;
}

.ud-santrupp-marker__icon {
    position: relative !important;
    z-index: 1 !important;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

.ud-santrupp-marker__count {
    position: absolute !important;
    top: 14px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 10 !important;
    min-width: 24px;
    height: 24px;
    padding: 0 5px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: #ffffff !important;
    background: transparent !important;
    font-family: "League Spartan", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 17px;
    font-weight: 900;
    line-height: 1;
    text-align: center;
    letter-spacing: -0.04em;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.65);
    pointer-events: none;
}

/* =========================================================
   SanHist als oberstes Karten-Overlay
   ========================================================= */

.ud-sanhist-marker {
    position: relative;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    user-select: none;
    transform: translateY(-4px);
    font-family: "League Spartan", system-ui, sans-serif;
}

.ud-sanhist-marker__ring {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.98);
    border: 4px solid #f22300;
    box-shadow: 0 5px 16px rgba(15, 23, 42, 0.34), 0 0 0 3px rgba(255, 255, 255, 0.82);
}

.ud-sanhist-marker__image {
    width: 20px;
    height: 20px;
    display: block;
    object-fit: contain;
    pointer-events: none;
}

.ud-sanhist-marker__text {
    color: #f22300;
    font-size: 24px;
    font-weight: 900;
    line-height: 1;
}

.ud-sanhist-marker__label {
    margin-top: 2px;
    padding: 4px 9px 3px;
    border-radius: 9px;
    color: #ffffff;
    background: rgba(242, 35, 0, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.26);
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

/* =========================================================
   Kleine Tracker neben SanHist
   ========================================================= */

.ud-santrupp-marker--named-place {
    z-index: 700;
    transform: none;
    cursor: pointer;
    touch-action: none;
}

    .ud-santrupp-marker--named-place .ud-santrupp-marker__icon-wrap {
        width: 22px;
        height: 28px;
        filter: drop-shadow(0 3px 6px rgba(15, 23, 42, 0.35));
    }

    .ud-santrupp-marker--named-place:hover
    .ud-santrupp-marker__icon-wrap {
        transform: scale(1.18);
    }

    .ud-santrupp-marker--named-place.is-inactive {
        opacity: 0.68;
    }

/*
 * Bei Touch-Geräten kein künstlicher Hover-Zustand.
 * Ein Tap öffnet stattdessen den Tooltip.
 */
@media (pointer: coarse) {
    .ud-santrupp-marker:hover
    .ud-santrupp-marker__icon-wrap {
        transform: none;
    }

    .ud-santrupp-marker--named-place {
        /*
         * Optisches Symbol bleibt klein,
         * aber das tatsächliche Touch-Ziel wird größer.
         */
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

        .ud-santrupp-marker--named-place
        .ud-santrupp-marker__icon-wrap {
            width: 28px;
            height: 36px;
        }

    .ud-santrupp-tooltip {
        min-width: 210px;
        max-width: min(300px, calc(100vw - 32px));
        padding: 12px;
        pointer-events: none;
    }
}

/* =========================================================
   SanHist-Trackergruppe
   Verwendet exakt dasselbe Design wie normale Cluster
   ========================================================= */

.ud-santrupp-marker--at-sanhist {
    position: relative;
    z-index: 700;
    pointer-events: auto;
    touch-action: none;
}

    /*
 * Keine eigene Icon-Größe setzen.
 * Der Marker übernimmt exakt die normale Clustergröße:
 *
 * .ud-santrupp-marker--cluster
 * .ud-santrupp-marker__icon-wrap
 */
    .ud-santrupp-marker--at-sanhist
    .ud-santrupp-marker__icon-wrap {
        position: relative;
    }

/*
 * Zahl direkt im weißen Innenbereich von Marker_Clean.
 * Deine bestehende Definition ist bereits ähnlich;
 * diese Regel fixiert die Position für normale und SanHist-Cluster.
 */
.ud-santrupp-marker--cluster
.ud-santrupp-marker__count {
    position: absolute;
    top: 50%;
    left: 50%;
    /*
     * Marker_Clean ist unten länger als oben.
     * Deshalb die Zahl leicht nach oben verschieben.
     */
    transform: translate(-50%, -62%);
    min-width: 18px;
    height: 20px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f22401;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    font-family: "League Spartan", Arial, sans-serif;
    font-size: 16px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.03em;
    text-align: center;
    pointer-events: none;
}

/*
 * SanHist liegt über dem Tracker-Cluster.
 */
.ud-sanhist-marker {
    z-index: 1000 !important;
}

/*
 * Hover wie bei normalen Clustern.
 */
@media (hover: hover) and (pointer: fine) {
    .ud-santrupp-marker--at-sanhist:hover
    .ud-santrupp-marker__icon-wrap {
        transform: scale(1.08);
        filter: drop-shadow( 0 7px 15px rgba(0, 0, 0, 0.42) );
    }
}

/*
 * Größeres unsichtbares Touch-Ziel,
 * während das sichtbare Symbol unverändert bleibt.
 */
@media (pointer: coarse) {
    .ud-santrupp-marker--at-sanhist {
        min-width: 28px;
        min-height: 34px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

        .ud-santrupp-marker--at-sanhist:hover
        .ud-santrupp-marker__icon-wrap {
            transform: none;
        }

    .ud-santrupp-marker--cluster
    .ud-santrupp-marker__count {
        font-size: 15px;
        transform: translate(-50%, -63%);
    }
}

/* =========================================================
Layout ohne Sidebar
Rolle "user" auf der Home-Seite
========================================================= */

.app-shell.app-shell--without-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
}

/*

* Der Inhaltsbereich verwendet die komplette Bildschirmbreite.
* Das normale Padding von .content wird hier überschrieben.
  */
.app-shell--without-sidebar > .content,
.app-shell--without-sidebar .content--full-width {
    position: relative;
    width: 100%;
    min-width: 0;
    max-width: none;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/*

* Die Karte füllt ohne Sidebar den gesamten Bildschirm.
  */
.app-shell--without-sidebar .home-map {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
}

    /*

* Auch die OpenLayers-Elemente erhalten keine Rundung.
  */
    .app-shell--without-sidebar .home-map .card,
    .app-shell--without-sidebar .home-map .ol-map,
    .app-shell--without-sidebar .home-map .ol-viewport {
        width: 100% !important;
        height: 100% !important;
        border-radius: 0 !important;
    }

/*

* Verhindert, dass ein eventuell verbleibendes aside
* Platz beansprucht.
  */
.app-shell--without-sidebar > aside {
    display: none;
}

/* Tablets */
@media (max-width: 1024px) {
    .app-shell.app-shell--without-sidebar {
        min-height: 100dvh;
    }

    .app-shell--without-sidebar > .content,
    .app-shell--without-sidebar .content--full-width {
        width: 100%;
        min-height: 100dvh;
        padding: 0;
    }

    .app-shell--without-sidebar .home-map {
        width: 100%;
        height: 100dvh;
        min-height: 100dvh;
        border-radius: 0;
    }
}

/* Handys */
@media (max-width: 768px) {
    .app-shell.app-shell--without-sidebar {
        display: block;
        width: 100%;
        min-height: 100dvh;
    }

    .app-shell--without-sidebar > .content,
    .app-shell--without-sidebar .content--full-width {
        width: 100%;
        height: 100dvh;
        min-height: 100dvh;
        padding: 0;
        overflow: hidden;
    }

    .app-shell--without-sidebar .home-map {
        width: 100%;
        height: 100dvh;
        min-height: 100dvh;
        border-radius: 0;
        box-shadow: none;
    }
}

/* =========================================================
Home-Seite ohne Sidebar für normale Benutzer
========================================================= */

.app-shell.app-shell--without-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
}

.app-shell--without-sidebar > aside {
    display: none;
}

.app-shell--without-sidebar > .content,
.app-shell--without-sidebar .content--full-width {
    position: relative;
    width: 100%;
    min-width: 0;
    max-width: none;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.app-shell--without-sidebar .home-map {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
}

    .app-shell--without-sidebar .home-map .card,
    .app-shell--without-sidebar .home-map .ol-map,
    .app-shell--without-sidebar .home-map .ol-viewport {
        width: 100% !important;
        height: 100% !important;
        border-radius: 0 !important;
    }

.santrupp-battery.battery-good {
    color: #047857 !important;
    background-color: rgba(16, 185, 129, 0.14) !important;
}

.santrupp-battery.battery-medium {
    color: #b45309 !important;
    background-color: rgba(245, 158, 11, 0.18) !important;
}

.santrupp-battery.battery-low {
    color: #b91c1c !important;
    background-color: rgba(239, 68, 68, 0.16) !important;
}

.santrupp-battery.battery-unknown {
    color: #64748b !important;
    background-color: rgba(100, 116, 139, 0.13) !important;
}

.santrupp-battery > * {
    color: inherit !important;
}

.symbol-icon-img {
    display: block;
    width: 24px !important;
    height: 24px !important;
    min-width: 24px;
    min-height: 24px;
    max-width: 24px !important;
    max-height: 24px !important;
    object-fit: contain;
}


/* Map editor: raster drawing guidance */
.grid-drawing-hint {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .65rem .8rem;
    color: #7f1d1d;
    background: rgba(239, 68, 68, .08);
    border: 1px solid rgba(239, 68, 68, .18);
    border-radius: 12px;
    font-size: .875rem;
}

.grid-drawing-dot {
    width: .55rem;
    height: .55rem;
    flex: 0 0 .55rem;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, .14);
}

/* =========================================================
   Home als kompakte Karten-App auf schmalen Bildschirmen
   ========================================================= */
.home-app-shell {
    position: relative;
}

.home-topbar {
    display: none;
}

.home-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #172033;
    text-decoration: none;
}

.home-brand__mark {
    position: relative;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #f22401;
    font-size: 31px;
    line-height: 1;
}

    .home-brand__mark .bi-plus-lg {
        position: absolute;
        top: 8px;
        left: 12px;
        color: #ffffff;
        font-size: 11px;
        font-weight: 900;
    }

.home-brand__name {
    font-family: "League Spartan", system-ui, sans-serif;
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -0.035em;
}

.home-logout-form {
    margin: 0;
}

.home-logout-button {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 13px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    color: #344054;
    background: #ffffff;
    font-size: 0.9rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

    .home-logout-button i {
        color: #f22401;
        font-size: 1rem;
    }

@media (max-width: 768px) {
    .home-app-shell {
        width: 100%;
        height: 100vh;
        height: 100dvh;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        background: #f6f7f9;
    }

    .home-topbar {
        position: relative;
        z-index: 3000;
        flex: 0 0 auto;
        min-height: calc(58px + env(safe-area-inset-top));
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: calc(7px + env(safe-area-inset-top)) 14px 7px;
        border-bottom: 1px solid rgba(226, 232, 240, 0.9);
        background: rgba(255, 255, 255, 0.97);
        box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
    }

    .home-brand {
        min-width: 0;
    }

    .home-brand__mark {
        width: 31px;
        height: 31px;
        font-size: 29px;
    }

        .home-brand__mark .bi-plus-lg {
            top: 7px;
            left: 11px;
            font-size: 10px;
        }

    .home-brand__name {
        font-size: 20px;
    }

    .home-logout-button {
        min-height: 40px;
        padding: 0 11px;
        border-radius: 11px;
        color: #b42318;
    }

        .home-logout-button i {
            color: inherit;
        }

    .home-map,
    .home-map.home-map--trupps-collapsed {
        position: relative;
        flex: 1 1 auto;
        width: 100%;
        height: auto !important;
        min-height: 0 !important;
        margin: 0;
        border-radius: 0;
        box-shadow: none;
        overflow: hidden;
    }

        .home-map .card,
        .home-map .ol-map,
        .home-map .ol-viewport {
            border-radius: 0;
        }

    .event-info-card {
        top: 10px;
        left: 10px;
        right: 10px;
        width: auto;
        z-index: 2100;
    }

        .event-info-card .map-switches-box {
            width: 100%;
            max-width: none;
            padding: 9px 12px;
            border: 1px solid rgba(226, 232, 240, 0.9);
            border-radius: 14px;
            background: rgba(255, 255, 255, 0.96);
            box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
            backdrop-filter: blur(12px);
            font-size: 0.88rem;
            line-height: 1.25;
        }

        .event-info-card .small {
            margin-top: 2px;
            font-size: 0.72rem;
        }

    .layer-switch-card {
        top: 83px;
        left: 10px;
        right: 10px;
        width: auto;
        z-index: 2100;
    }

        .layer-switch-card .map-switches-box {
            width: 100%;
            max-width: none;
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            column-gap: 8px;
            row-gap: 2px;
            padding: 8px 11px;
            border: 1px solid rgba(226, 232, 240, 0.9);
            border-radius: 14px;
            background: rgba(255, 255, 255, 0.96);
            box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
            backdrop-filter: blur(12px);
        }

        .layer-switch-card .form-check.form-switch {
            min-width: 0;
            min-height: 40px;
            display: flex;
            align-items: center;
            gap: 7px;
            margin: 0 !important;
            padding-left: 0;
        }

        .layer-switch-card .form-check-input {
            flex: 0 0 auto;
            float: none;
            width: 2.25em;
            height: 1.2em;
            margin: 0;
        }

        .layer-switch-card .form-check-label {
            min-width: 0;
            font-size: 0.78rem;
            line-height: 1.1;
        }

    .map-panel {
        top: auto;
        right: 10px;
        bottom: max(10px, env(safe-area-inset-bottom));
        left: 10px;
        width: auto;
        min-width: 0;
        max-width: none;
        max-height: 34dvh;
        border: 1px solid rgba(226, 232, 240, 0.95);
        border-radius: 20px;
        background: rgba(255, 255, 255, 0.97);
        box-shadow: 0 12px 34px rgba(15, 23, 42, 0.2);
        backdrop-filter: blur(14px);
    }

        .map-panel::before {
            content: "";
            position: absolute;
            top: 7px;
            left: 50%;
            width: 34px;
            height: 4px;
            transform: translateX(-50%);
            border-radius: 999px;
            background: #d0d5dd;
        }

    .map-panel__inner {
        max-height: 34dvh;
    }

    .map-panel__header {
        min-height: 58px;
        align-items: center;
        padding: 13px 56px 8px 14px;
        border-bottom-color: #eef0f3;
    }

    .map-panel__title {
        font-size: 0.95rem;
        font-weight: 800;
    }

    .map-panel__ctrl {
        margin-top: 2px;
        font-size: 0.78rem;
    }

    .map-panel__list {
        max-height: calc(34dvh - 58px);
        padding: 5px 10px 10px;
        gap: 3px;
    }

    .map-panel__item {
        grid-template-columns: 16px minmax(0, 1fr);
        min-height: 48px;
        align-items: center;
        padding: 7px 8px;
        border-radius: 11px;
    }

    .item-title {
        font-size: 0.88rem;
    }

    .item-sub {
        font-size: 0.75rem;
    }

    .panel-toggle {
        top: 13px;
        right: 11px;
        z-index: 2;
        width: 36px;
        height: 36px;
        border: 1px solid #e5e7eb;
        border-radius: 11px;
        color: #344054;
        box-shadow: none;
    }

    .map-panel.collapsed {
        right: 10px;
        bottom: max(10px, env(safe-area-inset-bottom));
        left: auto;
        width: 48px;
        min-width: 48px;
        height: 48px;
        max-height: 48px;
        border: 0;
        border-radius: 15px;
        background: transparent;
        box-shadow: none;
        backdrop-filter: none;
    }

        .map-panel.collapsed::before {
            display: none;
        }

        .map-panel.collapsed .panel-toggle {
            top: 0;
            right: 0;
            width: 48px;
            height: 48px;
            border: 1px solid rgba(226, 232, 240, 0.95);
            border-radius: 15px;
            color: #f22401;
            background: rgba(255, 255, 255, 0.97);
            box-shadow: 0 8px 22px rgba(15, 23, 42, 0.16);
            backdrop-filter: blur(12px);
        }

    .north-btn {
        bottom: calc(34dvh + 24px + env(safe-area-inset-bottom));
        left: 12px;
        width: 46px;
        height: 46px;
        border: 1px solid rgba(226, 232, 240, 0.95);
        color: #f22401;
        background: rgba(255, 255, 255, 0.97);
        box-shadow: 0 8px 22px rgba(15, 23, 42, 0.16);
        backdrop-filter: blur(12px);
    }

        .north-btn i {
            font-size: 1.2rem;
        }

    .home-map--trupps-collapsed .north-btn {
        bottom: calc(68px + env(safe-area-inset-bottom));
    }
}

@media (max-width: 420px) {
    .home-topbar {
        padding-right: 11px;
        padding-left: 11px;
    }

    .home-logout-button {
        min-height: 38px;
        padding: 0 9px;
        font-size: 0.82rem;
    }

    .layer-switch-card .map-switches-box {
        column-gap: 4px;
        padding-right: 8px;
        padding-left: 8px;
    }

    .layer-switch-card .form-check-label {
        font-size: 0.73rem;
    }
}

/* Map bleibt der Fokus: mobile Steuerungen werden erst bei Bedarf geöffnet. */
.mobile-map-actions,
.mobile-panel-close {
    display: none;
}

@media (max-width: 768px) {
    .event-info-card {
        top: 12px;
        right: auto;
        left: 12px;
        width: auto;
        max-width: calc(100% - 24px);
    }

        .event-info-card .map-switches-box {
            width: auto;
            max-width: 100%;
            padding: 7px 11px;
            border-radius: 12px;
            background: rgba(255, 255, 255, 0.86);
            box-shadow: 0 3px 12px rgba(15, 23, 42, 0.09);
            font-size: 0.8rem;
        }

            .event-info-card .map-switches-box > div:first-child,
            .event-info-card .map-switches-box .small {
                display: none;
            }

            .event-info-card .map-switches-box > div:nth-child(2) {
                overflow: hidden;
                max-width: 100%;
                color: #344054;
                font-weight: 700;
                text-overflow: ellipsis;
                white-space: nowrap;
            }

    .layer-switch-card {
        display: none;
        top: auto;
        right: 12px;
        bottom: calc(70px + env(safe-area-inset-bottom));
        left: auto;
        width: min(290px, calc(100% - 24px));
    }

        .layer-switch-card.mobile-open {
            display: block;
        }

        .layer-switch-card .map-switches-box {
            grid-template-columns: repeat(2, minmax(0, 1fr));
            padding: 7px 9px;
            border-radius: 15px;
            background: rgba(255, 255, 255, 0.96);
            box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
        }

        .layer-switch-card .form-check.form-switch {
            min-height: 38px;
        }

    .map-panel {
        display: none;
    }

        .map-panel.mobile-open,
        .map-panel.mobile-open.collapsed {
            display: flex;
            top: auto;
            right: 10px;
            bottom: max(10px, env(safe-area-inset-bottom));
            left: 10px;
            width: auto;
            min-width: 0;
            height: auto;
            min-height: 0;
            max-width: none;
            max-height: 42dvh;
            overflow: hidden;
            border: 1px solid rgba(226, 232, 240, 0.96);
            border-radius: 19px;
            background: rgba(255, 255, 255, 0.97);
            box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
            backdrop-filter: blur(14px);
        }

            .map-panel.mobile-open .map-panel__inner,
            .map-panel.mobile-open.collapsed .map-panel__inner {
                display: flex;
                max-height: 42dvh;
                opacity: 1;
            }

            .map-panel.mobile-open .map-panel__list {
                max-height: calc(42dvh - 58px);
                overflow-y: auto;
                overscroll-behavior: contain;
            }

            .map-panel.mobile-open .panel-toggle {
                display: none;
            }

    .mobile-panel-close {
        width: 36px;
        height: 36px;
        flex: 0 0 36px;
        display: inline-grid;
        place-items: center;
        border: 1px solid #e5e7eb;
        border-radius: 11px;
        color: #475467;
        background: #ffffff;
    }

    .mobile-map-actions {
        position: absolute;
        right: 12px;
        bottom: calc(12px + env(safe-area-inset-bottom));
        z-index: 2350;
        display: flex;
        align-items: center;
        gap: 8px;
        pointer-events: auto;
        transition: bottom 180ms ease;
    }

    .mobile-map-action {
        min-height: 42px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        padding: 0 13px;
        border: 1px solid rgba(226, 232, 240, 0.95);
        border-radius: 14px;
        color: #344054;
        background: rgba(255, 255, 255, 0.94);
        box-shadow: 0 5px 16px rgba(15, 23, 42, 0.12);
        backdrop-filter: blur(12px);
        font-size: 0.82rem;
        font-weight: 700;
    }

        .mobile-map-action i {
            color: #f22401;
            font-size: 1rem;
        }

        .mobile-map-action.active {
            border-color: rgba(242, 36, 1, 0.28);
            background: #fff7f5;
        }

    .north-btn {
        bottom: calc(12px + env(safe-area-inset-bottom));
        left: 12px;
        width: 44px;
        height: 44px;
        color: #f22401;
        background: rgba(255, 255, 255, 0.94);
        box-shadow: 0 5px 16px rgba(15, 23, 42, 0.12);
        backdrop-filter: blur(12px);
    }

    .home-map--mobile-trupps-open .mobile-map-actions,
    .home-map--mobile-trupps-open .north-btn {
        bottom: calc(42dvh + 18px + env(safe-area-inset-bottom));
    }
}

@media (max-width: 420px) {
    .mobile-map-action {
        min-height: 40px;
        gap: 6px;
        padding: 0 10px;
    }
}

@media (max-width: 768px) {
    .map-panel.mobile-open .map-panel__header {
        padding-right: 14px;
    }

        .map-panel.mobile-open .map-panel__header > div:first-child {
            flex: 1 1 auto;
            min-width: 0;
        }

    .map-panel.mobile-open .mobile-panel-close {
        flex: 0 0 38px;
        width: 38px;
        min-width: 38px;
        max-width: 38px;
        height: 38px;
        min-height: 38px;
        max-height: 38px;
        margin-left: auto;
        padding: 0;
        box-sizing: border-box;
        border-radius: 11px;
    }

        .map-panel.mobile-open .mobile-panel-close i {
            font-size: 0.9rem;
            line-height: 1;
        }
}

@media (max-width: 768px) {
    .app-shell--without-sidebar .home-app-shell {
        height: 100vh;
        height: 100dvh;
        min-height: 0;
    }

        .app-shell--without-sidebar .home-app-shell .home-map {
            flex: 1 1 0%;
            height: auto;
            min-height: 0;
            max-height: none;
        }
}

.map-editor-search {
    gap: 0;
    padding: 4px;
    border: 1px solid #d9e0ea;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.07);
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

    .map-editor-search:focus-within {
        border-color: rgba(242, 36, 1, 0.55);
        box-shadow: 0 0 0 3px rgba(242, 36, 1, 0.1), 0 6px 18px rgba(15, 23, 42, 0.08);
    }

    .map-editor-search .input-group-text {
        padding: 0 12px;
        border: 0;
        border-radius: 10px 0 0 10px;
        color: #f22401;
        background: transparent;
    }

    .map-editor-search .form-control {
        min-width: 0;
        min-height: 44px;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        color: #172033;
    }

        .map-editor-search .form-control:focus {
            border: 0;
            box-shadow: none;
        }

    .map-editor-search .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        min-width: 108px;
        border-radius: 10px !important;
        box-shadow: none;
    }

/* User ohne Sidebar: Logout und Branding auch auf Desktop sichtbar halten. */
@media (min-width: 769px) {
    .app-shell--without-sidebar .home-app-shell {
        display: flex;
        flex-direction: column;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        min-height: 0;
        overflow: hidden;
        background: #f6f7f9;
    }

    .app-shell--without-sidebar .home-topbar {
        position: relative;
        z-index: 3000;
        flex: 0 0 58px;
        min-height: 58px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        padding: 7px 20px;
        border-bottom: 1px solid rgba(226, 232, 240, 0.9);
        background: rgba(255, 255, 255, 0.97);
        box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
    }

    .app-shell--without-sidebar .home-map {
        flex: 1 1 0%;
        height: auto;
        min-height: 0;
        max-height: none;
    }
}

/* Logout als feste Kartenaktion; funktioniert auch ohne sichtbare Kopfzeile. */
.home-map-logout {
    position: absolute;
    left: 62px;
    bottom: 14px;
    z-index: 3200;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 14px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 14px;
    color: #344054;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.14);
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    pointer-events: auto;
}

    .home-map-logout i {
        color: #f22401;
        font-size: 1rem;
    }

    .home-map-logout:hover,
    .home-map-logout:focus-visible {
        color: #b42318;
        border-color: rgba(242, 36, 1, 0.35);
        background: #fff;
    }

@media (max-width: 768px) {
    .home-map-logout {
        left: 12px;
        bottom: calc(68px + env(safe-area-inset-bottom));
        min-height: 40px;
        padding: 0 12px;
        border-radius: 13px;
    }
}
