:root{--bg:#f8faf9;--ink:#182723;--muted:#62746f;--line:#dfe8e4;--accent:#167d63;--soft:#e7f4ef;--w:300px;font:14px/1.45 system-ui,-apple-system,'Segoe UI',sans-serif;color:var(--ink)}*{box-sizing:border-box}body{margin:0;background:var(--bg)}button,input{font:inherit}button{cursor:pointer}.top{height:62px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:18px;padding:0 20px;position:relative;z-index:1001}.brand{display:flex;gap:11px;align-items:center;white-space:nowrap}.brandmark{display:grid;place-items:center;background:var(--accent);color:white;width:36px;height:36px;border-radius:10px;font-size:27px}.brand strong,.brand small{display:block}.brand strong{font-size:18px;line-height:1.05;letter-spacing:-.4px}.brand small{font-size:10px;letter-spacing:.8px;text-transform:uppercase;color:var(--muted)}nav{display:flex;gap:5px;background:#f1f5f3;border-radius:10px;padding:4px}nav .view{border:0;border-radius:7px;padding:8px 17px;background:transparent;color:#5b6a64;font-weight:600}nav .view.active{background:white;color:var(--accent);box-shadow:0 1px 5px #10281b20}.layout{height:calc(100dvh - 62px);display:flex;overflow:hidden}aside{display:flex;flex-direction:column;width:var(--w);min-width:var(--w);overflow:auto;background:white;border-right:1px solid var(--line);z-index:600}.aside-head{padding:19px 18px 12px;display:flex;justify-content:space-between}.aside-head strong{font-size:16px}.muted{font-size:11px;color:var(--muted);margin-top:3px}.search{padding:5px 15px 15px}.search input{width:100%;border:1px solid var(--line);border-radius:8px;padding:10px 12px;outline-color:var(--accent);background:#f9fbfa}.results{max-height:190px;overflow:auto}.result{background:white;border:0;border-bottom:1px solid var(--line);padding:8px;width:100%;text-align:left;display:block}.result:hover{background:var(--soft)}.result small{display:block;color:var(--muted)}.group{border-top:1px solid var(--line)}.group-head{width:100%;background:#fff;border:0;text-align:left;padding:14px 17px;font-weight:700;font-size:13px;display:flex;justify-content:space-between;align-items:center}.group-head:hover{background:#f6f9f7}.group-body{padding:0 15px 13px;display:grid;gap:2px}.group-body[hidden]{display:none}.group-body label{display:flex;align-items:center;gap:9px;min-height:34px;padding:3px 5px;border-radius:5px;cursor:pointer}.group-body label:hover{background:#f3f7f5}.group-body input{accent-color:var(--accent);width:16px;height:16px;flex-shrink:0}.group-body em{margin-left:auto;font-style:normal;color:#9b7468;font-size:10px}.subhead{color:#82918b;text-transform:uppercase;font-size:10px;font-weight:700;letter-spacing:1px;margin:12px 0 5px 5px}.years{display:grid;grid-template-columns:1fr 1fr;gap:0 4px}.hint{background:#f3f6f4;color:var(--muted);font-size:11px;padding:10px;border-radius:7px;margin-top:8px}footer{margin-top:auto;display:flex;gap:5px;justify-content:space-between;padding:14px 17px;color:var(--muted);border-top:1px solid var(--line);font-size:10px}main{position:relative;min-width:0;flex:1}#map{width:100%;height:100%;background:#edf1ee}.map-overlay{position:absolute;left:16px;bottom:20px;z-index:500;display:flex;gap:8px;align-items:center}.map-overlay span,.map-overlay button{background:#fff;border:1px solid var(--line);border-radius:8px;padding:9px 12px;box-shadow:0 2px 10px #0002;color:#476056;font-size:11px}.map-overlay button{color:var(--accent);font-weight:700}#toast{position:absolute;top:18px;right:18px;background:#20352d;color:white;border-radius:8px;padding:10px 15px;z-index:1000;display:none;max-width:320px;box-shadow:0 4px 22px #0002}.leaflet-popup-content{line-height:1.6}.leaflet-popup-content h3{margin:0 0 5px;font-size:15px}.detail-btn{background:var(--accent);border:0;color:white;border-radius:5px;padding:6px 9px;margin-top:8px}.mobile-menu,.close{display:none}@media(max-width:700px){:root{--w:min(86vw,320px)}.top{padding:0 10px;height:55px;gap:6px}.brand strong{font-size:15px}.brand small{font-size:8px}.brandmark{width:28px;height:28px}nav{gap:0}nav .view{padding:7px 8px;font-size:11px}.layout{height:calc(100dvh - 55px)}aside{position:absolute;top:55px;bottom:0;left:0;transform:translateX(-102%);transition:transform .2s;box-shadow:5px 0 14px #0002}aside.open{transform:translateX(0)}.mobile-menu,.close{display:block;background:white;border:1px solid var(--line);border-radius:6px;padding:5px;font-size:11px}.close{border:0;font-size:23px}.map-overlay{left:8px;bottom:12px}.map-overlay span{max-width:170px}.leaflet-control-zoom{margin-top:15px!important}}

/* Legacy POI icons: custom PNG where available, Font Awesome otherwise. */
.mugi-poi-image { background: transparent; border: none; }
.mugi-poi-div { background: transparent; border: none; }
.mugi-poi-symbol { width: 27px; height: 27px; display: grid; place-items: center; color: white; border: 2px solid white; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); box-shadow: 0 1px 5px #0005; }
.mugi-poi-symbol .fa { transform: rotate(45deg); font-size: 13px; }

/* Search and planning tools */
.place-search{padding:0 15px 14px;display:grid;grid-template-columns:1fr auto;gap:6px}.place-search input{min-width:0;border:1px solid var(--line);border-radius:7px;padding:8px}.place-search button,.utility-btn{border:1px solid var(--line);background:#f5faf8;color:var(--accent);border-radius:7px;padding:8px 10px;font-weight:600}.place-search .results{grid-column:1/-1}.utility-btn{display:block;width:100%;text-align:left;margin:4px 0}.map-overlay select{background:white;border:1px solid var(--line);border-radius:8px;padding:9px 12px;box-shadow:0 2px 10px #0002;color:#167d63;font-size:11px}.mugi-position-dot{width:18px;height:18px;border-radius:50%;background:#1976d2;border:3px solid white;box-shadow:0 0 0 2px #1976d2,0 2px 12px #0005}.mugi-profile{margin:8px 0 0}.mugi-profile svg{display:block;width:100%;height:auto}.mugi-profile svg text{font-family:system-ui,sans-serif;fill:#62746f;font-size:10px}.mugi-profile .line{fill:none;stroke:#167d63;stroke-width:2}.mugi-popup .leaflet-popup-content-wrapper{min-width:320px;max-width:min(90vw,430px)}.mugi-popup .leaflet-popup-content{width:auto!important}.mugi-popup .leaflet-popup-content-wrapper{cursor:move}.mugi-popup button{cursor:pointer} @media(max-width:700px){.mugi-popup .leaflet-popup-content-wrapper{min-width:260px}}

/* Einzelne geplante Touren: kompakte Liste mit eigenem Scrollbereich */
.bucket-choices{max-height:260px;overflow-y:auto;display:grid;gap:2px;min-width:0}
.bucket-choices label{min-width:0;display:flex;align-items:center;gap:7px}
.bucket-choices .bucket-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;flex:1}
.bucket-choices .bucket-zoom,.bucket-actions button{border:1px solid var(--line);background:#fff;color:var(--accent);border-radius:5px;padding:3px 7px;cursor:pointer;flex-shrink:0}
.bucket-choices .bucket-zoom:hover,.bucket-actions button:hover{background:var(--soft)}
.bucket-actions{display:flex;gap:7px;margin:4px 0}

.mugi-popup-grip{border-bottom:1px solid #e3eae7;color:#547469;background:#f6faf8;padding:4px 8px;margin:-4px -4px 9px;border-radius:6px;font-size:11px;cursor:grab;touch-action:none;user-select:none}
.mugi-popup-grip:active{cursor:grabbing}

.bucket-picker{display:grid;gap:6px}.bucket-picker button{border:1px solid #dfe8e4;background:#f5faf8;border-radius:5px;padding:6px;text-align:left;cursor:pointer}.gpx-export-option{font-size:12px;line-height:1.4;align-items:flex-start!important;margin:7px 0}.gpx-export-option input{margin-top:2px}

/* Desktop: popup detail cards can be resized from the lower right corner. */
.mugi-popup .leaflet-popup-content-wrapper.mugi-popup-resizable{
  position:relative; box-sizing:border-box; width:380px; height:290px;
  min-width:260px; min-height:180px; max-width:calc(100vw - 32px);
  max-height:calc(100dvh - 100px); display:flex; flex-direction:column;
  overflow:hidden; cursor:default; padding:0;
}
.mugi-popup .mugi-popup-resizable .mugi-popup-grip{margin:0;flex-shrink:0; padding:7px 14px}
.mugi-popup .mugi-popup-resizable .leaflet-popup-content{
  width:auto!important; flex:1 1 auto; min-height:0; overflow:auto;
  margin:12px 15px 25px!important;
}
.mugi-popup .mugi-popup-resize{
  position:absolute;right:0;bottom:0;width:26px;height:26px;
  cursor:nwse-resize;touch-action:none;z-index:3;user-select:none;
  background:linear-gradient(135deg,transparent 56%,#8ca7a0 57%,#8ca7a0 63%,transparent 64%,transparent 72%,#8ca7a0 73%,#8ca7a0 79%,transparent 80%);
}
.mugi-popup .mugi-profile svg{width:100%;max-width:none}
@media(max-width:700px){
 .mugi-popup .leaflet-popup-content-wrapper.mugi-popup-resizable{width:min(320px,calc(100vw - 32px));height:270px}
}

/* Fix: long GPX mode selections must not make the sidebar scroll sideways. */
#sidebar {
  overflow-x: hidden;
  overflow-y: auto;
}
#sidebar .group,
#sidebar .group-body,
#sidebar .gpx-export-option {
  min-width: 0;
  max-width: 100%;
}
#sidebar .gpx-export-option {
  display: block;
  overflow-wrap: anywhere;
}
#sidebar #exportTileMode {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-top: 5px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  text-overflow: ellipsis;
}

/* mugi: individuelle Auswahl der fünf neuesten Aktivitäten */
.recent-choices{display:grid;gap:2px;min-width:0;margin:4px 0 8px 10px}
.recent-choices[hidden],.selected-search[hidden],.group-body label[hidden]{display:none!important}
.recent-choices label{display:flex;min-width:0;gap:6px;align-items:center}
.recent-name{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}
.recent-zoom{border:1px solid var(--line);border-radius:5px;background:#fff;color:var(--accent);padding:3px 7px;flex-shrink:0}
.selected-search{margin-top:8px;border:1px solid var(--line);background:var(--soft);border-radius:7px;padding:8px;display:flex;align-items:center;gap:8px}
.selected-search span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}
.selected-search button{border:1px solid var(--line);border-radius:5px;background:white;color:var(--accent);flex-shrink:0;padding:5px 7px;font-size:12px}

/* Compact multi-select activity search: full width, no horizontal sidebar overflow */
#sidebar .search{min-width:0}
#sidebar .selected-tracks{margin-top:9px;padding:9px;border:1px solid var(--line);border-radius:7px;background:var(--soft);min-width:0}
#sidebar .selected-tracks[hidden]{display:none!important}
.selected-tracks-heading{font-size:12px;font-weight:700;display:flex;justify-content:space-between;margin-bottom:5px;gap:8px}
.selected-tracks-list{display:grid;gap:3px;max-height:200px;overflow:auto;min-width:0}
.selected-track-row{display:flex;align-items:center;min-width:0;gap:6px;background:#fff;border-radius:5px}
.selected-track-name{display:block;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;border:0;background:transparent;color:var(--ink);font-size:12px;padding:6px}
.selected-track-name:hover{text-decoration:underline}
.selected-track-remove{flex:0 0 auto;border:0;background:transparent;color:#9d4438;font-size:20px;padding:2px 9px;line-height:1.3}
.selected-clear{width:100%;margin-top:7px;padding:6px 8px;border:1px solid var(--line);border-radius:5px;background:white;color:var(--accent);font-size:12px}
