body { margin:0; font-family: system-ui, sans-serif; }

/* ==================== Seitenleiste ==================== */
#sidebar{
  width:280px; flex:0 0 280px; height:100%; overflow-y:auto;
  background:#fff; border-right:1px solid #ddd;
  display:flex; flex-direction:column; gap:2px;
  font-size:14px;
}
body.sidebar-closed #sidebar{ display:none; }

#sidebarToggle{
  position:fixed; top:10px; left:10px; z-index:1100;
  width:40px; height:40px; font-size:18px;
  background:#fff; border:1px solid #bbb; border-radius:8px;
  box-shadow:0 1px 4px rgba(0,0,0,.25); cursor:pointer;
}
body:not(.sidebar-closed) #sidebarToggle{ display:none; }

.sb-head{
  display:flex; align-items:center; justify-content:space-between;
  padding:10px 12px; border-bottom:1px solid #eee; font-size:16px;
}
.sb-brand{ display:flex; align-items:center; gap:8px; min-width:0; }
.sb-brand img{ width:30px; height:30px; border-radius:50%; flex:0 0 auto; }
#sidebarClose{
  width:32px; height:32px; padding:0; font-size:16px; line-height:1;
  border:1px solid #ccc; border-radius:6px; background:#fff; cursor:pointer;
}
.sb-hint{ margin:8px 12px; font-size:12px; color:#555; }

.sb-sec{ border-bottom:1px solid #eee; padding:0 12px 8px; }
.sb-sec summary{
  cursor:pointer; font-weight:600; padding:8px 0; user-select:none;
}
.sb-row{ display:flex; gap:6px; flex-wrap:wrap; margin:4px 0; }
.sb-row button, .sb-row select{ flex:1 1 auto; }
.sb-field{
  display:flex; align-items:center; justify-content:space-between;
  gap:8px; margin:6px 0;
}
.sb-field select, .sb-field button{ min-width:110px; }
.sb-field-col{ display:flex; flex-direction:column; gap:2px; margin:6px 0; }
.sb-field-col input{
  width:100%; box-sizing:border-box; padding:5px 6px;
  border:1px solid #bbb; border-radius:6px; font:inherit;
}
.sb-foot{
  margin-top:auto; padding:10px 12px; display:flex; gap:6px;
  border-top:1px solid #eee;
}
.sb-foot button{ flex:1 1 auto; }

/* Mobil: Seitenleiste liegt über der Karte */
@media (max-width: 720px){
  #sidebar{
    position:fixed; top:0; left:0; bottom:0; z-index:1200;
    width:min(85vw, 320px);
    box-shadow:4px 0 16px rgba(0,0,0,.25);
  }
}

button { padding:6px 10px; border:1px solid #bbb; border-radius:6px; background:#fff; cursor:pointer; }
button:disabled { opacity:.5; cursor:not-allowed; }
select { padding:5px 6px; border:1px solid #bbb; border-radius:6px; background:#fff; }
select:disabled { opacity:.5; }

/* Schwebende Distanz-/Statusanzeige */
#routeinfo{
  position:fixed; bottom:14px; left:50%; transform:translateX(-50%);
  z-index:1000; background:#fff; padding:6px 16px; border-radius:18px;
  font-weight:600; font-size:14px; box-shadow:0 1px 6px rgba(0,0,0,.3);
  white-space:nowrap;
}
#routeinfo:empty{ display:none; }

/* Drop-Overlay beim Foto-Import per Drag & Drop */
#dropOverlay{
  position:fixed; inset:0; z-index:2000; display:none;
  align-items:center; justify-content:center; text-align:center;
  background:rgba(43,108,176,.15); backdrop-filter:blur(1px);
  pointer-events:none; /* fängt keine eigenen Drag-Events ab */
}
#dropOverlay span{
  background:#2b6cb0; color:#fff; padding:16px 28px; border-radius:12px;
  font-size:16px; font-weight:600; max-width:80%;
  box-shadow:0 4px 20px rgba(0,0,0,.35);
}
body.dragging-photos #dropOverlay{ display:flex; }

/* Nummer exakt mittig (horizontal + vertikal) */
.poi-num{
  width:26px; height:26px; border-radius:50%;
  display:grid; place-items:center;
  background:#2b6cb0; color:#fff;
  font-weight:700; font-size:13px; line-height:1;
  border:2px solid #fff;
  box-shadow:0 0 4px rgba(0,0,0,.3);
}

/* Anzeige-Popup (Titel, Datum, Link, Bild-Thumb) */
.tl-card{ display:flex; flex-direction:column; gap:6px; font:12px/1.3 system-ui,sans-serif; }
.tl-title{ line-height:1.3; }
.tl-date{ color:#777; font-size:11px; }
.tl-thumb{
  width:120px; height:90px; overflow:hidden; border-radius:6px;
  box-shadow:0 0 3px rgba(0,0,0,.2); display:inline-block; line-height:0;
}
.tl-thumb-btn{ display:block; width:120px; height:90px; padding:0; border:0; background:none; cursor:zoom-in; }
.tl-thumb img{ width:100%; height:100%; object-fit:contain; display:block; }

/* Anlegen/Bearbeiten-Dialog */
.tl-form{ display:flex; flex-direction:column; gap:6px; font:12px/1.3 system-ui,sans-serif; }
.tl-form label{ display:flex; flex-direction:column; gap:2px; }
.tl-form input{ width:220px; padding:3px 5px; border:1px solid #bbb; border-radius:4px; font:inherit; }
.tl-form-row{ display:flex; gap:6px; flex-wrap:wrap; }
.tl-form-thumb{
  width:120px; height:90px; object-fit:contain; display:none;
  background:#fff; border:1px solid #e6e6e6; border-radius:6px;
}
.tl-danger{ border-color:#c33; color:#c33; }

/* Hilfe-Overlay */
.tl-help-overlay{
  position:fixed; inset:0; z-index:10001; background:rgba(0,0,0,.5);
  display:flex; align-items:center; justify-content:center; padding:16px;
}
.tl-help-box{
  position:relative; background:#fff; border-radius:10px; padding:20px 24px;
  max-width:560px; max-height:85vh; overflow-y:auto;
  font:14px/1.5 system-ui,sans-serif; box-shadow:0 10px 40px rgba(0,0,0,.3);
}
.tl-help-box h2{ margin:0 0 8px; font-size:18px; }
.tl-help-box h3{ margin:14px 0 4px; font-size:14px; }
.tl-help-box p{ margin:4px 0; }
.tl-help-box code{ background:#f2f2f2; padding:1px 4px; border-radius:4px; font-size:12px; }
.tl-help-close{
  position:absolute; top:8px; right:8px; width:32px; height:32px;
  border:0; background:none; font-size:22px; line-height:1; cursor:pointer; color:#666;
}
