* { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
}

body { 
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
  overflow: hidden;
  background: #ffffff;
  color: #37352f;
}

nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 56px;
  background: #ffffff;
  border-bottom: 1px solid #e9e9e7;
  z-index: 1000;
}

nav .logo { 
  font-weight: 600; 
  font-size: 16px; 
  color: #37352f;
  letter-spacing: -0.2px;
}

#userInfo { 
  font-size: 14px; 
  color: #37352f;
  display: flex; 
  align-items: center; 
  gap: 8px;
}

nav button {
  padding: 6px 12px;
  border: 1px solid #e9e9e7;
  background: #ffffff;
  color: #37352f;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s;
}

nav button:hover { 
  background: #f7f6f3;
}

#logoutBtn {
  background: #37352f !important;
  color: #ffffff !important;
  border: none !important;
}

#logoutBtn:hover {
  background: #2f2e2a !important;
}

.share-bar {
  position: fixed;
  top: 68px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
}

.share-bar button {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  background: #37352f;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  transition: all 0.15s;
}

.share-bar button:hover:not(:disabled) {
  background: #2f2e2a;
}

.share-bar button:disabled { 
  opacity: 0.5; 
  cursor: not-allowed; 
}

#map { 
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  bottom: 0;
}

.letter-marker {
  width: 32px; 
  height: 32px;
  border-radius: 50%;
  background: #37352f;
  color: #ffffff;
  display: flex; 
  align-items: center; 
  justify-content: center;
  font-weight: 600; 
  font-size: 14px;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.letter-marker.me { 
  background: #eb5757;
}

.modal-overlay {
  display: none;
  position: fixed; 
  inset: 0;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open { 
  display: flex; 
}

.modal {
  background: #ffffff;
  border-radius: 8px;
  padding: 40px;
  width: 380px;
  max-width: 90%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

.modal h2 { 
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #37352f;
  letter-spacing: -0.4px;
}

.modal .subtitle { 
  font-size: 14px; 
  color: #eb5757;
  margin-bottom: 24px;
  min-height: 20px;
}

.modal input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e9e9e7;
  border-radius: 4px;
  font-size: 14px;
  margin-bottom: 12px;
  background: #ffffff;
  color: #37352f;
  transition: border 0.15s;
}

.modal input:focus {
  outline: none;
  border-color: #37352f;
}

.modal button[type=submit] {
  width: 100%;
  padding: 10px;
  background: #37352f;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  margin-top: 8px;
  transition: background 0.15s;
}

.modal button[type=submit]:hover:not(:disabled) {
  background: #2f2e2a;
}

.modal button[type=submit]:disabled { 
  opacity: 0.5; 
  cursor: not-allowed; 
}

.modal .error { 
  color: #eb5757; 
  font-size: 13px; 
  margin-top: 8px;
  min-height: 18px;
}

.modal .switch { 
  font-size: 14px; 
  color: #787774;
  text-align: center;
  margin-top: 20px;
}

.modal .switch a { 
  color: #37352f; 
  cursor: pointer; 
  text-decoration: underline;
  font-weight: 500;
}

.modal .close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none; 
  border: none;
  font-size: 24px; 
  cursor: pointer;
  color: #9b9a97;
  padding: 0; 
  line-height: 1;
  width: 24px;
  height: 24px;
}

.modal .close-btn:hover {
  color: #37352f;
}

.modal {
  position: relative;
}

.leaflet-control-locate {
  background: #ffffff !important;
  border: 1px solid #e9e9e7 !important;
  border-radius: 4px !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12) !important;
}

.leaflet-control-locate button {
  width: 36px !important;
  height: 36px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #ffffff !important;
  border: none !important;
  cursor: pointer !important;
  color: #37352f !important;
  transition: background 0.15s !important;
}

.leaflet-control-locate button:hover {
  background: #f7f6f3 !important;
}

@media (max-width: 768px) {
  nav {
    height: 52px;
    padding: 0 16px;
  }
  
  nav .logo { 
    font-size: 15px; 
  }
  
  #userInfo { 
    font-size: 13px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  nav button { 
    padding: 5px 10px; 
    font-size: 13px; 
  }
  
  .share-bar { 
    top: 64px; 
  }
  
  .share-bar button { 
    padding: 7px 14px; 
    font-size: 13px; 
  }
  
  #map { 
    top: 52px; 
  }
  
  .modal { 
    padding: 32px 24px;
    width: 90%; 
  }
  
  .modal h2 {
    font-size: 20px;
  }
}
