body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

#map {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100%;
}

/* ── Modal ── */

.modal {
  position: fixed;
  right: 32px;
  bottom: 32px;

  left: auto;
  top: auto;

  margin: 0;
  overflow: hidden;

  border: none;
  padding: 0;
  background: transparent;
}

.modal::backdrop {
  display: none;
}

/* Hauptkarte */
.modal-content {
  background: rgba(255, 255, 255, 0.92);

  padding: 22px 20px;
  border-radius: 16px;

  min-width: 280px;

  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.25),
    0 2px 8px rgba(0, 0, 0, 0.08);

  animation: modalIn 180ms ease-out;
}

/* kleine Entrance-Animation */
@keyframes modalIn {
  from {
    transform: translateY(10px) scale(0.98);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* Titel */
.modal-content h3 {
  margin: 0 0 14px 0;
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
}

/* Straßendetails (dynamische Key/Value-Liste) */
#viewRoadDetails {
  margin: 10px 0 14px 0;
}

#viewRoadDetails p {
  margin: 4px 0;
  font-size: 14px;
  color: #1f2937;
}

#viewRoadDetails strong {
  font-weight: 600;
  color: #1f2937;
}

/* Label */
.modal-content label {
  font-size: 13px;
  color: #4b5563;
}

/* Select */
.modal-content select {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;

  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.08);

  background: white;

  font-size: 14px;

  outline: none;
  transition: all 0.15s ease;
}

.modal-content select:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.modal-content input[type="range"] {
  width: 100%;
  margin-top: 8px;
}

.modal-content span {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: #4b5563;
}

/* Button Layout */
.modal-content button {
  margin-top: 14px;
  width: 100%;
  padding: 10px 12px;

  border-radius: 10px;
  border: none;

  font-weight: 500;
  font-size: 14px;

  cursor: pointer;

  transition: all 0.15s ease;
}

.modal-top-left {
  left: 32px;
  right: auto;
  top: 72px;
  bottom: auto;
}

.modal-content label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.modal-content label input[type="checkbox"] {
  width: auto;
  margin: 0;
}

#settingsBtn {
  padding: 7px 16px;
  border-radius: 10px;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  color: #374151;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

#settingsBtn:hover {
  background: rgba(0, 0, 0, 0.09);
}

#accountBtn {
  padding: 7px 16px;
  border-radius: 10px;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  color: #374151;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  margin-right: 10px;
}

#accountBtn:hover {
  background: rgba(0, 0, 0, 0.09);
}

/* Primary Button */
#saveRoadBtn {
  background: #4f46e5;
  color: white;
}

#saveRoadBtn:hover {
  background: #4338ca;
  transform: translateY(-1px);
}

/* Secondary Button */
#cancelRoadBtn {
  background: rgba(0,0,0,0.05);
  color: #374151;
}

#cancelRoadBtn:hover {
  background: rgba(0,0,0,0.08);
}

/* hidden bleibt gleich */
.hidden {
  display: none;
}

/* ── Header ── */
#appHeader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 0 24px;
  height: 56px;

  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

.header-left,
.header-right {
  flex: 1;
  display: flex;
}

.header-right {
  justify-content: flex-end;
}

.header-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;

  /* Basis-Typografie für schlichte Text-Header (z. B. "Mein Account").
     Das Branding nutzt .brand / .title-sub, die diese Werte überschreiben. */
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #1f2937;
}

/* "Fotomar" wordmark — matches the landing page header */
.header-title .brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: #1f2937;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.header-title .brand:hover {
  opacity: 0.7;
}

.header-title .brand .dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #4f46e5;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.10);
}

.header-title .title-sep {
  color: #9ca3af;
  font-weight: 400;
}

.header-title .title-sub {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.2px;
  color: #4b5563;
}

/* Auth button — matches your modal button style */
#loginBtn {
  padding: 7px 16px;
  border-radius: 10px;
  border: none;
  background: #4f46e5;
  color: white;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

#loginBtn:hover {
  background: #4338ca;
  transform: translateY(-1px);
}

/* Logged-in state: subtle secondary style */
.header-right.logged-in #loginBtn {
  background: rgba(0, 0, 0, 0.05);
  color: #374151;
}

.header-right.logged-in #loginBtn:hover {
  background: rgba(0, 0, 0, 0.09);
  transform: translateY(-1px);
}

.header-user {
  font-size: 13px;
  color: #4b5563;
  align-self: center;
  margin-right: 10px;
  white-space: nowrap;
}

/* Push the map down so it starts below the header */
#map {
  top: 56px;
}

/* ── Action Panel (unten rechts) ── */
#actionPanel {
  position: fixed;
  right: 32px;
  bottom: 32px;
  z-index: 100;

  font-size: 13px;
  color: #4b5563;
  line-height: 1.5;

  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  padding: 16px;
  border-radius: 16px;
  width: 280px;
  box-sizing: border-box;

  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.25),
    0 2px 8px rgba(0, 0, 0, 0.08);
}

#actionPanel.hidden {
  display: none;
}

#addRoadBtn {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: none;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

/* Eingeloggt */
#addRoadBtn.active {
  background: #4f46e5;
  color: white;
}

#addRoadBtn.active:hover {
  background: #4338ca;
  transform: translateY(-1px);
}

#ownCollectionFilterList {
  margin-bottom: 18px;
}

#subscribedCollectionFilterList {
  margin-bottom: 18px;
}

#publicCollectionFilterList {
  margin-bottom: 18px;
}

#searchCollectionBtn {
  padding: 7px 16px;
  border-radius: 10px;
  border: none;
  background: #4f46e5;
  color: white;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  margin-left: 10px;
}

#searchCollectionBtn:hover {
  background: #4338ca;
  transform: translateY(-1px);
}

#collectionSearchInput {
  width: 100%;
  padding: 10px 12px;
  margin-top: 6px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.08);
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
  transition: all 0.15s ease;
}

#collectionSearchInput:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

#collectionSearchResults {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  max-height: 220px;
  overflow-y: auto;
}

.collection-search-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  font-size: 14px;
  color: #1f2937;
}

.collection-search-result-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.collection-search-result-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: #1f2937;
}

.collection-search-result-meta {
  font-size: 12px;
  color: #9ca3af;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sammlungsname + Ersteller im Filter: eine Zeile, Ersteller heller.
   .modal-content-Scope nötig, um .modal-content span (display:block) zu schlagen. */
.modal-content .filter-collection-text {
  display: inline-block;
  margin-top: 0;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-content .filter-collection-creator {
  display: inline;
  margin-top: 0;
  font-size: 12px;
  color: #9199a5;
}

.modal-content .collection-add-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  margin-top: 0;
  border-radius: 8px;
  border: none;
  background: #4f46e5;
  color: white;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
}

.modal-content .collection-add-btn:hover {
  background: #4338ca;
}

#closeSearchModalBtn {
  background: rgba(0, 0, 0, 0.05);
  color: #374151;
}

#closeSearchModalBtn:hover {
  background: rgba(0, 0, 0, 0.08);
}

.modal-content .collection-preview-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  margin-top: 0;
  border-radius: 8px;
  border: none;
  background: rgba(0, 0, 0, 0.07);
  color: #374151;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
}

.modal-content .collection-preview-btn:hover {
  background: rgba(0, 0, 0, 0.12);
}