/* ============================================================
   app.css  –  Travel Planner
   Referenced via <link data-trunk rel="css" href="static/app.css">
   Trunk copies this file to dist/ with a content-hash filename
   and rewrites the <link> in index.html automatically.
   ============================================================ */

/* ── Reset / base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body, #app {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
    position: absolute;
    top: 0; left: 0;
    height: 100%;
    width: 300px;
    background: #fff;
    box-shadow: 2px 0 10px rgba(0, 0, 0, .12);
    z-index: 2000;
    overflow-y: auto;
    transition: transform .3s ease-in-out;
}
.sidebar.closed { transform: translateX(-100%); }
.sidebar-content { padding: 60px 20px 20px; }

/* ── Burger button ────────────────────────────────────────── */
.burger-btn {
    position: absolute;
    top: 15px; left: 15px;
    z-index: 2100;
    background: #fff;
    border: none;
    border-radius: 50%;
    width: 45px; height: 45px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: background .2s;
}
.burger-btn:hover { background: #f0f0f0; }

/* ── Search bar ───────────────────────────────────────────── */
.search-wrapper {
    position: absolute;
    top: 15px; right: 15px;
    z-index: 1000;
    width: 280px;
}
.search-container {
    background: #fff;
    border-radius: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,.2);
    display: flex;
    align-items: center;
    padding: 0 12px;
    height: 44px;
    gap: 8px;
}
.search-icon {
    color: #bbb;
    font-size: .9em;
    flex-shrink: 0;
}
.search-container input {
    border: none;
    flex: 1;
    outline: none;
    font-size: .95em;
    background: transparent;
    min-width: 0;
}
.search-dropdown {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,.15);
    list-style: none;
    padding: 4px 0;
    margin: 6px 0 0 0;
    overflow: hidden;
}
.search-suggestion {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    cursor: pointer;
    transition: background .12s;
    font-size: .88em;
}
.search-suggestion:hover { background: #f5f7fa; }
.sug-icon {
    width: 26px; height: 26px;
    border-radius: 50%;
    background: #e8f0fe;
    color: #007bff;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-size: .78em;
}
.sug-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #333;
}
.sug-pin-btn {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    padding: 4px 7px;
    border-radius: 6px;
    font-size: .85em;
    flex-shrink: 0;
    transition: color .12s, background .12s;
    line-height: 1;
}
.sug-pin-btn:hover {
    color: #007bff;
    background: rgba(0, 123, 255, .09);
}

/* ── Generic form helpers ─────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: .85em;
    color: #555;
}
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: .95em;
}
.form-group textarea { resize: vertical; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn-primary {
    background: #007bff;
    color: #fff;
    border: none;
    padding: 9px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background .2s;
}
.btn-primary:hover { background: #0056b3; }

.btn-secondary {
    background: #6c757d;
    color: #fff;
    border: none;
    padding: 9px 18px;
    border-radius: 6px;
    cursor: pointer;
    transition: background .2s;
}
.btn-secondary:hover { background: #5a6268; }

.btn-danger {
    background: #dc3545;
    color: #fff;
    border: none;
    padding: 9px 18px;
    border-radius: 6px;
    cursor: pointer;
    transition: background .2s;
}
.btn-danger:hover { background: #c82333; }

.btn-sm { padding: 5px 10px !important; font-size: .85em; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
button:active { transform: translateY(1px); }

/* ── Modal overlay ────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}
.modal-content {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    width: 90%;
    max-width: 440px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, .2);
}
.coords-hint { font-size: .8em; color: #999; margin: -8px 0 14px; }

/* ── Leaflet popup ────────────────────────────────────────── */
.leaflet-popup-content-wrapper {
    padding: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, .3);
}
.leaflet-popup-content { margin: 0; width: 620px !important; }

.popup-container {
    display: flex;
    flex-direction: column;
    min-height: 340px;
    width: 100%;
    overflow: hidden;
}
.popup-name-header {
    padding: 10px 16px;
    font-size: 1em;
    font-weight: 700;
    line-height: 1.35;
    word-break: break-word;
    flex-shrink: 0;
}
.popup-body {
    display: flex;
    flex: 1;
    min-height: 0;
}
.popup-info {
    flex: 0 0 55%;
    padding: 18px;
    border-right: 1px solid #eee;
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
}
.popup-media {
    flex: 0 0 45%;
    padding: 18px;
    background: #fdfdfd;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-height: 500px;
    overflow: hidden;
    min-width: 0;
}
.popup-form .form-group { margin-bottom: 10px; }
.popup-form label {
    font-size: .7em;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #aaa;
    margin-bottom: 2px;
}
.field-value {
    font-size: .95em;
    color: #333;
    word-break: break-word;
    min-height: 1.2em;
}
.popup-actions {
    margin-top: 18px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.popup-actions button {
    padding: 5px 11px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    font-size: .85em;
    transition: background .15s;
}
.popup-actions button:hover { background: #f5f5f5; }
.popup-actions .btn-primary  { background: #007bff; color: #fff; border-color: #007bff; }
.popup-actions .btn-secondary { background: #6c757d; color: #fff; border-color: #6c757d; }

/* slideshow */
.slide-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}
.slideshow-img {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .1);
}
.slide-nav {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.nav-btn {
    background: #eee;
    border: none;
    border-radius: 50%;
    width: 30px; height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}
.nav-btn:hover { background: #ddd; }

/* attachments */
.attach-list {
    max-height: 100px;
    overflow-y: auto;
    background: #f9f9f9;
    padding: 5px;
    border-radius: 4px;
    border: 1px solid #eee;
}
.attach-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: .88em;
}
.attach-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin-right: 8px;
}

/* ── Color picker circle ──────────────────────────────────── */
.color-picker-circle {
    -webkit-appearance: none;
    appearance: none;
    width: 32px !important;
    height: 32px !important;
    border: none !important;
    cursor: pointer;
    padding: 0 !important;
    border-radius: 50%;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
    background: transparent;
}
.color-picker-circle::-webkit-color-swatch-wrapper { padding: 0; }
.color-picker-circle::-webkit-color-swatch { border: 2px solid #ddd; border-radius: 50%; }
.color-picker-circle::-moz-color-swatch { border: 2px solid #ddd; border-radius: 50%; }

/* ── Sidebar sections ─────────────────────────────────────── */
.section { margin-bottom: 18px; }

.section-icon { margin-right: 8px; color: #007bff; }

.your-pins-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 11px 13px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    font-weight: 600;
    transition: background .15s, border-color .15s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
    color: #333;
    user-select: none;
}
.your-pins-header:hover { background: #f8f9fa; }
.your-pins-header.expanded {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    background: #f8f9fa;
    margin-bottom: 0;
    border-bottom-color: transparent;
}

.pins-list {
    list-style: none;
    margin: 0 0 4px;
    padding: 0;
    max-height: 240px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-top: none;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    background: #fff;
}
.your-pin-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 14px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: background .15s;
}
.your-pin-item:last-child { border-bottom: none; }
.your-pin-item:hover { background: #f0f7ff; }

.your-pin-icon-circle {
    width: 28px; height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    flex-shrink: 0;
}
.your-pin-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .92em;
    color: #333;
}
.pin-meta { font-size: .82em; color: #aaa; }

.user-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 14px;
    background: #fdfdfd;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    font-size: .9em;
    color: #444;
    user-select: none;
}
.user-group-header:hover { background: #f0f7ff; }

/* ── Filter section ───────────────────────────────────────── */
.filter-section {
    padding: 14px;
    border: 1px solid #eee;
    border-top: none;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    background: #fff;
}
.filter-group { margin-bottom: 14px; }
.filter-group:last-child { margin-bottom: 0; }
.filter-group-title {
    font-size: .72em;
    text-transform: uppercase;
    color: #aaa;
    margin: 0 0 8px;
    letter-spacing: .8px;
    font-weight: 700;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 4px;
}
.filter-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 0;
    font-size: .88em;
    cursor: pointer;
    color: #555;
    user-select: none;
}
.filter-item:hover { color: #007bff; }
.filter-item input[type="checkbox"] { width: 15px; height: 15px; cursor: pointer; }

/* ── Auth / user boxes ────────────────────────────────────── */
.auth-box,
.user-box {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 18px;
}
.auth-box h3,
.user-box h3 { margin-top: 0; }

.feedback {
    padding: 9px 12px;
    border-radius: 6px;
    font-size: .88em;
    margin-bottom: 12px;
    border: 1px solid;
}
.feedback.error   { background: #f8d7da; color: #721c24; border-color: #f5c6cb; }
.feedback.success { background: #d4edda; color: #155724; border-color: #c3e6cb; }

/* ── Admin panel ──────────────────────────────────────────── */
.admin-panel {
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: 4000;
    overflow-y: auto;
    padding: 20px;
}
.admin-inner { max-width: 1200px; margin: 0 auto; }
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.admin-header h1 { margin: 0; }

.admin-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.admin-table th {
    text-align: left;
    padding: 10px;
    border-bottom: 2px solid #eee;
    font-size: .88em;
    color: #555;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.admin-table td { padding: 10px; border-bottom: 1px solid #eee; }
.action-cell { display: flex; gap: 8px; align-items: center; }

.alert {
    padding: 13px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    border: 1px solid;
    font-size: .92em;
}
.alert-error   { background: #f8d7da; color: #721c24; border-color: #f5c6cb; }
.alert-success { background: #d4edda; color: #155724; border-color: #c3e6cb; }

/* ── Leaflet custom marker (strip default chrome) ─────────── */
.custom-marker {
    background: none !important;
    border: none !important;
    padding: 0 !important;
}

/* ── Star ratings ─────────────────────────────────────────── */
.stars { display: inline-flex; gap: 3px; color: #f59e0b; }
.star-btn { cursor: pointer; transition: transform .1s; }
.star-btn:hover { transform: scale(1.2); }

/* ── Sidebar badges & role pills ──────────────────────────────────────────── */
.sidebar-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    font-size: .72em;
    font-weight: 600;
    background: var(--badge-bg, #e8f0fe);
    color: var(--badge-text, #1a73e8);
    margin-left: 6px;
    vertical-align: middle;
}

.user-box-name {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.user-box-name span {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.role-badge {
    display: inline-block;
    font-size: .72em;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 10px;
    letter-spacing: .3px;
}
.role-admin    { background: #fee2e2; color: #991b1b; }
.role-traveler { background: #d1fae5; color: #065f46; }
.role-user     { background: #e0e7ff; color: #3730a3; }

/* ── Route Builder modal ──────────────────────────────────────────────────── */
.route-builder {
    max-width: 540px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
}

.route-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 10px;
    align-items: end;
    margin-bottom: 14px;
}
.route-meta-grid .form-group { margin-bottom: 0; }

/* stop tabs */
.stop-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #eee;
}
.stop-tab {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: .82em;
    color: #555;
    transition: all .15s;
    white-space: nowrap;
}
.stop-tab:hover { background: #f0f7ff; border-color: #007bff; color: #007bff; }
.stop-tab.active {
    background: #007bff;
    border-color: #007bff;
    color: #fff;
    font-weight: 600;
}
.stop-tab-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(0,0,0,.12);
    font-size: .85em;
    font-weight: 700;
}
.stop-tab.active .stop-tab-num { background: rgba(255,255,255,.25); }

.stop-tab-del {
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    font-size: 1em;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 4px;
    transition: color .15s, background .15s;
}
.stop-tab-del:hover { color: #dc3545; background: #fee2e2; }

/* stop editor */
.stop-editor {
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 14px;
}
.stop-coords {
    font-size: .8em;
    color: #888;
    margin-bottom: 12px;
    font-family: monospace;
}

/* train fields */
.train-fields {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 6px;
    padding: 12px;
    margin-top: 10px;
}

.price-row {
    display: flex;
    gap: 10px;
    align-items: end;
}

.route-builder-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.stop-count {
    font-size: .85em;
    color: #666;
}

/* ── Route bottom bar ────────────────────────────────────────────────────── */
.route-bottom-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: rgba(255, 255, 255, .97);
    backdrop-filter: blur(8px);
    border-top: 1px solid #e0e0e0;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    z-index: 2500;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, .1);
}
.route-bottom-left {
    display: flex;
    align-items: center;
    gap: 0;
    font-size: .92em;
    color: #333;
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.route-bottom-count { color: #555; }
.route-bottom-hint  { color: #007bff; font-size: .85em; }

/* ── Route stop list in details overlay ─────────────────────────────────── */
.route-stops-list {
    margin-bottom: 14px;
}
.route-stop-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border: 1px solid #eee;
    border-radius: 7px;
    margin-bottom: 5px;
    cursor: pointer;
    background: #fff;
    transition: background .15s, border-color .15s;
    user-select: none;
}
.route-stop-row:hover    { background: #f0f7ff; border-color: #b3d4ff; }
.route-stop-row.active   { background: #e8f0fe; border-color: #007bff; }
.route-stop-row[draggable="true"] { cursor: grab; }
.route-stop-num {
    min-width: 22px;
    height: 22px;
    border-radius: 50%;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.route-stop-name {
    flex: 1;
    font-size: .88em;
    font-weight: 600;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.route-stop-coords {
    font-size: .75em;
    color: #aaa;
    font-family: monospace;
    flex-shrink: 0;
}

/* ── "More options" toggle in PinForm ───────────────────────────────────── */
.btn-more-toggle {
    width: 100%;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 7px 12px;
    margin: 4px 0 10px;
    cursor: pointer;
    font-size: .85em;
    color: #555;
    text-align: left;
    transition: background .15s;
}
.btn-more-toggle:hover { background: #eef0f2; }

/* ── Sidebar backdrop (tap-to-close on mobile) ───────────────────────────── */
.sidebar-backdrop {
    display: none; /* hidden on desktop */
}

/* ── Responsive / Mobile ─────────────────────────────────────────────────── */
@media (max-width: 640px) {

    /* 1 · Sidebar: full-screen overlay */
    .sidebar { width: 100%; }
    .sidebar-content {
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }

    /* 2 · Backdrop: semi-transparent overlay behind open sidebar */
    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, .35);
        z-index: 1999; /* below sidebar (2000), above map */
    }

    /* 3 · Search bar: stays top-right, slightly narrower */
    .search-wrapper { width: 200px; }
    .search-container input { font-size: .9em; }

    /* 4 · Touch targets: minimum 44 px height for comfortable tapping */
    .your-pins-header  { min-height: 44px; }
    .your-pin-item     { min-height: 44px; padding: 10px 14px; }
    .user-group-header { min-height: 44px; }
    .filter-item       { min-height: 40px; padding: 8px 0; }
    .btn-sm            { min-height: 36px; padding: 7px 12px !important; }

    /* 5 · iOS auto-zoom fix: inputs < 16 px trigger unwanted zoom */
    .form-group input,
    .form-group textarea,
    .form-group select { font-size: 16px; }

    /* 6 · Modals: bottom sheet instead of centred dialog */
    .modal-overlay { align-items: flex-end; }
    .modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 90vh;
        overflow-y: auto;
        border-radius: 16px 16px 0 0;
        padding: 20px 16px max(28px, env(safe-area-inset-bottom));
    }

    /* 6b · Profile modal: bottom sheet on mobile */
    .profile-modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 88vh;
        border-radius: 16px 16px 0 0;
    }
    .profile-header { padding: 18px 16px 14px; }
    .profile-body   { padding: 14px 16px 20px; }
    .profile-avatar { width: 44px; height: 44px; font-size: 1.1em; }
    .profile-username { font-size: 1.05em; }

    /* 7 · Route bottom bar: safe-area + allow button wrap on tiny screens */
    .route-bottom-bar {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px 16px max(12px, env(safe-area-inset-bottom));
    }
    .route-bottom-left { font-size: .85em; }

    /* 8 · Route builder: single column, scrollable stop tabs */
    .route-meta-grid { grid-template-columns: 1fr; }
    .stop-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .price-row { flex-direction: column; }

    /* 9 · Leaflet popup: stack info + media vertically */
    .leaflet-popup-content {
        width: auto !important;
        min-width: 280px !important;
        max-width: calc(100vw - 40px) !important;
    }
    .popup-body { flex-direction: column; }
    .popup-info {
        flex: none;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #eee;
        max-height: 260px;
    }
    .popup-media {
        flex: none;
        width: 100%;
        max-height: 160px;
    }

    /* 10 · Admin panel: scrollable table, stacked header */
    .admin-inner { overflow-x: auto; }
    .admin-table { font-size: .82em; min-width: 500px; }
    .admin-header { flex-direction: column; align-items: flex-start; gap: 12px; }
}

/* ── Map: Vollbild (Standard) ──────────────────────────────── */
.map-fullscreen {
    position: absolute;
    inset: 0;
    z-index: 0;
}

/* ── Minimap: schwebendes Fenster unten rechts ─────────────── */
.minimap {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 320px;
    height: 240px;
    min-width: 180px;
    min-height: 140px;
    max-width: 60vw;
    max-height: 55vh;
    z-index: 1900;
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .35);
    overflow: hidden;
    resize: both;
}

/* Drag-Handle-Balken (wird per JS in den #map-Container injiziert) */
#minimap-drag-handle {
    display: none;
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 26px;
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    padding: 0 8px;
    cursor: grab;
    user-select: none;
    border-bottom: 1px solid #ddd;
}
#minimap-drag-handle:active { cursor: grabbing; }

/* Handle nur im Minimap-Modus einblenden */
.minimap #minimap-drag-handle { display: flex; }

/* Reset-Button im Drag-Handle */
#minimap-reset-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: .75em;
    color: #888;
    padding: 2px 5px;
    border-radius: 4px;
    line-height: 1;
    flex-shrink: 0;
    transition: color .15s, background .15s;
}
#minimap-reset-btn:hover { color: #333; background: rgba(0,0,0,.06); }

#minimap-grip-label { display: flex; align-items: center; flex: 1; }

/* ── Planner-Seite ─────────────────────────────────────────── */
.planner-page {
    position: absolute;
    inset: 0;
    z-index: 200;
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
}

.planner-topbar {
    display: flex;
    align-items: center;
    padding: 0 20px;
    height: 54px;
    background: #fff;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .1);
    z-index: 1;
    flex-shrink: 0;
}

.planner-title {
    font-size: 1.05em;
    font-weight: 600;
    color: #333;
    flex: 1;
}

.planner-title i { color: #3b82f6; margin-right: 6px; }

.planner-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2em;
    color: #888;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background .15s, color .15s;
}
.planner-close-btn:hover { background: #f0f0f0; color: #333; }

.planner-body {
    flex: 1;
    overflow: auto;
    padding: 24px;
}

/* ── Sidebar: Planner-Navigationsbutton ────────────────────── */
.planner-nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 8px 0 4px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: .9em;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .15s, transform .1s;
}
.planner-nav-btn:hover { opacity: .9; }
.planner-nav-btn:active { transform: scale(.98); }

/* ── Planner: Collapsible section ──────────────────────────── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    transition: background .15s, border-color .15s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
}
.section-header:hover { background: #f8f9fa; }

.section-title {
    font-size: .95em;
    font-weight: 600;
    color: #333;
}

.arrow {
    font-size: .7em;
    color: #aaa;
    display: inline-block;
    transition: transform .2s ease;
}
.arrow.open { transform: rotate(90deg); }

.section-body {
    border: 1px solid #e5e7eb;
    border-top: none;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    background: #fff;
    padding: 12px 14px;
}

/* ── Activity list ─────────────────────────────────────────── */
.planner-empty {
    color: #aaa;
    font-size: .88em;
    text-align: center;
    padding: 20px 0;
    margin: 0;
}

.activity-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.activity-item {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
    transition: box-shadow .15s, border-color .15s;
    display: flex;
    flex-direction: column;
}
.activity-card-header {
    padding: 9px 14px;
    font-size: .95em;
    font-weight: 700;
    line-height: 1.3;
    word-break: break-word;
    flex-shrink: 0;
}
.activity-card-body {
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.activity-item:hover {
    box-shadow: 0 3px 10px rgba(0, 0, 0, .1);
    border-color: #c7d2fe;
}

.activity-date {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .78em;
    font-weight: 700;
    color: #2563eb;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 20px;
    padding: 2px 10px;
    align-self: flex-start;
    letter-spacing: .2px;
}

.activity-name {
    font-size: .97em;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.35;
}

.activity-location {
    font-size: .84em;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 5px;
}
.activity-location i { color: #ef4444; font-size: .85em; }

.activity-desc {
    font-size: .85em;
    color: #4b5563;
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.activity-meta {
    font-size: .78em;
    color: #9ca3af;
    padding-top: 3px;
    border-top: 1px solid #f3f4f6;
    margin-top: 4px;
}

/* ── Planner: Add-Button ───────────────────────────────────── */
.planner-add-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    padding: 11px 16px;
    margin-top: 18px;
    margin-bottom: 6px;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: .9em;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, transform .1s;
}
.planner-add-btn:hover  { background: #2563eb; }
.planner-add-btn:active { transform: scale(.98); }
.planner-add-btn i      { font-size: .85em; }

/* ── Activity: actions (edit / delete) ─────────────────────── */
.activity-actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}
.activity-actions .btn-sm {
    padding: 4px 9px;
    font-size: .78em;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: opacity .15s;
}
.activity-actions .btn-sm:hover { opacity: .82; }

/* ── Activity: verknüpfte Pin-Chips ────────────────────────── */
.activity-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 5px;
}
.activity-pin-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 9px;
    font-size: .76em;
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
    border-radius: 99px;
    cursor: pointer;
    transition: background .15s, color .15s;
    white-space: nowrap;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.activity-pin-chip:hover {
    background: #2563eb;
    color: #fff;
}

/* ── Activity: Teilnehmer-Chips ─────────────────────────────── */
.activity-participants {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 5px;
}

/* ── Activity: Creator-Button (klickbar) ────────────────────── */
.activity-creator-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
    color: #6b7280;
    cursor: pointer;
    text-decoration: underline dotted;
    text-underline-offset: 2px;
}
.activity-creator-btn:hover { color: #2563eb; }

/* ── Activity form: two-column row ─────────────────────────── */
.activity-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.activity-form-row .form-group { margin-bottom: 0; }

/* ── Checkbox group (pins / participants) ───────────────────── */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 160px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 8px 10px;
    background: #fafafa;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .88em;
    color: #374151;
    padding: 3px 4px;
    border-radius: 4px;
    cursor: pointer;
    transition: background .12s;
    user-select: none;
}
.checkbox-label:hover { background: #f0f4ff; }
.checkbox-label input[type="checkbox"] {
    accent-color: #3b82f6;
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    cursor: pointer;
}

/* ── Form error message ─────────────────────────────────────── */
.form-error {
    color: #dc2626;
    font-size: .83em;
    margin: 6px 0 10px;
    padding: 7px 10px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 5px;
}

/* ── Todo list & Post-it Grid ───────────────────────────────── */
.todo-list {
    display: flex;
    flex-direction: column;
}

/* ── Post-it grid ───────────────────────────────────────────── */
.todo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
    gap: 11px;
    margin-bottom: 6px;
}

/* ── Post-it card ───────────────────────────────────────────── */
.todo-card {
    background: linear-gradient(145deg, #fdf4ff 0%, #f5f0ff 100%);
    border: 1px solid #e9d5ff;
    border-radius: 13px;
    padding: 11px 12px 10px;
    box-shadow: 0 2px 7px rgba(109, 40, 217, .09), 0 1px 2px rgba(0,0,0,.04);
    transition: transform .14s ease, box-shadow .14s ease;
    min-height: 110px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.todo-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 18px rgba(109, 40, 217, .15);
}

.todo-card--done {
    opacity: .6;
    background: #f5f3ff;
    transform: none !important;
    box-shadow: none !important;
}
.todo-card--done .todo-card-title {
    text-decoration: line-through;
    color: #9ca3af;
}

.todo-card--editing {
    background: #ede9fe;
    border-color: #a78bfa;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, .18);
    transform: none;
}

/* ── Card header row ────────────────────────────────────────── */
.todo-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    min-height: 24px;
}

.todo-checkbox {
    accent-color: #7c3aed;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    cursor: pointer;
}

/* ── Card action buttons (show on hover) ────────────────────── */
.todo-card-actions {
    display: flex;
    gap: 3px;
    opacity: 0;
    transition: opacity .15s;
    margin-left: auto;
}
.todo-card:hover .todo-card-actions { opacity: 1; }
.todo-card-actions .btn-sm {
    padding: 3px 7px;
    font-size: .74em;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: opacity .15s;
}
.todo-card-actions .btn-sm:hover { opacity: .8; }

/* ── Card title ─────────────────────────────────────────────── */
.todo-card-title {
    font-size: .91em;
    font-weight: 600;
    color: #2e1065;
    flex: 1;
    margin: 2px 0 0;
    word-break: break-word;
    line-height: 1.38;
}

/* ── Card footer (due date + user chips) ────────────────────── */
.todo-card-footer {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 5px;
}

.todo-card-due {
    font-size: .7em;
    font-weight: 600;
    color: #6d28d9;
    background: #ede9fe;
    padding: 2px 7px;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
}
.todo-card-due--overdue {
    color: #92400e;
    background: #fef3c7;
}

.todo-card-users {
    display: flex;
    gap: 2px;
    flex-wrap: wrap;
    margin-left: auto;
}

/* ── User avatar chip ───────────────────────────────────────── */
.todo-user-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    color: #fff;
    font-size: .63em;
    font-weight: 700;
    letter-spacing: .02em;
    flex-shrink: 0;
    cursor: default;
    box-shadow: 0 1px 4px rgba(109, 40, 217, .28);
    user-select: none;
}
.todo-user-chip--sm {
    width: 21px;
    height: 21px;
    font-size: .58em;
}

/* ── Edit form inside card ──────────────────────────────────── */
.todo-card-edit-form {
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.todo-card-edit-title {
    border: none;
    border-bottom: 2px solid #7c3aed;
    background: transparent;
    font-size: .94em;
    font-weight: 600;
    color: #2e1065;
    outline: none;
    padding: 3px 4px;
    width: 100%;
}
.todo-card-edit-label {
    font-size: .73em;
    font-weight: 600;
    color: #6d28d9;
    margin-top: 2px;
}
.todo-card-edit-due {
    border: 1.5px solid #ddd6fe;
    border-radius: 6px;
    padding: 5px 8px;
    font-size: .8em;
    color: #2e1065;
    background: #faf5ff;
    outline: none;
    width: 100%;
}
.todo-card-edit-due:focus { border-color: #7c3aed; }

.todo-card-user-checks {
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-height: 130px;
    overflow-y: auto;
    padding-right: 2px;
}
.todo-user-check {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}
.todo-user-check input[type="checkbox"] {
    accent-color: #7c3aed;
    width: 13px;
    height: 13px;
    cursor: pointer;
    flex-shrink: 0;
}
.todo-user-name {
    font-size: .8em;
    color: #4c1d95;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}
.todo-card-edit-actions {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}
.todo-card-edit-actions .btn-sm {
    padding: 5px 11px;
    font-size: .78em;
    border-radius: 6px;
    border: none;
    cursor: pointer;
}

/* ── Add card (expanded form) ───────────────────────────────── */
.todo-add-card {
    background: #faf5ff;
    border: 2px dashed #c4b5fd;
    border-radius: 13px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}
.todo-add-card .todo-add-input {
    border: 1.5px solid #e9d5ff;
    border-radius: 8px;
    padding: 9px 13px;
    font-size: .9em;
    color: #2e1065;
    background: #fff;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    width: 100%;
    box-sizing: border-box;
}
.todo-add-card .todo-add-input:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, .12);
}
.todo-add-card .todo-add-input::placeholder { color: #c4b5fd; }

.todo-add-row {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
}
.todo-add-row--users {
    align-items: flex-start;
}
.todo-add-extra-label {
    font-size: .77em;
    font-weight: 600;
    color: #6d28d9;
    white-space: nowrap;
    flex-shrink: 0;
    padding-top: 1px;
}
.todo-add-due {
    border: 1.5px solid #ddd6fe;
    border-radius: 6px;
    padding: 5px 8px;
    font-size: .82em;
    color: #2e1065;
    background: #fff;
    outline: none;
    flex: 1;
    min-width: 130px;
}
.todo-add-due:focus { border-color: #7c3aed; }

.todo-add-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}
.todo-add-buttons .btn-primary {
    background: #7c3aed;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: .88em;
}
.todo-add-buttons .btn-primary:hover    { background: #6d28d9; }
.todo-add-buttons .btn-primary:disabled { background: #c4b5fd; cursor: default; }
.todo-add-buttons .btn-secondary {
    padding: 8px 12px;
    font-size: .88em;
    border-radius: 8px;
}

/* ── Profile: open button (sidebar) ────────────────────────── */
.profile-open-btn {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 8px 10px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: background .15s;
    font-size: .93em;
    font-weight: 600;
    color: #374151;
}
.profile-open-btn:hover { background: #f0f4ff; }

/* ── Profile: modal override ────────────────────────────────── */
.profile-modal-content {
    max-width: 520px;
    width: 92%;
    max-height: calc(100vh - 60px);
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ── Profile: header ────────────────────────────────────────── */
.profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 24px 18px;
    background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}
.profile-header-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* ── Profile: avatar ────────────────────────────────────────── */
.profile-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35em;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
    letter-spacing: .5px;
    user-select: none;
}

/* ── Profile: username ──────────────────────────────────────── */
.profile-username {
    font-size: 1.2em;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -.2px;
    line-height: 1.2;
}
.profile-username small {
    display: block;
    font-size: .68em;
    font-weight: 500;
    color: #6b7280;
    letter-spacing: 0;
    margin-top: 2px;
}

/* ── Profile: close button ──────────────────────────────────── */
.profile-close-btn {
    background: rgba(0, 0, 0, .06);
    border: none;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1em;
    color: #6b7280;
    transition: background .15s, color .15s;
    flex-shrink: 0;
}
.profile-close-btn:hover {
    background: rgba(0, 0, 0, .13);
    color: #1e293b;
}

/* ── Profile: scrollable body ───────────────────────────────── */
.profile-body {
    padding: 18px 24px 22px;
    overflow-y: auto;
    flex: 1;
}

/* ── Profile: pin item ──────────────────────────────────────── */
.profile-pin-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #fafbfc;
    border: 1px solid #e5e7eb;
    margin-bottom: 6px;
    transition: background .12s, border-color .12s;
    font-size: .88em;
}
.profile-pin-item:hover {
    background: #f0f7ff;
    border-color: #bfdbfe;
}
.profile-pin-item .pin-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.profile-pin-item .pin-name {
    flex: 1;
    font-weight: 600;
    color: #1e293b;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.profile-pin-item .pin-category {
    font-size: .8em;
    color: #6b7280;
    background: #f3f4f6;
    border-radius: 5px;
    padding: 1px 7px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Profile: todo item ─────────────────────────────────────── */
.profile-todo-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #faf5ff;
    border: 1px solid #e9d5ff;
    margin-bottom: 6px;
    font-size: .88em;
    transition: background .12s, border-color .12s;
}
.profile-todo-item:hover {
    background: #f3e8ff;
    border-color: #c4b5fd;
}
.profile-todo-item .todo-check-icon {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 2px solid #a78bfa;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .7em;
    color: transparent;
    background: transparent;
}
.profile-todo-item.done .todo-check-icon {
    background: #7c3aed;
    border-color: #7c3aed;
    color: #fff;
}
.profile-todo-item .todo-label {
    flex: 1;
    font-weight: 500;
    color: #2e1065;
    min-width: 0;
    word-break: break-word;
}
.profile-todo-item.done {
    opacity: .72;
    background: #f5f3ff;
    border-color: #ede9fe;
}
.profile-todo-item.done .todo-label {
    text-decoration: line-through;
    color: #9ca3af;
}

/* ── Planner: responsive ───────────────────────────────────── */
@media (max-width: 640px) {
    .planner-body          { padding: 14px; }
    .activity-item         { padding: 11px 13px; }
    .activity-name         { font-size: .92em; }
    .activity-form-row     { grid-template-columns: 1fr; gap: 0; }
    .planner-add-btn       { font-size: .85em; padding: 9px 14px; margin-top: 14px; }
    .todo-grid             { grid-template-columns: 1fr 1fr; }
    .todo-add-card         { padding: 11px; }
}

@media (max-width: 480px) {
    .todo-grid             { grid-template-columns: 1fr; }
}

/* ── Stop-Suche im RouteForm ─────────────────────────────── */
.stop-search-dropdown {
    list-style: none;
    margin: 4px 0 0 0;
    padding: 0;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,.10);
    overflow: hidden;
    max-height: 200px;
    overflow-y: auto;
}
.stop-search-item {
    padding: 9px 14px;
    font-size: .85em;
    color: #374151;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background .12s;
    border-bottom: 1px solid #f3f4f6;
}
.stop-search-item:last-child { border-bottom: none; }
.stop-search-item:hover { background: #f0f4ff; }

/* ── POI-Panel ────────────────────────────────────────────── */
.poi-panel {
    position: absolute;
    top: 0; left: 0;
    height: 100%;
    width: 300px;
    background: #fff;
    box-shadow: 2px 0 10px rgba(0,0,0,.12);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.poi-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(135deg, #e65c00, #f9a825);
    color: #fff;
    font-weight: 700;
    font-size: .95em;
    flex-shrink: 0;
}

.poi-close-btn {
    background: rgba(255,255,255,.2);
    border: none;
    border-radius: 50%;
    width: 30px; height: 30px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background .15s;
}
.poi-close-btn:hover { background: rgba(255,255,255,.35); }

.poi-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px 20px;
}

.poi-section {
    margin-bottom: 14px;
}

.poi-section-label {
    font-size: .78em;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 7px;
}

.poi-cat-item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: .88em;
    color: #444;
    transition: background .1s;
    user-select: none;
}
.poi-cat-item:hover { background: #fff3e0; }
.poi-cat-item.poi-cat-selected { background: #fff3e0; color: #c45200; font-weight: 600; }
.poi-cat-item input[type="checkbox"] { accent-color: #e65c00; width: 14px; height: 14px; }

.poi-radius-slider {
    width: 100%;
    accent-color: #e65c00;
    margin: 4px 0;
}

.poi-radius-ticks {
    display: flex;
    justify-content: space-between;
    font-size: .72em;
    color: #aaa;
    margin-top: 2px;
}

.poi-search-btn {
    width: 100%;
    padding: 9px 0;
    background: #e65c00;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: .9em;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background .15s;
    margin-bottom: 10px;
}
.poi-search-btn:hover:not(:disabled) { background: #c45200; }
.poi-search-btn:disabled { opacity: .55; cursor: not-allowed; }

.poi-error {
    background: #fff0f0;
    border: 1px solid #ffcdd2;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: .82em;
    color: #c62828;
    margin-bottom: 10px;
}

.poi-empty {
    text-align: center;
    color: #bbb;
    padding: 20px 10px;
    font-size: .85em;
}

.poi-results-count {
    font-size: .75em;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid #f0f0f0;
}

.poi-result-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 6px;
    border-radius: 6px;
    transition: background .1s;
}
.poi-result-item:hover { background: #fff8f0; }

.poi-result-thumb {
    width: 46px;
    height: 46px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    border: 1px solid #ffe0b2;
}

.poi-result-info { flex: 1; min-width: 0; }

.poi-result-name {
    font-size: .87em;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.poi-result-romaji {
    font-size: .78em;
    color: #c45200;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.poi-result-addr {
    font-size: .76em;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.poi-save-btn {
    flex-shrink: 0;
    background: #fff3e0;
    border: 1px solid #ffcc80;
    border-radius: 6px;
    color: #e65c00;
    width: 30px; height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    transition: background .12s;
}
.poi-save-btn:hover { background: #ffe0b2; border-color: #e65c00; }

/* Temp-Marker gestrichelte Umrandung via SVG-Klasse */
.poi-temp-marker path {
    stroke-dasharray: 5 4;
}

@media (max-width: 480px) {
    .poi-panel { width: 100%; }
}

/* ── Pin-Links Editor (PinForm + Popup Edit-Modus) ───────────────────────── */
.pin-links-editor {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}
.pin-link-row {
    display: flex;
    gap: 6px;
    align-items: center;
}
.pin-link-label {
    width: 30%;
    min-width: 80px;
    padding: 6px 8px;
    border: 1px solid #d0d0d0;
    border-radius: 5px;
    font-size: .85em;
    color: #333;
    background: #fff;
    transition: border-color .15s;
}
.pin-link-label:focus {
    outline: none;
    border-color: #3388ff;
}
.pin-link-url {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid #d0d0d0;
    border-radius: 5px;
    font-size: .85em;
    color: #333;
    background: #fff;
    transition: border-color .15s;
}
.pin-link-url:focus {
    outline: none;
    border-color: #3388ff;
}
.pin-link-rm {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    background: #fff;
    color: #aaa;
    font-size: 1em;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.pin-link-rm:hover {
    background: #fdecea;
    border-color: #e63946;
    color: #e63946;
}
.pin-link-add {
    width: 100%;
    padding: 6px 10px;
    border: 1px dashed #aaa;
    border-radius: 5px;
    background: transparent;
    color: #555;
    font-size: .85em;
    cursor: pointer;
    text-align: center;
    transition: border-color .15s, background .15s, color .15s;
}
.pin-link-add:hover {
    border-color: #3388ff;
    background: #f0f6ff;
    color: #3388ff;
}

/* ── Pin-Links View (Popup Ansichtsmodus) ────────────────────────────────── */
.pin-links-view {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}
.pin-link-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    background: #eef4ff;
    border: 1px solid #c5d8ff;
    color: #3388ff;
    font-size: .8em;
    font-weight: 500;
    text-decoration: none;
    transition: background .15s, border-color .15s;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pin-link-item:hover {
    background: #d9eaff;
    border-color: #3388ff;
    text-decoration: none;
}

/* ── Travel Segments ─────────────────────────────────────────────────────── */

/* Sidebar filter list – matches .filter-group / .filter-item spacing */
.segment-section-body {
    padding: 6px 0 2px;
}
.segment-filter-list {
    display: flex;
    flex-direction: column;
    margin-bottom: 6px;
}
.segment-filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;          /* same as .filter-item */
    font-size: .88em;
    cursor: pointer;
    color: #555;
    user-select: none;
}
.segment-filter-row:hover .segment-filter-name { color: #007bff; }
.segment-filter-row.disabled {
    opacity: .45;
}
.segment-filter-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid rgba(0,0,0,.12);
    background: none;
    padding: 0;
    cursor: pointer;
}
.segment-filter-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color .15s;
}
.segment-filter-dates {
    font-size: .78em;
    color: #aaa;
    white-space: nowrap;
}
.segment-edit-btn,
.segment-del-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #aaa;
    padding: 2px 4px;
    border-radius: 4px;
    font-size: .82em;
    transition: color .15s, background .15s;
    flex-shrink: 0;
}
.segment-edit-btn:hover { color: #3388ff; background: #eef4ff; }
.segment-del-btn:hover  { color: #e63946; background: #fff0f1; }

/* ── Abschnittsfarben-Toggle ─────────────────────────────────────────────── */
.segment-color-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0 8px;
    margin-bottom: 4px;
    border-bottom: 1px solid #f0f0f0;
}
.segment-color-toggle-label {
    font-size: .82em;
    color: #555;
    font-weight: 500;
}
.toggle-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 24px;
    padding: 0 10px;
    border-radius: 12px;
    border: 1.5px solid #d1d5db;
    background: #f3f4f6;
    color: #9ca3af;
    font-size: .73em;
    font-weight: 700;
    letter-spacing: .04em;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
    user-select: none;
}
.toggle-pill:hover { border-color: #3388ff; color: #3388ff; }
.toggle-pill.on {
    background: #3388ff;
    border-color: #3388ff;
    color: #fff;
}
.toggle-pill.on:hover { background: #1a75ff; border-color: #1a75ff; }

/* Segment create/edit form in sidebar */
.segment-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
    box-sizing: border-box;
}
.segment-form-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #d0d8e8;
    border-radius: 6px;
    font-size: .88em;
    box-sizing: border-box;
}
.segment-form-input:focus {
    outline: none;
    border-color: #3388ff;
    box-shadow: 0 0 0 2px rgba(51,136,255,.15);
}
.segment-form-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.segment-form-date {
    flex: 1;
    min-width: 0;
    padding: 5px 6px;
    border: 1px solid #d0d8e8;
    border-radius: 6px;
    font-size: .8em;
    box-sizing: border-box;
    width: 0;               /* forces flex shrink to work properly */
}
.segment-form-date:focus {
    outline: none;
    border-color: #3388ff;
    box-shadow: 0 0 0 2px rgba(51,136,255,.15);
}
.segment-date-sep {
    font-size: .8em;
    color: #aaa;
    flex-shrink: 0;
}
.segment-color-picker {
    width: 32px;
    height: 28px;
    border: 1px solid #d0d8e8;
    border-radius: 6px;
    padding: 2px;
    cursor: pointer;
    flex-shrink: 0;
    box-sizing: border-box;
}
.segment-form-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

/* Segment select dropdown (used in pin/route/activity forms) */
.segment-select {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #d0d8e8;
    border-radius: 6px;
    font-size: .88em;
    background: #fff;
    cursor: pointer;
}
.segment-select:focus {
    outline: none;
    border-color: #3388ff;
    box-shadow: 0 0 0 2px rgba(51,136,255,.15);
}

/* Segment badge (view mode in pin popup / planner) */
.segment-badge {
    display: inline-block;
    font-size: .78em;
    font-weight: 500;
    color: #444;
}

/* ── Segment-Modal ───────────────────────────────────────────────────────── */
.segment-modal {
    max-width: 360px;
    width: 100%;
}
.segment-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.segment-modal-title {
    margin: 0;
    font-size: 1.05em;
    font-weight: 700;
    color: #222;
}
.segment-modal-close {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #aaa;
    line-height: 1;
    padding: 0 2px;
    transition: color .15s;
}
.segment-modal-close:hover { color: #333; }

.segment-modal-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d0d8e8;
    border-radius: 6px;
    font-size: .9em;
    box-sizing: border-box;
    transition: border-color .15s, box-shadow .15s;
}
.segment-modal-input:focus {
    outline: none;
    border-color: #3388ff;
    box-shadow: 0 0 0 3px rgba(51,136,255,.12);
}

.segment-modal-color-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.segment-modal-color-hex {
    font-size: .82em;
    color: #888;
    font-family: monospace;
}

.segment-modal-date-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.segment-modal-date {
    flex: 1;
    min-width: 0;
    padding: 7px 8px;
    border: 1px solid #d0d8e8;
    border-radius: 6px;
    font-size: .85em;
    box-sizing: border-box;
    transition: border-color .15s;
}
.segment-modal-date:focus {
    outline: none;
    border-color: #3388ff;
    box-shadow: 0 0 0 3px rgba(51,136,255,.12);
}
.segment-modal-date-sep {
    color: #aaa;
    font-size: .85em;
    flex-shrink: 0;
}

/* "+ Neuer Abschnitt"-Button in der Sidebar */
.segment-add-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 7px 0;
    background: none;
    border: none;
    color: #3388ff;
    font-size: .85em;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: background .15s, color .15s;
    margin-top: 4px;
}
.segment-add-btn:hover {
    background: #eef4ff;
    color: #1a6fe8;
}

/* Segment info block (name + dates stacked) */
.segment-filter-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

/* ── Sidebar empty hint ───────────────────────────────────────────────────── */
.sidebar-empty-hint {
    font-size: .82em;
    color: #bbb;
    margin: 0 0 8px;
    font-style: italic;
}

/* ── Map Settings Panel ──────────────────────────────────────────────────── */
.map-settings-trigger {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 30px !important;
    height: 30px !important;
    font-size: 15px;
    color: #555 !important;
}
.map-settings-trigger:hover { color: #333 !important; }

.map-settings-panel {
    position: absolute;
    bottom: 80px;
    right: 10px;
    z-index: 1000;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,.18);
    padding: 14px 16px;
    min-width: 220px;
    font-family: system-ui, sans-serif;
    border: 1px solid #e5e7eb;
}
.map-settings-panel.hidden { display: none; }

.settings-panel-title {
    font-size: .82em;
    font-weight: 700;
    color: #555;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.settings-section-label {
    font-size: .76em;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 6px;
}
.settings-tile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    margin-bottom: 4px;
}
.settings-tile-btn {
    background: #f3f4f6;
    border: 1.5px solid #e5e7eb;
    border-radius: 6px;
    padding: 5px 6px;
    font-size: .76em;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    text-align: center;
    transition: background .12s, border-color .12s, color .12s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.settings-tile-btn:hover { background: #e9f0ff; border-color: #3388ff; color: #3388ff; }
.settings-tile-btn.active { background: #3388ff; border-color: #3388ff; color: #fff; font-weight: 600; }

.settings-divider {
    height: 1px;
    background: #f0f0f0;
    margin: 10px 0;
}
.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.settings-row-label {
    font-size: .82em;
    color: #555;
    font-weight: 500;
}
